CN113099231B - Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium - Google Patents

Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium Download PDF

Info

Publication number
CN113099231B
CN113099231B CN202110310133.9A CN202110310133A CN113099231B CN 113099231 B CN113099231 B CN 113099231B CN 202110310133 A CN202110310133 A CN 202110310133A CN 113099231 B CN113099231 B CN 113099231B
Authority
CN
China
Prior art keywords
value
determining
target
vector
interpolation
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110310133.9A
Other languages
Chinese (zh)
Other versions
CN113099231A (en
Inventor
邹箭
丁文鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110310133.9A priority Critical patent/CN113099231B/en
Publication of CN113099231A publication Critical patent/CN113099231A/en
Application granted granted Critical
Publication of CN113099231B publication Critical patent/CN113099231B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/523Motion estimation or motion compensation with sub-pixel accuracy

Abstract

The application discloses a method and a device for determining a sub-pixel interpolation position, electronic equipment and a storage medium, and relates to the field of cloud computing and the field of artificial intelligence, in particular to the field of computer vision. The scheme is as follows: obtaining a motion vector between a reference pixel block and a pixel block to be coded, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction; respectively carrying out bit operation on the first vector value and the second vector value to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value; determining a target offset value corresponding to the motion vector according to the first value and the second value; and determining the sub-pixel interpolation position of the pixel point in the reference pixel block according to the target offset value, the first value and the second value. The offset value is determined according to the value of the designated bit in the vector values in the two directions, and the sub-pixel interpolation position is determined based on the offset value, so that the calculation amount of selecting the interpolation point in the sub-pixel interpolation process is reduced.

Description

Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium
Technical Field
The application relates to the field of cloud computing and the field of artificial intelligence, in particular to the field of computer vision, and specifically relates to a method and a device for determining a sub-pixel interpolation position, electronic equipment and a storage medium.
Background
Inter-frame prediction is an important technique in video coding compression standards. Inter-frame prediction is a process of obtaining the best matching block in the reference frame image by adopting a pixel block matching method, and this process is called motion estimation. Because the distance of the object motion is not necessarily an integral multiple of the pixel, the precision of the motion estimation needs to be improved to a sub-pixel level, and a sub-pixel interpolation algorithm needs to be used.
The sub-pixel interpolation process is relatively complex and has a large amount of calculation, and how to improve the video encoding and transcoding efficiency is an urgent problem to be solved.
Disclosure of Invention
The application provides a method, a device, an electronic device and a storage medium for determining a sub-pixel interpolation position.
According to an aspect of the present application, there is provided a method of determining a sub-pixel interpolation position, including:
acquiring a motion vector between a reference pixel block and a pixel block to be coded, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction;
performing bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value;
determining a target offset value corresponding to the motion vector according to the first value and the second value;
and determining the sub-pixel interpolation position of the pixel point in the reference pixel block according to the target offset value, the first value and the second value.
According to another aspect of the present application, there is provided an apparatus for determining a sub-pixel interpolation position, including:
the device comprises a first acquisition module, a second acquisition module and a coding module, wherein the first acquisition module is used for acquiring a motion vector between a reference pixel block and a pixel block to be coded, and the motion vector comprises a first vector value in a first direction and a second vector value in a second direction;
a second obtaining module, configured to perform bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value;
a first determining module, configured to determine a target offset value corresponding to the motion vector according to the first value and the second value;
and the second determining module is used for determining the sub-pixel interpolation position of the pixel point in the reference pixel block according to the target offset value, the first value and the second value.
According to another aspect of the present application, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method as described in an embodiment of the above aspect.
According to another aspect of the present application, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to the above-described embodiment of the one aspect.
According to another aspect of the present application, a computer program product is provided, comprising a computer program which, when executed by a processor, implements a method according to an embodiment of the above-mentioned aspect.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic flowchart illustrating a method for determining a sub-pixel interpolation position according to an embodiment of the present disclosure;
FIG. 2 is a schematic flowchart of another method for determining a sub-pixel interpolation position according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of sub-pixel interpolation provided in an embodiment of the present application;
FIG. 4 is a schematic flowchart illustrating another method for determining a sub-pixel interpolation position according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of an apparatus for determining a sub-pixel interpolation position according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of an electronic device for implementing a method of determining a sub-pixel interpolation position according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
A method, an apparatus, an electronic device, and a storage medium for determining a sub-pixel interpolation position according to embodiments of the present application are described below with reference to the accompanying drawings.
Artificial intelligence is the subject of research on the use of computers to simulate certain mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) of humans, both in the hardware and software domain. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology comprises a computer vision technology, a voice recognition technology, a natural language processing technology, deep learning, a big data processing technology, a knowledge map technology and the like.
Computer vision is a simulation of biological vision using a computer and associated equipment. The main task of the method is to process the collected pictures or videos to obtain the three-dimensional information of the corresponding scene.
Fig. 1 is a schematic flowchart of a method for determining a sub-pixel interpolation position according to an embodiment of the present disclosure.
As shown in fig. 1, the method for determining the interpolation position of the sub-pixel comprises the following steps:
step 101, obtaining a motion vector between a reference pixel block and a pixel block to be encoded, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction.
When a video is coded, because the distance of object motion is not necessarily an integral multiple of a pixel, the precision of motion estimation needs to be improved to a sub-pixel level, and a sub-pixel interpolation algorithm needs to be used.
In the present application, when a video is encoded, a pixel block to be encoded in a current image may be matched with a pixel block in a reference image, and a pixel block which is best matched with the current pixel block to be encoded is selected, which may be referred to as a reference pixel block for convenience of distinction. After the reference pixel block is determined, displacement information, i.e., a motion vector, of the reference pixel block with respect to the pixel block to be encoded may be acquired.
The motion vectors corresponding to each integer pixel point in the same reference pixel block may be considered to be the same, and the motion vectors may include vector values in two directions, a vector value in a first direction and a vector value in a second direction. For ease of distinction, the vector values for the first direction may be referred to as first vector values and the vector values for the second direction may be referred to as second vector values.
Since video images are typically two-dimensional images, the motion vectors may comprise vector values in a horizontal direction and vector values in a vertical direction, such as the first direction being the horizontal direction and the second direction being the vertical direction, or the first direction being the vertical direction and the second direction being the horizontal direction.
Step 102, performing bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value.
In the present application, the first vector values and the second vector values may be represented in binary, for example, in 16-bit binary. It should be noted that the number of binary bits of the first vector value and the second vector value can be determined according to the requirement, which is not limited in this application.
After a first vector value in a first direction and a second vector value in a second direction are obtained, bit operation can be performed on the first vector value to obtain a value of a designated bit in the first vector value.
It should be noted that the designated bits can be determined according to the need, such as the last two bits or the last three bits.
And 103, determining a target offset value corresponding to the motion vector according to the first value and the second value.
In the application, after the first value and the second value are obtained, the target offset value corresponding to the motion vector can be determined according to the first value and the second value, so that the interpolation position of the sub-pixel is determined by using the target offset value. For a method for determining the target offset value, reference may be made to the following embodiments, which are not described herein again.
And 104, determining the sub-pixel interpolation position of the pixel point in the reference pixel block according to the target offset value, the first value and the second value.
After the target offset value corresponding to the motion vector is obtained, the sub-pixel interpolation position of the pixel point in the reference pixel block can be determined according to the target offset value, the first value and the second value.
Because the target offset value is determined according to the values of the designated bits in the vector values in the first direction and the second direction, the approximate position of the sub-pixel can be determined based on the target offset value, and then the final interpolation position of the sub-pixel can be determined according to the first value and/or the second value.
When sub-pixel interpolation is carried out, aiming at each whole pixel point in the reference pixel block, the sub-pixel interpolation position of each whole pixel point can be determined by using the method of the embodiment of the application.
In the embodiment of the application, a motion vector between a reference pixel block and a pixel block to be coded is obtained, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction; performing bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value; determining a target offset value corresponding to the motion vector according to the first value and the second value; and determining the sub-pixel interpolation position of the pixel point in the reference pixel block according to the target offset value, the first value and the second value. Therefore, the offset value is determined according to the value of the designated bit in the vector values in the two directions, the sub-pixel interpolation position is determined based on the offset value, the calculation amount of selecting a certain interpolation point in the sub-pixel interpolation process is reduced, and the coding and transcoding efficiency is improved.
In an embodiment of the application, when determining the target offset value corresponding to the motion vector according to the first value and the second value, the second value may be shifted to the left by a first preset number of bits, to obtain a shifted third value, and then the target offset value is determined according to the third value and the first value, for example, the third value and the first value are added to obtain the target offset value.
In the embodiment of the application, a third value is obtained after the second value in the second direction is shifted to the left by the first preset digit, the target offset value is determined according to the first value in the first direction, the sub-pixel interpolation position of the pixel point in the reference pixel block is determined by using the target offset value, the calculation amount of selecting a certain interpolation point in the sub-pixel interpolation process is reduced, and the coding and transcoding efficiency is improved.
In an embodiment of the application, when determining the target offset value corresponding to the motion vector according to the first value and the second value, the first value may also be shifted to the left by a second preset number to obtain a shifted fourth value, and the target offset value is determined according to the fourth value and the second value, for example, the fourth value and the second value are added to obtain the target offset value.
In the embodiment of the application, a third value is obtained by shifting the first value in the first direction to the left by a second preset digit, the target offset value is determined according to the third value and the second value in the second direction, and the sub-pixel interpolation position of the pixel point in the reference pixel block is determined by using the target offset value, so that the calculation amount of selecting a certain interpolation point in the sub-pixel interpolation process is reduced, and the coding and transcoding efficiency is improved.
For example, the first direction is a horizontal direction, the second direction is a vertical direction, the motion vector includes a first vector value mvx in the horizontal direction and a second vector value mvy in the vertical direction, a first value xF is obtained by taking a value of two bits after mvx, and a second value yF is obtained by taking a value of two bits after mvy.
When determining the target offset value corresponding to the motion vector, two bits may be shifted to the left for yF to obtain a third value, and the third value is added to xF to obtain the target offset value, i.e., the target offset value luma _ offset = (yF < 2) + xF.
Or, the xF may be shifted left by two bits to obtain a fourth value, and the fourth value is added to yF to obtain the target offset value, i.e., the target offset value luma _ offset = (xF < 2) + yF.
It should be noted that the first preset digit and the second preset digit may be the same or different, and the application is not limited to this.
In an embodiment of the application, when determining the sub-pixel interpolation position according to the target offset value, the first value and the second value, the target offset value may be used to determine a corresponding interpolation direction, and after determining the interpolation direction, the first value and the second value are used to determine the sub-pixel interpolation position. Fig. 2 is a schematic flowchart of another method for determining a sub-pixel interpolation position according to an embodiment of the present application.
As shown in fig. 2, the method for determining the interpolation position of the sub-pixel includes:
step 201, obtaining a motion vector between a reference pixel block and a pixel block to be encoded, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction.
Step 202, performing bit operation on the first vector value and the second vector value respectively to obtain a first value of the designated bit in the first vector value and a second value of the designated bit in the second vector value.
And 203, determining a target offset value corresponding to the motion vector according to the first value and the second value.
In the present application, steps 201 to 203 are similar to steps 101 to 103, and thus are not described herein again.
And 204, determining a target interpolation direction corresponding to the target offset value according to the mapping relation between the preset offset value and the interpolation direction.
In the present application, a mapping relationship between an offset value and an interpolation direction may be preset, and after determining a target offset corresponding to a motion vector, based on the mapping relationship between the offset value and the interpolation direction, the interpolation direction corresponding to the target offset value may be determined, which is called a target interpolation direction for convenience of distinction.
For example, the target offset value is luma _ offset = (yF < 2) + xF, and the mapping relationship between the offset value and the interpolation direction may be: the luma _ offset is 0, and interpolation is correspondingly not needed; the luma _ offset is 1, 2 and 3, and the corresponding interpolation direction is the horizontal direction; the luma _ offset is 4, 8 and 12, and the corresponding interpolation direction is the vertical direction; the luma _ offset takes on other values, corresponding to diagonal positions. If the target offset value is 1, the target interpolation direction can be determined to be the horizontal direction.
It can be understood that when the method used for calculating the target offset value is different, the mapping relationship between the offset value and the interpolation direction is also different.
Step 205, selecting a target value from the first value and the second value according to the target interpolation direction.
Since the first value corresponds to the first direction and the second value corresponds to the second direction, the values used for determining the interpolation position are different and the same under the condition that the interpolation directions are different.
In the application, after the target interpolation direction is determined, the target value can be selected from the first value and the second value.
When the target interpolation direction is the first direction, a first value corresponding to the first direction may be taken as a target value; when the target interpolation direction is the second direction, a second value corresponding to the second direction may be taken as a target value; in the case where the target interpolation direction is the third direction, the first value and the second value may be taken as the target values.
And step 206, determining an interpolation position according to the target value.
After the target value is determined, the sub-pixel interpolation position of the pixel point in the reference pixel block can be determined according to the target value.
In the application, under the condition that the target interpolation direction is the first direction, the sub-pixel interpolation position can be determined according to the first value; under the condition that the target interpolation direction is a second direction, determining a sub-pixel interpolation position according to a second value; and under the condition that the target interpolation direction is the third direction, determining the sub-pixel interpolation position according to the first value and the second value.
Therefore, the target value is selected from the first value and the second value according to the target interpolation direction, and the target value is used for determining the sub-pixel interpolation position, so that the accuracy of the interpolation position can be improved.
Taking the first direction as the horizontal direction, the second direction as the vertical direction, and the third direction as the diagonal direction as an example, fig. 3 is a schematic diagram of sub-pixel interpolation provided in the embodiment of the present application.
In FIG. 3, A 0,0 、A 0,1 、A 1,0 、A 1,1 For a whole pixel point, a 0,0 Is a whole pixel point A 0,0 1/4 interpolation position in the horizontal direction, b 0,0 Is a whole pixel point A 0,0 Horizontal direction 1/2 interpolation position of (c) 0,0 Is a whole pixel point A 0,0 3/4 interpolation position in the horizontal direction of (d) 0,0 Is a whole pixel point A 0,0 1/4 interpolation position in the vertical direction of (1, h) 0,0 Is a whole pixel point A 0,0 1/2 interpolation position of the vertical direction, n 0,0 Is a whole pixel point A 0,0 Vertical direction 3/4 interpolation position of 0,0 、f 0,0 、g 0,0 、i 0,0 、j 0,0 、k 0,0 、p 0,0 、q 0,0 、r 0,0 The position is interpolated for the diagonal position.
For example, based on integer pixel A 0,0 And determining a target offset value luma _ offset = (yF < 2) + xF according to the corresponding motion vector, and determining a target interpolation direction according to the target offset value. If the target interpolation direction is the horizontal direction, the sub-pixel interpolation position can be determined according to xF. For example, xF =01, the sub-pixel interpolation position can be determined as a 1/4 interpolation position in the horizontal direction, i.e., a 0,0 (ii) a xF =10, the sub-pixel interpolation position can be determined as a 1/2 interpolation position in the horizontal direction, i.e., b 0,0 (ii) a xF =11, it can be determined that the sub-pixel interpolation position is a 3/4 interpolation position in the horizontal direction, i.e., c 0,0
In the embodiment of the application, when the sub-pixel interpolation position is determined according to the target offset value, the first value and the second value, the target interpolation direction corresponding to the target offset value can be determined according to the preset mapping relationship between the offset value and the interpolation direction, the target value is selected from the first value and the second value according to the target interpolation direction, and the interpolation position is determined according to the target value. Therefore, the interpolation direction is determined by utilizing the mapping relation between the offset value and the interpolation direction and the target offset value, the calculation amount of selecting a certain interpolation point in the sub-pixel interpolation process is reduced, and the coding and transcoding efficiency is improved.
In order to meet the personalized requirement, in an embodiment of the present application, when the first value and the second value of the designated bit are obtained, the number of bits of the designated bit may be determined according to the type of the component to be interpolated, and the first value and the second value are obtained based on the determined number of bits of the designated bit, so as to implement the personalized requirement of the sub-pixel precision. Fig. 4 is a schematic flowchart of another method for determining a sub-pixel interpolation position according to an embodiment of the present application, which is described below with reference to fig. 4.
As shown in fig. 4, the method for determining the interpolation position of the sub-pixel includes:
step 401, obtaining a motion vector between a reference pixel block and a pixel block to be encoded, where the motion vector includes a first vector value in a first direction and a second vector value in a second direction.
In the present application, step 401 is similar to step 101, and therefore is not described herein again.
Step 402, determining the number of bits of the designated bit according to the type of the component to be interpolated.
In the present application, the type of the component to be interpolated of the sub-pixel may include luminance, chrominance, and the like, that is, the sub-pixel may be subjected to luminance component interpolation, chrominance component interpolation, and the like. Because the types of the components to be interpolated are different, the requirements on the sub-pixel precision may be different, and therefore, the number of bits of the designated bit can be determined according to the types of the components to be interpolated.
For example, if the luminance interpolation is performed, the number of designated bits may be two; if chroma interpolation is performed, the number of designated bits may be three. For another example, in the luminance interpolation and the chrominance interpolation, the number of designated bits is two.
It should be noted that the number of designated bits corresponding to the luminance and the chrominance is merely an example, and should not be considered as a limitation to the present application.
Step 403, performing bit operation on the first vector value and the second vector value respectively according to the number of bits of the designated bit to obtain a first value and a second value.
After the number of bits of the designated bit is determined, bit operations can be performed on the first vector value and the second vector value respectively according to the number of bits of the designated bit, and a first value and a second value are obtained.
For example, luminance interpolation is performed, the number of designated bits is two, values of the last two bits in the first vector value can be obtained as a first value, and values of the last two bits in the second vector value can be obtained as a second value. For another example, chroma interpolation is performed, the number of bits of a designated bit is three, values of the last three bits in the first vector value can be obtained as the first value, and values of the last three bits in the second vector value are obtained as the second value.
And step 404, determining a target offset value corresponding to the motion vector according to the first value and the second value.
Step 405, determining a target interpolation direction corresponding to the target offset value according to a mapping relation between a preset offset value and the interpolation direction.
Step 406, selecting a target value from the first value and the second value according to the target interpolation direction.
Step 407, determining an interpolation position according to the target value.
In the present application, steps 404-407 can refer to the above embodiments, and thus are not described herein again.
For example, chroma interpolation is performed, the number of bits of a designated bit is three, the values of the last three bits in a first vector value mvx in the horizontal direction are taken to obtain a first value xF, the values of the last three bits in a second vector value mvy in the vertical direction are taken to obtain a second value yF, and the offset value can be determined by chroma _ offset = (yF < 3) + xF. The mapping relation between the value of the offset value and the interpolation direction is as follows: chroma _ offset is 0, no interpolation is needed; chroma _ offset is 1, 2, 3, 4, 5, 6, 7, and the corresponding interpolation direction is the horizontal direction; chroma _ offset is 8, 16, 24, 32, 40, 48, 56, corresponding to the interpolation direction being the vertical direction; chroma _ offset is the other value, corresponding to the diagonal position of the interpolation direction.
If the target offset value is 1, the target interpolation direction corresponding to the target offset value can be determined to be the horizontal direction according to the mapping relation. In the case that the target interpolation direction is determined to be the horizontal direction, the sub-pixel interpolation position may be determined according to the value of xF, for example, xF =001, and the sub-pixel interpolation position is determined to be a 1/8 position.
In the embodiment of the application, when the bit operation is performed on the first vector value and the second vector value respectively to obtain the first value of the designated bit in the first vector value and the second value of the designated bit in the second vector value, the bit number of the designated bit can be determined according to the type of the component to be interpolated, and the bit operation is performed on the first vector value and the second vector value respectively according to the bit number of the designated bit to obtain the first value and the second value. Therefore, the requirement of different components to be interpolated on the sub-pixel precision can be met by determining the number of bits of the designated bit according to the type of the components to be interpolated.
When video coding is carried out, the method for determining the sub-pixel interpolation position in the embodiment of the application can be utilized to determine the sub-pixel interpolation position of the luminance interpolation, so that a luminance interpolation plane is generated, and then the method in the embodiment of the application can be utilized to determine the sub-pixel interpolation position of the chrominance interpolation, so that a chrominance interpolation plane is generated. Alternatively, the sub-pixel interpolation position for luminance interpolation or the sub-pixel interpolation position for chrominance interpolation may also be determined according to the method of the embodiment of the present application.
After the luminance interpolation plane is obtained, motion estimation with sub-pixel precision can be carried out on the current pixel block to be coded and the luminance interpolation plane. After the chrominance interpolation plane is obtained, the sub-pixel precision motion estimation can be carried out on the current pixel block to be coded and the luminance interpolation plane.
In an embodiment of the present application, after the sub-pixel interpolation position of the pixel point in the reference pixel block is determined, a value of a component to be interpolated at the sub-pixel interpolation position may be determined according to a coefficient of a tap filter corresponding to the sub-pixel interpolation position. Therefore, the sub-pixel interpolation of the whole pixel point in the reference pixel block can be realized, and the video restoration effect is improved.
In order to implement the foregoing embodiments, an apparatus for determining a sub-pixel interpolation position is also provided in the embodiments of the present application. Fig. 5 is a schematic structural diagram of an apparatus for determining a sub-pixel interpolation position according to an embodiment of the present disclosure.
As shown in fig. 5, the apparatus for determining the sub-pixel interpolation position includes: a first obtaining module 510, a second obtaining module 520, a first determining module 530, and a second determining module 540.
A first obtaining module 510, configured to obtain a motion vector between a reference pixel block and a pixel block to be encoded, where the motion vector includes a first vector value in a first direction and a second vector value in a second direction;
a second obtaining module 520, configured to perform bit operations on the first vector value and the second vector value, respectively, to obtain a first value of a specified bit in the first vector value and a second value of the specified bit in the second vector value;
a first determining module 530, configured to determine a target offset value corresponding to the motion vector according to the first value and the second value;
a second determining module 540, configured to determine, according to the target offset value, the first value, and the second value, a sub-pixel interpolation position of a pixel point in the reference pixel block.
In a possible implementation manner of the embodiment of the present application, the first determining module 530 is configured to:
shifting the second value by a first preset digit to the left to obtain a shifted third value;
and determining the target offset value according to the third value and the first value.
In a possible implementation manner of the embodiment of the present application, the first determining module 530 is configured to:
shifting the first value by a second preset digit to the left to obtain a shifted fourth value;
and determining the target offset value according to the fourth value and the second value.
In a possible implementation manner of this embodiment of the present application, the second determining module 540 includes:
the first determining unit is used for determining a target interpolation direction corresponding to the target offset value according to a mapping relation between a preset offset value and the interpolation direction;
a second determining unit, configured to select a target value from the first value and the second value according to the target interpolation direction;
and the third determining unit is used for determining the interpolation position according to the target value.
In a possible implementation manner of the embodiment of the present application, the second determining unit is configured to:
determining the first value as the target value under the condition that the target interpolation direction is a first direction;
determining the second value as the target value under the condition that the target interpolation direction is a second direction;
and under the condition that the target interpolation direction is a third direction, determining the first value and the second value as the target value.
In a possible implementation manner of the embodiment of the present application, the second obtaining module 520 is configured to:
determining the number of bits of the designated bit according to the type of the component to be interpolated;
and performing bit operation on the first vector value and the second vector value respectively according to the number of the designated bits to obtain the first value and the second value.
In a possible implementation manner of the embodiment of the present application, the apparatus may further include:
and the third determining module is used for determining the value of the component to be interpolated at the sub-pixel interpolation position.
It should be noted that the explanation of the foregoing method for determining a sub-pixel interpolation position is also applicable to the apparatus for determining a sub-pixel interpolation position in this embodiment, and therefore, the explanation is not repeated here.
In the embodiment of the application, a motion vector between a reference pixel block and a pixel block to be coded is obtained, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction; performing bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value; determining a target offset value corresponding to the motion vector according to the first value and the second value; and determining the sub-pixel interpolation position of the pixel point in the reference pixel block according to the target offset value, the first value and the second value. Therefore, the offset value is determined according to the value of the designated bit in the vector values in the two directions, the sub-pixel interpolation position is determined based on the offset value, the operation amount of selecting a certain interpolation point in the sub-pixel interpolation process is reduced, and the coding and transcoding efficiency is improved.
There is also provided, in accordance with an embodiment of the present application, an electronic device, a readable storage medium, and a computer program product.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 6, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes in accordance with a computer program stored in a ROM (Read-Only Memory) 602 or a computer program loaded from a storage unit 608 into a RAM (Random Access Memory) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An I/O (Input/Output) interface 605 is also connected to the bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 601 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing Unit 601 include, but are not limited to, a CPU (Central Processing Unit), a GPU (graphics Processing Unit), various dedicated AI (Artificial Intelligence) computing chips, various computing Units running machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable Processor, controller, microcontroller, and the like. The calculation unit 601 performs the respective methods and processes described above, such as a method of determining a sub-pixel interpolation position. For example, in some embodiments, the method of determining a sub-pixel interpolation position may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method of determining a sub-pixel interpolation position described above may be performed. Alternatively, in other embodiments, the calculation unit 601 may be configured by any other suitable means (e.g. by means of firmware) to perform the method of determining the sub-pixel interpolation positions.
Various implementations of the systems and techniques described here above may be realized in digital electronic circuitry, integrated circuitry, FPGAs (Field Programmable Gate arrays), ASICs (Application-Specific Integrated circuits), ASSPs (Application Specific Standard products), SOCs (System On Chip, system On a Chip), CPLDs (Complex Programmable Logic devices), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an EPROM (Electrically Programmable Read-Only-Memory) or flash Memory, an optical fiber, a CD-ROM (Compact Disc Read-Only-Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a Display device (e.g., a CRT (Cathode Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), internet, and blockchain Network.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service extensibility in a conventional physical host and VPS service (Virtual Private Server). The server may also be a server of a distributed system, or a server incorporating a blockchain.
There is also provided, in accordance with an embodiment of the present application, a computer program product, which when executed by an instruction processor in the computer program product, performs the method for determining a sub-pixel interpolation position set forth in the above-mentioned embodiment of the present application.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (14)

1. A method of determining a sub-pixel interpolation position, comprising:
obtaining a motion vector between a reference pixel block and a pixel block to be coded, wherein the motion vector comprises a first vector value in a first direction and a second vector value in a second direction;
performing bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value;
determining a target offset value corresponding to the motion vector according to the first value and the second value;
determining a sub-pixel interpolation position of a pixel point in the reference pixel block according to the target offset value, the first value and the second value, wherein determining the target offset value corresponding to the motion vector according to the first value and the second value comprises:
shifting the second value by a first preset digit to the left to obtain a shifted third value;
and adding the third value and the first value to obtain the target offset value.
2. The method of claim 1, wherein the determining a target offset value corresponding to the motion vector according to the first value and the second value comprises:
shifting the first value by a second preset digit to the left to obtain a shifted fourth value;
and determining the target offset value according to the fourth value and the second value.
3. The method of claim 1, wherein the determining a sub-pixel interpolation position of a pixel point in the reference pixel block according to the target offset value, the first value, and the second value comprises:
determining a target interpolation direction corresponding to the target offset value according to a mapping relation between a preset offset value and the interpolation direction;
selecting a target value from the first value and the second value according to the target interpolation direction;
and determining the interpolation position according to the target value.
4. The method of claim 3, wherein the selecting a target value from the first value and the second value according to the target interpolation direction comprises:
determining the first value as the target value under the condition that the target interpolation direction is a first direction;
determining the second value as the target value under the condition that the target interpolation direction is a second direction;
and under the condition that the target interpolation direction is a third direction, determining the first value and the second value as the target value.
5. The method of any of claims 1-4 wherein said performing a bit operation on said first vector value and said second vector value, respectively, to obtain a first value for a specified bit in said first vector value and a second value for a specified bit in said second vector value comprises:
determining the number of bits of the designated bits according to the type of the component to be interpolated;
and performing bit operation on the first vector value and the second vector value respectively according to the number of the designated bits to obtain the first value and the second value.
6. The method of claim 5, wherein after said determining the sub-pixel interpolation position of the pixel point in the reference pixel block, further comprising:
and determining the value of the component to be interpolated at the sub-pixel interpolation position.
7. An apparatus for determining a sub-pixel interpolation position, comprising:
the device comprises a first acquisition module, a second acquisition module and a coding module, wherein the first acquisition module is used for acquiring a motion vector between a reference pixel block and a pixel block to be coded, and the motion vector comprises a first vector value in a first direction and a second vector value in a second direction;
a second obtaining module, configured to perform bit operation on the first vector value and the second vector value respectively to obtain a first value of a designated bit in the first vector value and a second value of the designated bit in the second vector value;
a first determining module, configured to determine a target offset value corresponding to the motion vector according to the first value and the second value;
a second determining module, configured to determine, according to the target offset value, the first value, and the second value, a sub-pixel interpolation position of a pixel point in the reference pixel block;
the first determining module is configured to:
shifting the second value by a first preset digit to the left to obtain a shifted third value;
and adding the third value and the first value to obtain the target offset value.
8. The apparatus of claim 7, wherein the first determining means is configured to:
shifting the first value by a second preset digit to the left to obtain a shifted fourth value;
and determining the target offset value according to the fourth value and the second value.
9. The apparatus of claim 7, wherein the second determining means comprises:
the first determining unit is used for determining a target interpolation direction corresponding to the target offset value according to a mapping relation between a preset offset value and the interpolation direction;
a second determining unit, configured to select a target value from the first value and the second value according to the target interpolation direction;
and the third determining unit is used for determining the interpolation position according to the target value.
10. The apparatus of claim 9, wherein the second determining unit is to:
determining the first value as the target value under the condition that the target interpolation direction is a first direction;
determining the second value as the target value under the condition that the target interpolation direction is a second direction;
and under the condition that the target interpolation direction is a third direction, determining the first value and the second value as the target value.
11. The apparatus of any of claims 7-10, wherein the second obtaining means is to:
determining the number of bits of the designated bit according to the type of the component to be interpolated;
and performing bit operation on the first vector value and the second vector value respectively according to the number of the designated bits to obtain the first value and the second value.
12. The apparatus of claim 11, further comprising:
and the third determining module is used for determining the value of the component to be interpolated at the sub-pixel interpolation position.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202110310133.9A 2021-03-23 2021-03-23 Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium Active CN113099231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110310133.9A CN113099231B (en) 2021-03-23 2021-03-23 Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110310133.9A CN113099231B (en) 2021-03-23 2021-03-23 Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113099231A CN113099231A (en) 2021-07-09
CN113099231B true CN113099231B (en) 2022-12-20

Family

ID=76669120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110310133.9A Active CN113099231B (en) 2021-03-23 2021-03-23 Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113099231B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1675406A2 (en) * 2004-12-21 2006-06-28 STMicroelectronics, Inc. Method and system for fast implementation of subpixel interpolation
CN102625095A (en) * 2011-01-27 2012-08-01 联合信源数字音视频技术(北京)有限公司 AVS-based interframe prediction method
CN103650506A (en) * 2011-07-01 2014-03-19 摩托罗拉移动有限责任公司 Joint sub-pixel interpolation filter for temporal prediction

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4570700B2 (en) * 1996-12-26 2010-10-27 ユナイテッド・モジュール・コーポレーション Motion vector detector
US7620109B2 (en) * 2002-04-10 2009-11-17 Microsoft Corporation Sub-pixel interpolation in motion estimation and compensation
KR100899730B1 (en) * 2006-10-20 2009-05-27 삼성전자주식회사 Method Chroma Interpolation of Image Encoder and Decoder

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1675406A2 (en) * 2004-12-21 2006-06-28 STMicroelectronics, Inc. Method and system for fast implementation of subpixel interpolation
CN102625095A (en) * 2011-01-27 2012-08-01 联合信源数字音视频技术(北京)有限公司 AVS-based interframe prediction method
CN103650506A (en) * 2011-07-01 2014-03-19 摩托罗拉移动有限责任公司 Joint sub-pixel interpolation filter for temporal prediction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于XSBase270平台的AVS解码器亚像素插值优化;谢黎等;《计算机应用与软件》;20100715(第07期);全文 *

Also Published As

Publication number Publication date
CN113099231A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN112862006B (en) Training method and device for image depth information acquisition model and electronic equipment
CN113901909B (en) Video-based target detection method and device, electronic equipment and storage medium
CN112488060B (en) Target detection method, device, equipment and medium
CN114792355B (en) Virtual image generation method and device, electronic equipment and storage medium
CN113902696A (en) Image processing method, image processing apparatus, electronic device, and medium
CN113393468A (en) Image processing method, model training device and electronic equipment
CN113920313B (en) Image processing method, image processing device, electronic equipment and storage medium
CN115797565A (en) Three-dimensional reconstruction model training method, three-dimensional reconstruction device and electronic equipment
CN113766117B (en) Video de-jitter method and device
CN113099231B (en) Method and device for determining sub-pixel interpolation position, electronic equipment and storage medium
CN114723894B (en) Three-dimensional coordinate acquisition method and device and electronic equipment
CN116129101A (en) Target detection method, target detection device, electronic equipment and storage medium
CN115953468A (en) Method, device and equipment for estimating depth and self-movement track and storage medium
CN114078097A (en) Method and device for acquiring image defogging model and electronic equipment
CN114842066A (en) Image depth recognition model training method, image depth recognition method and device
CN115174774A (en) Depth image compression method, device, equipment and storage medium
GB2600796A (en) Method and apparatus for coding video, device and medium
CN113112398A (en) Image processing method and device
CN113610856A (en) Method and device for training image segmentation model and image segmentation
CN113177483B (en) Video object segmentation method, device, equipment and storage medium
CN115661449B (en) Image segmentation and training method and device for image segmentation model
CN113542620B (en) Special effect processing method and device and electronic equipment
CN114332416B (en) Image processing method, device, equipment and storage medium
CN113658277B (en) Stereo matching method, model training method, related device and electronic equipment
CN113570607B (en) Target segmentation method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant