WO2022133664A1 - Pixel interpolation method and apparatus, electronic device and computer-readable medium - Google Patents

Pixel interpolation method and apparatus, electronic device and computer-readable medium Download PDF

Info

Publication number
WO2022133664A1
WO2022133664A1 PCT/CN2020/138064 CN2020138064W WO2022133664A1 WO 2022133664 A1 WO2022133664 A1 WO 2022133664A1 CN 2020138064 W CN2020138064 W CN 2020138064W WO 2022133664 A1 WO2022133664 A1 WO 2022133664A1
Authority
WO
WIPO (PCT)
Prior art keywords
interpolation
target
pixel
parameter
pixel matrix
Prior art date
Application number
PCT/CN2020/138064
Other languages
French (fr)
Chinese (zh)
Inventor
唐小东
王亚强
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2020/138064 priority Critical patent/WO2022133664A1/en
Publication of WO2022133664A1 publication Critical patent/WO2022133664A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof

Definitions

  • the embodiments of the present application relate to the field of computer technologies, and in particular, to a pixel interpolation method, an apparatus, an electronic device, and a computer-readable medium.
  • Motion estimation Integer Motion Estimation (IME) and Fraction Motion Estimation (FME).
  • Integer-pixel motion estimation is to perform a matching search with integer-pixel precision within a certain range of the reference frame to search for the most matching image block with integer-pixel precision.
  • Pixel-by-pixel motion estimation is based on whole-pixel motion estimation to perform matching search with pixel-by-pixel precision to improve the accuracy of motion estimation. Since fractional pixel values do not exist in digital video, the pixel values at these positions need to be calculated by interpolation.
  • the disadvantage of the prior art is that the interpolation parameters are calculated in real time during the interpolation process, resulting in low interpolation efficiency.
  • the embodiments of the present application propose a pixel interpolation method, an apparatus, an electronic device, and a computer-readable medium, so as to solve the technical problem of low pixel interpolation efficiency in the prior art.
  • an embodiment of the present application provides a pixel interpolation method, including: selecting a target interpolation position of a target image block; querying a target pixel matrix offset corresponding to the target interpolation position and The target filtering parameter corresponding to the target interpolation position; based on the target pixel matrix offset and the target filtering parameter, the target interpolation position is interpolated.
  • an embodiment of the present application provides a pixel interpolation device, including: a selection unit, configured to select a target interpolation position of a target image block; a query unit, configured to query the preset mapping table for the the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position; the interpolation unit is configured to, based on the target pixel matrix offset and the target filtering parameter, perform interpolation on the target position to interpolate.
  • embodiments of the present application provide an electronic device, including: a processor and a memory; a memory for storing program instructions; a processor for executing program instructions stored in the memory, and when the program instructions are executed, processing
  • the device is used to perform the following steps: select the target interpolation position of the target image block; from the preset mapping table, query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position;
  • the target pixel matrix offset and the target filter parameter are used to interpolate the target interpolation position.
  • an embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, implements the above pixel interpolation method.
  • Embodiments of the present application provide a pixel interpolation method, an apparatus, an electronic device, and a computer-readable medium, which improve pixel interpolation efficiency.
  • 1A is a schematic diagram of a video encoding process
  • 1B is a schematic diagram of sub-pixel positions
  • FIG. 2 is a flowchart of an embodiment of a pixel interpolation method according to the present application
  • FIG. 3 is a schematic diagram of the distribution of interpolation positions according to the pixel interpolation method of the present application.
  • FIG. 4 is a schematic diagram of first mapping information according to the pixel interpolation method of the present application.
  • FIG. 5 is a schematic diagram of second mapping information according to the pixel interpolation method of the present application.
  • FIG. 6 is a schematic diagram of a hardware framework for calculating an interpolation result according to the pixel interpolation method of the present application
  • FIG. 7 is a schematic structural diagram of an embodiment of a pixel interpolation device according to the present application.
  • FIG. 8 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
  • This scene is a video encoding scene.
  • the so-called video encoding method refers to the method of converting the original video format file into another video format file through compression technology.
  • the traditional video coding process usually includes processes such as prediction, transformation, quantization, and entropy coding, and finally outputs a video code stream.
  • processes such as prediction, transformation, quantization, and entropy coding, and finally outputs a video code stream.
  • pixel interpolation is usually required.
  • the video encoding process is described below.
  • Video data has strong correlation, so there is a lot of redundant information.
  • the redundant information can be divided into spatial domain redundant information and time domain redundant information.
  • the purpose of prediction is to use the predicted image block data to reduce redundant information of the image block currently to be encoded, that is, to remove the correlation between the data.
  • a predicted image block relative to the current image block to be encoded can be obtained.
  • a residual block corresponding to the current image block to be encoded can be obtained by subtracting the pixel values of the current image block to be encoded and the predicted image block, thereby completing the prediction process.
  • Prediction usually includes two types of intra prediction and inter prediction.
  • the intra-frame prediction is to predict the current image block to be encoded by using the image blocks already encoded in the same video frame, so as to reduce spatial redundancy information.
  • Inter-frame prediction is to predict the current to-be-encoded image block by using the image blocks that have been encoded in the previous frame or multiple previous frames, so as to reduce redundant information in the temporal domain.
  • the principle of inter-frame prediction is to use the temporal correlation between adjacent frames in the video, use the previously encoded reconstructed frame as a reference frame, and predict the current to-be-encoded image block through motion estimation and motion compensation to remove the The temporal redundancy information in the video, and then achieve the purpose of compressing the video data.
  • motion estimation refers to the need to find the image block most similar to the current image to be encoded in the reference frame, so that the encoding cost is the smallest and the encoding efficiency is the highest.
  • Motion compensation is a process of modifying the searched image blocks on the basis of motion estimation.
  • Integer Motion Estimation IME
  • Fractional Motion Estimation FME
  • Integer-pixel motion estimation is used to perform a matching search with integer-pixel accuracy within a certain range of the reference frame, and obtain the most matching image block with integer-pixel accuracy. Due to the continuity of motion of natural objects, the motion of objects between two adjacent frames may not be exactly separated by an integer pixel unit. Therefore, in order to improve the accuracy of motion estimation, it is necessary to perform pixel-by-pixel estimation on the basis of whole-pixel motion estimation. Match search is performed on sub-pixel precision (eg 1/2 pixel precision, 1/4 pixel precision, etc.). Since pixel values of sub-pixel positions do not exist in digital video, these pixel values need to be calculated by interpolation.
  • sub-pixel precision eg 1/2 pixel precision, 1/4 pixel precision, etc.
  • FIG. 1B shows a schematic diagram of sub-pixel positions.
  • FIG. 1B shows a schematic diagram of sub-pixel positions.
  • the transform operation is used to transform the residual block obtained in the prediction process from the time domain to the frequency domain.
  • the transformation method may include discrete cosine transform (discrete cosine transform, DCT), discrete wavelet transform (discrete wavelet transform, DWT), and the like.
  • DCT discrete cosine transform
  • DWT discrete wavelet transform
  • a transform coefficient matrix can be obtained.
  • the quantization operation is used to reduce the coefficient of variation obtained after transformation, thereby facilitating entropy coding.
  • Entropy coding that is, coding in which no information is lost according to the principle of entropy during the coding process.
  • Common entropy codes include: Shannon coding, Huffman coding and arithmetic coding (arithmetic coding). After the entropy coding process, an entropy coded bit stream can be obtained. The video encoding process can be completed by storing or sending the entropy encoded bit stream and related information (such as mode information, motion vector, etc.) to the decoding end.
  • a residual block (which may be called a reconstructed residual block) can also be recovered through inverse quantization and inverse transformation, and then the reconstructed residual block and the predicted image block are added to obtain the reconstruction. image block, and finally perform in-loop filtering on the reconstructed image block to obtain the final reconstructed image, which is then provided to the subsequent coded image for inter-frame prediction.
  • the in-loop filtering may include, but is not limited to, deblocking filtering, pixel adaptive offset (Sample adaptive offset, SAO), and the like.
  • interpolation parameters are usually calculated in real time during the pixel interpolation process, such as the offset of the pixel matrix required by the interpolation point compared to the input pixel matrix, filtering parameters, etc., so the interpolation efficiency is low. Therefore, it is urgent to find a method that can improve the interpolation efficiency.
  • FIG. 2 shows a flowchart of a pixel interpolation method 200 according to the present application.
  • the executing subject of the pixel interpolation method can be various electronic devices. For example cell phones, tablets, laptops, desktops, servers, etc.
  • the flow of the pixel interpolation method includes the following steps:
  • Step 201 Select a target interpolation position of a target image block.
  • the target interpolation position of the target image block can be selected first.
  • the target pixel block is an image block to be subjected to pixel interpolation, for example, it may be an image block obtained by performing an integer pixel search in the inter-frame prediction stage of the video coding process.
  • the size of the target image block can be preset as required, for example, it can be set to 4 ⁇ 4, 8 ⁇ 8, etc., which is not specifically limited here.
  • the target interpolation position may be a position to be interpolated between integer pixels.
  • 8 interpolation positions may be included around each integer pixel in the target image block.
  • 8 interpolation positions may be further included around each 1/2 pixel point in the target image block. Therefore, each integer pixel in the target image block may correspond to multiple interpolation positions.
  • Each interpolation position of each integer pixel can be numbered according to the same rule, so that a same numbered interpolation position of each integer pixel of the target image block is used as the target interpolation position.
  • each integer pixel in the target image block can contain 49 interpolation positions (including the integer pixel itself).
  • the 49 interpolation positions of each integer pixel can be numbered respectively to obtain a total of 49 numbers from 0 to 48.
  • the target interpolation position can be the interpolation position corresponding to any number. For example, it can be the interpolation position No. 8 of each integer pixel in the target image block. Since the target image block has a total of 16 integer pixels, there are 16 No. 8 interpolation positions in total, and each No. 8 interpolation position can be regarded as the target interpolation position of the target image block.
  • Step 202 from a preset mapping table, query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters corresponding to the target interpolation position.
  • a preset mapping table may be stored in the above-mentioned execution body.
  • the mapping table may indicate a mapping relationship between interpolation positions and pixel matrix offsets, and may indicate a mapping relationship between interpolation positions and filtering parameters used for interpolation calculation.
  • the above-mentioned execution body can query the target pixel matrix offset corresponding to the target interpolation position and the target filter parameter corresponding to the target interpolation position from the mapping table.
  • the pixel matrix offset is the offset of the pixel matrix required for the interpolation position relative to the input pixel matrix.
  • the pixel matrix offset is the offset of the pixel matrix required for the interpolation position relative to the input pixel matrix.
  • the pixel matrix actually required for different interpolation positions in an image block is usually different from the input pixel matrix.
  • the actual required pixel matrix size is 11 ⁇ 11.
  • the 11 ⁇ 11 pixel matrix may have an offset in the horizontal direction and the vertical direction, and the offset is the pixel matrix offset.
  • each integer pixel includes 49 interpolation positions (eg, interpolation positions numbered 0 to 48). Since the pixel matrix required for different interpolation positions is usually different from the input pixel matrix, the pixel matrix offset corresponding to each interpolation position can be pre-calculated, so as to map the 49 interpolation positions to the pixel matrix offset Relationships are pre-recorded in the mapping table.
  • the above executive body only needs to look up the table during the interpolation process to obtain the target pixel matrix offset corresponding to the target interpolation position. Since the interpolation process does not need to calculate the offset of the pixel matrix in real time, the efficiency of pixel interpolation can be improved.
  • the filtering parameters used for different interpolation positions in the interpolation process are usually different (for example, the filtering parameters applicable to 1/4 pixel points are [-1,4,-10,58,17,-5,1 ], the filtering parameters applicable to 1/2 pixel points are [-1,4,-11,40,40,-11,4,-1], and the filtering parameters applicable to 3/4 pixel points are [1,- 5,17,58,-10,4,-1]), so the filtering parameters corresponding to the 49 interpolation positions can be pre-determined, so that the mapping relationship between the 49 interpolation positions and the filtering parameters can be recorded in the mapping table middle.
  • the above executive body only needs to look up the table during the interpolation process to obtain the target filtering parameters corresponding to the target interpolation position. Since the interpolation process does not need to filter and determine the filtering parameters in real time, the efficiency of pixel interpolation can be improved.
  • the above-mentioned mapping table may include first mapping information of the interpolation position and the offset of the pixel matrix.
  • the first mapping information can represent the mapping relationship between the interpolation position and the offset of the pixel matrix, and can be generated by the following steps:
  • the first step is to obtain the input pixel matrix corresponding to the specified size image block.
  • the size of the specified size image block is the same as the size of the target image block.
  • the specified size image block and the above-mentioned target image block are both 4 ⁇ 4 image blocks, and both contain 16 integer pixels.
  • the input pixel matrix corresponding to the specified size image block can be a 12 ⁇ 12 pixel matrix.
  • the second step is to determine the pixel matrix offset of the pixel matrix required for each interpolation position in the image block of the specified size relative to the input pixel matrix.
  • the interpolation value can be determined first.
  • the position of the pixel matrix required for the position, and then the pixel matrix offset is determined based on the relative positional relationship between the position and the position of the input pixel matrix.
  • the third step is to generate first mapping information based on the pixel matrix offset corresponding to each interpolation position.
  • mapping relationship between each interpolation position and the offset of the pixel matrix may be summarized in order to obtain the first mapping information.
  • a position number may be set for each interpolation position first (as shown in FIG. 3 , which will not be repeated here); then, based on the pixel matrix offset corresponding to each interpolation position, a relationship between the position number and the pixel matrix offset is established. mapping to obtain the first mapping information.
  • the pixel matrix offset corresponding to each interpolation position may include a horizontal pixel matrix offset and a vertical pixel matrix offset. Therefore, referring to FIG. 4 , the first mapping information may include the mapping relationship between each interpolation position (referred to by the available position number) and the offset of the pixel matrix in the horizontal direction, and may also include each interpolation position (referred to by the available position number) ) and the mapping relationship of the pixel matrix offset in the vertical direction.
  • the mapping table may include second mapping information of interpolation positions and filtering parameters.
  • the second mapping information may represent the mapping relationship between the interpolation position and the filtering parameter.
  • the second mapping information can be generated by the following steps:
  • the first step is to determine the type of each interpolation position in an image block of a specified size.
  • the size of the specified size image block is the same as the size of the target image block.
  • the specified size image block and the above-mentioned target image block are both 4 ⁇ 4 image blocks, and both contain 16 integer pixels.
  • the input pixel matrix corresponding to the specified size image block can be a 12 ⁇ 12 pixel matrix.
  • the filtering parameters corresponding to each interpolation position are determined based on the type of each interpolation position.
  • the type of interpolation location may include, but is not limited to, at least one of the following: 1/4 pixel, 1/2 pixel, 3/4 pixel, and integer pixel.
  • Different types of interpolation positions can correspond to different filter parameters. You can directly select the default filter parameters for each type of interpolation position, or you can adjust the default filter parameters.
  • the third step is to generate second mapping information based on the filtering parameters corresponding to each interpolation position.
  • mapping relationship between each interpolation position and the filtering parameter can be summarized in order to obtain the second mapping information.
  • a position number may be set for each interpolation position first (as shown in FIG. 3 , which will not be repeated here); then, an index number may be set for each filter parameter.
  • the index number of the filtering parameter of the whole pixel is 0.
  • the index number of the filtering parameter of the 1/4 pixel is 1.
  • the index number of the filtering parameter of the 1/2 pixel is 2.
  • the index number of the filtering parameter of the 3/4 pixel point is 3.
  • the type of each interpolation position includes the type of each interpolation position in the horizontal direction and the type of each interpolation position in the vertical direction.
  • the filtering parameters corresponding to each interpolation position are determined based on the type of each interpolation position, which can be divided into the following steps: based on the type of each interpolation position in the horizontal direction, determine each interpolation position in the horizontal direction.
  • the second mapping information may include the mapping relationship between each interpolation position and the filter parameter (represented by an index number) corresponding to the horizontal direction, and the corresponding interpolation position in the vertical direction.
  • the mapping relationship of the filtering parameters represented by index numbers).
  • the filtering parameters corresponding to different types of interpolation positions may be parameter vectors with the same dimension.
  • the type of interpolation location may include, but is not limited to, at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point, and whole pixel point.
  • the filtering parameters corresponding to different types of interpolation positions are all 8-dimensional parameter vectors, and the 8-dimensional parameter vectors corresponding to different types of interpolation positions are different.
  • the first default filter parameter may be [-1, 4, -10, 58, 17, -5, 1], and M is 7.
  • the final filter parameter [-1,4,-10,58,17,-5,1,0] corresponding to the 1/4 pixel point can be obtained, at this time N is 8.
  • the filter parameter corresponding to the 1/2 pixel point is the second default filter parameter
  • the second default filter parameter is an M-dimensional parameter vector
  • M is a positive integer.
  • the second default filter parameter is [-1,4,-11,40,40,-11,4,-1], and M is 7 at this time.
  • the third default filter parameter may be [1,-5,17,58,-10,4,-1], and M is 7.
  • the final filter parameter [0,1,-5,17,58,-10,4,-1] corresponding to the 3/4 pixel point can be obtained.
  • N is 8.
  • the filtering parameter corresponding to an integer pixel is an M-dimensional parameter vector with a parameter value of 0, where M is a positive integer. That is, the filter parameter corresponding to the integer pixel is [0,0,0,0,0,0,0,0].
  • the filtering parameters corresponding to 1/4 pixel points among the filtering parameters corresponding to 1/4 pixel points, the filtering parameters corresponding to 1/2 pixel points, the filtering parameters corresponding to 3/4 pixel points, and the filtering parameters corresponding to integer pixels
  • the parameter values of the same dimension are not less than 0 or are not greater than 0.
  • the filtering parameters corresponding to 1/4 pixel points are [-1,4,-10,58,17,-5,1,0] and the filtering parameters corresponding to 1/2 pixel points are [-1, 4,-11,40,40,-11,4,-1], the filtering parameters corresponding to 3/4 pixel points are [0,1,-5,17,58,-10,4,-1],
  • the filter parameter corresponding to an integer pixel is [0, 0, 0, 0, 0, 0, 0], which ensures that the parameter values of the same dimension are not less than 0 or are not greater than 0.
  • Step 203 Interpolate the target interpolation position based on the target pixel matrix offset and the target filter parameter.
  • the execution subject may perform interpolation on the target interpolation position based on the target pixel matrix offset and the target filter parameter.
  • the input pixel matrix corresponding to the target image block may be obtained first; then, the target pixel matrix required for interpolation of the target interpolation position may be determined based on the target pixel matrix offset and the input pixel matrix. Finally, the target interpolation position can be interpolated based on the pixel data in the target pixel matrix and the target filter parameters.
  • the above-mentioned executing subject may first select reference pixels in the target pixel matrix based on the target interpolation position. Then, use the target filtering parameters to filter the reference pixels to obtain the interpolation result of the target interpolation position.
  • the type of the target interpolation position is a 1/2 pixel point
  • an integer pixel point in the target pixel matrix may be selected as a reference pixel point.
  • the type of the target interpolation position is a 1/4 pixel point or a 3/4 pixel point
  • a 1/2 pixel point in the target pixel matrix may be selected as a reference pixel point.
  • the position of interpolation required for 1/2 interpolation precision includes the upper left interpolation position of the whole pixel (as shown in Figure 3, the position number corresponding to No.
  • the target pixel matrix can be used.
  • the pixels in the horizontal direction including the 4 integer pixels on the left side of the target interpolation position and the 4 integer pixels on the right side) are used as reference pixels, and the target filtering parameters corresponding to the target interpolation position are used for the reference pixels.
  • the pixel value is filtered and calculated to obtain the pixel value of the target interpolation position.
  • the current target interpolation position is the upper-middle interpolation position (that is, the position corresponding to the position number 10) or the lower-middle interpolation position (that is, the position corresponding to the position number 38) of each integer pixel point
  • the pixels in the vertical direction including the 4 integer pixels above the target interpolation position and the 4 integer pixels below) are used as reference pixels, and the target filtering parameters corresponding to the target interpolation position are used.
  • the value is filtered and calculated to obtain the pixel value of the target interpolation position.
  • the current target interpolation position is the upper left interpolation position of each integer pixel (that is, the position corresponding to the position number 8) or the lower left interpolation position (that is, the position corresponding to the position number 36), you can use the middle left of each integer pixel.
  • the pixel at the interpolation position is used as a reference pixel point, and the pixel value of the reference pixel point is filtered and calculated by using the target filter parameter corresponding to the target interpolation position to obtain the pixel value of the target interpolation position.
  • the current target interpolation position is the upper right interpolation position of each integer pixel (that is, the position corresponding to the position number 12) or the lower right interpolation position (that is, the position corresponding to the position number 40), the right interpolation position of each integer pixel can be used.
  • the pixel at the intermediate interpolation position is used as a reference pixel point, and the pixel value of the reference pixel point is filtered and calculated by using the target filtering parameter corresponding to the target interpolation position to obtain the pixel value of the target interpolation position.
  • the current target interpolation position is the middle interpolation position of each integer pixel (that is, the position corresponding to the position number 24), since the position of the integer pixel does not require interpolation, the pixel value of the integer pixel can be directly used as the target interpolation position. Pixel values.
  • the interpolation position in the horizontal direction of each integer pixel in the target image block may be firstly used as the target interpolation position for interpolation.
  • the interpolation can be performed first by using the middle left interpolation position of each pixel as the target interpolation position, and then using the middle right interpolation position of each integer pixel in the target image block as the target interpolation position for interpolation, and then using the target image block in the interpolation position.
  • the median interpolation position of each integer pixel of is used as the target interpolation position for interpolation, so as to complete the interpolation of the interpolation position in the horizontal direction.
  • the interpolation of the left-middle interpolation position can be divided into two steps.
  • the first time is to interpolate the left middle position of the left two columns of integer pixels
  • the second time is to interpolate the left middle position of the right two columns of integer pixels.
  • the right-middle interpolation position it can also be divided into two steps.
  • the first time is to interpolate the right middle position of the left two columns of integer pixels
  • the second time is to interpolate the right middle position of the right two columns of integer pixels.
  • the interpolation result of each time can be stored in the cache, and in the next interpolation, for the repeated interpolation position, the previous interpolation result can be directly extracted from the buffer without repeated calculation.
  • the median interpolation position since the median interpolation position is the position of the integer pixel, the pixel value of the integer pixel can be directly used.
  • the interpolation positions in the vertical direction may be used as the target interpolation positions for interpolation.
  • the upper left interpolation position, the middle left interpolation position (the obtained interpolation result can be directly read), and the lower left interpolation position of each integer pixel can be interpolated first as the target interpolation position; then, the interpolation position of each integer pixel can be The upper right interpolation position, the middle right interpolation position (the obtained interpolation result can be directly read), and the lower right interpolation position are used as the target interpolation position for interpolation; Directly read the pixel value of the whole pixel), the middle and lower interpolation positions are used as the target interpolation positions for interpolation. In this way, all the interpolation processes under the full 1/2 interpolation precision can be completed.
  • the interpolation when performing interpolation on each position to be interpolated in the vertical direction, the interpolation may also be performed twice, which will not be repeated here.
  • the interpolation result under the 1/2 interpolation precision can be used for calculation, and the calculation process is basically the same as the interpolation process under the 1/2 interpolation precision, and will not be repeated here.
  • the interpolation order in practical application is not limited to the above example, and other interpolation orders can also be set as required.
  • the pixel interpolation method of the embodiment of the present application is not limited to the 1/4 interpolation precision and the 1/2 interpolation precision, and can also be applied to other interpolation precisions, which will not be repeated here.
  • the target filtering parameter is an N-dimensional parameter vector, where N is a positive integer (eg, 8).
  • the above executive body can perform interpolation on the target interpolation position with the help of the same hardware framework. Specifically, the above-mentioned execution body controls the hardware framework to calculate the interpolation result of the target interpolation position according to the following steps:
  • the first step is to control N data selectors to select N data, that is, each data selector selects one data.
  • the N pieces of data are respectively the data processing results after processing the target pixel matrix by using the N parameter values in the target filtering parameters.
  • FIG. 6 A schematic diagram of the hardware framework used to calculate the interpolation results can be found in Figure 6.
  • the hardware frame can contain 8 data selectors, numbered 0 to 7 in sequence. If the target filter parameter is [-1,4,-11,40,40,-11,4,-1], the data selector numbered 0 can select the first parameter (ie -1) to the target pixel matrix The data processing result after processing; the data selector numbered 1 can select the second parameter (ie, 4) the data processing result after processing the target pixel matrix; and so on.
  • the N data selectors may be pre-divided into the first group and the second group. Taking the 8 data selectors shown in Figure 3 as an example, the data selectors numbered 0, 2, 5, and 7 can be divided into the first group, and the data selectors numbered 1, 3, 4, and 6 can be divided into the first group. Divide into the second group.
  • the data output by the data selectors in the first group is input into the first adder, and the data output by the data selectors in the second group is input into the second adder.
  • the data output by the data selectors numbered 0 and 7 can be added by an adder and then input to the first adder, and the data numbered 2 and 5 are selected
  • the data output by the adder can be added by another adder and then input to the first adder.
  • the data output by the data selectors numbered 1 and 6 can be added by one adder and then input to the second adder, and the data output by the data selectors numbered 3 and 4 can be added by another adder.
  • One adder adds and inputs to the second adder.
  • the data output by the first adder and the data output by the second adder are input to the subtractor, and the data output by the subtracter is used as the interpolation result of the target interpolation position.
  • the subtractor may subtract the data output from the second adder and the data output from the first adder to obtain a difference result.
  • the filtering parameters corresponding to different types of interpolation positions can be set as N-dimensional (eg, 8-dimensional) parameter vectors, and the parameter values of the same dimension in the filtering parameters are all not less than 0 or not greater than 0.
  • N-dimensional e.g, 8-dimensional
  • the same set of hardware frameworks can be used to calculate the interpolation results of different interpolation precisions and different types of interpolation positions, and there is no need to set different hardware frameworks for different interpolation precisions and different types of interpolation positions, thereby saving hardware resources.
  • the target interpolation position of the target image block is selected, and then the target pixel matrix offset corresponding to the target interpolation position and the target pixel matrix offset corresponding to the target interpolation position are queried from the preset mapping table.
  • target filter parameters so that the target interpolation position can be interpolated based on the target pixel matrix offset and the target filter parameters. Therefore, in the interpolation process, it is only necessary to look up the table to obtain the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters.
  • the interpolation process does not need to calculate the pixel matrix offset and determine the filtering parameters in real time. Therefore, Improves the efficiency of pixel interpolation.
  • the filtering parameters corresponding to different types of interpolation positions are set as parameter vectors of the same dimension, and the parameter values of the same dimension in the filtering parameters are not less than 0 or are not greater than 0, and the same set of hardware frameworks can be used to calculate different values. Interpolation precision and interpolation results for different types of interpolation positions. Thereby, hardware resources are saved.
  • the present application provides an embodiment of a pixel interpolation apparatus, and the apparatus embodiment corresponds to the method embodiment shown in FIG. 5 .
  • the electronic device can be among various electronic devices.
  • the above-mentioned pixel interpolation 700 in this embodiment includes: a selection unit 701 configured to select a target interpolation position of a target image block; a query unit 702 configured to query the above target from a preset mapping table The target pixel matrix offset corresponding to the interpolation position and the target filtering parameter corresponding to the above-mentioned target interpolation position; the interpolation unit 703 is configured to perform interpolation on the above-mentioned target interpolation position based on the above-mentioned target pixel matrix offset and the above-mentioned target filtering parameter.
  • the above-mentioned mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix; the above-mentioned first mapping information is generated by the following steps: obtaining the input corresponding to the image block of the specified size A pixel matrix, wherein the size of the image block of the specified size is the same as that of the target image block; the pixel matrix offset required for each interpolation position in the image block of the specified size is determined relative to the pixel matrix of the input pixel matrix; based on the above The pixel matrix offset corresponding to each interpolation position is used to generate the first mapping information.
  • generating the first mapping information based on the pixel matrix offsets corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; The offset of the pixel matrix is established, and the mapping between the position number and the offset of the pixel matrix is established to obtain the first mapping information.
  • the pixel matrix offset corresponding to each interpolation position includes a horizontal pixel matrix offset and a vertical pixel matrix offset;
  • the first mapping information includes The mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the horizontal direction, and the mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the vertical direction.
  • the above-mentioned mapping table includes second mapping information of interpolation positions and filtering parameters; the above-mentioned second mapping information is generated by the following steps: determining the value of each interpolation position in an image block of a specified size type, wherein the size of the image block of the specified size is the same as the size of the target image block; based on the type of each interpolation position, the filtering parameters corresponding to the interpolation positions are determined; based on the filtering parameters corresponding to the interpolation positions, a second mapping is generated information.
  • generating the second mapping information based on the filtering parameters corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; setting an index number for each filtering parameter; For the filtering parameters corresponding to the above-mentioned interpolation positions, a mapping between the position number and the index number is established to obtain the second mapping information.
  • the types of the above-mentioned interpolation positions include the types of the above-mentioned interpolation positions in the horizontal direction and the types of the above-mentioned interpolation positions in the vertical direction.
  • determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions includes: determining the horizontal direction based on the types of the interpolation positions in the horizontal direction. filtering parameters corresponding to the above-mentioned interpolation positions; based on the types of the above-mentioned interpolation positions in the vertical direction, the filtering parameters corresponding to the above-mentioned interpolation positions in the vertical direction are determined.
  • the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions corresponding to the vertical direction.
  • the mapping relationship of the filtering parameters includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions corresponding to the vertical direction.
  • the type of the interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point, and whole pixel point.
  • the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
  • the filtering parameters corresponding to the above-mentioned 1/4 pixel points are determined by the following steps: obtaining the first default filtering parameters corresponding to the above-mentioned 1/4 pixel points, the above-mentioned first default filtering parameters
  • the filtering parameters corresponding to the above-mentioned 1/2 pixel points are second default filtering parameters
  • the above-mentioned second default filtering parameters are M-dimensional parameter vectors
  • M is a positive integer.
  • the filtering parameters corresponding to the above-mentioned 3/4 pixel points are determined by the following steps: obtaining the third default filtering parameters corresponding to the above-mentioned 3/4 pixel points, and the above-mentioned third default filtering parameters
  • the filtering parameter corresponding to the above-mentioned integer pixel is an M-dimensional parameter vector with a parameter value of 0, where M is a positive integer.
  • the filtering parameters corresponding to the foregoing 1/4 pixel points, the filtering parameters corresponding to the foregoing 1/2 pixel points, the filtering parameters corresponding to the foregoing 3/4 pixel points, and the above The parameter values of the same dimension in the filtering parameters corresponding to the integer pixels are not less than 0 or are not greater than 0.
  • the above-mentioned interpolation unit 703 is further configured to: obtain the input pixel matrix corresponding to the above-mentioned target image block; The target pixel matrix required for interpolation of the target interpolation position; based on the target pixel matrix and the target filtering parameter, the target interpolation position is interpolated.
  • the above-mentioned interpolation unit 703 is further configured to: select a reference pixel point in the above-mentioned target pixel matrix based on the type of the above-mentioned target interpolation position; The pixel points are filtered to obtain the interpolation result of the target interpolation position.
  • the above-mentioned interpolation unit 703 is further configured to: if the type of the above-mentioned target interpolation position is a 1/2 pixel point, select an integer pixel point in the above-mentioned target pixel matrix, As a reference pixel; if the type of the target interpolation position is a 1/4 pixel or a 3/4 pixel, then select a 1/2 pixel in the target pixel matrix as a reference pixel.
  • the above-mentioned target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and, the above-mentioned interpolation unit 703 is further configured to: control N data selectors to select N pieces of data , the above-mentioned N data are respectively the data processing result after the above-mentioned target pixel matrix is processed by using the N parameter values in the target filtering parameters, wherein, the above-mentioned N data selectors are pre-divided into the first group and the second group; Input the data outputted by the data selectors in the above-mentioned first group into the first adder, and input the data outputted by the data selectors in the above-mentioned second group into the second adder; The data output by the second adder is input to the subtracter, and the data output by the subtracter is used as the interpolation result of the target interpolation position.
  • the pixel interpolation device selects the target interpolation position of the target image block, and then queries the target pixel matrix offset corresponding to the target interpolation position and the target corresponding to the target interpolation position from the preset mapping table.
  • filter parameters so that the target interpolation position can be interpolated based on the target pixel matrix offset and the target filter parameter. Therefore, in the interpolation process, it is only necessary to look up the table to obtain the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters.
  • the interpolation process does not need to calculate the pixel matrix offset and determine the filtering parameters in real time. Therefore, Improves the efficiency of pixel interpolation.
  • the filtering parameters corresponding to different types of interpolation positions are set as parameter vectors of the same dimension, and the parameter values of the same dimension in the filtering parameters are not less than 0 or are not greater than 0, and the same set of hardware frameworks can be used to calculate different values. Interpolation precision and interpolation results for different types of interpolation positions. Thereby, hardware resources are saved.
  • the present application provides an embodiment of an electronic device, which corresponds to the method embodiment shown in FIG. 1 .
  • the electronic device may specifically include: a processor 801 and a memory 802 .
  • the above-mentioned memory 801 can be used to store program instructions.
  • the above-mentioned processor 802 can be used to execute the program instructions stored in the above-mentioned memory.
  • the above-mentioned processor can be used to perform the following steps: selecting the target interpolation position of the target image block; from the preset mapping table, The target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position are queried; based on the target pixel matrix offset and the target filtering parameter, the target interpolation position is interpolated.
  • the above-mentioned mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix; the above-mentioned first mapping information is generated by the following steps: obtaining the input corresponding to the image block of the specified size A pixel matrix, wherein the size of the image block of the specified size is the same as that of the target image block; the pixel matrix offset required for each interpolation position in the image block of the specified size is determined relative to the pixel matrix of the input pixel matrix; based on the above The pixel matrix offset corresponding to each interpolation position is used to generate the first mapping information.
  • generating the first mapping information based on the pixel matrix offsets corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; The offset of the pixel matrix is established, and the mapping between the position number and the offset of the pixel matrix is established to obtain the first mapping information.
  • the pixel matrix offset corresponding to each interpolation position includes a horizontal pixel matrix offset and a vertical pixel matrix offset;
  • the first mapping information includes The mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the horizontal direction, and the mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the vertical direction.
  • the above-mentioned mapping table includes second mapping information of interpolation positions and filtering parameters; the above-mentioned second mapping information is generated by the following steps: determining the value of each interpolation position in an image block of a specified size type, wherein the size of the image block of the specified size is the same as the size of the target image block; based on the type of each interpolation position, the filtering parameters corresponding to the interpolation positions are determined; based on the filtering parameters corresponding to the interpolation positions, a second mapping is generated information.
  • generating the second mapping information based on the filtering parameters corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; setting an index number for each filtering parameter; For the filtering parameters corresponding to the above-mentioned interpolation positions, a mapping between the position number and the index number is established to obtain the second mapping information.
  • the types of the above-mentioned interpolation positions include the types of the above-mentioned interpolation positions in the horizontal direction and the types of the above-mentioned interpolation positions in the vertical direction.
  • determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions includes: determining the horizontal direction based on the types of the interpolation positions in the horizontal direction. filtering parameters corresponding to the above-mentioned interpolation positions; based on the types of the above-mentioned interpolation positions in the vertical direction, the filtering parameters corresponding to the above-mentioned interpolation positions in the vertical direction are determined.
  • the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions corresponding to the vertical direction.
  • the mapping relationship of the filtering parameters includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions corresponding to the vertical direction.
  • the type of the interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point, and whole pixel point.
  • the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
  • the filtering parameters corresponding to the above-mentioned 1/4 pixel points are determined by the following steps: obtaining the first default filtering parameters corresponding to the above-mentioned 1/4 pixel points, the above-mentioned first default filtering parameters
  • the filtering parameters corresponding to the above-mentioned 1/2 pixel points are second default filtering parameters
  • the above-mentioned second default filtering parameters are M-dimensional parameter vectors
  • M is a positive integer.
  • the filtering parameters corresponding to the above-mentioned 3/4 pixel points are determined by the following steps: obtaining the third default filtering parameters corresponding to the above-mentioned 3/4 pixel points, and the above-mentioned third default filtering parameters
  • the filtering parameter corresponding to the above-mentioned integer pixel is an M-dimensional parameter vector with a parameter value of 0, where M is a positive integer.
  • the filtering parameters corresponding to the foregoing 1/4 pixel points, the filtering parameters corresponding to the foregoing 1/2 pixel points, the filtering parameters corresponding to the foregoing 3/4 pixel points, and the above The parameter values of the same dimension in the filtering parameters corresponding to the integer pixels are not less than 0 or are not greater than 0.
  • the above-mentioned processor 802 is further configured to: obtain an input pixel matrix corresponding to the above-mentioned target image block; The target pixel matrix required for target interpolation position interpolation; based on the target pixel matrix and the target filtering parameter, the target interpolation position is interpolated.
  • the above-mentioned processor 802 is further configured to: select reference pixels in the above-mentioned target pixel matrix based on the type of the above-mentioned target interpolation position; Filter the points to obtain the interpolation result of the above target interpolation position.
  • the above-mentioned processor 802 is further configured to: if the type of the above-mentioned target interpolation position is a 1/2 pixel point, select an integer pixel point in the above-mentioned target pixel matrix as the type of the above-mentioned target pixel matrix. Reference pixel; if the type of the target interpolation position is 1/4 pixel or 3/4 pixel, then select 1/2 pixel in the target pixel matrix as the reference pixel.
  • the target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and the processor 802 is further configured to: control the N data selectors to select N data,
  • the above-mentioned N pieces of data are respectively the data processing results after the above-mentioned target pixel matrix is processed by using the N parameter values in the target filtering parameters, wherein the above-mentioned N data selectors are pre-divided into the first group and the second group;
  • the data output by the data selectors in the first group is input to the first adder, and the data output by the data selectors in the second group is input into the second adder;
  • the data output by the first adder and the above The data output by the second adder is input to the subtractor, and the data output by the subtractor is used as the interpolation result of the target interpolation position.
  • the electronic device selects the target interpolation position of the target image block, and then queries the target pixel matrix offset corresponding to the target interpolation position and the target corresponding to the target interpolation position from the preset mapping table.
  • filter parameters so that the target interpolation position can be interpolated based on the target pixel matrix offset and the target filter parameter. Therefore, in the interpolation process, it is only necessary to look up the table to obtain the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters.
  • the interpolation process does not need to calculate the pixel matrix offset and determine the filtering parameters in real time. Therefore, Improves the efficiency of pixel interpolation.
  • the filtering parameters corresponding to different types of interpolation positions are set as parameter vectors of the same dimension, and the parameter values of the same dimension in the filtering parameters are not less than 0 or are not greater than 0, and the same set of hardware frameworks can be used to calculate different values. Interpolation precision and interpolation results for different types of interpolation positions. Thereby, hardware resources are saved.
  • the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment.
  • Embodiments of the present application further provide a computer-readable medium, where a computer program is stored on the computer-readable medium.
  • a computer program is stored on the computer-readable medium.
  • the embodiments of the present application may be provided as a method, an apparatus, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable media having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
  • These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the The instruction means implement the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

Abstract

The embodiments of the present application disclose a pixel interpolation method and apparatus, an electronic device, and a computer-readable medium. Said method comprises: selecting a target interpolation position of a target image block; querying, from a preset mapping table, a target pixel matrix offset corresponding to the target interpolation position and a target filtering parameter corresponding to the target interpolation position; and performing interpolation on the target interpolation position on the basis of the target pixel matrix offset and the target filtering parameter. The present implementation method improves the pixel interpolation efficiency.

Description

像素插值方法、装置、电子设备和计算机可读介质Pixel interpolation method, apparatus, electronic device and computer readable medium 技术领域technical field
本申请实施例涉及计算机技术领域,具体涉及像素插值方法、装置、电子设备和计算机可读介质。The embodiments of the present application relate to the field of computer technologies, and in particular, to a pixel interpolation method, an apparatus, an electronic device, and a computer-readable medium.
背景技术Background technique
在视频、图像等处理场景中,通常需要进行像素插值。例如,在视频编码过程中,需要在帧间预测阶段进行运动估计,以便参考帧中找到与当前编码块最相近的图像块。运动估计包括整像素运动估计(Integer Motion Estimation,IME)和分像素运动估计(Fraction Motion Estimation,FME)。整像素运动估计是在参考帧中一定范围内以整像素精度进行匹配搜索,以搜索到在整像素精度上最匹配的图像块。分像素运动估计是在整像素运动估计的基础上进行分像素精度的匹配搜索,以提高运动估计的精度。由于数字视频中不存在分数像素值,故需要将这些位置的像素值通过插值方式计算出来。In video, image and other processing scenarios, pixel interpolation is usually required. For example, in the process of video coding, motion estimation needs to be performed in the inter-frame prediction stage, so as to find the image block most similar to the current coding block in the reference frame. Motion estimation includes Integer Motion Estimation (IME) and Fraction Motion Estimation (FME). Integer-pixel motion estimation is to perform a matching search with integer-pixel precision within a certain range of the reference frame to search for the most matching image block with integer-pixel precision. Pixel-by-pixel motion estimation is based on whole-pixel motion estimation to perform matching search with pixel-by-pixel precision to improve the accuracy of motion estimation. Since fractional pixel values do not exist in digital video, the pixel values at these positions need to be calculated by interpolation.
现有技术中,在像素插值过程中,通常需要实时根据当前的插值位置确定插值参数,如插值位置所需要的像素矩阵相较于输入像素矩阵的偏移量、滤波参数等,从而基于插值参数进行分像素插值。In the prior art, in the process of pixel interpolation, it is usually necessary to determine the interpolation parameters in real time according to the current interpolation position, such as the offset of the pixel matrix required by the interpolation position compared to the input pixel matrix, filtering parameters, etc., so as to determine the interpolation parameters based on the interpolation parameters. Perform sub-pixel interpolation.
现有技术的不足之处在于,在插值过程中实时计算插值参数,导致插值效率较低。The disadvantage of the prior art is that the interpolation parameters are calculated in real time during the interpolation process, resulting in low interpolation efficiency.
发明内容SUMMARY OF THE INVENTION
本申请实施例提出了像素插值方法、装置、电子设备和计算机可读介质,以解决现有技术中像素插值效率较低技术问题。The embodiments of the present application propose a pixel interpolation method, an apparatus, an electronic device, and a computer-readable medium, so as to solve the technical problem of low pixel interpolation efficiency in the prior art.
第一方面,本申请实施例提供了一种像素插值方法,包括:选取目标图像块的目标插值位置;从预设的映射表中,查询所述目标插值位置对应的目标像素矩阵偏移量和所述目标插值位置对应的目标滤波参数;基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行插值。In a first aspect, an embodiment of the present application provides a pixel interpolation method, including: selecting a target interpolation position of a target image block; querying a target pixel matrix offset corresponding to the target interpolation position and The target filtering parameter corresponding to the target interpolation position; based on the target pixel matrix offset and the target filtering parameter, the target interpolation position is interpolated.
第二方面,本申请实施例提供了一种像素插值装置,包括:选取单元,被配置成选取目标图像块的目标插值位置;查询单元,被配置成从预设的映射表中,查询所述目标插值位置对应的目标像素矩阵偏移量和所述目标插值位置对应的目标滤波参数;插值单元,被配置成基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行插值。In a second aspect, an embodiment of the present application provides a pixel interpolation device, including: a selection unit, configured to select a target interpolation position of a target image block; a query unit, configured to query the preset mapping table for the the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position; the interpolation unit is configured to, based on the target pixel matrix offset and the target filtering parameter, perform interpolation on the target position to interpolate.
第三方面,本申请实施例提供了一种电子设备,包括:处理器和存储器;存储器,用于存储程序指令;处理器,用于执行存储器存储的程序指令,当程序指令被 执行时,处理器用于执行如下步骤:选取目标图像块的目标插值位置;从预设的映射表中,查询所述目标插值位置对应的目标像素矩阵偏移量和所述目标插值位置对应的目标滤波参数;基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行插值。In a third aspect, embodiments of the present application provide an electronic device, including: a processor and a memory; a memory for storing program instructions; a processor for executing program instructions stored in the memory, and when the program instructions are executed, processing The device is used to perform the following steps: select the target interpolation position of the target image block; from the preset mapping table, query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position; The target pixel matrix offset and the target filter parameter are used to interpolate the target interpolation position.
第四方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如上述像素插值方法。In a fourth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, implements the above pixel interpolation method.
本申请实施例提供了像素插值方法、装置、电子设备和计算机可读介质,提高了像素插值效率。Embodiments of the present application provide a pixel interpolation method, an apparatus, an electronic device, and a computer-readable medium, which improve pixel interpolation efficiency.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1A是视频编码过程的示意图;1A is a schematic diagram of a video encoding process;
图1B是分像素位置的示意图;1B is a schematic diagram of sub-pixel positions;
图2是根据本申请的像素插值方法的一个实施例的流程图;FIG. 2 is a flowchart of an embodiment of a pixel interpolation method according to the present application;
图3是根据本申请的像素插值方法的插值位置的分布示意图;3 is a schematic diagram of the distribution of interpolation positions according to the pixel interpolation method of the present application;
图4是根据本申请的像素插值方法的第一映射信息的示意图;4 is a schematic diagram of first mapping information according to the pixel interpolation method of the present application;
图5是根据本申请的像素插值方法的第二映射信息的示意图;5 is a schematic diagram of second mapping information according to the pixel interpolation method of the present application;
图6是根据本申请的像素插值方法的用于计算插值结果的硬件框架的示意图;6 is a schematic diagram of a hardware framework for calculating an interpolation result according to the pixel interpolation method of the present application;
图7是根据本申请的像素插值装置的一个实施例的结构示意图;7 is a schematic structural diagram of an embodiment of a pixel interpolation device according to the present application;
图8是根据本申请的电子设备的一个实施例的结构示意图。FIG. 8 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
具体实施例specific embodiment
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
为便于理解,先结合图1,对一种常规的像素插值场景进行简单介绍。此场景为视频编码场景。所谓视频编码方式就是指通过压缩技术,将原始视频格式的文件转换成另一种视频格式文件的方式。For ease of understanding, a conventional pixel interpolation scene is briefly introduced first with reference to FIG. 1 . This scene is a video encoding scene. The so-called video encoding method refers to the method of converting the original video format file into another video format file through compression technology.
如图1A所示,传统视频编码过程通常包括预测、变换、量化和熵编码等过程,最终输出视频的码流。在预测过程中,通常需要进行像素插值。下面对视频编码过程进行介绍。As shown in FIG. 1A , the traditional video coding process usually includes processes such as prediction, transformation, quantization, and entropy coding, and finally outputs a video code stream. During prediction, pixel interpolation is usually required. The video encoding process is described below.
视频数据有很强的相关性,因而存在大量的冗余信息。其中冗余信息可分为空 域冗余信息和时域冗余信息。预测的目的在于利用预测出的图像块数据减少当前待编码图像块的冗余信息,即去除数据之间的相关性。在预测阶段,可得到相对于当前待编码图像块的预测图像块。将当前待编码图像块与预测图像块的像素值相减,即可得到该当前待编码图像块对应的残差块,由此可完成预测过程。Video data has strong correlation, so there is a lot of redundant information. The redundant information can be divided into spatial domain redundant information and time domain redundant information. The purpose of prediction is to use the predicted image block data to reduce redundant information of the image block currently to be encoded, that is, to remove the correlation between the data. In the prediction stage, a predicted image block relative to the current image block to be encoded can be obtained. A residual block corresponding to the current image block to be encoded can be obtained by subtracting the pixel values of the current image block to be encoded and the predicted image block, thereby completing the prediction process.
预测通常包括帧内预测和帧间预测两种类型。其中,帧内预测是使用同一视频帧中已经编码的图像块对当前的待编码图像块进行预测,以减少空域冗余信息。帧间预测是使用前一帧或前多帧已经编码的图像块对当前待编码图像块进行预测,以减少时域冗余信息。具体地,帧间预测的原理是利用视频中临近帧之间的时域相关性,使用先前已编码的重建帧作为参考帧,通过运动估计和运动补偿对当前待编码图像块进行预测,以去除视频中的时域冗余信息,进而达到压缩视频数据的目的。其中,运动估计是指需要在参考帧中找到与当前待编码图像最相近的图像块,使得编码代价最小,编码效率最高。运动补偿是在运动估计的基础上对所搜索到的图像块作出修正的过程。Prediction usually includes two types of intra prediction and inter prediction. The intra-frame prediction is to predict the current image block to be encoded by using the image blocks already encoded in the same video frame, so as to reduce spatial redundancy information. Inter-frame prediction is to predict the current to-be-encoded image block by using the image blocks that have been encoded in the previous frame or multiple previous frames, so as to reduce redundant information in the temporal domain. Specifically, the principle of inter-frame prediction is to use the temporal correlation between adjacent frames in the video, use the previously encoded reconstructed frame as a reference frame, and predict the current to-be-encoded image block through motion estimation and motion compensation to remove the The temporal redundancy information in the video, and then achieve the purpose of compressing the video data. Among them, motion estimation refers to the need to find the image block most similar to the current image to be encoded in the reference frame, so that the encoding cost is the smallest and the encoding efficiency is the highest. Motion compensation is a process of modifying the searched image blocks on the basis of motion estimation.
以H.265视频压缩标准为例,对于当前待编码图像块,为了实现高精度的运动估计,可分为两步实现:整像素运动估计(Integer Motion Estimation,IME)和分像素运动估计(Fraction Motion Estimation,FME)。整像素运动估计用以在参考帧中一定范围内以整像素精度进行匹配搜索,得到在整像素精度上最匹配的图像块。由于自然物体运动的连续性,物体在相邻两帧之间的运动不一定恰好相隔整像素单位,因此为了提高运动估计的准确度,需要在整像素运动估计的基础上进行分像素估计,以在分像素精度(如1/2像素精度、1/4像素精度等)上进行匹配搜索。由于数字视频中并不存在分像素位置的像素值,故需要将这些像素值通过插值方式计算出来。Taking the H.265 video compression standard as an example, for the current image block to be encoded, in order to achieve high-precision motion estimation, it can be implemented in two steps: Integer Motion Estimation (IME) and Fractional Motion Estimation (Fraction) Motion Estimation, FME). Integer-pixel motion estimation is used to perform a matching search with integer-pixel accuracy within a certain range of the reference frame, and obtain the most matching image block with integer-pixel accuracy. Due to the continuity of motion of natural objects, the motion of objects between two adjacent frames may not be exactly separated by an integer pixel unit. Therefore, in order to improve the accuracy of motion estimation, it is necessary to perform pixel-by-pixel estimation on the basis of whole-pixel motion estimation. Match search is performed on sub-pixel precision (eg 1/2 pixel precision, 1/4 pixel precision, etc.). Since pixel values of sub-pixel positions do not exist in digital video, these pixel values need to be calculated by interpolation.
作为示例,图1B示出了分像素位置的示意图。如图1B所示,对于4×4的图像块中的某一整像素点A(0,0),该点周围存在8个1/2像素位置。进一步地,对于每一个1/2像素位置,该位置周围存在8个1/4像素位置。由于分像素的像素值更为精确,因而与整像素精度相比,分像素的匹配搜索使得运动估计的精度得到了很大的提高。As an example, FIG. 1B shows a schematic diagram of sub-pixel positions. As shown in FIG. 1B , for a certain integer pixel point A(0,0) in a 4×4 image block, there are 8 1/2 pixel positions around the point. Further, for each 1/2 pixel position, there are 8 1/4 pixel positions around the position. Since the pixel values of sub-pixels are more accurate, the matching search of sub-pixels greatly improves the accuracy of motion estimation compared with the accuracy of whole pixels.
在执行预测过程后,需要依次执行变换、量化以及熵编码等过程。变换操作用于将预测过程中得到的残差块从时域转换成频域。变换方式可包括离散余弦变换(discrete cosine transform,DCT)、离散小波变换(discrete wavelet transform,DWT)等。对残差块进行变换后,可得到一个变换系数矩阵。量化操作用于减小变换后所得到的变化系数,从而便于进行熵编码。熵编码,即编码过程中按熵原理不丢失任何信息的编码。常见的熵编码有:香农(Shannon)编码、哈夫曼(Huffman)编码和算术编码(arithmetic coding)等。熵编码处理后,可得到熵编码比特流。将熵编码比特流以及相关信息(如模式信息、运动矢量等信息)进行存储或发送到解码端,即可完成视频编码过程。After the prediction process is performed, processes such as transformation, quantization, and entropy coding need to be performed in sequence. The transform operation is used to transform the residual block obtained in the prediction process from the time domain to the frequency domain. The transformation method may include discrete cosine transform (discrete cosine transform, DCT), discrete wavelet transform (discrete wavelet transform, DWT), and the like. After transforming the residual block, a transform coefficient matrix can be obtained. The quantization operation is used to reduce the coefficient of variation obtained after transformation, thereby facilitating entropy coding. Entropy coding, that is, coding in which no information is lost according to the principle of entropy during the coding process. Common entropy codes include: Shannon coding, Huffman coding and arithmetic coding (arithmetic coding). After the entropy coding process, an entropy coded bit stream can be obtained. The video encoding process can be completed by storing or sending the entropy encoded bit stream and related information (such as mode information, motion vector, etc.) to the decoding end.
需要说明的是,在进行量化和变换后,还可以通过反量化和反变换恢复出残差块(可称为重建残差块),然后将重建残差块与预测图像块相加,得到重建图像块,最后对重建图像块进行环内滤波,得到最终的重建图像,以便提供给之后的编码图像进行帧间预测。其中,环内滤波可以包括但不限于去块滤波、像素自适应补偿(Sample adaptive offset,SAO)等。通过上述过程,即可完成视频的编码。It should be noted that, after quantization and transformation, a residual block (which may be called a reconstructed residual block) can also be recovered through inverse quantization and inverse transformation, and then the reconstructed residual block and the predicted image block are added to obtain the reconstruction. image block, and finally perform in-loop filtering on the reconstructed image block to obtain the final reconstructed image, which is then provided to the subsequent coded image for inter-frame prediction. The in-loop filtering may include, but is not limited to, deblocking filtering, pixel adaptive offset (Sample adaptive offset, SAO), and the like. Through the above process, the encoding of the video can be completed.
由于视频编码过程中的帧间预测阶段需要进行分像素运动估计,因而需要进行像素插值。现有技术通常在像素插值过程中实时计算插值参数,如插值点所需要的像素矩阵相较于输入像素矩阵的偏移量、滤波参数等,因而插值效率较低。因此,亟待寻找一种能够提高插值效率的方法。Since pixel-by-pixel motion estimation is required in the inter prediction stage of the video coding process, pixel interpolation is required. In the prior art, interpolation parameters are usually calculated in real time during the pixel interpolation process, such as the offset of the pixel matrix required by the interpolation point compared to the input pixel matrix, filtering parameters, etc., so the interpolation efficiency is low. Therefore, it is urgent to find a method that can improve the interpolation efficiency.
请参考图2,其示出了根据本申请的像素插值方法200的流程图。该像素插值方法的执行主体可以是各种电子设备。例如手机、平板电脑、膝上便携式计算机、台式计算机、服务器等。Please refer to FIG. 2, which shows a flowchart of a pixel interpolation method 200 according to the present application. The executing subject of the pixel interpolation method can be various electronic devices. For example cell phones, tablets, laptops, desktops, servers, etc.
该像素插值方法的流程包括以下步骤:The flow of the pixel interpolation method includes the following steps:
步骤201,选取目标图像块的目标插值位置。Step 201: Select a target interpolation position of a target image block.
在本实施例中,像素插值方法的执行主体(如上述电子设备)在需要对某一图像中的目标图像块进行插值时,可首先选取目标图像块的目标插值位置。其中,目标像素块即为待进行像素插值的图像块,例如,可以是视频编码过程的帧间预测阶段进行整像素搜索后所得到的图像块。目标图像块的尺寸可以根据需要预先设定,例如可以设定为4×4、8×8等,此处不作具体限定。In this embodiment, when the execution body of the pixel interpolation method (such as the electronic device described above) needs to perform interpolation on a target image block in a certain image, the target interpolation position of the target image block can be selected first. The target pixel block is an image block to be subjected to pixel interpolation, for example, it may be an image block obtained by performing an integer pixel search in the inter-frame prediction stage of the video coding process. The size of the target image block can be preset as required, for example, it can be set to 4×4, 8×8, etc., which is not specifically limited here.
目标插值位置可以是整像素之间待进行插值的位置。作为示例,在需要以1/2插值精度进行插值时,目标图像块中每一个整像素点周围可包含8个插值位置。在需要以1/4插值精度进行插值时,目标图像块中每个1/2分像素点周围还可进一步包含8个插值位置。由此,目标图像块中的每一个整像素点,可对应有多个插值位置。可分别对每一个整像素点的各个插值位置按照相同规则进行编号,从而将目标图像块的各个整像素点的某一相同编号的插值位置作为目标插值位置。The target interpolation position may be a position to be interpolated between integer pixels. As an example, when interpolation needs to be performed with 1/2 interpolation precision, 8 interpolation positions may be included around each integer pixel in the target image block. When interpolation needs to be performed with 1/4 interpolation precision, 8 interpolation positions may be further included around each 1/2 pixel point in the target image block. Therefore, each integer pixel in the target image block may correspond to multiple interpolation positions. Each interpolation position of each integer pixel can be numbered according to the same rule, so that a same numbered interpolation position of each integer pixel of the target image block is used as the target interpolation position.
以图3所示的像素插值方法的插值位置的分布示意图为例,若目标像素块的大小为4×4,则目标像素块中包含16个整像素点。在最高插值精度为1/4时,目标图像块中的每一个整像素点,可包含49个插值位置(含整像素点自身)。可分别对每一个整像素点的49个插值位置进行编号,得到0至48共49个编号。目标插值位置可以是任一编号对应的插值位置。例如,可以是目标图像块中的各整像素点的8号插值位置。由于目标图像块共有16个整像素点,因而共有16个8号插值位置,各8号插值位置可视为目标图像块的目标插值位置。Taking the distribution diagram of the interpolation positions of the pixel interpolation method shown in FIG. 3 as an example, if the size of the target pixel block is 4×4, the target pixel block includes 16 whole pixels. When the highest interpolation precision is 1/4, each integer pixel in the target image block can contain 49 interpolation positions (including the integer pixel itself). The 49 interpolation positions of each integer pixel can be numbered respectively to obtain a total of 49 numbers from 0 to 48. The target interpolation position can be the interpolation position corresponding to any number. For example, it can be the interpolation position No. 8 of each integer pixel in the target image block. Since the target image block has a total of 16 integer pixels, there are 16 No. 8 interpolation positions in total, and each No. 8 interpolation position can be regarded as the target interpolation position of the target image block.
步骤202,从预设的映射表中,查询目标插值位置对应的目标像素矩阵偏移量和目标插值位置对应的目标滤波参数。 Step 202 , from a preset mapping table, query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters corresponding to the target interpolation position.
在本实施例中,上述执行主体中可以存储有预设的映射表。该映射表可以指示插值位置与像素矩阵偏移量的映射关系,以及,可以指示插值位置与用于进行插值计算滤波参数的映射关系。由此,上述执行主体可以从该映射表中,查询目标插值位置对应的目标像素矩阵偏移量和目标插值位置对应的目标滤波参数。In this embodiment, a preset mapping table may be stored in the above-mentioned execution body. The mapping table may indicate a mapping relationship between interpolation positions and pixel matrix offsets, and may indicate a mapping relationship between interpolation positions and filtering parameters used for interpolation calculation. Thus, the above-mentioned execution body can query the target pixel matrix offset corresponding to the target interpolation position and the target filter parameter corresponding to the target interpolation position from the mapping table.
此处,像素矩阵偏移量为插值位置所需的像素矩阵相对于输入像素矩阵的偏移量。实践中,在需要对某一图像块进行插值时,通常需要输入一个像素矩阵,用以提供插值过程所需的像素数据。例如,若对4×4的图像块插值,则需要输入12×12的像素矩阵,该像素矩阵即为输入像素矩阵。然而,图像块中的不同插值位置实际所需的像素矩阵相较于输入像素矩阵通常存在一定差异,例如,对于该图像块中某一特定的插值位置,其实际需要的像素矩阵大小为11×11。该11×11的像素矩阵相较于12×12的像素矩阵,可在水平方向和竖直方向存在偏移量,该偏移量即为像素矩阵偏移量。Here, the pixel matrix offset is the offset of the pixel matrix required for the interpolation position relative to the input pixel matrix. In practice, when an image block needs to be interpolated, it is usually necessary to input a pixel matrix to provide pixel data required for the interpolation process. For example, if a 4×4 image block is interpolated, a 12×12 pixel matrix needs to be input, and the pixel matrix is the input pixel matrix. However, the pixel matrix actually required for different interpolation positions in an image block is usually different from the input pixel matrix. For example, for a specific interpolation position in the image block, the actual required pixel matrix size is 11× 11. Compared with the 12×12 pixel matrix, the 11×11 pixel matrix may have an offset in the horizontal direction and the vertical direction, and the offset is the pixel matrix offset.
以图3中所示的插值位置为例,每一个整像素点包含49个插值位置(如编号0至48的插值位置)。由于不同插值位置所需的像素矩阵相较于输入像素矩阵通常存在差异,因而可预先计算每一个插值位置对应的像素矩阵偏移量,从而将这49个插值位置与像素矩阵偏移量的映射关系预先记录于映射表中。上述执行主体在插值过程中只需进行查表,即可得到目标插值位置对应的目标像素矩阵偏移量。由于插值过程无需实时进行像素矩阵偏移量的计算,因而可提高像素插值的效率。Taking the interpolation positions shown in FIG. 3 as an example, each integer pixel includes 49 interpolation positions (eg, interpolation positions numbered 0 to 48). Since the pixel matrix required for different interpolation positions is usually different from the input pixel matrix, the pixel matrix offset corresponding to each interpolation position can be pre-calculated, so as to map the 49 interpolation positions to the pixel matrix offset Relationships are pre-recorded in the mapping table. The above executive body only needs to look up the table during the interpolation process to obtain the target pixel matrix offset corresponding to the target interpolation position. Since the interpolation process does not need to calculate the offset of the pixel matrix in real time, the efficiency of pixel interpolation can be improved.
同理,由于插值过程中针对不同的插值位置所使用的滤波参数通常存在差异(如1/4分像素点适用的滤波参数为[-1,4,-10,58,17,-5,1]、1/2分像素点适用的滤波参数为[-1,4,-11,40,40,-11,4,-1]、3/4分像素点适用的滤波参数为[1,-5,17,58,-10,4,-1]),因而可预先确定这49个插值位置所分别对应的滤波参数,从而将这49个插值位置与滤波参数的映射关系记录至该映射表中。上述执行主体在插值过程中只需进行查表,即可得到目标插值位置对应的目标滤波参数。由于插值过程无需实时进行滤波参数的筛选和判定,因而可提高像素插值的效率。Similarly, because the filtering parameters used for different interpolation positions in the interpolation process are usually different (for example, the filtering parameters applicable to 1/4 pixel points are [-1,4,-10,58,17,-5,1 ], the filtering parameters applicable to 1/2 pixel points are [-1,4,-11,40,40,-11,4,-1], and the filtering parameters applicable to 3/4 pixel points are [1,- 5,17,58,-10,4,-1]), so the filtering parameters corresponding to the 49 interpolation positions can be pre-determined, so that the mapping relationship between the 49 interpolation positions and the filtering parameters can be recorded in the mapping table middle. The above executive body only needs to look up the table during the interpolation process to obtain the target filtering parameters corresponding to the target interpolation position. Since the interpolation process does not need to filter and determine the filtering parameters in real time, the efficiency of pixel interpolation can be improved.
在一些可选的实施例中,上述映射表中可以包括插值位置与像素矩阵偏移量的第一映射信息。第一映射信息可以表征插值位置与像素矩阵偏移量的映射关系,可通过如下步骤生成:In some optional embodiments, the above-mentioned mapping table may include first mapping information of the interpolation position and the offset of the pixel matrix. The first mapping information can represent the mapping relationship between the interpolation position and the offset of the pixel matrix, and can be generated by the following steps:
第一步,获取指定尺寸图像块对应的输入像素矩阵。The first step is to obtain the input pixel matrix corresponding to the specified size image block.
其中,指定尺寸图像块与目标图像块的尺寸相同。作为示例,指定尺寸图像块与上述目标图像块均为4×4大小的图像块,均包含16个整像素点。指定尺寸图像块对应的输入像素矩阵可以是12×12的像素矩阵。Wherein, the size of the specified size image block is the same as the size of the target image block. As an example, the specified size image block and the above-mentioned target image block are both 4×4 image blocks, and both contain 16 integer pixels. The input pixel matrix corresponding to the specified size image block can be a 12×12 pixel matrix.
第二步,确定指定尺寸图像块中的各插值位置所需的像素矩阵相对于输入像素矩阵的像素矩阵偏移量。The second step is to determine the pixel matrix offset of the pixel matrix required for each interpolation position in the image block of the specified size relative to the input pixel matrix.
此处,对于指定尺寸图像块中的每一个插值位置(即每一个位置编号对应的插 值位置,如4×4图像块中的没给整像素点的8号插值位置),可以首先确定该插值位置所需的像素矩阵的位置,而后基于该位置与输入像素矩阵的位置的相对位置关系,确定出像素矩阵偏移量。Here, for each interpolation position in the image block of the specified size (that is, the interpolation position corresponding to each position number, such as the interpolation position No. 8 in the 4×4 image block without an integer pixel point), the interpolation value can be determined first. The position of the pixel matrix required for the position, and then the pixel matrix offset is determined based on the relative positional relationship between the position and the position of the input pixel matrix.
第三步,基于各插值位置对应的像素矩阵偏移量,生成第一映射信息。The third step is to generate first mapping information based on the pixel matrix offset corresponding to each interpolation position.
此处,可按照顺序将各插值位置与像素矩阵偏移量的映射关系进行汇总,得到第一映射信息。作为示例,可以首先为各插值位置设置位置编号(如图3所示,此处不再赘述);而后,基于各插值位置对应的像素矩阵偏移量,建立位置编号与像素矩阵偏移量的映射,从而得到第一映射信息。Here, the mapping relationship between each interpolation position and the offset of the pixel matrix may be summarized in order to obtain the first mapping information. As an example, a position number may be set for each interpolation position first (as shown in FIG. 3 , which will not be repeated here); then, based on the pixel matrix offset corresponding to each interpolation position, a relationship between the position number and the pixel matrix offset is established. mapping to obtain the first mapping information.
在一些可选的实施例中,各插值位置对应的像素矩阵偏移量可以包括水平方向的像素矩阵偏移量和竖直方向的像素矩阵偏移量。由此,参见图4,第一映射信息可以包括各插值位置(可用位置编号指代)与水平方向的像素矩阵偏移量的映射关系,同时,还可以包括各插值位置(可用位置编号指代)与竖直方向的像素矩阵偏移量的映射关系。In some optional embodiments, the pixel matrix offset corresponding to each interpolation position may include a horizontal pixel matrix offset and a vertical pixel matrix offset. Therefore, referring to FIG. 4 , the first mapping information may include the mapping relationship between each interpolation position (referred to by the available position number) and the offset of the pixel matrix in the horizontal direction, and may also include each interpolation position (referred to by the available position number) ) and the mapping relationship of the pixel matrix offset in the vertical direction.
在一些可选的实施例中,映射表中可以包括插值位置与滤波参数的第二映射信息。第二映射信息可以表征插值位置与滤波参数的映射关系。其中,第二映射信息可以通过如下步骤生成:In some optional embodiments, the mapping table may include second mapping information of interpolation positions and filtering parameters. The second mapping information may represent the mapping relationship between the interpolation position and the filtering parameter. Wherein, the second mapping information can be generated by the following steps:
第一步,确定指定尺寸图像块中的各插值位置的类型。The first step is to determine the type of each interpolation position in an image block of a specified size.
其中,指定尺寸图像块与目标图像块的尺寸相同。作为示例,指定尺寸图像块与上述目标图像块均为4×4大小的图像块,均包含16个整像素点。指定尺寸图像块对应的输入像素矩阵可以是12×12的像素矩阵。Wherein, the size of the specified size image block is the same as the size of the target image block. As an example, the specified size image block and the above-mentioned target image block are both 4×4 image blocks, and both contain 16 integer pixels. The input pixel matrix corresponding to the specified size image block can be a 12×12 pixel matrix.
第二步,基于各插值位置的类型,确定各插值位置对应的滤波参数。In the second step, the filtering parameters corresponding to each interpolation position are determined based on the type of each interpolation position.
在一些示例中,插值位置的类型可以包括但不限于以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。不同类型的插值位置可对应不同的滤波参数。可以直接选取各类型插值位置默认的滤波参数,也可以对默认的滤波参数进行调整。In some examples, the type of interpolation location may include, but is not limited to, at least one of the following: 1/4 pixel, 1/2 pixel, 3/4 pixel, and integer pixel. Different types of interpolation positions can correspond to different filter parameters. You can directly select the default filter parameters for each type of interpolation position, or you can adjust the default filter parameters.
第三步,基于各插值位置对应的滤波参数,生成第二映射信息。The third step is to generate second mapping information based on the filtering parameters corresponding to each interpolation position.
此处,可按照顺序将各插值位置与滤波参数的映射关系进行汇总,得到第二映射信息。作为示例,可以首先为各插值位置设置位置编号(如图3所示,此处不再赘述);而后,为各滤波参数设置索引编号。例如,整像素点的滤波参数的索引编号为0。1/4分像素点的滤波参数的索引编号为1。1/2分像素点的滤波参数的索引编号为2。和3/4分像素点的滤波参数的索引编号为3。最后,可以基于各插值位置对应的滤波参数,建立位置编号与索引编号的映射,得到第二映射信息。Here, the mapping relationship between each interpolation position and the filtering parameter can be summarized in order to obtain the second mapping information. As an example, a position number may be set for each interpolation position first (as shown in FIG. 3 , which will not be repeated here); then, an index number may be set for each filter parameter. For example, the index number of the filtering parameter of the whole pixel is 0. The index number of the filtering parameter of the 1/4 pixel is 1. The index number of the filtering parameter of the 1/2 pixel is 2. and the index number of the filtering parameter of the 3/4 pixel point is 3. Finally, based on the filtering parameters corresponding to each interpolation position, a mapping between the position number and the index number can be established to obtain the second mapping information.
在一些可选的实施例中,各插值位置的类型包括各插值位置在水平方向上的类型和各插值位置在竖直方向上的类型。此时,上述第二步中基于各插值位置的类型,确定各插值位置对应的滤波参数,可以分为如下步骤执行:基于各插值位置在水平 方向上的类型,确定在水平方向上各插值位置对应的滤波参数;基于各插值位置在竖直方向上的类型,确定在竖直方向上各插值位置对应的滤波参数。In some optional embodiments, the type of each interpolation position includes the type of each interpolation position in the horizontal direction and the type of each interpolation position in the vertical direction. At this time, in the above second step, the filtering parameters corresponding to each interpolation position are determined based on the type of each interpolation position, which can be divided into the following steps: based on the type of each interpolation position in the horizontal direction, determine each interpolation position in the horizontal direction. Corresponding filtering parameters; based on the type of each interpolation position in the vertical direction, determine the filtering parameters corresponding to each interpolation position in the vertical direction.
在此基础上,参见图5,第二映射信息可以包括各插值位置与在水平方向上对应的滤波参数(可用索引编号表示)的映射关系,以及,包括各插值位置与在竖直方向上对应的滤波参数(可用索引编号表示)的映射关系。On this basis, referring to FIG. 5 , the second mapping information may include the mapping relationship between each interpolation position and the filter parameter (represented by an index number) corresponding to the horizontal direction, and the corresponding interpolation position in the vertical direction. The mapping relationship of the filtering parameters (represented by index numbers).
在一些可选的实施例中,不同类型的插值位置对应的滤波参数可以是具有相同维度的参数向量。例如,插值位置的类型可以包括但不限于以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。不同类型的插值位置对应的滤波参数均为8维参数向量,且不同类型的插值位置对应的8维参数向量不同。In some optional embodiments, the filtering parameters corresponding to different types of interpolation positions may be parameter vectors with the same dimension. For example, the type of interpolation location may include, but is not limited to, at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point, and whole pixel point. The filtering parameters corresponding to different types of interpolation positions are all 8-dimensional parameter vectors, and the 8-dimensional parameter vectors corresponding to different types of interpolation positions are different.
在一些可选的实施例中,1/4分像素点对应的滤波参数通过如下步骤确定:首先,获取1/4分像素点对应的第一默认滤波参数,第一默认滤波参数为M维参数向量,M为正整数。之后,对第一默认滤波参数的末尾添加0,得到1/4分像素点对应的最终的滤波参数,最终的滤波参数为N维参数向量,N=M+1。作为示例,第一默认滤波参数可以是[-1,4,-10,58,17,-5,1],M为7。在对第一默认滤波参数的末尾添加0后,可得到1/4分像素点对应的最终的滤波参数[-1,4,-10,58,17,-5,1,0],此时N为8。In some optional embodiments, the filtering parameters corresponding to the 1/4 pixel points are determined by the following steps: first, the first default filtering parameters corresponding to the 1/4 pixel points are obtained, and the first default filtering parameters are M-dimensional parameters vector, where M is a positive integer. After that, 0 is added to the end of the first default filter parameter to obtain the final filter parameter corresponding to the 1/4 pixel point, and the final filter parameter is an N-dimensional parameter vector, N=M+1. As an example, the first default filter parameter may be [-1, 4, -10, 58, 17, -5, 1], and M is 7. After adding 0 to the end of the first default filter parameter, the final filter parameter [-1,4,-10,58,17,-5,1,0] corresponding to the 1/4 pixel point can be obtained, at this time N is 8.
在一些可选的实施例中,1/2分像素点对应的滤波参数为第二默认滤波参数,第二默认滤波参数为M维参数向量,M为正整数。例如,第二默认滤波参数为[-1,4,-11,40,40,-11,4,-1],此时M为7。In some optional embodiments, the filter parameter corresponding to the 1/2 pixel point is the second default filter parameter, the second default filter parameter is an M-dimensional parameter vector, and M is a positive integer. For example, the second default filter parameter is [-1,4,-11,40,40,-11,4,-1], and M is 7 at this time.
在一些可选的实施例中,3/4分像素点对应的滤波参数可通过如下步骤确定:首先,获取3/4分像素点对应的第三默认滤波参数,第三默认滤波参数为M维参数向量,M为正整数。之后,对第三默认滤波参数的首位前添加0,得到3/4分像素点对应的最终的滤波参数,最终的滤波参数为N维参数向量,N=M+1。作为示例,第三默认滤波参数可以是[1,-5,17,58,-10,4,-1],M为7。对第三默认滤波参数的首位前添加0后,可得到3/4分像素点对应的最终的滤波参数[0,1,-5,17,58,-10,4,-1],此时N为8。In some optional embodiments, the filtering parameters corresponding to the 3/4 pixel points may be determined by the following steps: first, obtain the third default filtering parameters corresponding to the 3/4 pixel points, and the third default filtering parameters are M-dimensional parameter vector, M is a positive integer. After that, add 0 to the first position of the third default filter parameter to obtain the final filter parameter corresponding to the 3/4 pixel point, and the final filter parameter is an N-dimensional parameter vector, N=M+1. As an example, the third default filter parameter may be [1,-5,17,58,-10,4,-1], and M is 7. After adding 0 to the first position of the third default filter parameter, the final filter parameter [0,1,-5,17,58,-10,4,-1] corresponding to the 3/4 pixel point can be obtained. N is 8.
在一些可选的实施例中,整像素点对应的滤波参数为参数值为0的M维参数向量,M为正整数。即,整像素点对应的滤波参数为[0,0,0,0,0,0,0,0]。In some optional embodiments, the filtering parameter corresponding to an integer pixel is an M-dimensional parameter vector with a parameter value of 0, where M is a positive integer. That is, the filter parameter corresponding to the integer pixel is [0,0,0,0,0,0,0,0].
通过将不同类型的插值位置对应的滤波参数为具有相同维度的参数向量,可便于使用同一套硬件架构对不同类型的插值位置进行插值,从而降低硬件成本。By using the filtering parameters corresponding to different types of interpolation positions as parameter vectors with the same dimension, it is convenient to use the same set of hardware architecture to interpolate different types of interpolation positions, thereby reducing hardware costs.
在一些可选的实施例中,1/4分像素点对应的滤波参数、1/2分像素点对应的滤波参数、3/4分像素点对应的滤波参数以及整像素点对应的滤波参数中的同一维度的参数值均不小于0或者均不大于0。作为示例,1/4分像素点对应的滤波参数为[-1,4,-10,58,17,-5,1,0],1/2分像素点对应的滤波参数为[-1,4,-11,40,40,-11,4,-1],3/4分像素点对应的滤波参数为[0,1,-5,17,58,-10,4,-1],整像素点对应的滤波参数为[0,0,0,0,0,0,0,0],由此可保证同一维度的参数值均不小于0或者均不大于0。In some optional embodiments, among the filtering parameters corresponding to 1/4 pixel points, the filtering parameters corresponding to 1/2 pixel points, the filtering parameters corresponding to 3/4 pixel points, and the filtering parameters corresponding to integer pixels The parameter values of the same dimension are not less than 0 or are not greater than 0. As an example, the filtering parameters corresponding to 1/4 pixel points are [-1,4,-10,58,17,-5,1,0], and the filtering parameters corresponding to 1/2 pixel points are [-1, 4,-11,40,40,-11,4,-1], the filtering parameters corresponding to 3/4 pixel points are [0,1,-5,17,58,-10,4,-1], The filter parameter corresponding to an integer pixel is [0, 0, 0, 0, 0, 0, 0, 0], which ensures that the parameter values of the same dimension are not less than 0 or are not greater than 0.
通过使不同类型的插值位置对应的滤波参数中同一维度的参数值均不小于0或者均不大于0,可便于使用同一套硬件架构(如包含同一套加法器和减法器)对不同类型的插值位置进行插值,从而降低硬件成本。By making the parameter values of the same dimension in the filtering parameters corresponding to different types of interpolation positions not less than 0 or not greater than 0, it is convenient to use the same set of hardware architecture (for example, including the same set of adders and subtractors) for different types of interpolation Positions are interpolated, thereby reducing hardware costs.
步骤203,基于目标像素矩阵偏移量和目标滤波参数,对目标插值位置进行插值。Step 203: Interpolate the target interpolation position based on the target pixel matrix offset and the target filter parameter.
在本实施例中,上述执行主体可以基于目标像素矩阵偏移量和目标滤波参数,对目标插值位置进行插值。In this embodiment, the execution subject may perform interpolation on the target interpolation position based on the target pixel matrix offset and the target filter parameter.
在一些可选的实施例中,可以首先获取目标图像块对应的输入像素矩阵;而后,可以基于目标像素矩阵偏移量和该输入像素矩阵,确定对目标插值位置插值所需要的目标像素矩阵。最后,可以基于目标像素矩阵中的像素数据和目标滤波参数,对目标插值位置进行插值。In some optional embodiments, the input pixel matrix corresponding to the target image block may be obtained first; then, the target pixel matrix required for interpolation of the target interpolation position may be determined based on the target pixel matrix offset and the input pixel matrix. Finally, the target interpolation position can be interpolated based on the pixel data in the target pixel matrix and the target filter parameters.
在一些可选的实施例中,在使用目标像素矩阵和目标滤波参数对目标插值位置进行插值时,上述执行主体可以首先基于目标插值位置,选取目标像素矩阵中的参考像素点。而后,使用目标滤波参数对参考像素点进行滤波处理,得到目标插值位置的插值结果。在一些示例中,若目标插值位置的类型为1/2分像素点,则可以选取目标像素矩阵中的整像素点,作为参考像素点。在另一些示例中,若目标插值位置的类型为1/4分像素点或3/4分像素点,则可以选取目标像素矩阵中的1/2分像素点,作为参考像素点。In some optional embodiments, when using the target pixel matrix and the target filtering parameters to interpolate the target interpolation position, the above-mentioned executing subject may first select reference pixels in the target pixel matrix based on the target interpolation position. Then, use the target filtering parameters to filter the reference pixels to obtain the interpolation result of the target interpolation position. In some examples, if the type of the target interpolation position is a 1/2 pixel point, an integer pixel point in the target pixel matrix may be selected as a reference pixel point. In other examples, if the type of the target interpolation position is a 1/4 pixel point or a 3/4 pixel point, a 1/2 pixel point in the target pixel matrix may be selected as a reference pixel point.
以对4×4大小的目标图像块进行1/2精度的插值为例,1/2插值精度所需插值的位置包括整像素点的左上插值位置(如图3中的8号位置编号对应的位置)、左中插值位置(如图3中的22号位置编号对应的位置)、左下插值位置(如图3中的36号位置编号对应的位置)、右上插值位置(如图3中的12号位置编号对应的位置)、右中插值位置(如图3中的26号位置编号对应的位置)、右下插值位置(如图3中的40号位置编号对应的位置)、中上插值位置(如图3中的10号位置编号对应的位置)、正中插值位置(如图3中的24号位置编号对应的位置,也即整像素点的位置)和中下插值位置(如图3中的38号位置编号对应的位置)。Taking the interpolation of 1/2 precision for the target image block of 4×4 size as an example, the position of interpolation required for 1/2 interpolation precision includes the upper left interpolation position of the whole pixel (as shown in Figure 3, the position number corresponding to No. 8) position), the left middle interpolation position (the position corresponding to the position number 22 in Figure 3), the lower left interpolation position (the position corresponding to the position number 36 in Figure 3), the upper right interpolation position (the position corresponding to the position number 12 in Figure 3) number corresponding to the position number), the right middle interpolation position (the position corresponding to the 26th position number in Figure 3), the lower right interpolation position (the position corresponding to the 40th position number in Figure 3), the upper middle interpolation position (the position corresponding to the position number 10 in Figure 3), the middle interpolation position (the position corresponding to the position number 24 in Figure 3, that is, the position of the whole pixel), and the middle and lower interpolation positions (as shown in Figure 3) The position corresponding to the position number 38).
若当前的目标插值位置为各个整像素点的左中插值位置(即22号位置编号对应的位置)或者右中插值位置(即26号位置编号对应的位置),则可以利用目标像素矩阵中的水平方向的像素点(包括该目标插值位置左侧的4个整像素点以及右侧的4个整像素点)作为参考像素点,利用该目标插值位置对应的目标滤波参数对该参考像素点的像素值进行滤波计算,得到该目标插值位置的像素值。If the current target interpolation position is the left middle interpolation position (that is, the position corresponding to the 22nd position number) or the right middle interpolation position (that is, the position corresponding to the 26th position number) of each integer pixel, the target pixel matrix can be used. The pixels in the horizontal direction (including the 4 integer pixels on the left side of the target interpolation position and the 4 integer pixels on the right side) are used as reference pixels, and the target filtering parameters corresponding to the target interpolation position are used for the reference pixels. The pixel value is filtered and calculated to obtain the pixel value of the target interpolation position.
若当前的目标插值位置为各个整像素点的中上插值位置(即10号位置编号对应的位置)或中下插值位置(即38号位置编号对应的位置),则可以利用目标像素矩阵中的竖直方向的像素点(包括该目标插值位置上方的4个整像素点以及下方的4个整像素点)作为参考像素点,利用该目标插值位置对应的目标滤波参数对该参考像素点的像素值进行滤波计算,得到该目标插值位置的像素值。If the current target interpolation position is the upper-middle interpolation position (that is, the position corresponding to the position number 10) or the lower-middle interpolation position (that is, the position corresponding to the position number 38) of each integer pixel point, you can use the target pixel matrix. The pixels in the vertical direction (including the 4 integer pixels above the target interpolation position and the 4 integer pixels below) are used as reference pixels, and the target filtering parameters corresponding to the target interpolation position are used. The value is filtered and calculated to obtain the pixel value of the target interpolation position.
若当前的目标插值位置为各个整像素点的左上插值位置(即8号位置编号对应的位置)或者左下插值位置(即36号位置编号对应的位置),则可以使用各个整像素点的左中插值位置的像素作为参考像素点,利用该目标插值位置对应的目标滤波参数对该参考像素点的像素值进行滤波计算,得到该目标插值位置的像素值。If the current target interpolation position is the upper left interpolation position of each integer pixel (that is, the position corresponding to the position number 8) or the lower left interpolation position (that is, the position corresponding to the position number 36), you can use the middle left of each integer pixel. The pixel at the interpolation position is used as a reference pixel point, and the pixel value of the reference pixel point is filtered and calculated by using the target filter parameter corresponding to the target interpolation position to obtain the pixel value of the target interpolation position.
若当前的目标插值位置为各个整像素点的右上插值位置(即12号位置编号对应的位置)或者右下插值位置(即40号位置编号对应的位置),则可以使用各个整像素点的右中插值位置的像素作为参考像素点,利用该目标插值位置对应的目标滤波参数对该参考像素点的像素值进行滤波计算,得到该目标插值位置的像素值。If the current target interpolation position is the upper right interpolation position of each integer pixel (that is, the position corresponding to the position number 12) or the lower right interpolation position (that is, the position corresponding to the position number 40), the right interpolation position of each integer pixel can be used. The pixel at the intermediate interpolation position is used as a reference pixel point, and the pixel value of the reference pixel point is filtered and calculated by using the target filtering parameter corresponding to the target interpolation position to obtain the pixel value of the target interpolation position.
若当前的目标插值位置为各个整像素点的正中插值位置(即24号位置编号对应的位置),由于整像素点所在位置无需插值,因而可直接将整像素点的像素值作为目标插值位置的像素值。If the current target interpolation position is the middle interpolation position of each integer pixel (that is, the position corresponding to the position number 24), since the position of the integer pixel does not require interpolation, the pixel value of the integer pixel can be directly used as the target interpolation position. Pixel values.
在实际应用中,可以首先将目标图像块中的各个整像素点水平方向上的插值位置作为目标插值位置进行插值。具体地,可以首先将各个像素点的左中插值位置作为目标插值位置进行插值,而后将目标图像块中的各个整像素点的右中插值位置作为目标插值位置进行插值,之后将目标图像块中的各个整像素点的正中插值位置作为目标插值位置进行插值,从而完成水平方向的插值位置的插值。In practical applications, the interpolation position in the horizontal direction of each integer pixel in the target image block may be firstly used as the target interpolation position for interpolation. Specifically, the interpolation can be performed first by using the middle left interpolation position of each pixel as the target interpolation position, and then using the middle right interpolation position of each integer pixel in the target image block as the target interpolation position for interpolation, and then using the target image block in the interpolation position. The median interpolation position of each integer pixel of , is used as the target interpolation position for interpolation, so as to complete the interpolation of the interpolation position in the horizontal direction.
其中,在对左中插值位置进行插值时,可分为两次进行。第一次对左边两列整像素点的左中位置进行插值,第二次对右边两列整像素点的左中位置进行插值。同理,在对右中插值位置进行插值时,也可分为两次进行。第一次对左边两列整像素点的右中位置进行插值,第二次对右边两列整像素点的右中位置进行插值。每一次的插值结果可存储至缓存中,下一次插值时,对于重复的插值位置,可从缓冲中直接提取上一次的插值结果,无需重复计算。在对正中插值位置进行插值时,由于正中插值位置即为整像素点的位置,因而可直接采用整像素点的像素值。Among them, the interpolation of the left-middle interpolation position can be divided into two steps. The first time is to interpolate the left middle position of the left two columns of integer pixels, and the second time is to interpolate the left middle position of the right two columns of integer pixels. Similarly, when interpolating the right-middle interpolation position, it can also be divided into two steps. The first time is to interpolate the right middle position of the left two columns of integer pixels, and the second time is to interpolate the right middle position of the right two columns of integer pixels. The interpolation result of each time can be stored in the cache, and in the next interpolation, for the repeated interpolation position, the previous interpolation result can be directly extracted from the buffer without repeated calculation. When interpolating the median interpolation position, since the median interpolation position is the position of the integer pixel, the pixel value of the integer pixel can be directly used.
在对各个整像素点水平方向上的插值位置作为目标插值位置进行插值后,可以将竖直方向上的待插值位置作为目标插值位置进行插值。具体地,可以首先将各个整像素点的左上插值位置、左中插值位置(可直接读取已得到的插值结果)、左下插值位置作为目标插值位置进行插值;而后,可以将各个整像素点的右上插值位置、右中插值位置(可直接读取已得到的插值结果)、右下插值位置作为目标插值位置进行插值;最后,可以将各个整像素点的中上插值位置、正中插值位置(可直接读取整像素点的像素值)、中下插值位置作为目标插值位置进行插值。由此,即可完成全部的1/2插值精度下的全部插值过程。After the interpolation positions of each integer pixel in the horizontal direction are used as the target interpolation positions, the interpolation positions in the vertical direction may be used as the target interpolation positions for interpolation. Specifically, the upper left interpolation position, the middle left interpolation position (the obtained interpolation result can be directly read), and the lower left interpolation position of each integer pixel can be interpolated first as the target interpolation position; then, the interpolation position of each integer pixel can be The upper right interpolation position, the middle right interpolation position (the obtained interpolation result can be directly read), and the lower right interpolation position are used as the target interpolation position for interpolation; Directly read the pixel value of the whole pixel), the middle and lower interpolation positions are used as the target interpolation positions for interpolation. In this way, all the interpolation processes under the full 1/2 interpolation precision can be completed.
其中,在对竖直方向上的每一种待插值位置进行插值时,也可分为两次进行,此处不再赘述。Wherein, when performing interpolation on each position to be interpolated in the vertical direction, the interpolation may also be performed twice, which will not be repeated here.
需要说明的是,在1/4插值精度下,可使用1/2插值精度下的插值结果进行计算,其计算过程与1/2插值精度下的插值过程基本相同,此处不再赘述。另外,实际应用 时的插值顺序不限于上述示例,还可以根据需要设定其他插值顺序。此外,本申请实施例的像素插值方法不限于1/4插值精度以及1/2插值精度,还可以应用于其他插值精度,此处不再一一赘述。It should be noted that under the 1/4 interpolation precision, the interpolation result under the 1/2 interpolation precision can be used for calculation, and the calculation process is basically the same as the interpolation process under the 1/2 interpolation precision, and will not be repeated here. In addition, the interpolation order in practical application is not limited to the above example, and other interpolation orders can also be set as required. In addition, the pixel interpolation method of the embodiment of the present application is not limited to the 1/4 interpolation precision and the 1/2 interpolation precision, and can also be applied to other interpolation precisions, which will not be repeated here.
在一些可选的实施例中,目标滤波参数为N维参数向量,N为正整数(如8)。上述执行主体可以借助同一个硬件框架,对目标插值位置进行插值。具体地,上述执行主体按照如下步骤控制硬件框架计算出目标插值位置的插值结果:In some optional embodiments, the target filtering parameter is an N-dimensional parameter vector, where N is a positive integer (eg, 8). The above executive body can perform interpolation on the target interpolation position with the help of the same hardware framework. Specifically, the above-mentioned execution body controls the hardware framework to calculate the interpolation result of the target interpolation position according to the following steps:
第一步,控制N个数据选择器选取N个数据,即每一个数据选择器选取一个数据。其中,N个数据分别为采用目标滤波参数中的N个参数值对目标像素矩阵进行处理后的数据处理结果。The first step is to control N data selectors to select N data, that is, each data selector selects one data. Among them, the N pieces of data are respectively the data processing results after processing the target pixel matrix by using the N parameter values in the target filtering parameters.
用于计算插值结果的硬件框架的示意图可参见图6。如图6所示,该硬件框中可包含8个数据选择器,依次编号为0至7。若目标滤波参数为[-1,4,-11,40,40,-11,4,-1],则编号为0的数据选择器可选择第一个参数(即-1)对目标像素矩阵进行处理后的数据处理结果;编号为1的数据选择器可选择第二个参数(即4)对目标像素矩阵进行处理后的数据处理结果;以此类推。A schematic diagram of the hardware framework used to calculate the interpolation results can be found in Figure 6. As shown in Figure 6, the hardware frame can contain 8 data selectors, numbered 0 to 7 in sequence. If the target filter parameter is [-1,4,-11,40,40,-11,4,-1], the data selector numbered 0 can select the first parameter (ie -1) to the target pixel matrix The data processing result after processing; the data selector numbered 1 can select the second parameter (ie, 4) the data processing result after processing the target pixel matrix; and so on.
此处,N个数据选择器可以被预先划分为第一组和第二组。以图3所示的8个数据选择器为例,编号为0、2、5、7的数据选择器可被划分为第一组,编号为1、3、4、6的数据选择器可被划分为第二组。Here, the N data selectors may be pre-divided into the first group and the second group. Taking the 8 data selectors shown in Figure 3 as an example, the data selectors numbered 0, 2, 5, and 7 can be divided into the first group, and the data selectors numbered 1, 3, 4, and 6 can be divided into the first group. Divide into the second group.
第二步,将第一组中的数据选择器输出的数据输入至第一加法器,将第二组中的数据选择器输出的数据输入至第二加法器。In the second step, the data output by the data selectors in the first group is input into the first adder, and the data output by the data selectors in the second group is input into the second adder.
作为示例,参见图3,第一组数据选择器中,编号为0和7的数据选择器输出的数据可经一个加法器相加后输入至第一加法器,编号为2和5的数据选择器输出的数据可经另一个加法器相加后输入至第一加法器。第二组数据选择器中,编号为1和6的数据选择器输出的数据可经一个加法器相加后输入至第二加法器,编号为3和4的数据选择器输出的数据可经另一个加法器相加后输入至第二加法器。由此,可达到将第一组中的数据选择器输出的数据输入至第一加法器、将第二组中的数据选择器输出的数据输入至第二加法器的效果。As an example, referring to FIG. 3, in the first group of data selectors, the data output by the data selectors numbered 0 and 7 can be added by an adder and then input to the first adder, and the data numbered 2 and 5 are selected The data output by the adder can be added by another adder and then input to the first adder. In the second group of data selectors, the data output by the data selectors numbered 1 and 6 can be added by one adder and then input to the second adder, and the data output by the data selectors numbered 3 and 4 can be added by another adder. One adder adds and inputs to the second adder. Thus, the effect of inputting the data outputted by the data selectors in the first group to the first adder and inputting the data outputted by the data selectors in the second group to the second adder can be achieved.
第三步,将第一加法器输出的数据与第二加法器输出的数据输入至减法器,将减法器输出的数据作为目标插值位置的插值结果。其中,减法器可将第二加法器输出的数据与第一加法器输出的数据相减,得到差值结果。In the third step, the data output by the first adder and the data output by the second adder are input to the subtractor, and the data output by the subtracter is used as the interpolation result of the target interpolation position. The subtractor may subtract the data output from the second adder and the data output from the first adder to obtain a difference result.
此处,可将不同类型的插值位置对应滤波参数均设定为N维(如8维)参数向量,并使滤波参数中的同一维度的参数值均不小于0或者均不大于0。通过上述设定,能够利用同一套硬件框架计算不同插值精度以及不同类型的插值位置的插值结果,无需分别针对不同插值精度以及不同插值位置的类型和设置不同的硬件框架,从而节约了硬件资源。Here, the filtering parameters corresponding to different types of interpolation positions can be set as N-dimensional (eg, 8-dimensional) parameter vectors, and the parameter values of the same dimension in the filtering parameters are all not less than 0 or not greater than 0. Through the above settings, the same set of hardware frameworks can be used to calculate the interpolation results of different interpolation precisions and different types of interpolation positions, and there is no need to set different hardware frameworks for different interpolation precisions and different types of interpolation positions, thereby saving hardware resources.
通过本申请的上述实施例提供的像素插值方法,通过选取目标图像块的目标插 值位置,而后从预设的映射表中查询目标插值位置对应的目标像素矩阵偏移量和上述目标插值位置对应的目标滤波参数,从而能够基于上述目标像素矩阵偏移量和上述目标滤波参数,对上述目标插值位置进行插值。由此,在插值过程中只需进行查表,即可得到目标插值位置对应的目标像素矩阵偏移量以及目标滤波参数,插值过程无需实时进行像素矩阵偏移量的计算以及滤波参数判定,因而可提高像素插值的效率。With the pixel interpolation method provided by the above embodiments of the present application, the target interpolation position of the target image block is selected, and then the target pixel matrix offset corresponding to the target interpolation position and the target pixel matrix offset corresponding to the target interpolation position are queried from the preset mapping table. target filter parameters, so that the target interpolation position can be interpolated based on the target pixel matrix offset and the target filter parameters. Therefore, in the interpolation process, it is only necessary to look up the table to obtain the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters. The interpolation process does not need to calculate the pixel matrix offset and determine the filtering parameters in real time. Therefore, Improves the efficiency of pixel interpolation.
进一步地,将不同类型的插值位置对应滤波参数设定为相同维度的参数向量,并使滤波参数中的同一维度的参数值均不小于0或者均不大于0,能够利用同一套硬件框架计算不同插值精度以及不同类型的插值位置的插值结果。由此,节约了硬件资源。Further, the filtering parameters corresponding to different types of interpolation positions are set as parameter vectors of the same dimension, and the parameter values of the same dimension in the filtering parameters are not less than 0 or are not greater than 0, and the same set of hardware frameworks can be used to calculate different values. Interpolation precision and interpolation results for different types of interpolation positions. Thereby, hardware resources are saved.
进一步参考图7,作为对上述各图所示方法的实现,本申请提供了一种像素插值装置的一个实施例,该装置实施例与图5所示的方法实施例相对应。该电子设备可以各种电子设备中。Further referring to FIG. 7 , as an implementation of the methods shown in the above figures, the present application provides an embodiment of a pixel interpolation apparatus, and the apparatus embodiment corresponds to the method embodiment shown in FIG. 5 . The electronic device can be among various electronic devices.
如图7所示,本实施例上述的像素插值700包括:选取单元701,被配置成选取目标图像块的目标插值位置;查询单元702,被配置成从预设的映射表中,查询上述目标插值位置对应的目标像素矩阵偏移量和上述目标插值位置对应的目标滤波参数;插值单元703,被配置成基于上述目标像素矩阵偏移量和上述目标滤波参数,对上述目标插值位置进行插值。As shown in FIG. 7 , the above-mentioned pixel interpolation 700 in this embodiment includes: a selection unit 701 configured to select a target interpolation position of a target image block; a query unit 702 configured to query the above target from a preset mapping table The target pixel matrix offset corresponding to the interpolation position and the target filtering parameter corresponding to the above-mentioned target interpolation position; the interpolation unit 703 is configured to perform interpolation on the above-mentioned target interpolation position based on the above-mentioned target pixel matrix offset and the above-mentioned target filtering parameter.
在本实施例的一些可选的实现方式中,上述映射表中包括插值位置与像素矩阵偏移量的第一映射信息;上述第一映射信息通过如下步骤生成:获取指定尺寸图像块对应的输入像素矩阵,其中,上述指定尺寸图像块与上述目标图像块的尺寸相同;确定上述指定尺寸图像块中的各插值位置所需的像素矩阵相对于上述输入像素矩阵的像素矩阵偏移量;基于上述各插值位置对应的像素矩阵偏移量,生成第一映射信息。In some optional implementations of this embodiment, the above-mentioned mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix; the above-mentioned first mapping information is generated by the following steps: obtaining the input corresponding to the image block of the specified size A pixel matrix, wherein the size of the image block of the specified size is the same as that of the target image block; the pixel matrix offset required for each interpolation position in the image block of the specified size is determined relative to the pixel matrix of the input pixel matrix; based on the above The pixel matrix offset corresponding to each interpolation position is used to generate the first mapping information.
在本实施例的一些可选的实现方式中,上述基于上述各插值位置对应的像素矩阵偏移量,生成第一映射信息,包括:为上述各插值位置设置位置编号;基于上述各插值位置对应的像素矩阵偏移量,建立位置编号与像素矩阵偏移量的映射,得到第一映射信息。In some optional implementations of this embodiment, generating the first mapping information based on the pixel matrix offsets corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; The offset of the pixel matrix is established, and the mapping between the position number and the offset of the pixel matrix is established to obtain the first mapping information.
在本实施例的一些可选的实现方式中,上述各插值位置对应的像素矩阵偏移量包括水平方向的像素矩阵偏移量和竖直方向的像素矩阵偏移量;上述第一映射信息包括上述各插值位置与水平方向的像素矩阵偏移量的映射关系,以及,包括上述各插值位置与竖直方向的像素矩阵偏移量的映射关系。In some optional implementations of this embodiment, the pixel matrix offset corresponding to each interpolation position includes a horizontal pixel matrix offset and a vertical pixel matrix offset; the first mapping information includes The mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the horizontal direction, and the mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the vertical direction.
在本实施例的一些可选的实现方式中,上述映射表中包括插值位置与滤波参数的第二映射信息;上述第二映射信息通过如下步骤生成:确定指定尺寸图像块中的 各插值位置的类型,其中,上述指定尺寸图像块与上述目标图像块的尺寸相同;基于上述各插值位置的类型,确定上述各插值位置对应的滤波参数;基于上述各插值位置对应的滤波参数,生成第二映射信息。In some optional implementations of this embodiment, the above-mentioned mapping table includes second mapping information of interpolation positions and filtering parameters; the above-mentioned second mapping information is generated by the following steps: determining the value of each interpolation position in an image block of a specified size type, wherein the size of the image block of the specified size is the same as the size of the target image block; based on the type of each interpolation position, the filtering parameters corresponding to the interpolation positions are determined; based on the filtering parameters corresponding to the interpolation positions, a second mapping is generated information.
在本实施例的一些可选的实现方式中,上述基于上述各插值位置对应的滤波参数,生成第二映射信息,包括:为上述各插值位置设置位置编号;为各滤波参数设置索引编号;基于上述各插值位置对应的滤波参数,建立位置编号与索引编号的映射,得到第二映射信息。In some optional implementations of this embodiment, generating the second mapping information based on the filtering parameters corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; setting an index number for each filtering parameter; For the filtering parameters corresponding to the above-mentioned interpolation positions, a mapping between the position number and the index number is established to obtain the second mapping information.
在本实施例的一些可选的实现方式中,上述各插值位置的类型包括上述各插值位置在水平方向上的类型和上述各插值位置在竖直方向上的类型。In some optional implementations of this embodiment, the types of the above-mentioned interpolation positions include the types of the above-mentioned interpolation positions in the horizontal direction and the types of the above-mentioned interpolation positions in the vertical direction.
在本实施例的一些可选的实现方式中,上述基于上述各插值位置的类型,确定上述各插值位置对应的滤波参数,包括:基于上述各插值位置在水平方向上的类型,确定在水平方向上上述各插值位置对应的滤波参数;基于上述各插值位置在竖直方向上的类型,确定在竖直方向上上述各插值位置对应的滤波参数。In some optional implementations of this embodiment, determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions includes: determining the horizontal direction based on the types of the interpolation positions in the horizontal direction. filtering parameters corresponding to the above-mentioned interpolation positions; based on the types of the above-mentioned interpolation positions in the vertical direction, the filtering parameters corresponding to the above-mentioned interpolation positions in the vertical direction are determined.
在本实施例的一些可选的实现方式中,上述第二映射信息包括上述各插值位置与在水平方向上对应的滤波参数的映射关系,以及,包括上述各插值位置与在竖直方向上对应的滤波参数的映射关系。In some optional implementations of this embodiment, the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions corresponding to the vertical direction. The mapping relationship of the filtering parameters.
在本实施例的一些可选的实现方式中,插值位置的类型包括以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。In some optional implementations of this embodiment, the type of the interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point, and whole pixel point.
在本实施例的一些可选的实现方式中,不同类型的插值位置对应的滤波参数为具有相同维度的参数向量。In some optional implementations of this embodiment, the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
在本实施例的一些可选的实现方式中,上述1/4分像素点对应的滤波参数通过如下步骤确定:获取上述1/4分像素点对应的第一默认滤波参数,上述第一默认滤波参数为M维参数向量,M为正整数;对上述第一默认滤波参数的末尾添加0,得到上述1/4分像素点对应的最终的滤波参数,上述最终的滤波参数为N维参数向量,N=M+1。In some optional implementation manners of this embodiment, the filtering parameters corresponding to the above-mentioned 1/4 pixel points are determined by the following steps: obtaining the first default filtering parameters corresponding to the above-mentioned 1/4 pixel points, the above-mentioned first default filtering parameters The parameter is an M-dimensional parameter vector, and M is a positive integer; add 0 to the end of the first default filtering parameter above to obtain the final filtering parameter corresponding to the above-mentioned 1/4 pixel point, and the above-mentioned final filtering parameter is an N-dimensional parameter vector, N=M+1.
在本实施例的一些可选的实现方式中,上述1/2分像素点对应的滤波参数为第二默认滤波参数,上述第二默认滤波参数为M维参数向量,M为正整数。In some optional implementations of this embodiment, the filtering parameters corresponding to the above-mentioned 1/2 pixel points are second default filtering parameters, the above-mentioned second default filtering parameters are M-dimensional parameter vectors, and M is a positive integer.
在本实施例的一些可选的实现方式中,上述3/4分像素点对应的滤波参数通过如下步骤确定:获取上述3/4分像素点对应的第三默认滤波参数,上述第三默认滤波参数为M维参数向量,M为正整数;对上述第三默认滤波参数的首位前添加0,得到上述3/4分像素点对应的最终的滤波参数,上述最终的滤波参数为N维参数向量,N=M+1。In some optional implementations of this embodiment, the filtering parameters corresponding to the above-mentioned 3/4 pixel points are determined by the following steps: obtaining the third default filtering parameters corresponding to the above-mentioned 3/4 pixel points, and the above-mentioned third default filtering parameters The parameter is an M-dimensional parameter vector, and M is a positive integer; add 0 to the first position of the above-mentioned third default filtering parameter to obtain the final filtering parameter corresponding to the above-mentioned 3/4 pixel point, and the above-mentioned final filtering parameter is an N-dimensional parameter vector. , N=M+1.
在本实施例的一些可选的实现方式中,上述整像素点对应的滤波参数为参数值为0的M维参数向量,M为正整数。In some optional implementations of this embodiment, the filtering parameter corresponding to the above-mentioned integer pixel is an M-dimensional parameter vector with a parameter value of 0, where M is a positive integer.
在本实施例的一些可选的实现方式中,上述1/4分像素点对应的滤波参数、上述 1/2分像素点对应的滤波参数、上述3/4分像素点对应的滤波参数以及上述整像素点对应的滤波参数中的同一维度的参数值均不小于0或者均不大于0。In some optional implementation manners of this embodiment, the filtering parameters corresponding to the foregoing 1/4 pixel points, the filtering parameters corresponding to the foregoing 1/2 pixel points, the filtering parameters corresponding to the foregoing 3/4 pixel points, and the above The parameter values of the same dimension in the filtering parameters corresponding to the integer pixels are not less than 0 or are not greater than 0.
在本实施例的一些可选的实现方式中,上述插值单元703,进一步被配置成:获取上述目标图像块对应的输入像素矩阵;基于上述目标像素矩阵偏移量和上述输入像素矩阵,确定对上述目标插值位置插值所需要的目标像素矩阵;基于上述目标像素矩阵和上述目标滤波参数,对上述目标插值位置进行插值。In some optional implementations of this embodiment, the above-mentioned interpolation unit 703 is further configured to: obtain the input pixel matrix corresponding to the above-mentioned target image block; The target pixel matrix required for interpolation of the target interpolation position; based on the target pixel matrix and the target filtering parameter, the target interpolation position is interpolated.
在本实施例的一些可选的实现方式中,上述插值单元703,进一步被配置成:基于上述目标插值位置的类型,选取上述目标像素矩阵中的参考像素点;基于上述目标滤波参数对上述参考像素点进行滤波处理,得到上述目标插值位置的插值结果。In some optional implementations of this embodiment, the above-mentioned interpolation unit 703 is further configured to: select a reference pixel point in the above-mentioned target pixel matrix based on the type of the above-mentioned target interpolation position; The pixel points are filtered to obtain the interpolation result of the target interpolation position.
在本实施例的一些可选的实现方式中,上述插值单703,进一步被配置成:若上述目标插值位置的类型为1/2分像素点,则选取上述目标像素矩阵中的整像素点,作为参考像素点;若上述目标插值位置的类型为1/4分像素点或3/4分像素点,则选取上述目标像素矩阵中的1/2分像素点,作为参考像素点。In some optional implementations of this embodiment, the above-mentioned interpolation unit 703 is further configured to: if the type of the above-mentioned target interpolation position is a 1/2 pixel point, select an integer pixel point in the above-mentioned target pixel matrix, As a reference pixel; if the type of the target interpolation position is a 1/4 pixel or a 3/4 pixel, then select a 1/2 pixel in the target pixel matrix as a reference pixel.
在本实施例的一些可选的实现方式中,上述目标滤波参数为N维参数向量,N为正整数;以及,上述插值单元703,进一步被配置成:控制N个数据选择器选取N个数据,上述N个数据分别为采用目标滤波参数中的N个参数值对上述目标像素矩阵进行处理后的数据处理结果,其中,上述N个数据选择器被预先划分为第一组和第二组;将上述第一组中的数据选择器输出的数据输入至第一加法器,将上述第二组中的数据选择器输出的数据输入至第二加法器;将上述第一加法器输出的数据与上述第二加法器输出的数据输入至减法器,将上述减法器输出的数据作为目标插值位置的插值结果。In some optional implementations of this embodiment, the above-mentioned target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and, the above-mentioned interpolation unit 703 is further configured to: control N data selectors to select N pieces of data , the above-mentioned N data are respectively the data processing result after the above-mentioned target pixel matrix is processed by using the N parameter values in the target filtering parameters, wherein, the above-mentioned N data selectors are pre-divided into the first group and the second group; Input the data outputted by the data selectors in the above-mentioned first group into the first adder, and input the data outputted by the data selectors in the above-mentioned second group into the second adder; The data output by the second adder is input to the subtracter, and the data output by the subtracter is used as the interpolation result of the target interpolation position.
本申请的上述实施例提供的像素插值装置,通过选取目标图像块的目标插值位置,而后从预设的映射表中查询目标插值位置对应的目标像素矩阵偏移量和上述目标插值位置对应的目标滤波参数,从而能够基于上述目标像素矩阵偏移量和上述目标滤波参数,对上述目标插值位置进行插值。由此,在插值过程中只需进行查表,即可得到目标插值位置对应的目标像素矩阵偏移量以及目标滤波参数,插值过程无需实时进行像素矩阵偏移量的计算以及滤波参数判定,因而可提高像素插值的效率。The pixel interpolation device provided by the above embodiments of the present application selects the target interpolation position of the target image block, and then queries the target pixel matrix offset corresponding to the target interpolation position and the target corresponding to the target interpolation position from the preset mapping table. filter parameters, so that the target interpolation position can be interpolated based on the target pixel matrix offset and the target filter parameter. Therefore, in the interpolation process, it is only necessary to look up the table to obtain the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters. The interpolation process does not need to calculate the pixel matrix offset and determine the filtering parameters in real time. Therefore, Improves the efficiency of pixel interpolation.
进一步地,将不同类型的插值位置对应滤波参数设定为相同维度的参数向量,并使滤波参数中的同一维度的参数值均不小于0或者均不大于0,能够利用同一套硬件框架计算不同插值精度以及不同类型的插值位置的插值结果。由此,节约了硬件资源。Further, the filtering parameters corresponding to different types of interpolation positions are set as parameter vectors of the same dimension, and the parameter values of the same dimension in the filtering parameters are not less than 0 or are not greater than 0, and the same set of hardware frameworks can be used to calculate different values. Interpolation precision and interpolation results for different types of interpolation positions. Thereby, hardware resources are saved.
作为对上述图1所示方法的实现,本申请提供了一种电子设备的一个实施例,该实施例与图1所示的方法实施例相对应。参见图8,该电子设备具体可以包括:处理器801和存储器802。As an implementation of the above method shown in FIG. 1 , the present application provides an embodiment of an electronic device, which corresponds to the method embodiment shown in FIG. 1 . Referring to FIG. 8 , the electronic device may specifically include: a processor 801 and a memory 802 .
上述存储器801,可以用于存储程序指令。The above-mentioned memory 801 can be used to store program instructions.
上述处理器802,可以用于执行上述存储器存储的程序指令,当程序指令被执行时,上述处理器可以用于执行如下步骤:选取目标图像块的目标插值位置;从预设的映射表中,查询上述目标插值位置对应的目标像素矩阵偏移量和上述目标插值位置对应的目标滤波参数;基于上述目标像素矩阵偏移量和上述目标滤波参数,对上述目标插值位置进行插值。The above-mentioned processor 802 can be used to execute the program instructions stored in the above-mentioned memory. When the program instructions are executed, the above-mentioned processor can be used to perform the following steps: selecting the target interpolation position of the target image block; from the preset mapping table, The target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position are queried; based on the target pixel matrix offset and the target filtering parameter, the target interpolation position is interpolated.
在本实施例的一些可选的实现方式中,上述映射表中包括插值位置与像素矩阵偏移量的第一映射信息;上述第一映射信息通过如下步骤生成:获取指定尺寸图像块对应的输入像素矩阵,其中,上述指定尺寸图像块与上述目标图像块的尺寸相同;确定上述指定尺寸图像块中的各插值位置所需的像素矩阵相对于上述输入像素矩阵的像素矩阵偏移量;基于上述各插值位置对应的像素矩阵偏移量,生成第一映射信息。In some optional implementations of this embodiment, the above-mentioned mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix; the above-mentioned first mapping information is generated by the following steps: obtaining the input corresponding to the image block of the specified size A pixel matrix, wherein the size of the image block of the specified size is the same as that of the target image block; the pixel matrix offset required for each interpolation position in the image block of the specified size is determined relative to the pixel matrix of the input pixel matrix; based on the above The pixel matrix offset corresponding to each interpolation position is used to generate the first mapping information.
在本实施例的一些可选的实现方式中,上述基于上述各插值位置对应的像素矩阵偏移量,生成第一映射信息,包括:为上述各插值位置设置位置编号;基于上述各插值位置对应的像素矩阵偏移量,建立位置编号与像素矩阵偏移量的映射,得到第一映射信息。In some optional implementations of this embodiment, generating the first mapping information based on the pixel matrix offsets corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; The offset of the pixel matrix is established, and the mapping between the position number and the offset of the pixel matrix is established to obtain the first mapping information.
在本实施例的一些可选的实现方式中,上述各插值位置对应的像素矩阵偏移量包括水平方向的像素矩阵偏移量和竖直方向的像素矩阵偏移量;上述第一映射信息包括上述各插值位置与水平方向的像素矩阵偏移量的映射关系,以及,包括上述各插值位置与竖直方向的像素矩阵偏移量的映射关系。In some optional implementations of this embodiment, the pixel matrix offset corresponding to each interpolation position includes a horizontal pixel matrix offset and a vertical pixel matrix offset; the first mapping information includes The mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the horizontal direction, and the mapping relationship between the above-mentioned interpolation positions and the offset of the pixel matrix in the vertical direction.
在本实施例的一些可选的实现方式中,上述映射表中包括插值位置与滤波参数的第二映射信息;上述第二映射信息通过如下步骤生成:确定指定尺寸图像块中的各插值位置的类型,其中,上述指定尺寸图像块与上述目标图像块的尺寸相同;基于上述各插值位置的类型,确定上述各插值位置对应的滤波参数;基于上述各插值位置对应的滤波参数,生成第二映射信息。In some optional implementations of this embodiment, the above-mentioned mapping table includes second mapping information of interpolation positions and filtering parameters; the above-mentioned second mapping information is generated by the following steps: determining the value of each interpolation position in an image block of a specified size type, wherein the size of the image block of the specified size is the same as the size of the target image block; based on the type of each interpolation position, the filtering parameters corresponding to the interpolation positions are determined; based on the filtering parameters corresponding to the interpolation positions, a second mapping is generated information.
在本实施例的一些可选的实现方式中,上述基于上述各插值位置对应的滤波参数,生成第二映射信息,包括:为上述各插值位置设置位置编号;为各滤波参数设置索引编号;基于上述各插值位置对应的滤波参数,建立位置编号与索引编号的映射,得到第二映射信息。In some optional implementations of this embodiment, generating the second mapping information based on the filtering parameters corresponding to the above-mentioned interpolation positions includes: setting a position number for each of the above-mentioned interpolation positions; setting an index number for each filtering parameter; For the filtering parameters corresponding to the above-mentioned interpolation positions, a mapping between the position number and the index number is established to obtain the second mapping information.
在本实施例的一些可选的实现方式中,上述各插值位置的类型包括上述各插值位置在水平方向上的类型和上述各插值位置在竖直方向上的类型。In some optional implementations of this embodiment, the types of the above-mentioned interpolation positions include the types of the above-mentioned interpolation positions in the horizontal direction and the types of the above-mentioned interpolation positions in the vertical direction.
在本实施例的一些可选的实现方式中,上述基于上述各插值位置的类型,确定上述各插值位置对应的滤波参数,包括:基于上述各插值位置在水平方向上的类型,确定在水平方向上上述各插值位置对应的滤波参数;基于上述各插值位置在竖直方向上的类型,确定在竖直方向上上述各插值位置对应的滤波参数。In some optional implementations of this embodiment, determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions includes: determining the horizontal direction based on the types of the interpolation positions in the horizontal direction. filtering parameters corresponding to the above-mentioned interpolation positions; based on the types of the above-mentioned interpolation positions in the vertical direction, the filtering parameters corresponding to the above-mentioned interpolation positions in the vertical direction are determined.
在本实施例的一些可选的实现方式中,上述第二映射信息包括上述各插值位置与在水平方向上对应的滤波参数的映射关系,以及,包括上述各插值位置与在竖直方向上对应的滤波参数的映射关系。In some optional implementations of this embodiment, the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions corresponding to the vertical direction. The mapping relationship of the filtering parameters.
在本实施例的一些可选的实现方式中,插值位置的类型包括以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。In some optional implementations of this embodiment, the type of the interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point, and whole pixel point.
在本实施例的一些可选的实现方式中,不同类型的插值位置对应的滤波参数为具有相同维度的参数向量。In some optional implementations of this embodiment, the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
在本实施例的一些可选的实现方式中,上述1/4分像素点对应的滤波参数通过如下步骤确定:获取上述1/4分像素点对应的第一默认滤波参数,上述第一默认滤波参数为M维参数向量,M为正整数;对上述第一默认滤波参数的末尾添加0,得到上述1/4分像素点对应的最终的滤波参数,上述最终的滤波参数为N维参数向量,N=M+1。In some optional implementation manners of this embodiment, the filtering parameters corresponding to the above-mentioned 1/4 pixel points are determined by the following steps: obtaining the first default filtering parameters corresponding to the above-mentioned 1/4 pixel points, the above-mentioned first default filtering parameters The parameter is an M-dimensional parameter vector, and M is a positive integer; add 0 to the end of the first default filtering parameter above to obtain the final filtering parameter corresponding to the above-mentioned 1/4 pixel point, and the above-mentioned final filtering parameter is an N-dimensional parameter vector, N=M+1.
在本实施例的一些可选的实现方式中,上述1/2分像素点对应的滤波参数为第二默认滤波参数,上述第二默认滤波参数为M维参数向量,M为正整数。In some optional implementations of this embodiment, the filtering parameters corresponding to the above-mentioned 1/2 pixel points are second default filtering parameters, the above-mentioned second default filtering parameters are M-dimensional parameter vectors, and M is a positive integer.
在本实施例的一些可选的实现方式中,上述3/4分像素点对应的滤波参数通过如下步骤确定:获取上述3/4分像素点对应的第三默认滤波参数,上述第三默认滤波参数为M维参数向量,M为正整数;对上述第三默认滤波参数的首位前添加0,得到上述3/4分像素点对应的最终的滤波参数,上述最终的滤波参数为N维参数向量,N=M+1。In some optional implementations of this embodiment, the filtering parameters corresponding to the above-mentioned 3/4 pixel points are determined by the following steps: obtaining the third default filtering parameters corresponding to the above-mentioned 3/4 pixel points, and the above-mentioned third default filtering parameters The parameter is an M-dimensional parameter vector, and M is a positive integer; add 0 to the first position of the above-mentioned third default filtering parameter to obtain the final filtering parameter corresponding to the above-mentioned 3/4 pixel point, and the above-mentioned final filtering parameter is an N-dimensional parameter vector. , N=M+1.
在本实施例的一些可选的实现方式中,上述整像素点对应的滤波参数为参数值为0的M维参数向量,M为正整数。In some optional implementations of this embodiment, the filtering parameter corresponding to the above-mentioned integer pixel is an M-dimensional parameter vector with a parameter value of 0, where M is a positive integer.
在本实施例的一些可选的实现方式中,上述1/4分像素点对应的滤波参数、上述1/2分像素点对应的滤波参数、上述3/4分像素点对应的滤波参数以及上述整像素点对应的滤波参数中的同一维度的参数值均不小于0或者均不大于0。In some optional implementation manners of this embodiment, the filtering parameters corresponding to the foregoing 1/4 pixel points, the filtering parameters corresponding to the foregoing 1/2 pixel points, the filtering parameters corresponding to the foregoing 3/4 pixel points, and the above The parameter values of the same dimension in the filtering parameters corresponding to the integer pixels are not less than 0 or are not greater than 0.
在本实施例的一些可选的实现方式中,上述处理器802,进一步用于:获取上述目标图像块对应的输入像素矩阵;基于上述目标像素矩阵偏移量和上述输入像素矩阵,确定对上述目标插值位置插值所需要的目标像素矩阵;基于上述目标像素矩阵和上述目标滤波参数,对上述目标插值位置进行插值。In some optional implementations of this embodiment, the above-mentioned processor 802 is further configured to: obtain an input pixel matrix corresponding to the above-mentioned target image block; The target pixel matrix required for target interpolation position interpolation; based on the target pixel matrix and the target filtering parameter, the target interpolation position is interpolated.
在本实施例的一些可选的实现方式中,上述处理器802,进一步用于:基于上述目标插值位置的类型,选取上述目标像素矩阵中的参考像素点;基于上述目标滤波参数对上述参考像素点进行滤波处理,得到上述目标插值位置的插值结果。In some optional implementations of this embodiment, the above-mentioned processor 802 is further configured to: select reference pixels in the above-mentioned target pixel matrix based on the type of the above-mentioned target interpolation position; Filter the points to obtain the interpolation result of the above target interpolation position.
在本实施例的一些可选的实现方式中,上述处理器802,进一步用于:若上述目标插值位置的类型为1/2分像素点,则选取上述目标像素矩阵中的整像素点,作为参考像素点;若上述目标插值位置的类型为1/4分像素点或3/4分像素点,则选取上述目标像素矩阵中的1/2分像素点,作为参考像素点。In some optional implementations of this embodiment, the above-mentioned processor 802 is further configured to: if the type of the above-mentioned target interpolation position is a 1/2 pixel point, select an integer pixel point in the above-mentioned target pixel matrix as the type of the above-mentioned target pixel matrix. Reference pixel; if the type of the target interpolation position is 1/4 pixel or 3/4 pixel, then select 1/2 pixel in the target pixel matrix as the reference pixel.
在本实施例的一些可选的实现方式中,上述目标滤波参数为N维参数向量,N为正整数;以及,上述处理器802,进一步用于:控制N个数据选择器选取N个数据,上述N个数据分别为采用目标滤波参数中的N个参数值对上述目标像素矩阵进行处理后的数据处理结果,其中,上述N个数据选择器被预先划分为第一组和第二组;将上述第一组中的数据选择器输出的数据输入至第一加法器,将上述第二组中的数据选择器输出的数据输入至第二加法器;将上述第一加法器输出的数据与上述第二加法器输出的数据输入至减法器,将上述减法器输出的数据作为目标插值位置的插值结果。In some optional implementations of this embodiment, the target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and the processor 802 is further configured to: control the N data selectors to select N data, The above-mentioned N pieces of data are respectively the data processing results after the above-mentioned target pixel matrix is processed by using the N parameter values in the target filtering parameters, wherein the above-mentioned N data selectors are pre-divided into the first group and the second group; The data output by the data selectors in the first group is input to the first adder, and the data output by the data selectors in the second group is input into the second adder; the data output by the first adder and the above The data output by the second adder is input to the subtractor, and the data output by the subtractor is used as the interpolation result of the target interpolation position.
本申请的上述实施例所提供的电子设备,通过选取目标图像块的目标插值位置,而后从预设的映射表中查询目标插值位置对应的目标像素矩阵偏移量和上述目标插值位置对应的目标滤波参数,从而能够基于上述目标像素矩阵偏移量和上述目标滤波参数,对上述目标插值位置进行插值。由此,在插值过程中只需进行查表,即可得到目标插值位置对应的目标像素矩阵偏移量以及目标滤波参数,插值过程无需实时进行像素矩阵偏移量的计算以及滤波参数判定,因而可提高像素插值的效率。The electronic device provided by the above embodiments of the present application selects the target interpolation position of the target image block, and then queries the target pixel matrix offset corresponding to the target interpolation position and the target corresponding to the target interpolation position from the preset mapping table. filter parameters, so that the target interpolation position can be interpolated based on the target pixel matrix offset and the target filter parameter. Therefore, in the interpolation process, it is only necessary to look up the table to obtain the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameters. The interpolation process does not need to calculate the pixel matrix offset and determine the filtering parameters in real time. Therefore, Improves the efficiency of pixel interpolation.
进一步地,将不同类型的插值位置对应滤波参数设定为相同维度的参数向量,并使滤波参数中的同一维度的参数值均不小于0或者均不大于0,能够利用同一套硬件框架计算不同插值精度以及不同类型的插值位置的插值结果。由此,节约了硬件资源。Further, the filtering parameters corresponding to different types of interpolation positions are set as parameter vectors of the same dimension, and the parameter values of the same dimension in the filtering parameters are not less than 0 or are not greater than 0, and the same set of hardware frameworks can be used to calculate different values. Interpolation precision and interpolation results for different types of interpolation positions. Thereby, hardware resources are saved.
对于电子设备实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the electronic device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment.
本申请实施例还提供一种计算机可读介质,计算机可读介质上存储有计算机程序,该计算机程序被处理器执行时实现上述…方法的实施例的各个过程,且能达到相同的技术效果。为避免重复,该计算机程序被处理器执行时实现上述各方法的实施例的各个过程,这里不再赘述。Embodiments of the present application further provide a computer-readable medium, where a computer program is stored on the computer-readable medium. When the computer program is executed by a processor, each process of the above-mentioned embodiments of the method can be achieved, and the same technical effect can be achieved. In order to avoid repetition, when the computer program is executed by the processor, each process of the embodiments of the above-mentioned methods is implemented, which will not be repeated here.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本申请的实施例可提供为方法、装置、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可读介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the present application may be provided as a method, an apparatus, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable media having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
本申请是参照根据本申请的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提 供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine that causes the instructions to be executed by the processor of the computer or other programmable data processing terminal equipment Means are created for implementing the functions specified in the flow or flows of the flowcharts and/or the blocks or blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the The instruction means implement the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby executing on the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart or blocks and/or the block or blocks of the block diagrams.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also 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 these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or terminal device that includes a list of elements includes not only those elements, but also a non-exclusive list of elements. other elements, or also include elements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
以上对本申请所提供的…方法、装置、电子设备和计算机可读介质,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The methods, devices, electronic devices and computer-readable media provided by the present application have been described in detail above. The principles and implementations of the present application are described with specific examples. The descriptions of the above embodiments are only used for Help to understand the method of the present application and its core idea; meanwhile, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In summary, the content of this specification It should not be construed as a limitation of this application.

Claims (61)

  1. 一种像素插值方法,其特征在于,所述方法包括:A pixel interpolation method, characterized in that the method comprises:
    选取目标图像块的目标插值位置;Select the target interpolation position of the target image block;
    从预设的映射表中,查询所述目标插值位置对应的目标像素矩阵偏移量和所述目标插值位置对应的目标滤波参数;From the preset mapping table, query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position;
    基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行插值。The target interpolation position is interpolated based on the target pixel matrix offset and the target filter parameter.
  2. 根据权利要求1所述的方法,其特征在于,所述映射表中包括插值位置与像素矩阵偏移量的第一映射信息;The method according to claim 1, wherein the mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix;
    所述第一映射信息通过如下步骤生成:The first mapping information is generated by the following steps:
    获取指定尺寸图像块对应的输入像素矩阵,其中,所述指定尺寸图像块与所述目标图像块的尺寸相同;obtaining an input pixel matrix corresponding to an image block of a specified size, wherein the size of the image block of the specified size is the same as that of the target image block;
    确定所述指定尺寸图像块中的各插值位置所需的像素矩阵相对于所述输入像素矩阵的像素矩阵偏移量;determining the pixel matrix offset of the pixel matrix relative to the input pixel matrix required for each interpolation position in the image block of the specified size;
    基于所述各插值位置对应的像素矩阵偏移量,生成第一映射信息。First mapping information is generated based on the pixel matrix offset corresponding to each interpolation position.
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述各插值位置对应的像素矩阵偏移量,生成第一映射信息,包括:The method according to claim 2, wherein the generating the first mapping information based on the pixel matrix offset corresponding to each interpolation position comprises:
    为所述各插值位置设置位置编号;setting a position number for each of the interpolation positions;
    基于所述各插值位置对应的像素矩阵偏移量,建立位置编号与像素矩阵偏移量的映射,得到第一映射信息。Based on the pixel matrix offset corresponding to each interpolation position, a mapping between the position number and the pixel matrix offset is established to obtain first mapping information.
  4. 根据权利要求2所述的方法,其特征在于,所述各插值位置对应的像素矩阵偏移量包括水平方向的像素矩阵偏移量和竖直方向的像素矩阵偏移量;The method according to claim 2, wherein the pixel matrix offset corresponding to each interpolation position comprises a horizontal pixel matrix offset and a vertical pixel matrix offset;
    所述第一映射信息包括所述各插值位置与水平方向的像素矩阵偏移量的映射关系,以及,包括所述各插值位置与竖直方向的像素矩阵偏移量的映射关系。The first mapping information includes the mapping relationship between the interpolation positions and the offset of the pixel matrix in the horizontal direction, and includes the mapping relationship between the interpolation positions and the offset of the pixel matrix in the vertical direction.
  5. 根据权利要求1所述的方法,其特征在于,所述映射表中包括插值位置与滤波参数的第二映射信息;The method according to claim 1, wherein the mapping table includes second mapping information of interpolation positions and filtering parameters;
    所述第二映射信息通过如下步骤生成:The second mapping information is generated through the following steps:
    确定指定尺寸图像块中的各插值位置的类型,其中,所述指定尺寸图像块与所述目标图像块的尺寸相同;determining the type of each interpolation position in an image block of a specified size, wherein the size of the image block of the specified size is the same as the size of the target image block;
    基于所述各插值位置的类型,确定所述各插值位置对应的滤波参数;Based on the type of each interpolation position, determine the filtering parameter corresponding to each interpolation position;
    基于所述各插值位置对应的滤波参数,生成第二映射信息。The second mapping information is generated based on the filtering parameters corresponding to the interpolation positions.
  6. 根据权利要求5所述的方法,其特征在于,所述基于所述各插值位置对应的滤波参数,生成第二映射信息,包括:The method according to claim 5, wherein the generating the second mapping information based on the filtering parameters corresponding to the interpolation positions comprises:
    为所述各插值位置设置位置编号;setting a position number for each of the interpolation positions;
    为各滤波参数设置索引编号;Set the index number for each filter parameter;
    基于所述各插值位置对应的滤波参数,建立位置编号与索引编号的映射,得到第二映射信息。Based on the filtering parameters corresponding to the interpolation positions, a mapping between position numbers and index numbers is established to obtain second mapping information.
  7. 根据权利要求5所述的方法,其特征在于,所述各插值位置的类型包括所述各插值位置在水平方向上的类型和所述各插值位置在竖直方向上的类型。The method according to claim 5, wherein the types of the interpolation positions include the types of the interpolation positions in the horizontal direction and the types of the interpolation positions in the vertical direction.
  8. 根据权利要求7所述的方法,其特征在于,所述基于所述各插值位置的类型,确定所述各插值位置对应的滤波参数,包括:The method according to claim 7, wherein the determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions comprises:
    基于所述各插值位置在水平方向上的类型,确定在水平方向上所述各插值位置对应的滤波参数;determining the filtering parameters corresponding to the interpolation positions in the horizontal direction based on the types of the interpolation positions in the horizontal direction;
    基于所述各插值位置在竖直方向上的类型,确定在竖直方向上所述各插值位置对应的滤波参数。Based on the types of the interpolation positions in the vertical direction, filter parameters corresponding to the interpolation positions in the vertical direction are determined.
  9. 根据权利要求7所述的方法,其特征在于,所述第二映射信息包括所述各插值位置与在水平方向上对应的滤波参数的映射关系,以及,包括所述各插值位置与在竖直方向上对应的滤波参数的映射关系。The method according to claim 7, wherein the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions and the vertical The mapping relationship of the corresponding filter parameters in the direction.
  10. 根据权利要求5所述的方法,其特征在于,插值位置的类型包括以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。The method according to claim 5, wherein the type of the interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point and whole pixel point.
  11. 根据权利要求5所述的方法,其特征在于,不同类型的插值位置对应的滤波参数为具有相同维度的参数向量。The method according to claim 5, wherein the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
  12. 根据权利要求10所述的方法,其特征在于,所述1/4分像素点对应的滤波参数通过如下步骤确定:The method according to claim 10, wherein the filtering parameters corresponding to the 1/4 pixel points are determined by the following steps:
    获取所述1/4分像素点对应的第一默认滤波参数,所述第一默认滤波参数为M维参数向量,M为正整数;Obtain the first default filter parameter corresponding to the 1/4 pixel point, the first default filter parameter is an M-dimensional parameter vector, and M is a positive integer;
    对所述第一默认滤波参数的末尾添加0,得到所述1/4分像素点对应的最终的滤波参数,所述最终的滤波参数为N维参数向量,N=M+1。Add 0 to the end of the first default filter parameter to obtain the final filter parameter corresponding to the 1/4 pixel point, where the final filter parameter is an N-dimensional parameter vector, N=M+1.
  13. 根据权利要求10所述的方法,其特征在于,所述1/2分像素点对应的滤波参数为第二默认滤波参数,所述第二默认滤波参数为M维参数向量,M为正整数。The method according to claim 10, wherein the filter parameter corresponding to the 1/2 pixel point is a second default filter parameter, the second default filter parameter is an M-dimensional parameter vector, and M is a positive integer.
  14. 根据权利要求10所述的方法,其特征在于,所述3/4分像素点对应的滤波参数通过如下步骤确定:The method according to claim 10, wherein the filtering parameters corresponding to the 3/4 pixel points are determined by the following steps:
    获取所述3/4分像素点对应的第三默认滤波参数,所述第三默认滤波参数为M维参数向量,M为正整数;Obtain the third default filter parameter corresponding to the 3/4 pixel point, the third default filter parameter is an M-dimensional parameter vector, and M is a positive integer;
    对所述第三默认滤波参数的首位前添加0,得到所述3/4分像素点对应的最终的滤波参数,所述最终的滤波参数为N维参数向量,N=M+1。0 is added before the first digit of the third default filtering parameter to obtain the final filtering parameter corresponding to the 3/4 pixel point, and the final filtering parameter is an N-dimensional parameter vector, N=M+1.
  15. 根据权利要求10所述的方法,其特征在于,所述整像素点对应的滤波参数为参数值为0的M维参数向量,M为正整数。The method according to claim 10, wherein the filtering parameter corresponding to the integer pixel is an M-dimensional parameter vector with a parameter value of 0, and M is a positive integer.
  16. 根据权利要求10所述的方法,其特征在于,所述1/4分像素点对应的滤波参数、所述1/2分像素点对应的滤波参数、所述3/4分像素点对应的滤波参数以及所述整像素点对应的滤波参数中的同一维度的参数值均不小于0或者均不大于0。The method according to claim 10, wherein the filtering parameters corresponding to the 1/4 pixel points, the filtering parameters corresponding to the 1/2 pixel points, and the filtering parameters corresponding to the 3/4 pixel points The parameter value and the parameter value of the same dimension in the filtering parameter corresponding to the integer pixel are not less than 0 or are not greater than 0.
  17. 根据权利要求1所述的方法,其特征在于,所述基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行插值,包括:The method according to claim 1, wherein the performing interpolation on the target interpolation position based on the target pixel matrix offset and the target filtering parameter comprises:
    获取所述目标图像块对应的输入像素矩阵;obtaining the input pixel matrix corresponding to the target image block;
    基于所述目标像素矩阵偏移量和所述输入像素矩阵,确定对所述目标插值位置插值所需要的目标像素矩阵;Based on the target pixel matrix offset and the input pixel matrix, determine a target pixel matrix required for interpolation of the target interpolation position;
    基于所述目标像素矩阵和所述目标滤波参数,对所述目标插值位置进行插值。The target interpolation position is interpolated based on the target pixel matrix and the target filter parameter.
  18. 根据权利要求17所述的方法,其特征在于,所述基于所述目标像素矩阵和所述目标滤波参数,对所述目标插值位置进行插值,包括:The method according to claim 17, wherein the performing interpolation on the target interpolation position based on the target pixel matrix and the target filtering parameter comprises:
    基于所述目标插值位置的类型,选取所述目标像素矩阵中的参考像素点;Based on the type of the target interpolation position, select the reference pixel point in the target pixel matrix;
    基于所述目标滤波参数对所述参考像素点进行滤波处理,得到所述目标插值位置的插值结果。Filter processing is performed on the reference pixel point based on the target filtering parameter to obtain an interpolation result of the target interpolation position.
  19. 根据权利要求18所述的方法,其特征在于,所述基于所述目标插值位置的类型,选取所述目标像素矩阵中的参考像素点,包括:The method according to claim 18, wherein the selecting a reference pixel point in the target pixel matrix based on the type of the target interpolation position comprises:
    若所述目标插值位置的类型为1/2分像素点,则选取所述目标像素矩阵中的整像素点,作为参考像素点;If the type of the target interpolation position is a 1/2 pixel point, then select an integer pixel point in the target pixel matrix as a reference pixel point;
    若所述目标插值位置的类型为1/4分像素点或3/4分像素点,则选取所述目标像素矩阵中的1/2分像素点,作为参考像素点。If the type of the target interpolation position is a 1/4 pixel point or a 3/4 pixel point, a 1/2 pixel point in the target pixel matrix is selected as a reference pixel point.
  20. 根据权利要求18所述的方法,其特征在于,所述目标滤波参数为N维参数向量,N为正整数;以及,The method according to claim 18, wherein the target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and,
    所述基于所述目标滤波参数对所述参考像素点进行滤波处理,得到所述目标插值位置的插值结果,包括:The filtering processing is performed on the reference pixel based on the target filtering parameter to obtain an interpolation result of the target interpolation position, including:
    控制N个数据选择器选取N个数据,所述N个数据分别为采用目标滤波参数中的N个参数值对所述目标像素矩阵进行处理后的数据处理结果,其中,所述N个数据选择器被预先划分为第一组和第二组;Controlling N data selectors to select N pieces of data, the N pieces of data are respectively the data processing results after the target pixel matrix is processed by using the N parameter values in the target filter parameters, wherein the N pieces of data are selected The device is pre-divided into the first group and the second group;
    将所述第一组中的数据选择器输出的数据输入至第一加法器,将所述第二组中的数据选择器输出的数据输入至第二加法器;inputting the data outputted by the data selectors in the first group into the first adder, and inputting the data outputted by the data selectors in the second group into the second adder;
    将所述第一加法器输出的数据与所述第二加法器输出的数据输入至减法器,将所述减法器输出的数据作为目标插值位置的插值结果。The data output by the first adder and the data output by the second adder are input to a subtractor, and the data output by the subtracter is used as the interpolation result of the target interpolation position.
  21. 一种像素插值装置,其特征在于,所述装置包括:A pixel interpolation device, characterized in that the device comprises:
    选取单元,被配置成选取目标图像块的目标插值位置;a selection unit, configured to select the target interpolation position of the target image block;
    查询单元,被配置成从预设的映射表中,查询所述目标插值位置对应的目标像素矩阵偏移量和所述目标插值位置对应的目标滤波参数;a query unit, configured to query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position from a preset mapping table;
    插值单元,被配置成基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行插值。An interpolation unit configured to interpolate the target interpolation position based on the target pixel matrix offset and the target filter parameter.
  22. 根据权利要求21所述的装置,其特征在于,所述映射表中包括插值位置与像素矩阵偏移量的第一映射信息;The device according to claim 21, wherein the mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix;
    所述第一映射信息通过如下步骤生成:The first mapping information is generated by the following steps:
    获取指定尺寸图像块对应的输入像素矩阵,其中,所述指定尺寸图像块与所述目标图像块的尺寸相同;obtaining an input pixel matrix corresponding to an image block of a specified size, wherein the size of the image block of the specified size is the same as that of the target image block;
    确定所述指定尺寸图像块中的各插值位置所需的像素矩阵相对于所述输入像素矩阵的像素矩阵偏移量;determining the pixel matrix offset of the pixel matrix relative to the input pixel matrix required for each interpolation position in the image block of the specified size;
    基于所述各插值位置对应的像素矩阵偏移量,生成第一映射信息。First mapping information is generated based on the pixel matrix offset corresponding to each interpolation position.
  23. 根据权利要求22所述的装置,其特征在于,所述基于所述各插值位置对应的像素矩阵偏移量,生成第一映射信息,包括:The device according to claim 22, wherein the generating the first mapping information based on the pixel matrix offset corresponding to each interpolation position comprises:
    为所述各插值位置设置位置编号;setting a position number for each of the interpolation positions;
    基于所述各插值位置对应的像素矩阵偏移量,建立位置编号与像素矩阵偏移量 的映射,得到第一映射信息。Based on the pixel matrix offset corresponding to each interpolation position, a mapping between the position number and the pixel matrix offset is established to obtain the first mapping information.
  24. 根据权利要求22所述的装置,其特征在于,所述各插值位置对应的像素矩阵偏移量包括水平方向的像素矩阵偏移量和竖直方向的像素矩阵偏移量;The device according to claim 22, wherein the pixel matrix offset corresponding to each interpolation position comprises a pixel matrix offset in a horizontal direction and a pixel matrix offset in a vertical direction;
    所述第一映射信息包括所述各插值位置与水平方向的像素矩阵偏移量的映射关系,以及,包括所述各插值位置与竖直方向的像素矩阵偏移量的映射关系。The first mapping information includes the mapping relationship between the interpolation positions and the offset of the pixel matrix in the horizontal direction, and includes the mapping relationship between the interpolation positions and the offset of the pixel matrix in the vertical direction.
  25. 根据权利要求21所述的装置,其特征在于,所述映射表中包括插值位置与滤波参数的第二映射信息;The apparatus according to claim 21, wherein the mapping table includes second mapping information of interpolation positions and filtering parameters;
    所述第二映射信息通过如下步骤生成:The second mapping information is generated through the following steps:
    确定指定尺寸图像块中的各插值位置的类型,其中,所述指定尺寸图像块与所述目标图像块的尺寸相同;determining the type of each interpolation position in an image block of a specified size, wherein the size of the image block of the specified size is the same as the size of the target image block;
    基于所述各插值位置的类型,确定所述各插值位置对应的滤波参数;Based on the type of each interpolation position, determine the filtering parameter corresponding to each interpolation position;
    基于所述各插值位置对应的滤波参数,生成第二映射信息。The second mapping information is generated based on the filtering parameters corresponding to the interpolation positions.
  26. 根据权利要求25所述的装置,其特征在于,所述基于所述各插值位置对应的滤波参数,生成第二映射信息,包括:The device according to claim 25, wherein the generating the second mapping information based on the filtering parameters corresponding to the interpolation positions comprises:
    为所述各插值位置设置位置编号;setting a position number for each of the interpolation positions;
    为各滤波参数设置索引编号;Set the index number for each filter parameter;
    基于所述各插值位置对应的滤波参数,建立位置编号与索引编号的映射,得到第二映射信息。Based on the filtering parameters corresponding to the interpolation positions, a mapping between position numbers and index numbers is established to obtain second mapping information.
  27. 根据权利要求25所述的装置,其特征在于,所述各插值位置的类型包括所述各插值位置在水平方向上的类型和所述各插值位置在竖直方向上的类型。The apparatus according to claim 25, wherein the types of the interpolation positions include the types of the interpolation positions in the horizontal direction and the types of the interpolation positions in the vertical direction.
  28. 根据权利要求27所述的装置,其特征在于,所述基于所述各插值位置的类型,确定所述各插值位置对应的滤波参数,包括:The device according to claim 27, wherein the determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions comprises:
    基于所述各插值位置在水平方向上的类型,确定在水平方向上所述各插值位置对应的滤波参数;determining the filtering parameters corresponding to the interpolation positions in the horizontal direction based on the types of the interpolation positions in the horizontal direction;
    基于所述各插值位置在竖直方向上的类型,确定在竖直方向上所述各插值位置对应的滤波参数。Based on the types of the interpolation positions in the vertical direction, filter parameters corresponding to the interpolation positions in the vertical direction are determined.
  29. 根据权利要求27所述的装置,其特征在于,所述第二映射信息包括所述各插值位置与在水平方向上对应的滤波参数的映射关系,以及,包括所述各插值位置与在竖直方向上对应的滤波参数的映射关系。The apparatus according to claim 27, wherein the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions and the vertical The mapping relationship of the corresponding filter parameters in the direction.
  30. 根据权利要求25所述的装置,其特征在于,插值位置的类型包括以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。The apparatus according to claim 25, wherein the type of interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point and whole pixel point.
  31. 根据权利要求25所述的装置,其特征在于,不同类型的插值位置对应的滤波参数为具有相同维度的参数向量。The apparatus according to claim 25, wherein the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
  32. 根据权利要求30所述的装置,其特征在于,所述1/4分像素点对应的滤波参数通过如下步骤确定:The device according to claim 30, wherein the filtering parameters corresponding to the 1/4 pixel points are determined by the following steps:
    获取所述1/4分像素点对应的第一默认滤波参数,所述第一默认滤波参数为M维参数向量,M为正整数;Obtain the first default filter parameter corresponding to the 1/4 pixel point, the first default filter parameter is an M-dimensional parameter vector, and M is a positive integer;
    对所述第一默认滤波参数的末尾添加0,得到所述1/4分像素点对应的最终的滤波参数,所述最终的滤波参数为N维参数向量,N=M+1。Add 0 to the end of the first default filtering parameter to obtain the final filtering parameter corresponding to the 1/4 pixel point, and the final filtering parameter is an N-dimensional parameter vector, N=M+1.
  33. 根据权利要求30所述的装置,其特征在于,所述1/2分像素点对应的滤波参数为第二默认滤波参数,所述第二默认滤波参数为M维参数向量,M为正整数。The apparatus according to claim 30, wherein the filtering parameter corresponding to the 1/2 pixel point is a second default filtering parameter, the second default filtering parameter is an M-dimensional parameter vector, and M is a positive integer.
  34. 根据权利要求30所述的装置,其特征在于,所述3/4分像素点对应的滤波参数通过如下步骤确定:The device according to claim 30, wherein the filtering parameters corresponding to the 3/4 pixel points are determined by the following steps:
    获取所述3/4分像素点对应的第三默认滤波参数,所述第三默认滤波参数为M维参数向量,M为正整数;Obtain the third default filter parameter corresponding to the 3/4 pixel point, the third default filter parameter is an M-dimensional parameter vector, and M is a positive integer;
    对所述第三默认滤波参数的首位前添加0,得到所述3/4分像素点对应的最终的滤波参数,所述最终的滤波参数为N维参数向量,N=M+1。0 is added before the first digit of the third default filtering parameter to obtain the final filtering parameter corresponding to the 3/4 pixel point, and the final filtering parameter is an N-dimensional parameter vector, N=M+1.
  35. 根据权利要求30所述的装置,其特征在于,所述整像素点对应的滤波参数为参数值为0的M维参数向量,M为正整数。The device according to claim 30, wherein the filtering parameter corresponding to the integer pixel is an M-dimensional parameter vector with a parameter value of 0, and M is a positive integer.
  36. 根据权利要求30所述的装置,其特征在于,所述1/4分像素点对应的滤波参数、所述1/2分像素点对应的滤波参数、所述3/4分像素点对应的滤波参数以及所述整像素点对应的滤波参数中的同一维度的参数值均不小于0或者均不大于0。The device according to claim 30, wherein the filtering parameters corresponding to the 1/4 pixel points, the filtering parameters corresponding to the 1/2 pixel points, and the filtering parameters corresponding to the 3/4 pixel points The parameter value and the parameter value of the same dimension in the filtering parameter corresponding to the integer pixel are not less than 0 or are not greater than 0.
  37. 根据权利要求21所述的装置,其特征在于,所述插值单元,进一步被配置成:The apparatus according to claim 21, wherein the interpolation unit is further configured to:
    获取所述目标图像块对应的输入像素矩阵;obtaining the input pixel matrix corresponding to the target image block;
    基于所述目标像素矩阵偏移量和所述输入像素矩阵,确定对所述目标插值位置 插值所需要的目标像素矩阵;Based on the offset of the target pixel matrix and the input pixel matrix, determine the target pixel matrix required for the interpolation of the target interpolation position;
    基于所述目标像素矩阵和所述目标滤波参数,对所述目标插值位置进行插值。The target interpolation position is interpolated based on the target pixel matrix and the target filter parameter.
  38. 根据权利要求27所述的装置,其特征在于,所述插值单元,进一步被配置成:The apparatus according to claim 27, wherein the interpolation unit is further configured to:
    基于所述目标插值位置的类型,选取所述目标像素矩阵中的参考像素点;Based on the type of the target interpolation position, select the reference pixel point in the target pixel matrix;
    基于所述目标滤波参数对所述参考像素点进行滤波处理,得到所述目标插值位置的插值结果。Filter processing is performed on the reference pixel point based on the target filtering parameter to obtain an interpolation result of the target interpolation position.
  39. 根据权利要求28所述的装置,其特征在于,所述插值单元,进一步被配置成:The apparatus according to claim 28, wherein the interpolation unit is further configured to:
    若所述目标插值位置的类型为1/2分像素点,则选取所述目标像素矩阵中的整像素点,作为参考像素点;If the type of the target interpolation position is a 1/2 pixel point, then select an integer pixel point in the target pixel matrix as a reference pixel point;
    若所述目标插值位置的类型为1/4分像素点或3/4分像素点,则选取所述目标像素矩阵中的1/2分像素点,作为参考像素点。If the type of the target interpolation position is a 1/4 pixel point or a 3/4 pixel point, a 1/2 pixel point in the target pixel matrix is selected as a reference pixel point.
  40. 根据权利要求28所述的装置,其特征在于,所述目标滤波参数为N维参数向量,N为正整数;以及,The device according to claim 28, wherein the target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and,
    所述插值单元,进一步被配置成:The interpolation unit is further configured to:
    控制N个数据选择器选取N个数据,所述N个数据分别为采用目标滤波参数中的N个参数值对所述目标像素矩阵进行处理后的数据处理结果,其中,所述N个数据选择器被预先划分为第一组和第二组;Controlling N data selectors to select N pieces of data, the N pieces of data are respectively the data processing results after the target pixel matrix is processed by using the N parameter values in the target filtering parameters, wherein the N pieces of data are selected The device is pre-divided into the first group and the second group;
    将所述第一组中的数据选择器输出的数据输入至第一加法器,将所述第二组中的数据选择器输出的数据输入至第二加法器;inputting the data outputted by the data selectors in the first group into the first adder, and inputting the data outputted by the data selectors in the second group into the second adder;
    将所述第一加法器输出的数据与所述第二加法器输出的数据输入至减法器,将所述减法器输出的数据作为目标插值位置的插值结果。The data output by the first adder and the data output by the second adder are input to a subtractor, and the data output by the subtracter is used as the interpolation result of the target interpolation position.
  41. 一种电子设备,其特征在于,包括:处理器和存储器;An electronic device, comprising: a processor and a memory;
    所述存储器,用于存储程序指令;the memory for storing program instructions;
    所述处理器,执行所述存储器存储的程序指令,当程序指令被执行时,所述处理器用于执行如下步骤:The processor executes the program instructions stored in the memory, and when the program instructions are executed, the processor is configured to perform the following steps:
    选取目标图像块的目标插值位置;Select the target interpolation position of the target image block;
    从预设的映射表中,查询所述目标插值位置对应的目标像素矩阵偏移量和所述目标插值位置对应的目标滤波参数;From the preset mapping table, query the target pixel matrix offset corresponding to the target interpolation position and the target filtering parameter corresponding to the target interpolation position;
    基于所述目标像素矩阵偏移量和所述目标滤波参数,对所述目标插值位置进行 插值。The target interpolation position is interpolated based on the target pixel matrix offset and the target filter parameter.
  42. 根据权利要求41所述的装置,其特征在于,所述映射表中包括插值位置与像素矩阵偏移量的第一映射信息;The device according to claim 41, wherein the mapping table includes first mapping information of the interpolation position and the offset of the pixel matrix;
    所述第一映射信息通过如下步骤生成:The first mapping information is generated by the following steps:
    获取指定尺寸图像块对应的输入像素矩阵,其中,所述指定尺寸图像块与所述目标图像块的尺寸相同;obtaining an input pixel matrix corresponding to an image block of a specified size, wherein the size of the image block of the specified size is the same as that of the target image block;
    确定所述指定尺寸图像块中的各插值位置所需的像素矩阵相对于所述输入像素矩阵的像素矩阵偏移量;determining the pixel matrix offset of the pixel matrix relative to the input pixel matrix required for each interpolation position in the image block of the specified size;
    基于所述各插值位置对应的像素矩阵偏移量,生成第一映射信息。The first mapping information is generated based on the pixel matrix offset corresponding to each interpolation position.
  43. 根据权利要求42所述的装置,其特征在于,所述基于所述各插值位置对应的像素矩阵偏移量,生成第一映射信息,包括:The device according to claim 42, wherein the generating the first mapping information based on the pixel matrix offset corresponding to each interpolation position comprises:
    为所述各插值位置设置位置编号;setting a position number for each of the interpolation positions;
    基于所述各插值位置对应的像素矩阵偏移量,建立位置编号与像素矩阵偏移量的映射,得到第一映射信息。Based on the pixel matrix offset corresponding to each interpolation position, a mapping between the position number and the pixel matrix offset is established to obtain first mapping information.
  44. 根据权利要求42所述的装置,其特征在于,所述各插值位置对应的像素矩阵偏移量包括水平方向的像素矩阵偏移量和竖直方向的像素矩阵偏移量;The device according to claim 42, wherein the pixel matrix offset corresponding to each interpolation position comprises a horizontal pixel matrix offset and a vertical pixel matrix offset;
    所述第一映射信息包括所述各插值位置与水平方向的像素矩阵偏移量的映射关系,以及,包括所述各插值位置与竖直方向的像素矩阵偏移量的映射关系。The first mapping information includes a mapping relationship between the interpolation positions and the offset of the pixel matrix in the horizontal direction, and includes a mapping relationship between the interpolation positions and the offset of the pixel matrix in the vertical direction.
  45. 根据权利要求41所述的装置,其特征在于,所述映射表中包括插值位置与滤波参数的第二映射信息;The apparatus according to claim 41, wherein the mapping table includes second mapping information of interpolation positions and filtering parameters;
    所述第二映射信息通过如下步骤生成:The second mapping information is generated through the following steps:
    确定指定尺寸图像块中的各插值位置的类型,其中,所述指定尺寸图像块与所述目标图像块的尺寸相同;determining the type of each interpolation position in an image block of a specified size, wherein the size of the image block of the specified size is the same as the size of the target image block;
    基于所述各插值位置的类型,确定所述各插值位置对应的滤波参数;Based on the types of the interpolation positions, determine the filtering parameters corresponding to the interpolation positions;
    基于所述各插值位置对应的滤波参数,生成第二映射信息。The second mapping information is generated based on the filtering parameters corresponding to the interpolation positions.
  46. 根据权利要求45所述的装置,其特征在于,所述基于所述各插值位置对应的滤波参数,生成第二映射信息,包括:The apparatus according to claim 45, wherein the generating the second mapping information based on the filtering parameters corresponding to the interpolation positions, comprises:
    为所述各插值位置设置位置编号;setting a position number for each of the interpolation positions;
    为各滤波参数设置索引编号;Set the index number for each filter parameter;
    基于所述各插值位置对应的滤波参数,建立位置编号与索引编号的映射,得到 第二映射信息。Based on the filtering parameters corresponding to the interpolation positions, a mapping between position numbers and index numbers is established to obtain second mapping information.
  47. 根据权利要求45所述的装置,其特征在于,所述各插值位置的类型包括所述各插值位置在水平方向上的类型和所述各插值位置在竖直方向上的类型。The apparatus according to claim 45, wherein the types of the interpolation positions include the types of the interpolation positions in the horizontal direction and the types of the interpolation positions in the vertical direction.
  48. 根据权利要求47所述的装置,其特征在于,所述基于所述各插值位置的类型,确定所述各插值位置对应的滤波参数,包括:The device according to claim 47, wherein the determining the filtering parameters corresponding to the interpolation positions based on the types of the interpolation positions comprises:
    基于所述各插值位置在水平方向上的类型,确定在水平方向上所述各插值位置对应的滤波参数;determining the filtering parameters corresponding to the interpolation positions in the horizontal direction based on the types of the interpolation positions in the horizontal direction;
    基于所述各插值位置在竖直方向上的类型,确定在竖直方向上所述各插值位置对应的滤波参数。Based on the types of the interpolation positions in the vertical direction, filter parameters corresponding to the interpolation positions in the vertical direction are determined.
  49. 根据权利要求47所述的装置,其特征在于,所述第二映射信息包括所述各插值位置与在水平方向上对应的滤波参数的映射关系,以及,包括所述各插值位置与在竖直方向上对应的滤波参数的映射关系。The apparatus according to claim 47, wherein the second mapping information includes a mapping relationship between the interpolation positions and the filtering parameters corresponding to the horizontal direction, and includes the interpolation positions and the vertical The mapping relationship of the corresponding filter parameters in the direction.
  50. 根据权利要求45所述的装置,其特征在于,插值位置的类型包括以下至少一项:1/4分像素点、1/2分像素点、3/4分像素点和整像素点。The apparatus according to claim 45, wherein the type of interpolation position includes at least one of the following: 1/4 pixel point, 1/2 pixel point, 3/4 pixel point and whole pixel point.
  51. 根据权利要求45所述的装置,其特征在于,不同类型的插值位置对应的滤波参数为具有相同维度的参数向量。The apparatus according to claim 45, wherein the filtering parameters corresponding to different types of interpolation positions are parameter vectors with the same dimension.
  52. 根据权利要求50所述的装置,其特征在于,所述1/4分像素点对应的滤波参数通过如下步骤确定:The device according to claim 50, wherein the filtering parameters corresponding to the 1/4 pixel points are determined by the following steps:
    获取所述1/4分像素点对应的第一默认滤波参数,所述第一默认滤波参数为M维参数向量,M为正整数;Obtain the first default filter parameter corresponding to the 1/4 pixel point, the first default filter parameter is an M-dimensional parameter vector, and M is a positive integer;
    对所述第一默认滤波参数的末尾添加0,得到所述1/4分像素点对应的最终的滤波参数,所述最终的滤波参数为N维参数向量,N=M+1。Add 0 to the end of the first default filtering parameter to obtain the final filtering parameter corresponding to the 1/4 pixel point, and the final filtering parameter is an N-dimensional parameter vector, N=M+1.
  53. 根据权利要求50所述的装置,其特征在于,所述1/2分像素点对应的滤波参数为第二默认滤波参数,所述第二默认滤波参数为M维参数向量,M为正整数。The apparatus according to claim 50, wherein the filtering parameter corresponding to the 1/2 pixel point is a second default filtering parameter, the second default filtering parameter is an M-dimensional parameter vector, and M is a positive integer.
  54. 根据权利要求50所述的装置,其特征在于,所述3/4分像素点对应的滤波参数通过如下步骤确定:The device according to claim 50, wherein the filtering parameters corresponding to the 3/4 pixel points are determined by the following steps:
    获取所述3/4分像素点对应的第三默认滤波参数,所述第三默认滤波参数为M 维参数向量,M为正整数;Obtain the third default filter parameter corresponding to the 3/4 pixel point, the third default filter parameter is an M-dimensional parameter vector, and M is a positive integer;
    对所述第三默认滤波参数的首位前添加0,得到所述3/4分像素点对应的最终的滤波参数,所述最终的滤波参数为N维参数向量,N=M+1。0 is added before the first digit of the third default filter parameter to obtain the final filter parameter corresponding to the 3/4 pixel point, and the final filter parameter is an N-dimensional parameter vector, N=M+1.
  55. 根据权利要求50所述的装置,其特征在于,所述整像素点对应的滤波参数为参数值为0的M维参数向量,M为正整数。The device according to claim 50, wherein the filtering parameter corresponding to the integer pixel is an M-dimensional parameter vector with a parameter value of 0, and M is a positive integer.
  56. 根据权利要求50所述的装置,其特征在于,所述1/4分像素点对应的滤波参数、所述1/2分像素点对应的滤波参数、所述3/4分像素点对应的滤波参数以及所述整像素点对应的滤波参数中的同一维度的参数值均不小于0或者均不大于0。The device according to claim 50, wherein the filtering parameters corresponding to the 1/4 pixel points, the filtering parameters corresponding to the 1/2 pixel points, and the filtering parameters corresponding to the 3/4 pixel points The parameter value and the parameter value of the same dimension in the filtering parameter corresponding to the integer pixel are not less than 0 or are not greater than 0.
  57. 根据权利要求41所述的装置,其特征在于,所述处理器,进一步用于:The apparatus of claim 41, wherein the processor is further configured to:
    获取所述目标图像块对应的输入像素矩阵;obtaining the input pixel matrix corresponding to the target image block;
    基于所述目标像素矩阵偏移量和所述输入像素矩阵,确定对所述目标插值位置插值所需要的目标像素矩阵;Based on the target pixel matrix offset and the input pixel matrix, determine a target pixel matrix required for interpolation of the target interpolation position;
    基于所述目标像素矩阵和所述目标滤波参数,对所述目标插值位置进行插值。The target interpolation position is interpolated based on the target pixel matrix and the target filter parameter.
  58. 根据权利要求47所述的装置,其特征在于,所述处理器,进一步用于:The apparatus of claim 47, wherein the processor is further configured to:
    基于所述目标插值位置的类型,选取所述目标像素矩阵中的参考像素点;Based on the type of the target interpolation position, select the reference pixel point in the target pixel matrix;
    基于所述目标滤波参数对所述参考像素点进行滤波处理,得到所述目标插值位置的插值结果。Filter processing is performed on the reference pixel point based on the target filtering parameter to obtain an interpolation result of the target interpolation position.
  59. 根据权利要求48所述的装置,其特征在于,所述处理器,进一步用于:The apparatus of claim 48, wherein the processor is further configured to:
    若所述目标插值位置的类型为1/2分像素点,则选取所述目标像素矩阵中的整像素点,作为参考像素点;If the type of the target interpolation position is a 1/2 pixel point, then select an integer pixel point in the target pixel matrix as a reference pixel point;
    若所述目标插值位置的类型为1/4分像素点或3/4分像素点,则选取所述目标像素矩阵中的1/2分像素点,作为参考像素点。If the type of the target interpolation position is a 1/4 pixel point or a 3/4 pixel point, a 1/2 pixel point in the target pixel matrix is selected as a reference pixel point.
  60. 根据权利要求48所述的装置,其特征在于,所述目标滤波参数为N维参数向量,N为正整数;以及,The device according to claim 48, wherein the target filtering parameter is an N-dimensional parameter vector, and N is a positive integer; and,
    所述处理器,进一步用于:The processor is further used for:
    控制N个数据选择器选取N个数据,所述N个数据分别为采用目标滤波参数中的N个参数值对所述目标像素矩阵进行处理后的数据处理结果,其中,所述N个数据选择器被预先划分为第一组和第二组;Controlling N data selectors to select N pieces of data, the N pieces of data are respectively the data processing results after the target pixel matrix is processed by using the N parameter values in the target filtering parameters, wherein the N pieces of data are selected The device is pre-divided into the first group and the second group;
    将所述第一组中的数据选择器输出的数据输入至第一加法器,将所述第二组中 的数据选择器输出的数据输入至第二加法器;Inputting the data outputted by the data selectors in the first group to the first adder, and inputting the data outputted by the data selectors in the second group to the second adder;
    将所述第一加法器输出的数据与所述第二加法器输出的数据输入至减法器,将所述减法器输出的数据作为目标插值位置的插值结果。The data output by the first adder and the data output by the second adder are input to a subtractor, and the data output by the subtracter is used as the interpolation result of the target interpolation position.
  61. 一种计算机可读介质,其特征在于,所述计算机可读介质中存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-20中任一所述的方法。A computer-readable medium, characterized in that, a computer program is stored in the computer-readable medium, and when the computer program is executed by a processor, the method according to any one of claims 1-20 is implemented.
PCT/CN2020/138064 2020-12-21 2020-12-21 Pixel interpolation method and apparatus, electronic device and computer-readable medium WO2022133664A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/138064 WO2022133664A1 (en) 2020-12-21 2020-12-21 Pixel interpolation method and apparatus, electronic device and computer-readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/138064 WO2022133664A1 (en) 2020-12-21 2020-12-21 Pixel interpolation method and apparatus, electronic device and computer-readable medium

Publications (1)

Publication Number Publication Date
WO2022133664A1 true WO2022133664A1 (en) 2022-06-30

Family

ID=82156931

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138064 WO2022133664A1 (en) 2020-12-21 2020-12-21 Pixel interpolation method and apparatus, electronic device and computer-readable medium

Country Status (1)

Country Link
WO (1) WO2022133664A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729885A (en) * 2008-10-24 2010-06-09 安凯(广州)微电子技术有限公司 Image pixel interpolation method and system
CN103650506A (en) * 2011-07-01 2014-03-19 摩托罗拉移动有限责任公司 Joint sub-pixel interpolation filter for temporal prediction
CN104574277A (en) * 2015-01-30 2015-04-29 京东方科技集团股份有限公司 Image interpolation method and image interpolation device
US20160182918A1 (en) * 2014-03-31 2016-06-23 Peking University Shenzhen Graduate School Chroma interpolation method and filter device using the method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729885A (en) * 2008-10-24 2010-06-09 安凯(广州)微电子技术有限公司 Image pixel interpolation method and system
CN103650506A (en) * 2011-07-01 2014-03-19 摩托罗拉移动有限责任公司 Joint sub-pixel interpolation filter for temporal prediction
US20160182918A1 (en) * 2014-03-31 2016-06-23 Peking University Shenzhen Graduate School Chroma interpolation method and filter device using the method
CN104574277A (en) * 2015-01-30 2015-04-29 京东方科技集团股份有限公司 Image interpolation method and image interpolation device

Similar Documents

Publication Publication Date Title
JP5021712B2 (en) Motion evaluation engine with parallel interpolation and search hardware
JP5646654B2 (en) Chrominance high-precision motion filtering for motion interpolation
RU2683591C1 (en) Method and device for predictive motion compensation
US8761261B1 (en) Encoding using motion vectors
TW202019177A (en) Combining mode dependent intra smoothing (mdis) with intra interpolation filter switching
US9118927B2 (en) Sub-pixel interpolation and its application in motion compensated encoding of a video signal
TW202038611A (en) Triangle motion information for video coding
JP2003333603A (en) Method and system implemented by computer and computer readable medium
WO2013069095A1 (en) Image encoding method, image decoding method, image encoding device and image decoding device
TW202041017A (en) Implicit transform selection in video coding
JP6961115B2 (en) Image decoding device, image decoding method and program
WO2020251470A1 (en) Simplified downsampling for matrix based intra prediction
US20240098255A1 (en) Video picture component prediction method and apparatus, and computer storage medium
KR20230145063A (en) Upsampling of reference pixels for intra-prediction in video coding
WO2022133664A1 (en) Pixel interpolation method and apparatus, electronic device and computer-readable medium
TW202046721A (en) Gradient-based prediction refinement for video coding
CN112601095B (en) Method and system for creating fractional interpolation model of video brightness and chrominance
US11202082B2 (en) Image processing apparatus and method
JP6564315B2 (en) Encoding device, decoding device, and program
CN113395520A (en) Decoding prediction method, device and computer storage medium
CN112313950A (en) Method and apparatus for predicting video image component, and computer storage medium
TW201406166A (en) Method and device for encoding video
JP7061737B1 (en) Image decoder, image decoding method and program
KR20110126075A (en) Method and apparatus for video encoding and decoding using extended block filtering
TW202017385A (en) Non-affine blocks predicted from affine motion

Legal Events

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

Ref document number: 20966245

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20966245

Country of ref document: EP

Kind code of ref document: A1