[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2019169997A1 - 视频运动估计方法、装置、终端及存储介质 - Google Patents

视频运动估计方法、装置、终端及存储介质 Download PDF

Info

Publication number
WO2019169997A1
WO2019169997A1 PCT/CN2019/075548 CN2019075548W WO2019169997A1 WO 2019169997 A1 WO2019169997 A1 WO 2019169997A1 CN 2019075548 W CN2019075548 W CN 2019075548W WO 2019169997 A1 WO2019169997 A1 WO 2019169997A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
prediction unit
search
motion vector
rate distortion
Prior art date
Application number
PCT/CN2019/075548
Other languages
English (en)
French (fr)
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 EP19764644.1A priority Critical patent/EP3764648A4/en
Priority to JP2020540622A priority patent/JP7024099B2/ja
Publication of WO2019169997A1 publication Critical patent/WO2019169997A1/zh
Priority to US16/910,938 priority patent/US11375227B2/en

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/523Motion estimation or motion compensation with sub-pixel accuracy
    • 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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • 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/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
    • 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/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/53Multi-resolution motion estimation; Hierarchical motion estimation
    • 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/567Motion estimation based on rate distortion criteria
    • 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/57Motion estimation characterised by a search window with variable size or shape

Definitions

  • the present application relates to the field of video compression technologies, and in particular, to a video motion estimation method, apparatus, terminal, and storage medium.
  • the inter prediction mainly uses the correlation of the video time domain, and uses the pixels of the adjacent and encoded image to predict the current.
  • the pixels of the image are used for the purpose of effectively removing video time domain redundancy.
  • the interframe prediction part of video coding mainly adopts block-based motion compensation technology, and the principle is to find a best matching block in the previously encoded image for each pixel block (ie, prediction unit) of the current image.
  • Motion Estimation (ME) wherein, the image used for prediction is referred to as a reference image, and the displacement of the reference block in the reference image to the current pixel block in the current image is referred to as a motion vector (Motion Vector, MV).
  • an image frame is divided into 2N ⁇ 2N, 2N ⁇ N, N ⁇ 2N, 2N ⁇ by an Inter Prediction Unit (PU).
  • Prediction units of modes such as nU, 2N ⁇ nD, nL ⁇ 2N, and nR ⁇ 2N. Then, a unified processing method is adopted for all prediction units.
  • the starting point of the search point is taken as the center, and the point with the lowest rate distortion cost is searched in the search range, and finally The position of the point at which the rate distortion cost of each prediction unit is the smallest is used as the motion vector corresponding to each prediction unit, and subsequent operations such as sub-pixel motion compensation for the image frame are performed according to the motion vector corresponding to each prediction unit.
  • the inventors of the present application found that since the same processing method is uniformly adopted for all prediction units in the prior art, a new independent search is performed for each prediction unit, for example, for all The prediction units all use the same complexity search method, which makes the motion estimation of the video less flexible and leads to inefficiency of motion estimation.
  • a video motion estimation method is provided.
  • a video motion estimation method includes:
  • the image frame is subjected to sub-pixel motion estimation according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • a video motion estimation apparatus includes:
  • a dividing unit configured to divide an image frame in the video into a plurality of prediction units, and divide the plurality of prediction units into a first type prediction unit and a second type prediction unit;
  • a first acquiring unit configured to acquire a motion vector of the first type prediction unit according to a first search algorithm
  • a second acquiring unit configured to acquire a motion vector of the second type prediction unit according to a second search algorithm, where the second search algorithm is different from the first search algorithm
  • a motion estimation unit configured to perform motion estimation of the image frame according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • a terminal comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the processor, causing the one or more processors to perform the following step:
  • the image frame is subjected to sub-pixel motion estimation according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • One or more non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the following steps:
  • the image frame is subjected to sub-pixel motion estimation according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • FIG. 1 is a schematic diagram of a scenario of a video motion estimation system according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a video motion estimation method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a prediction unit obtained by dividing an image frame according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a diamond search template provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of performing two-point search around a to-be-set point according to an embodiment of the present application
  • FIG. 6 is a schematic diagram of searching according to a preset interval step according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a moving four-sided model provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a moving hexagonal model provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a motion vector search sequence of different prediction units according to an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of searching for a motion vector of a first type prediction unit according to an embodiment of the present application
  • FIG. 11 is a schematic flowchart of searching for a motion vector of a second type prediction unit according to an embodiment of the present application
  • FIG. 12 is a schematic structural diagram of a video motion estimation apparatus according to an embodiment of the present application.
  • FIG. 13 is another schematic structural diagram of a video motion estimation apparatus according to an embodiment of the present application.
  • FIG. 14 is another schematic structural diagram of a video motion estimation apparatus according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • Embodiments of the present application provide a video motion estimation method, apparatus, and system.
  • FIG. 1 is a schematic diagram of a scenario of a video motion estimation system according to an embodiment of the present disclosure.
  • the video motion estimation system may include a video motion estimation device, where the video motion estimation device may be integrated into a tablet computer, a mobile phone, or a notebook.
  • a terminal having a computing unit and having a computing unit capable of storing a computer, a desktop computer, and a television is mainly used for dividing an image frame in a video into a plurality of prediction units, and dividing the plurality of prediction units into the first a type prediction unit and a second type prediction unit; wherein the video may be locally acquired from a terminal or downloaded from a server, and the prediction unit may include a prediction unit A, a prediction unit B, a prediction unit C, a prediction unit D, and a prediction unit.
  • the first type prediction unit may include a plurality of prediction units such as prediction unit A, prediction unit B, and prediction unit C
  • the second type prediction unit may include prediction unit D and prediction unit E, and a plurality of prediction units such as prediction unit F.
  • the multilateral model can be obtained, and the current motion vector of the second type of prediction unit is obtained by moving the multilateral model; wherein the multilateral model can be a polygonal model such as a diamond or a hexagon.
  • the searched prediction unit may include at least one of the second type prediction unit and the second type prediction unit. Then, according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit, the image frame is subjected to sub-pixel motion estimation to obtain a motion estimation result;
  • the video motion estimation system may further include a server, and the video motion estimation device may download the video from the server.
  • the video motion estimation device may send a video acquisition request to the server, and receive a video about the video that the server feeds back based on the acquisition request. Documents, etc.
  • the scenario of the video motion estimation system shown in FIG. 1 is only an example.
  • the video motion estimation system and the scenario described in the embodiments of the present application are used to more clearly illustrate the technical solution of the embodiment of the present application, and
  • the technical solution provided by the embodiment of the present application is similar to the technical problem with the evolution of the video motion estimation system and the appearance of a new service scenario. Be applicable.
  • the video motion estimation apparatus may be specifically integrated in a terminal having a storage unit and a microprocessor having a computing capability, such as a computer, a mobile phone, and a television.
  • a video motion estimation method includes: dividing an image frame in a video into a plurality of prediction units, and dividing the plurality of prediction units into a first type prediction unit and a second type prediction unit; acquiring the first according to the first search algorithm a motion vector of the type prediction unit; acquiring a motion vector of the second type prediction unit according to the second search algorithm; performing motion estimation of the image frame according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit .
  • FIG. 2 is a schematic flowchart diagram of a video motion estimation method according to a first embodiment of the present application.
  • the video motion estimation method can include:
  • step S101 the image frame in the video is divided into a plurality of prediction units, and the plurality of prediction units are divided into a first type prediction unit and a second type prediction unit.
  • the video motion estimation device can acquire video from the local or the server.
  • the video needs to be inter-predictively coded.
  • each image frame in the video needs to be performed.
  • Motion estimation when performing motion estimation on an image frame, the image frame in the video may be divided into 2N ⁇ 2N, 2N ⁇ N, N ⁇ 2N, 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N by the inter prediction unit PU. And a plurality of prediction units such as nR ⁇ 2N, wherein, as shown in FIG.
  • 2N ⁇ 2N, 2N ⁇ N, and N ⁇ 2N are prediction units of a symmetric mode, for example, the 2N ⁇ N prediction unit includes the above 1
  • the ratio of 1: is divided into partitioned blocks with an index of 0 and an index of 1
  • 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N, and nR ⁇ 2N are prediction units of an asymmetric mode, for example, 2N ⁇ nD prediction units include The above ratio of 3:1 is divided into partitions with an index of 0 and an index of 1.
  • multiple prediction units may be divided into a first type prediction unit and a second type prediction unit.
  • the first type prediction unit may a prediction unit including a symmetric mode such as 2N ⁇ 2N, 2N ⁇ N, and N ⁇ 2N
  • the second type prediction unit may include a prediction unit of an asymmetric mode such as 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N, and nR ⁇ 2N. .
  • first and “second” and the like used in the embodiments of the present application are for the purpose of description only, and are not to be understood as indicating or implied importance, for example, the first type of prediction unit and
  • the second type of prediction unit is a prediction unit, the first type of prediction unit corresponds to one type of prediction unit, and the second type of prediction unit corresponds to another type of prediction unit, and does not describe the first type.
  • the prediction unit is more important than the second type prediction unit or the like.
  • step S102 the motion vector of the first type prediction unit is acquired according to the first search algorithm.
  • the video motion estimation apparatus may separately search for the motion vector of the prediction unit by using different search algorithms, for example, for the first type of prediction unit, the first search algorithm may be used to obtain the first A motion vector of a type of prediction unit; for the second type of prediction unit, a motion vector of the second type of prediction unit may be acquired according to a second search algorithm, wherein the first search algorithm is inconsistent with the second search algorithm, which will be described in detail below.
  • the step of acquiring the motion vector of the first type of prediction unit according to the first search algorithm may include:
  • the position of the second to-be-determined point is set as the motion vector of the first type prediction unit
  • the video motion estimation apparatus determines a starting search point (ie, a second starting search point), which may be specifically as follows:
  • the video motion estimation apparatus may acquire a second candidate start search point corresponding to the first type prediction unit by using Advanced Motion Vector Prediction (AMVP), wherein the AMVP technology mainly utilizes correlation between motion vectors in the airspace and the time domain.
  • AMVP Advanced Motion Vector Prediction
  • a candidate prediction MV list for the current prediction unit where there are multiple candidate prediction MVs, and the video motion estimation device may select a second candidate starting search point from the plurality of candidate prediction MV lists; or, video motion
  • the estimating device may also acquire the second candidate starting search point corresponding to the first type prediction unit by using the Merge mode.
  • the video motion estimation apparatus may calculate a rate distortion cost for each second candidate start search point, and set a second candidate start search point with the lowest rate distortion cost as the second start.
  • the search point that is, the second start search point is the final determined search point corresponding to the first type of prediction unit.
  • the video motion estimation device searches for a to-be-determined point (ie, a second to-be-determined point) within a search window, which may be as follows:
  • the video motion estimation device may search using a diamond template or a square template, as shown in FIG. 4, taking a diamond template as an example, and starting with a second starting search point as a center of the diamond template, starting with a search step length 1, according to FIG.
  • the diamond template is configured to acquire a plurality of second candidate points in a search window centered on the second initial search point according to the second preset incremental step, wherein the second preset incremental step size may be 2
  • the step size of the integer power is incremented, that is, starting with the search step length 1, and searching in the search steps of 2, 4, and 8, etc.
  • the corresponding search window range is the inner ring area of the diamond template corresponding to the search step length of 8; when the maximum search step length is set to 16, the corresponding search window The range is the inner ring area of the diamond template corresponding to the search step size 16; and so on.
  • a two-point search is performed around the to-be-determined point, which may be as follows:
  • the video motion estimation device may determine whether the search step corresponding to the second to-be-determined point is a second preset step, and the second preset step may be flexibly set according to actual needs, for example,
  • the second preset step size may be set to 1, that is, when the search step corresponding to the second to-be-determined point is 1, the second supplement that is not searched for each point corresponding to the second preset step may be acquired.
  • Point, the second supplemental point may include one or more points, as shown in FIG.
  • the search template for searching for the second to-be-determined point is a diamond template
  • the vertex corresponding to the diamond having the search step size of 1 is 2. 4
  • the AB two points can be added at the 2 position, and the AB two points can be set as the second supplement.
  • the CE two points can be added at the position of 4, and the CE point can be set as the second supplementary point; if the rate distortion is the least costly, the second is obtained.
  • the DF two points can be added at the position of 5, and the DF two points can be set as the second supplementary point; if the second to-be-determined point with the lowest rate distortion is 7, the position is 7
  • the position is complemented by two points of GH, and the two points of GH can be set as the second supplementary point.
  • the point where the screening rate distortion cost is the smallest from the second supplementary point and the second pending point may be as follows:
  • the video motion estimating device may calculate a rate distortion cost of each second supplemental point, compare the rate distortion cost of the second supplemental point with the rate distortion cost of the second to-be-determined point, and determine the second supplement Whether the point with the lowest rate distortion cost in the point and the second to-be-determined point is the second to-be-determined point.
  • the position of the second to-be-determined point is set as the motion vector of the first type prediction unit.
  • the position of the point where the rate-distortion cost of the second to-be-determined point and the second supplementary point is the smallest is set as the first type of prediction unit. Sport vector.
  • the step of setting the location of the second to-be-determined point as the motion vector of the first type prediction unit may include:
  • the video motion estimation device may correct the motion vector of the currently searched first type prediction unit according to the motion vector of the searched prediction unit in the image frame. Specifically, in the process of searching for the motion vector of each prediction unit, the video motion estimation apparatus may store the motion vector of the searched prediction unit, and may generate a mapping relationship between the prediction unit identifier and the motion vector.
  • the video motion estimation apparatus may acquire a mapping relationship corresponding to the searched prediction unit identifier, and acquire the searched prediction unit in the image frame according to the mapping relationship. a motion vector, and calculating a second target rate distortion cost of the corresponding position of the first type of prediction unit according to the motion vector of the searched prediction unit.
  • the corresponding position pointed to may be determined according to the motion vector of the searched prediction unit, and the corresponding position is calculated.
  • the rate-distortion penalty cost sets the calculated rate distortion cost of the corresponding position to the second target rate distortion cost.
  • the rate distortion penalty of the second pending point can then be compared to the second target rate distortion cost.
  • the motion vector of the searched prediction unit is set as the motion vector of the first type prediction unit, that is, the motion vector of the first type prediction unit is corrected to the searched The motion vector of the prediction unit. If the rate distortion penalty of the second to-be-determined point is less than or equal to the second target rate distortion cost, the location of the second to-be-determined point is set as the motion vector of the first type prediction unit.
  • the searched prediction unit may include one or more prediction units, which may include one or more prediction units of the first type of prediction unit in the image frame, or the searched prediction unit may include One or more prediction units of the second type of prediction unit in the image frame, or the searched prediction unit may include one or more prediction units of the first type of prediction unit in the image frame, and the second type in the image frame One or more prediction units of the prediction unit; and so on, the motion vector of the searched prediction unit may also include one or more.
  • the 2N ⁇ 2N prediction unit and 2N ⁇ N may be used when searching for the motion vector of the N ⁇ 2N prediction unit.
  • the motion vector of the prediction unit is corrected for the motion vector of the N ⁇ 2N prediction unit.
  • the second type prediction unit includes a third partitioning block and a fourth partitioning block, and acquires a second candidate starting search point corresponding to the first type of prediction unit, and calculates a rate distortion cost of each second candidate starting search point.
  • the step of setting the second candidate starting search point with the lowest rate distortion cost as the second starting search point may include:
  • the foregoing first type prediction unit may include a third partition block with an index of 0 and a fourth partition block with an index of 1, and the video motion estimation apparatus may separately search for the third partition block and the first type of the first type prediction unit.
  • the motion vector of the quadrant block when determining the start search point of the fourth partition in the first type of prediction unit, may refer to the motion vector of the third partition that has been searched to guide the search process of the current fourth partition, ie
  • the position corresponding to the motion vector of the searched third divided block may be utilized as one of the candidate start search points of the current fourth divided block.
  • the position corresponding to the motion vector of the searched fourth divided block is taken as the current One of the initial search points of the fourth divided block is explained as an example.
  • the video motion estimation apparatus may acquire, by using the AMVP technology, at least one second candidate start search point corresponding to the fourth partitioning block in the first type of prediction unit, in the process of searching for the fourth partitioning block in the first type of prediction unit, And determining whether the third partition in the first type of prediction unit has completed the search, that is, determining whether the third partition in the first type of prediction unit has been predicted to be completed.
  • the prediction result of the third partitioning block is obtained, and the prediction result may be a third partitioning block motion vector, and the prediction result of the third partitioning block may be calculated according to the prediction result of the third partitioning block.
  • the rate distortion cost of the location of the three-divided block is calculated according to the third partitioning block motion vector. For example, the corresponding position pointed to by the third partitioning block motion vector may be determined, and the corresponding position may be calculated.
  • the rate-distortion cost of the location sets the calculated rate distortion cost of the corresponding location to the rate-distortion penalty of the location of the third partition.
  • the index may be
  • the position corresponding to the motion vector in the prediction result corresponding to the divided block of 0 is one of the candidate starting search point positions of the divided block whose index is 1, so that the point at which the rate distortion cost is the smallest among the candidate starting search points can be selected.
  • the search point is started, so that the starting search point is closer to the optimal position of the motion estimation, and the search process can be exited faster.
  • the video motion estimation method may further include:
  • the search step corresponding to the second to-be-determined point is within the third preset step threshold range
  • the search is performed according to the preset interval step within the preset range centered on the second to-be-determined point, and multiple search points are obtained. , calculating the rate distortion cost of each search point;
  • the point that minimizes the rate distortion cost of the second to-be-determined point and the plurality of search points is used as the second initial search point, and returns to execute within the search window centered on the second initial search point according to the second preset incremental step size.
  • the video motion estimation apparatus may determine whether the search step corresponding to the second to-be-determined point is within a third preset step threshold range, where the third preset step threshold range may be Flexible settings according to actual needs.
  • the distance from the point where the rate distortion cost is the smallest to the center of the search window range can be obtained, and it is determined whether the distance is within the first preset distance threshold range, and the preset distance threshold range can be flexibly set according to actual needs, for example, the first A predetermined distance threshold range may be greater than or equal to 5 and less than or equal to 8.
  • the search step corresponding to the second to-be-determined point is within the third preset step threshold range (or the distance from the point where the rate distortion cost is the smallest to the center of the search window range is within the first preset distance threshold)
  • the search is performed according to the preset interval step, and multiple search points are obtained.
  • the preset range and the preset interval step size can be flexibly set according to actual needs, and the specific value is here. There is no limit. For example, the preset interval step size may be set to be 5 steps per row and column. As shown in FIG. 6 , in the search window centered on the second to-be-determined point, each interval is performed by raster scanning.
  • the search window range can be flexibly set according to actual needs, for example, It can be 128 rows x 128 columns.
  • the rate distortion cost of each search point is calculated, and the point of the second to-be-determined point and the plurality of search points with the lowest rate distortion cost is used as the second starting search point, and the execution is performed according to the second preset incremental step size.
  • the video motion estimation method may further include:
  • the second to-be-determined point is used as the second initial search point, and the return execution is performed according to the second preset incremental step.
  • the video motion estimation apparatus may determine whether the search step corresponding to the second to-be-determined point is within a fourth preset step threshold range, where the fourth preset step threshold range may be Flexible settings according to actual needs.
  • the distance from the point where the rate distortion cost is the smallest to the center of the search window range can be obtained, and it is determined whether the distance is within the second preset distance threshold range, and the second preset distance threshold range can be flexibly set according to actual needs, for example, Can be greater than 1 and less than 5.
  • the second The to-be-determined point is used as the second starting search point, and returns to perform acquiring a plurality of second candidate points within a search window centering on the second starting search point according to the second preset incremental step, and calculating each second candidate The rate distortion cost of the point, the point where the rate distortion cost is the smallest from the plurality of second candidate points, the step of obtaining the second to-be-determined point.
  • step S103 the motion vector of the second type prediction unit is acquired according to the second search algorithm.
  • the video motion estimation apparatus may acquire the motion vector of the second type of prediction unit by using the second search algorithm.
  • the step of acquiring the motion vector of the second type prediction unit according to the second search algorithm may include: acquiring the polygon model according to the second search algorithm, and acquiring the current motion vector of the second type prediction unit by moving the polygon model Obtaining a motion vector of the searched prediction unit in the image frame, and correcting the current motion vector according to the motion vector of the searched prediction unit to obtain a motion vector of the second type prediction unit.
  • the step of acquiring the polygon model according to the second search algorithm and acquiring the current motion vector of the second type prediction unit by moving the polygon model may include:
  • the most advantageous location is set as the current motion vector of the second type prediction unit.
  • the video motion estimation apparatus may acquire the first candidate start search point corresponding to the second type prediction unit by using the AMVP technology, filter the first start search point from the first candidate start search point, and then use the first start search point. Searching for the center of the diamond template or the square template, obtaining a plurality of first candidate points, and filtering the first to-be-determined points from the plurality of first candidate points.
  • the video motion estimation device may determine whether the search step corresponding to the first to-be-determined point is within a first preset step threshold range, where the first preset step threshold range may be according to actual needs. Make flexible settings.
  • the search step of the first to-be-determined point is within the first preset step threshold range, the polygon model is acquired, wherein the polygon model may be a quadrangle or a hexagon or the like.
  • the video motion estimation device may acquire the first target point according to the multilateral model. For example, the video motion estimation device may calculate the rate distortion cost of the center of the polygon model and the position of each vertex, and the center and each vertex of the polygon model. The point at which the mid-rate distortion cost is the smallest is set as the first target point.
  • the video motion estimation device may determine whether the first target point is consistent with the first to-be-determined point. When the first target point is inconsistent with the first to-be-determined point, the first target point may not be the most The advantage that the first target point may have the best advantage that the rate distortion cost is smaller than the rate distortion cost of the first target point.
  • the multilateral model is moved, and the best advantage is obtained according to the moved multilateral model. It is the point where the rate distortion is the least cost in the moving multilateral model.
  • the step of moving the multilateral model and obtaining the most advantageous according to the moved multilateral model may include: when the first target point is inconsistent with the first pending point, The center of the multilateral model moves to the position where the first target point is located; the best advantage is obtained from the center of the moving multilateral model and the point where the screening rate distortion is the lowest among the vertices.
  • the polygon model preserves the original shape after moving, for example, the center of the polygon model can be moved to the position of the first target point. Then calculate the rate distortion cost of the center of the moving polygon model and the position of each vertex, and set the center of the moving polygon model and the point where the rate distortion cost of each vertex is the smallest.
  • the video motion estimation device can determine whether the best advantage is consistent with the first target point. If the most advantageous point is consistent with the first target point, the most advantageous location is set as the current motion vector of the second type prediction unit.
  • the video motion estimation method may further include: setting the location of the first target point to the second type prediction when the first target point is consistent with the first pending point The current motion vector of the unit.
  • the polygon model is a diamond model
  • the rate distortion cost of the center of the diamond model and the vertices of the upper, lower, left, and right sides is calculated in FIG. 7(a)
  • the point at which the rate distortion cost is the smallest is obtained.
  • move the center of the diamond model to the position of the right vertex as shown in Figure 7(b).
  • the center of the diamond model is moved to the position where the lower vertex is located, as shown in Fig. 7(c), at which time the calculated diamond model is calculated.
  • Rate distortion cost of the center and the vertices of the top, bottom, left, and right If the point at which the rate distortion cost is the smallest is the position of the lower vertex of the diamond model, the center of the diamond model is moved to the position where the lower vertex is located, as shown in Fig. 7(d), at which time the calculated diamond model is calculated. Rate distortion cost of the center and the vertices of the top, bottom, left, and right.
  • the diamond model is no longer moved, and the center position of the diamond model (ie, the most advantageous position) is set to The current motion vector of the second type of prediction unit.
  • the first to-be-determined point in the second type of prediction unit is obtained according to the second search algorithm, and when the search step of the first to-be-determined point is within the first preset step threshold, the first is acquired.
  • the multilateral model to be centered on the point, the steps of obtaining the first target point according to the multilateral model may include:
  • the first target point is obtained by selecting the point where the rate distortion cost is the smallest among the midpoints of the multilateral model and each vertex.
  • the video motion estimation apparatus may acquire the first candidate start search point corresponding to the second type prediction unit by using the AMVP technology, calculate a rate distortion cost of the first candidate start search point, and set a point where the rate distortion cost is the smallest. a starting search point, and then searching with the first starting search point as the center of the diamond template or the square template, obtaining a plurality of first candidate points, calculating a rate distortion cost of each first candidate point, from the plurality of first candidate points The point in which the screening rate distortion is the least expensive is set as the first to-be-determined point.
  • the video motion estimation device may determine whether the search step corresponding to the first to-be-determined point is within a first preset step threshold range, where the first preset step threshold range may be according to actual needs. Make flexible settings.
  • a polygonal model such as a quadrilateral or a hexagon centered on the first to-be-determined point is acquired.
  • the video motion estimation device can calculate the rate distortion cost of the center of the polygon model and the position of each vertex, and set the center of the polygon model and the point where the rate distortion cost of each vertex is the smallest as the first target point.
  • the video motion estimation device can also calculate the rate distortion cost of the center of the polygon model, the positions of the vertices and the midpoint of each edge (or the position of the three bisectors of each edge), and set the point at which the rate distortion cost is the smallest. The first target point.
  • the step of obtaining the lowest rate distortion cost in the second type of prediction unit according to the second search algorithm, the step of obtaining the first to-be-determined point may include:
  • a point where the rate distortion cost is the smallest is selected from the plurality of first candidate points, and the first to-be-determined point is obtained.
  • the video motion estimation apparatus may acquire the first candidate start search point corresponding to the second type prediction unit by using the AMVP technology or the Merge mode, and then calculate a rate distortion cost of each first candidate start search point, and the rate is distorted.
  • the first candidate starting search point with the lowest cost is set as the first starting search point, that is, the first starting search point is the final determined starting search point corresponding to the second type prediction unit.
  • the video motion estimation device may search for a plurality of first candidate points within a search window centered on the first start search point according to the first preset incremental step size, where the search window range may Is the search range of the diamond template or the square template.
  • the search window range may be the inner ring area corresponding to the largest search step of the diamond template or the square template, for example, when the maximum search step size of the diamond template is set to 8, corresponding
  • the search window range is the inner ring area of the diamond template corresponding to the search step size of 8;
  • the first preset incremental step size may be a step size incremented by an integer power of 2, or may be flexibly set according to actual needs.
  • the first starting search point is the center of the diamond template, starting with the search step length 1, and searching according to the step size increasing by the integer power of 2, obtaining multiple firsts.
  • the candidate point may be a vertex of the diamond template corresponding to each search step, a midpoint between the two vertices, and the like, as shown by the marked five-pointed star in FIG. Then, calculating a rate distortion cost of each first candidate point, selecting a point with the lowest rate distortion cost from the plurality of first candidate points, and setting a point at which the rate distortion cost of the plurality of first candidate points is the smallest to be the first to be determined point.
  • the second type prediction unit includes a first partitioning block and a second partitioning block, and acquires a first candidate starting search point corresponding to the second type of prediction unit according to the second search algorithm, and calculates each first candidate.
  • the rate distortion cost of the initial search point, the step of setting the first candidate start search point with the lowest rate distortion cost as the first start search point may include:
  • a point at which the obtained rate distortion cost is minimized is set as a start search point of the second divided block in the second type prediction unit, and a start search point of the second divided block is set as the first start search point.
  • the foregoing second type prediction unit may include a first partition block with an index of 0 and a second partition block with an index of 1, and the video motion estimation apparatus may separately search for the first partition block and the first type of the second type prediction unit.
  • the motion vector of the second partition block when determining the start search point of the second partition block in the second type prediction unit, may refer to the motion vector of the searched first partition block to guide the current fourth partition block search process, ie The position corresponding to the motion vector of the searched first divided block may be utilized as one of the starting search points of the current second divided block.
  • the position corresponding to the motion vector of the searched second divided block is taken as the current One of the initial search points of the second divided block is explained as an example.
  • the video motion estimation apparatus may acquire, by using the AMVP technology, at least one first candidate start search point corresponding to the second partitioning block in the second type of prediction unit, in the process of searching for the second partitioning block in the second type of prediction unit, And determining whether the first segmentation block in the second type prediction unit has completed the search, that is, determining whether the first segmentation block in the second type prediction unit has predicted completion.
  • the prediction result of the first partitioning block is obtained, and the prediction result may be the predicted first partitioning block motion vector, which may be calculated according to the prediction result of the first partitioning block.
  • the rate distortion cost of the location of the first partition block is calculated according to the first partition block motion vector. For example, the corresponding position pointed to by the first partition block motion vector may be determined, and the Corresponding to the rate distortion cost of the location, the calculated rate distortion cost of the corresponding location is set to the rate distortion cost of the location of the first partition.
  • the index may be
  • the position of the motion vector in the prediction result corresponding to the partitioned block of 0 is one of the candidate starting search point positions of the divided block whose index is 1, so that the point at which the rate distortion cost is the smallest among the candidate starting search points can be selected.
  • the search point is started, so that the starting search point is closer to the optimal position of the motion estimation, and the search process can be exited faster.
  • the video motion estimation method may further include:
  • the search step corresponding to the first to-be-determined point is the first preset step
  • the first supplement point that is not searched around each point corresponding to the first preset step is acquired, and the first supplementary point is calculated.
  • the location of the first to-be-determined point is set as the current motion vector of the second type prediction unit
  • the position of the point where the rate-distortion cost of the first to-be-determined point and the first supplementary point is the smallest is set as the second type prediction unit. Current motion vector.
  • the video motion estimation apparatus may determine whether the search step corresponding to the first to-be-determined point is a first preset step, where the first preset step size may be performed according to actual needs.
  • the first preset step size may be set to 1, that is, when the search step corresponding to the first to-be-determined point is 1, the step size may be obtained for each point corresponding to the first preset step.
  • the second supplemental point of the search, the second supplemental point may include one or more points, as shown in FIG.
  • the search template for searching for the second to-be-determined point is a diamond template
  • the vertex corresponding to the diamond having the search step size of 1 is 2. 4
  • the AB two points can be added at the 2 position, and the AB two points can be set as the second supplement.
  • the DF two points are added at the position of 5, and the DF two points can be set as the second supplementary point;
  • the video motion estimation device may calculate a rate distortion cost of the first supplemental point, compare the rate distortion cost of the first supplemental point with a rate distortion cost of the first to-be-determined point, and determine the first supplemental point and Whether the point at which the rate distortion cost is the smallest in the first to-be-determined point is the first to-be-determined point.
  • the position of the first to-be-determined point is set as the current motion vector of the second type prediction unit.
  • the position of the point where the rate-distortion cost of the first to-be-determined point and the first supplementary point is the smallest is set as the second type prediction unit. Current motion vector.
  • the video motion estimation method may further include:
  • the search step corresponding to the first to-be-determined point is within the second preset step threshold range, the first to-be-determined point is set as the first initial search point, and the return execution is performed according to the first preset incremental step.
  • the search point is a step of searching for a plurality of first candidate points within a search window centered on the center.
  • the video motion estimation apparatus may determine whether the search step corresponding to the first to-be-determined point is within a second preset step threshold range, where the second preset step threshold range may be Flexible settings according to actual needs.
  • the search step corresponding to the first to-be-determined point is within the second preset step threshold range
  • the first to-be-determined point is set as the first initial search point, and the return execution is performed according to the first preset incremental step.
  • the search point is a step of searching for a plurality of first candidate points within a search window centered on the center, and calculating a rate distortion cost for each of the first candidate points.
  • the video motion estimation device may acquire the motion vector of the searched prediction unit in the image frame, and correct the current motion vector according to the motion vector of the searched prediction unit, so that the second type can be obtained.
  • the motion vector of the prediction unit can be specifically as follows.
  • the video motion estimation apparatus may acquire a motion vector of the searched prediction unit in the image frame, wherein the searched prediction unit may include one or more prediction units, the searched prediction unit One or more prediction units of the first type of prediction unit in the image frame may be included, or the searched prediction unit may include one or more prediction units of the second type of prediction unit in the image frame, or the searched prediction unit One or more prediction units of the first type of prediction unit in the image frame may be included, as well as one or more prediction units of the second type of prediction unit in the image frame. Then, the current motion vector is corrected according to the motion vector of the searched prediction unit, and the motion vector of the second type prediction unit is obtained.
  • the motion vector of the searched prediction unit in the image frame is obtained, and the current motion vector is corrected according to the motion vector of the searched prediction unit, and the step of obtaining the motion vector of the second type of prediction unit may include:
  • the position of the current rate distortion cost corresponding point is set as the motion vector of the second type prediction unit.
  • the video motion estimation apparatus may correct the current motion vector of the currently searched second type prediction unit according to the motion vector of the searched prediction unit in the image frame. Specifically, in the process of searching for the motion vector of each prediction unit, the video motion estimation apparatus may store the motion vector of the searched prediction unit, and may generate a mapping relationship between the prediction unit identifier and the motion vector.
  • the video motion estimation apparatus may acquire a mapping relationship corresponding to the searched prediction unit identifier, and acquire the searched prediction unit in the image frame according to the mapping relationship. a motion vector, and calculating a first target rate distortion cost of the corresponding position of the second type prediction unit according to the motion vector of the searched prediction unit. For example, the corresponding position pointed to may be determined according to the motion vector of the searched prediction unit, and the corresponding position is calculated. The rate-distortion penalty cost sets the calculated rate distortion cost of the corresponding position to the first target rate distortion cost.
  • the video motion estimation device can then compare the current rate distortion cost of the second type of prediction unit to the first target rate distortion cost. If the current rate distortion cost of the second type prediction unit is greater than the first target rate distortion cost, the motion vector of the searched prediction unit is set as the motion vector of the second type prediction unit; if the current rate distortion cost of the second type prediction unit If the first target rate distortion cost is less than or equal to, the position of the current rate distortion cost corresponding point is set as the motion vector of the second type prediction unit.
  • the video motion estimation apparatus is a 2N ⁇ 2N prediction unit, a 2 ⁇ N prediction unit, an N ⁇ 2N prediction unit, a 2N ⁇ nU prediction unit, a 2N ⁇ nD prediction unit, and an nL ⁇ 2N prediction unit.
  • the nR ⁇ 2N prediction unit and the like sequentially search for the motion vector corresponding to each prediction unit, and when the 2N ⁇ nD prediction unit is currently searched, the 2N ⁇ 2N prediction unit, the 2N ⁇ N prediction unit, and the N that have been searched before may be utilized.
  • the motion vector of the ⁇ 2N prediction unit and the 2N ⁇ nU prediction unit corrects the motion vector of the currently searched 2N ⁇ nD prediction unit.
  • step S104 the image frame is subjected to sub-pixel motion estimation according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • the video motion estimation apparatus may perform pixel division on the image frame according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • the motion estimation wherein the obtained motion vector of the first type prediction unit and the motion vector of the second type prediction unit are mainly integer pixel motion vectors obtained by performing full pixel motion prediction (ie, integer pixel search) on the image frame.
  • full pixel motion prediction ie, integer pixel search
  • the video motion estimation apparatus may perform a half-pixel search and a quarter-pixel precision search according to the motion vector obtained by the whole pixel motion prediction to obtain an accurate motion vector.
  • the motion compensation processing is performed on the prime precision motion vector.
  • the obtained precision motion vector is subjected to discrete cosine transform (DCT) and quantization to obtain a residual coefficient. Then, the obtained residual coefficient is sent to the entropy coding module to output the code stream. At the same time, after the residual coefficient is inversely quantized and inverse transformed, the residual value of the reconstructed image is obtained, and then the reconstructed image is obtained according to the residual value, and the weight is After the image is filtered by the in-loop, it enters the reference frame queue as the reference image of the next frame, so that one frame is backward encoded.
  • DCT discrete cosine transform
  • the embodiment of the present application may divide an image frame in a video into multiple prediction units, and classify the multiple prediction units, for example, divide the multiple prediction units into a first type prediction unit and a second type prediction. unit.
  • Obtaining motion vectors of different types of prediction units by using different search algorithms for different types of prediction units for example, acquiring motion vectors of the first type prediction unit according to the first search algorithm, and acquiring the second type prediction unit according to the second search algorithm Motion vector.
  • the image frame may be subjected to sub-pixel motion estimation according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • the scheme can classify a plurality of prediction units and use different search algorithms to obtain motion vectors of different types of prediction units, the search efficiency is high, and therefore, the same is adopted uniformly for different prediction units in the prior art.
  • the processing method improves the efficiency and flexibility of motion estimation for video.
  • the video motion estimation apparatus described above can be integrated in a terminal having a storage unit and a microprocessor with a computing capability, such as a computer, a mobile phone, and a television.
  • a computing capability such as a computer, a mobile phone, and a television. The following description will be made from the perspective of the terminal.
  • the terminal may acquire video from the local or server, and divide the image frame in the video into 2N ⁇ 2N, 2N ⁇ N, N ⁇ 2N, 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N, and nR ⁇ by the inter prediction unit PU. Multiple prediction units such as 2N.
  • the 2N ⁇ N prediction unit includes a ratio of the above 1:1 to be divided into partitions with an index of 0 and an index of 1
  • the N ⁇ 2N prediction unit includes an index divided by a ratio of 1:1 to the left and right.
  • the 2N ⁇ nU prediction unit includes a ratio of the above 1:3 divided into partitions with an index of 0 and an index of 1
  • the 2N ⁇ nD prediction unit includes a ratio of the above 3:1.
  • the nL ⁇ 2N prediction unit includes a partitioned block with an index of 0 and an index of 1 in a ratio of 1:3 to the left and right, and the nR ⁇ 2N prediction unit includes 3:1 of the left and right.
  • the scale is divided into partitions with an index of 0 and an index of 1.
  • the terminal may divide the obtained multiple prediction units into a first type prediction unit and a second type prediction unit according to symmetry, and the first type prediction unit may include symmetry such as 2N ⁇ 2N, 2N ⁇ N, and N ⁇ 2N.
  • the prediction unit of the mode, the second type prediction unit may include prediction units of an asymmetric mode such as 2N ⁇ nU, 2N ⁇ nD, nL ⁇ 2N, and nR ⁇ 2N.
  • the terminal may separately search for the motion vector of the prediction unit by using different search algorithms, which will be described in detail below.
  • FIG. 10 is a schematic flowchart of searching for a motion vector of a first type of prediction unit according to an embodiment of the present application.
  • the method flow can include:
  • the terminal acquires a second candidate start search point corresponding to the first type prediction unit, and sets a second candidate start search point with the lowest rate distortion cost as the second start search point.
  • the terminal may acquire one or more second candidate starting search points by using the AMVP technology or the Merge mode, calculate a rate distortion cost of each second candidate starting search point, and set a second candidate starting search point with the lowest rate distortion cost.
  • the second starting search point that is, the second starting search point is the final determined starting search point corresponding to the first type prediction unit.
  • the first type prediction unit may include a third partition block with an index of 0 and a fourth partition block with an index of 1, and the terminal may separately search for the third partition block and the fourth partition block of the first type prediction unit.
  • a motion vector when determining a starting search point of the fourth divided block in the first type of prediction unit, using a position corresponding to the motion vector of the searched third divided block as a candidate starting search point of the current fourth divided block One.
  • the terminal may acquire, by using the AMVP technology, at least one second candidate starting search point corresponding to the fourth partitioning block in the first type of prediction unit, and determine Whether the third partition in a type of prediction unit has been predicted to be completed.
  • the predicted third divided block motion vector is obtained, and the predicted point corresponding to the predicted third divided block motion vector is determined, and each second candidate is calculated. The rate distortion cost of the search point and the third partition.
  • the index may be
  • the position corresponding to the motion vector in the prediction result corresponding to the divided block of 0 is one of the candidate starting search point positions of the divided block whose index is 1, so that the point at which the rate distortion cost is the smallest among the candidate starting search points can be selected.
  • the search point is started, so that the starting search point is closer to the optimal position of the motion estimation, and the search process can be exited faster.
  • the terminal acquires multiple second candidate points in a search window centering on the second initial search point according to the second preset incremental step, and selects a point with the lowest rate distortion cost from the plurality of second candidate points. , get the second to-be-determined point.
  • the terminal may use a diamond template or a square template to perform a search in the search window centered on the second starting search point according to the second preset incremental step, and obtain multiple numbers. Two candidate points.
  • the second starting search point is the center of the square template, starting with the search step length 1 and following the second preset incremental step size in the search window range centered on the second starting search point.
  • a plurality of second candidate points are obtained, wherein the second preset incremental step size may be incremented by an integer power of 2, that is, starting with a search step of 1 and sequentially searching for steps 2, 4, and 8, etc.
  • the search is performed to obtain a plurality of second candidate points, which may be the vertices of the square template corresponding to each search step, the points corresponding to the quarters between the two vertices, and the like.
  • the corresponding search window range is the inner ring area of the square template corresponding to the search step length of 8; when the maximum search step length is set to 16, the corresponding search window The range is the inner ring area of the square template corresponding to the search step size 16; and so on.
  • the terminal acquires the second supplementary point that is not searched for each point corresponding to the second preset step.
  • the terminal may determine whether the search step corresponding to the second to-be-determined point is a second preset step, and the second preset step may be flexibly set according to actual needs, for example, The two preset steps are set to 1 or 2, and so on.
  • the terminal acquires the second supplementary point that is not searched around each point corresponding to the second preset step.
  • the search template for searching for the second to-be-determined point is a square template
  • the vertex corresponding to the square with the search step size of 1 is 1, 3, 6, 8
  • These four points, 2, 4, 5, 7 are the midpoints of each side of the square.
  • the AC two points are added at the position of 1 to set the AC two points as the second supplementary point; if the rate distortion cost is the smallest If the two to-be-determined points are 2, the two points of AB are added at the position of 2, and the two points of AB can be set as the second supplementary point; if the second to-be-determined point with the lowest rate distortion is 3, the position is 3
  • the location of the BD is two points, and the two points of the BD can be set as the second supplementary point; if the second to-be-determined point with the lowest rate distortion is 4, the CE can be made at the position of 4, and the CE can be used.
  • the two points are set as the second supplementary point; if the second to-be-determined point with the lowest rate distortion cost is 5, the DF two points are added at the position of 5, and the DF two points can be set as the second supplementary point;
  • the second to-be-determined point with the lowest rate distortion cost is 6 position, then the EG two points are complemented at the 6 position, and the EG two points can be set as the second supplementary point; if the second distortion point with the lowest rate distortion cost is 7 At the location, you can make two points of GH at the location of 7 Set the two points of GH as the second supplementary point; if the second to-be-determined point with the lowest rate distortion is 8, the two points of FH can be added at the position of 8 and the two points of FH can be set as the second supplementary point.
  • step S204 The terminal determines whether the point where the rate distortion cost of the second to-be-determined point and the second supplementary point is the smallest is the second to-be-determined point; if yes, step S205 is performed; if not, step S206 is performed.
  • the terminal may calculate a rate distortion cost of each second supplemental point, compare the rate distortion cost of the second supplemental point with the rate distortion cost of the second to-be-determined point, and determine the second supplemental point and the Whether the point with the lowest rate distortion cost in the two to-be-determined points is the second to-be-determined point.
  • the terminal sets a location of the second to-be-determined point as a motion vector of the first type prediction unit, and corrects the motion vector.
  • the terminal sets the location of the second to-be-determined point as the motion vector of the first type prediction unit.
  • the terminal sets the position of the point where the rate-distortion cost of the second to-be-determined point and the second supplementary point is the smallest as the first type of image. The motion vector of the block.
  • the terminal may correct the motion vector of the first type of prediction unit. Specifically, the terminal may store the motion vector of the searched prediction unit in the process of searching for the motion vector of each prediction unit, and may generate a prediction. The mapping relationship between unit identification and motion vector.
  • the terminal may acquire a mapping relationship corresponding to the searched prediction unit identifier, and acquire a motion vector of the searched prediction unit in the image frame according to the mapping relationship.
  • a second target rate distortion cost of the first type of prediction unit is calculated based on the motion vector of the searched prediction unit.
  • the rate distortion penalty of the second pending point can then be compared to the second target rate distortion cost.
  • the motion vector mv_ref of the searched prediction unit is set to the motion vector mv_best of the first type prediction unit, that is, the motion vector of the first type prediction unit.
  • the motion vector of each prediction unit may be named in advance, and the naming algorithm may be: mv_best_prediction unit type_prediction unit index, such as mv_best_2N ⁇ N_PU1, indicating that the motion vector of the index is 1 partition in the 2N ⁇ N prediction unit .
  • mv_best_prediction unit type_prediction unit index such as mv_best_2N ⁇ N_PU1
  • the motion vector of the index is 1 partition in the 2N ⁇ N prediction unit .
  • the terminal performs the search according to the preset interval step within the preset range centered on the second to-be-determined point, and obtains more For each search point, the point that minimizes the rate distortion cost of the second to-be-determined point and the plurality of search points is used as the second initial search point, and the process returns to step S202.
  • the terminal may determine whether the search step corresponding to the second to-be-determined point is within a third preset step threshold range, where the third preset step-length threshold range may be flexibly set according to actual needs.
  • the specific value is not limited here.
  • the search is performed according to the preset interval step within the preset range centered on the second to-be-determined point, and multiple search points are obtained.
  • the preset range and the preset interval step size can be flexibly set according to actual needs, and the specific values are not limited herein. For example, as shown in FIG. 6, in the search window centered on the second to-be-determined point, all points are scanned every 5 rows and 5 columns in a raster scan manner to obtain a plurality of search points.
  • the rate distortion cost of each search point is calculated, and the point of the second to-be-determined point and the plurality of search points with the lowest rate distortion cost is used as the second starting search point, and the execution is performed according to the second preset incremental step size.
  • a plurality of second candidate points are obtained within a search window centered on the starting search point, and a point with the lowest rate distortion cost is selected from the plurality of second candidate points to obtain a second to-be-determined point.
  • the terminal uses the second to-be-determined point as the second initial search point, and returns to step S202.
  • the terminal may determine whether the search step corresponding to the second to-be-determined point is within a fourth preset step threshold range, where the fourth preset step-length threshold range may be flexibly set according to actual needs.
  • the specific content is not limited here.
  • the search step corresponding to the second to-be-determined point is within the fourth preset step threshold range, the second to-be-determined point is used as the second initial search point, and the return execution is performed according to the second preset incremental step.
  • a plurality of second candidate points are acquired within a search window centered on the search point, and a point with the lowest rate distortion cost is selected from the plurality of second candidate points to obtain a second to-be-determined point.
  • FIG. 11 is a schematic flowchart of searching for a motion vector of a second type of prediction unit according to an embodiment of the present application.
  • the method flow can include:
  • the terminal acquires a first candidate start search point corresponding to the second type prediction unit, and sets a first candidate start search point with a minimum rate distortion cost as the first start search point.
  • the terminal may acquire the first candidate starting search point corresponding to the second type prediction unit by using the AMVP technology or the Merge mode, and then calculate the rate distortion cost of each first candidate starting search point, and the first candidate with the lowest rate distortion cost.
  • the starting search point is set as the first starting search point, that is, the first starting search point is the final determined starting search point corresponding to the second type prediction unit.
  • the second type prediction unit may include a first partition block with an index of 0 and a second partition block with an index of 1, and the terminal may separately search for the first partition block and the second partition block of the second type prediction unit.
  • a motion vector when determining a starting search point of the second divided block in the second type of prediction unit, using a position corresponding to the motion vector of the searched first divided block as one of the starting search points of the current second divided block .
  • the terminal may acquire, by using the AMVP technology, at least one first candidate starting search point corresponding to the second partitioning block in the second type of prediction unit, and determine Whether the first divided block in the two types of prediction units has been searched for is determined whether or not the first divided block in the second type of prediction unit has been predicted to be completed.
  • the predicted first divided block motion vector is obtained, and the predicted point corresponding to the predicted first divided block motion vector is determined, and each first candidate is calculated. The rate of distortion of the first search point and the first partition.
  • the start search point is set to the second start search point to execute step S302.
  • the index may be The position of the motion vector corresponding to the divided block of 0 is one of the candidate starting search point positions of the divided block whose index is 1, so that the point with the lowest rate distortion cost can be selected from the candidate starting search points as the starting search point. This brings the starting search point closer to the optimal position of the motion estimation and can exit the search process faster.
  • the terminal acquires a plurality of first candidate points in a search window centering on the first starting search point according to the first preset incremental step, and selects a point with the lowest rate distortion cost from the plurality of first candidate points. Get the first to-be-determined point.
  • the terminal may search for a plurality of first candidate points within a search window centered on the first starting search point according to the first preset incremental step, wherein the search window range may be a diamond template Or the search range of the square template, for example, the search window range may be the inner ring area corresponding to the largest search step of the diamond template or the square template, for example, when the maximum search step size of the diamond template is set to 8, the corresponding search window range That is, the inner loop area of the diamond template corresponding to the search step length is 8; the first preset incremental step size may be a step size incremented by an integer power of 2, or may be flexibly set according to actual needs.
  • the search window range may be a diamond template Or the search range of the square template, for example, the search window range may be the inner ring area corresponding to the largest search step of the diamond template or the square template, for example, when the maximum search step size of the diamond template is set to 8, the corresponding search window range That is, the inner loop area of the diamond template corresponding to the search
  • the first starting search point is the center of the square template, starting with the search step length 1, and searching according to the first starting search point according to the search step size increasing by the integer power of 2 Searching a plurality of first candidate points in the window range to obtain a plurality of first candidate points, where the first candidate points may be vertices of a square template corresponding to each search step, points corresponding to four equal divisions between two vertices, and the like .
  • the terminal acquires a multilateral model centered on the first to-be-determined point, and selects a rate distortion cost from a midpoint of the polygon model and each vertex. The smallest point, the first target point.
  • the terminal may determine whether the search step corresponding to the first to-be-determined point is within a first preset step threshold, where the first preset step threshold range may be flexibly set according to actual needs.
  • the specific value is not limited here.
  • the terminal acquires a multilateral model centered on the first to-be-determined point, and the polygon model may be a quadrangle or a hexagon.
  • the terminal can calculate the rate distortion cost of the center of the polygon model and the position of each vertex, and set the center of the polygon model and the point with the lowest rate distortion cost among the vertices as the first target point.
  • the terminal sets the location of the first target point to the current motion vector of the second type prediction unit, and corrects the current motion vector to obtain the second type prediction unit. Motion vector.
  • the terminal may determine whether the first target point is consistent with the first to-be-determined point. When the first target point is consistent with the first to-be-determined point, the terminal may set the location of the first target point to be the second. The current motion vector of the type prediction unit.
  • the terminal may acquire a motion vector of the searched prediction unit in the image frame, wherein the searched prediction unit may include one or more prediction units, and according to the motion of the searched prediction unit The vector corrects the current motion vector of the second type prediction unit to obtain a motion vector of the second type prediction unit.
  • the terminal may store the motion vector of the searched prediction unit, and may generate a mapping relationship between the prediction unit identifier and the motion vector.
  • the terminal may acquire a mapping relationship corresponding to the searched prediction unit identifier, and acquire a motion vector of the searched prediction unit in the image frame according to the mapping relationship.
  • a first target rate distortion cost of the second type of prediction unit is calculated based on the motion vector of the searched prediction unit.
  • the terminal can then compare the current rate distortion penalty of the second type of prediction unit to the first target rate distortion cost. If the current rate distortion cost of the second type prediction unit is greater than the first target rate distortion cost, the motion vector of the searched prediction unit is set as the motion vector of the second type prediction unit; if the current rate distortion cost of the second type prediction unit If the first target rate distortion cost is less than or equal to, the position of the current rate distortion cost corresponding point is set as the motion vector of the second type prediction unit.
  • the motion vector of each prediction unit may be named in advance, and the naming algorithm may be: mv_best_prediction unit type_prediction unit index, such as mv_best_2N ⁇ N_PU1, indicating that the motion vector of the index is 1 partition in the 2N ⁇ N prediction unit .
  • the motion vector of the searched prediction unit in the image frame may include: ⁇ mv_best_2N ⁇ 2N_PU0, mv_best_2N ⁇ 2N_PU1 ⁇ .
  • the motion vector of the searched prediction unit in the image frame may include: ⁇ mv_best_2N ⁇ 2N_PU0, mv_best_2N ⁇ 2N_PU1, mv_best_2N ⁇ N_PU0, mv_best_2N ⁇ N_PU1 ⁇ .
  • the motion vector of the searched prediction unit in the image frame may include: ⁇ mv_best_2N ⁇ 2N_PU0, mv_best_2N ⁇ 2N_PU1, mv_best_2N ⁇ N_PU0, mv_best_2N ⁇ N_PU1, mv_best_N ⁇ 2N_PU0, mv_best_N ⁇ 2N_PU1 ⁇ .
  • the motion vector of the searched prediction unit in the image frame may include: ⁇ mv_best_2N ⁇ 2N_PU0, mv_best_2N ⁇ 2N_PU1, mv_best_2N ⁇ N_PU0, mv_best_2N ⁇ N_PU1, mv_best_N ⁇ 2N_PU0, mv_best_N ⁇ 2N_PU1, mv_best_2N ⁇ nU_PU0, mv_best_2N ⁇ nU_PU1 ⁇ .
  • the motion vector of the searched prediction unit in the image frame may include: ⁇ mv_best_2N ⁇ 2N_PU0, mv_best_2N ⁇ 2N_PU1, mv_best_2N ⁇ N_PU0, mv_best_2N ⁇ N_PU1, mv_best_N ⁇ 2N_PU0, mv_best_N ⁇ 2N_PU1, mv_best_2N ⁇ nU_PU0, mv_best_2N ⁇ nU_PU1, mv_best_2N ⁇ nD_PU0, mv_best_2N ⁇ nD_PU1 ⁇ .
  • the motion vector of the searched prediction unit in the image frame may include: ⁇ mv_best_2N ⁇ 2N_PU0, mv_best_2N ⁇ 2N_PU1, mv_best_2N ⁇ N_PU0, mv_best_2N ⁇ N_PU1, mv_best_N ⁇ 2N_PU0, mv_best_N ⁇ 2N_PU1, mv_best_2N ⁇ nU_PU0, mv_best_2N ⁇ nU_PU1, mv_best_2N ⁇ nD_PU0, mv_best_2N ⁇ nD_PU1, mv_best_nL ⁇ 2N_PU0, mv_best_nL ⁇ 2N_PU1 ⁇ .
  • the terminal moves the center of the polygonal model to a position where the first target point is located, and the point where the screening rate distortion is the least from the center of the moved multilateral model and each vertex , get the best.
  • the terminal may move the center of the polygonal model to a position where the first target point is located, and the polygon model saves the original shape after moving. Then calculate the rate distortion cost of the center of the moving polygon model and the position of each vertex, and set the center of the moving polygon model and the point where the rate distortion cost of each vertex is the smallest.
  • the polygon model is a hexagonal model
  • the point at which the rate distortion cost is the smallest ie, the most
  • the position of the right vertex of the hexagonal model moves the center of the hexagonal model to the position of the right vertex, as shown in Figure 8(b), at which point the calculated hexagonal model is calculated.
  • the rate distortion cost of the center and each vertex If the point at which the rate distortion cost is the smallest is the position of the upper right vertex of the hexagonal model, the center of the hexagonal model is moved to the position where the upper right vertex is located, as shown in Fig. 8(c).
  • step S306 The terminal determines whether the best advantage is consistent with the first target point; if yes, step S307 is performed; if no, step S308 is performed.
  • the terminal After obtaining the best advantage, the terminal can determine whether the best advantage is consistent with the first target point.
  • the terminal sets the most advantageous location to the current motion vector of the second type prediction unit, and corrects the current motion vector to obtain a motion vector of the second type prediction unit.
  • the terminal may set the most advantageous location as the current motion vector of the second type prediction unit. And, the terminal may correct the current motion vector of the obtained second type prediction unit according to the manner that the current motion vector of the second type prediction unit is corrected.
  • the terminal sets the most advantageous point as the first starting search point, and returns to step S302.
  • the terminal sets the most advantageous point as the first starting search point, and returns to perform searching for multiples within the search window centering on the first starting search point according to the first preset incremental step size.
  • the first candidate point selects a point from which the rate distortion cost is the smallest among the plurality of first candidate points, and obtains the first to-be-determined point.
  • the terminal acquires the first supplementary point that is not searched around each point corresponding to the first preset step.
  • the terminal may determine whether the search step corresponding to the first to-be-determined point is the first preset step size, where the first preset step size may be flexibly set according to actual needs, and the specific value is There is no limit here.
  • the terminal may acquire the first supplementary point that is not searched around each point corresponding to the first preset step.
  • the search template for searching for the first to-be-determined point is a square template
  • the obtained search step corresponding to the first to-be-determined point is 1, the vertices corresponding to the square with the search step size of 1 are 1, 3, 6, 8
  • These four points, 2, 4, 5, 7 are the midpoints of each side of the square.
  • the AC two points are added at the position of 1 to set the AC two points as the first supplementary point; if the rate distortion cost is the smallest If the position to be fixed is 3, the two points of BD are added at the position of 3, and the two points of BD can be set as the first supplementary point; if the first to-be-determined point with the lowest rate distortion is 6, the position is 6 The position of the EG is doubled, and the two points of the EG can be set as the first supplementary point; if the first to-be-determined point with the lowest rate distortion is 8, the FH can be made at the position of 8 and the FH can be added. Two points are set as the first supplementary point.
  • step S310 The terminal determines whether the point where the rate distortion cost of the first to-be-determined point and the first supplementary point is the smallest is the first to-be-determined point; if yes, step S311 is performed; if not, step S312 is performed.
  • the terminal may calculate a rate distortion cost of the first supplemental point, compare the rate distortion cost of the first supplemental point with the rate distortion cost of the first to-be-determined point, and determine the first supplemental point and the first to-be-determined Whether the point with the lowest rate distortion in the point is the first to-be-determined point.
  • the terminal sets a location of the first to-be-determined point as a current motion vector of the second type prediction unit, and corrects the current motion vector to obtain a motion vector of the second type prediction unit.
  • the position of the first to-be-determined point is set as the current motion vector of the second type prediction unit.
  • the terminal may correct the current motion vector of the obtained second type prediction unit according to the manner that the current motion vector of the second type prediction unit is modified to obtain a motion vector of the second type image block.
  • the terminal sets a position of a point where the first to-be fixed point and the first supplementary point have the lowest rate distortion cost as a current motion vector of the second type image block, and corrects the current motion vector to obtain a motion of the second type image block.
  • Vector
  • the terminal may set the position of the point where the rate-distortion cost of the first to-be-determined point and the first supplementary point is the smallest to the second type.
  • the current motion vector of the image block may correct the current motion vector of the obtained second type prediction unit according to the manner that the current motion vector of the second type prediction unit is modified to obtain a motion vector of the second type image block.
  • the terminal sets the first to-be-determined point as the first starting search point, and returns to step S302.
  • the terminal may determine whether the search step corresponding to the first to-be-determined point is within a second preset step threshold, where the second preset step threshold range may be flexibly set according to actual needs.
  • the specific value is not limited here.
  • the first to-be-determined point is set as the first initial search point, and the return execution is performed according to the first preset incremental step. Searching for a plurality of first candidate points within a search window centered on the search point, and filtering out a point where the rate distortion cost is the smallest among the plurality of first candidate points, the step of obtaining the first to-be-determined point.
  • the terminal may perform motion estimation of the image frame according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit. For example, the terminal may perform discrete cosine transform and quantization according to the obtained motion vector to obtain a residual coefficient. Then, the obtained residual coefficient is sent to the entropy coding module to output the code stream.
  • the residual coefficient is inversely quantized and inverse transformed
  • the residual value of the reconstructed image is obtained, and then the reconstructed image is obtained according to the residual value, and the weight is
  • the image is intra-loop filtered, it enters the reference frame queue as the reference image of the next frame, so that one frame is encoded backward.
  • Embodiments of the present application may divide an image frame in a video into a plurality of prediction units, and divide the plurality of prediction units into a first type prediction unit and a second type prediction unit.
  • a more complex search algorithm may be used for searching
  • a fast search algorithm may be used for searching, from which the motion estimation process can be accelerated; and, for one prediction unit, there are two divided blocks.
  • the post-searched segmentation block can refer to the final search result of the segmentation block that has been searched, and also accelerates the motion estimation process; and the correction strategy can correct the results of some possible search for the local optimal position, thereby avoiding the search error.
  • the encoding speed has been greatly improved, and the compression ratio loss is less.
  • the embodiment of the present application further provides an apparatus based on the foregoing video motion estimation method.
  • the meaning of the noun is the same as the method of video motion estimation described above. For specific implementation details, refer to the description in the method embodiment.
  • FIG. 12 is a schematic structural diagram of a video motion estimation apparatus according to an embodiment of the present disclosure, where the video motion estimation apparatus may include a segmentation unit 401, a first acquisition unit 402, a second acquisition unit 403, and a motion estimation unit. 404.
  • the dividing unit 401 is configured to divide an image frame in the video into multiple prediction units, and divide the plurality of prediction units into a first type prediction unit and a second type prediction unit.
  • the first obtaining unit 402 is configured to acquire a motion vector of the first type prediction unit according to the first search algorithm.
  • step S102 For specific implementations of the first acquisition unit 402, reference may be made to the embodiments previously described for step S102.
  • the first obtaining unit 402 may include a second obtaining subunit 4021, a calculating subunit 4022, a third obtaining subunit 4023, a third setting subunit 4024, and a fourth setting sub Unit 4025 and the like can be specifically as follows:
  • a second obtaining sub-unit 4021 configured to acquire a second candidate starting search point corresponding to the first type of prediction unit, calculate a rate distortion cost of each second candidate starting search point, and use a second candidate with a minimum rate distortion cost
  • the starting search point is set to the second starting search point
  • the calculating sub-unit 4022 is configured to acquire a plurality of second candidate points within a search window centering on the second starting search point according to the second preset incremental step, and calculate a rate distortion cost of each second candidate point. Extracting a point with the lowest rate distortion cost from the plurality of second candidate points to obtain a second to-be-determined point;
  • the third obtaining sub-unit 4023 is configured to: when the search step corresponding to the second to-be-determined point is the second preset step, the acquiring step is not searched for each point corresponding to the second preset step. a second supplemental point, calculating a rate distortion penalty of the second supplemental point;
  • a third setting subunit 4024 configured to set a location of the second to-be-determined point to the second point when the second to-be-determined point and the second supplemental point have the lowest rate distortion cost a motion vector of the first type of prediction unit;
  • a fourth setting subunit 4025 configured to set the second to-be-determined point as a second start when a point where the rate distortion cost of the second to-be-determined point and the second supplementary point is the smallest is not the second to-be-determined point Searching for a plurality of second candidate points acquired by the computing subunit in a search window centered on the second starting search point according to the second preset incremental step, and calculating each second candidate point
  • the rate distortion cost is obtained by selecting a point where the rate distortion cost is the smallest among the plurality of second candidate points, and obtaining the second to-be-determined point.
  • the third setting subunit 4024 is specifically configured to:
  • the location of the second to-be-determined point is set as the motion vector of the first type prediction unit.
  • the third setting sub-unit 4024 For a specific implementation of the third setting sub-unit 4024, reference may be made to the previously described embodiment for the step of setting the location of the second to-be-determined point as the motion vector of the first type of prediction unit.
  • the second type of prediction unit includes a third partitioning block and a fourth partitioning block, where the second acquiring subunit 4021 is specifically configured to:
  • the second obtaining sub-unit 4021 For the specific implementation of the second obtaining sub-unit 4021, reference may be made to obtaining a second candidate starting search point corresponding to the first type of prediction unit, calculating a rate distortion cost of each second candidate starting search point, and minimizing the rate distortion cost.
  • the second candidate starting search point is set to the embodiment described by the second starting search point.
  • the first obtaining unit 402 may further include:
  • a first execution subunit configured to use, as a second initial search point, a point that minimizes a rate distortion cost of the second to-be-determined point and the plurality of search points, and the second sub-increment step is performed by the calculation sub-unit.
  • Acquiring a plurality of second candidate points within a search window centered on the starting search point, and calculating a rate distortion cost of each second candidate point, and selecting a point with the lowest rate distortion cost from the plurality of second candidate points The second step of the pending point.
  • the search subunit and the first execution subunit reference may be made to the previously described embodiment for when the search step corresponding to the second pending point is within the third predetermined step threshold range.
  • the first obtaining unit 402 may further include:
  • a second execution subunit configured to: when the search step corresponding to the second to-be-determined point is within the fourth preset step threshold range, use the second to-be-determined point as the second initial search point, and execute by the calculating sub-unit
  • Two preset incremental steps acquire a plurality of second candidate points within a search window centered on the second starting search point, and calculate a rate distortion cost of each second candidate point, from the plurality of second candidate points The point at which the rate distortion is the least cost is selected, and the step of obtaining the second to-be-determined point is obtained.
  • the second obtaining unit 403 is configured to acquire a motion vector of the second type prediction unit according to a second search algorithm.
  • the second obtaining unit 403 may include a first obtaining subunit 4031, a correcting subunit 4032, and the like, and may specifically be as follows:
  • a first obtaining sub-unit 4031 configured to acquire a polygon model according to a second search algorithm, and acquire a current motion vector of the second type prediction unit by moving the polygon model;
  • the correction subunit 4032 is configured to acquire a motion vector of the searched prediction unit in the image frame, and correct the current motion vector according to the motion vector of the searched prediction unit to obtain a motion vector of the second type prediction unit.
  • the first obtaining subunit 4031 may include:
  • a searching module configured to acquire a first to-be-determined point in the second type of prediction unit according to the second search algorithm
  • An acquiring module configured to acquire a multilateral model centered on the first to-be-determined point when the search step of the first to-be-determined point is within the first preset step threshold, and acquire the first target point according to the multilateral model;
  • a moving module configured to move the multilateral model when the first target point is inconsistent with the first pending point, and obtain the best advantage according to the moved multilateral model
  • the first setting module is configured to set the most advantageous location to the current motion vector of the second type prediction unit if the best advantage is consistent with the first target point.
  • search module For specific implementations of the search module, the acquisition module, and the mobile module described above, reference may be made to the previously described embodiments for the step of acquiring a multilateral model in accordance with the second search algorithm and acquiring the current motion vector of the second type of prediction unit by moving the multilateral model.
  • the mobile module can be specifically used for:
  • the first obtaining subunit 4031 may further include:
  • a second setting module configured to set a location of the first target point as a current motion vector of the second type prediction unit when the first target point is consistent with the first to-be-determined point.
  • the search module can include:
  • a search submodule configured to obtain, according to the second search algorithm, a point with the lowest rate distortion cost in the second type of prediction unit, to obtain a first to-be-determined point;
  • the acquisition module is specifically used to:
  • the first target point is obtained from the midpoint of the polygon model and the point at which the rate distortion cost is the smallest among the vertices.
  • the search sub-module and the acquisition module reference may be made to obtaining the first to-be-determined point in the second-type prediction unit according to the second search algorithm, where the search step of the first to-be-determined point is at the first preset step threshold.
  • the embodiment described in the step of acquiring the first target point according to the multilateral model is obtained from the multilateral model centered on the first to-be-determined point.
  • search submodule can be specifically used for:
  • a point where the rate distortion cost is the smallest is selected from the plurality of first candidate points, and the first to-be-determined point is obtained.
  • the second type prediction unit includes a first partitioning block and a second partitioning block
  • the search submodule is further specifically configured to:
  • the prediction result of the first divided block is obtained, the rate distortion cost of each first candidate starting search point is calculated, and the prediction result is calculated according to the first divided block. Rate distortion cost at the location of the first segmentation block;
  • a point at which the obtained rate distortion cost is minimized is set as a start search point of the second divided block in the second type prediction unit, and a start search point of the second divided block is set as the first start search point.
  • first divided block For the specific implementation of the foregoing first divided block, the second divided block, and the search sub-module, reference may be made to the first candidate starting search point corresponding to acquiring the second type prediction unit according to the second search algorithm, and calculating each first candidate.
  • the rate distortion cost of the search point is initially set, and the first candidate start search point with the lowest rate distortion cost is set as the embodiment described by the first start search point.
  • the obtaining module may also be specifically configured to:
  • the search step corresponding to the first to-be-determined point is the first preset step
  • the first supplement point that is not searched around each point corresponding to the first preset step is acquired, and the first supplementary point is calculated.
  • the location of the first to-be-determined point is set as the current motion vector of the second type prediction unit
  • the position of the point where the rate-distortion cost of the first to-be-determined point and the first supplementary point is the smallest is set as the second type prediction unit. Current motion vector.
  • the obtaining module may also be specifically configured to:
  • the first to-be-determined point is set as the first initial search point, and the return execution is performed according to the first preset incremental step.
  • the modification sub-unit 4032 is specifically configured to:
  • the position of the current rate distortion cost corresponding point is set as the motion vector of the second type prediction unit.
  • the motion estimation unit 404 is configured to perform motion estimation of the image frame according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • motion estimation unit 404 For specific implementations of motion estimation unit 404, reference may be made to the embodiments previously described for step S104.
  • the embodiment of the present application further provides a terminal.
  • the terminal may include a radio frequency (RF) circuit 601, a memory 602 including one or more computer readable storage media, and an input unit. 603, a display unit 604, a sensor 605, an audio circuit 606, wireless fidelity (WiFi, W ireless fidelity) module 607, a processor comprises one or more processing cores 608, 609 and a power supply and other components.
  • RF radio frequency
  • the RF circuit 601 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, the downlink information is processed by one or more processors 608. In addition, the data related to the uplink is sent to the base station. .
  • the RF circuit 601 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM), a transceiver, a coupler, and a low noise amplifier (LNA, Low Noise Amplifier), duplexer, etc. In addition, the RF circuit 601 can also communicate with the network and other devices through wireless communication.
  • SIM Subscriber Identity Module
  • LNA Low Noise Amplifier
  • the wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), and Code Division Multiple Access (CDMA). , Code Division Multiple Access), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • Memory 602 can be used to store computer readable instructions and modules, and processor 608 executes various functional applications and data processing by running computer readable instructions and modules stored in memory 602.
  • the memory 602 can mainly include a storage computer readable instruction area and a storage data area, wherein the storage computer readable instruction area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.);
  • the storage data area can store data (such as audio data, phone book, etc.) created according to the use of the terminal.
  • memory 602 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 602 may also include a memory controller to provide access to memory 602 by processor 608 and input unit 603.
  • the input unit 603 can be configured to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
  • input unit 603 can include a touch-sensitive surface as well as other input devices.
  • Touch-sensitive surfaces also known as touch screens or trackpads, collect touch operations on or near the user (such as the user using a finger, stylus, etc., any suitable object or accessory on a touch-sensitive surface or touch-sensitive The operation near the surface), and the corresponding connecting device is driven according to a preset program.
  • the touch sensitive surface may include two parts of a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 608 is provided and can receive commands from the processor 608 and execute them.
  • touch-sensitive surfaces can be implemented in a variety of types, including resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 603 can also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • Display unit 604 can be used to display information entered by the user or information provided to the user, as well as various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, video, and any combination thereof.
  • the display unit 604 can include a display panel.
  • the display panel can be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
  • the touch-sensitive surface can cover the display panel, and when the touch-sensitive surface detects a touch operation thereon or nearby, it is transmitted to the processor 608 to determine the type of the touch event, and then the processor 608 displays the type according to the type of the touch event. A corresponding visual output is provided on the panel.
  • the touch-sensitive surface and display panel are implemented as two separate components to perform input and input functions, in some embodiments, the touch-sensitive surface can be integrated with the display panel to implement input and output functions.
  • the terminal may also include at least one type of sensor 605, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may close the display panel and/or the backlight when the terminal moves to the ear.
  • the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • the terminal can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
  • the audio circuit 606, the speaker, and the microphone provide an audio interface between the user and the terminal.
  • the audio circuit 606 can transmit the converted electrical signal of the audio data to the speaker, and convert it into a sound signal output by the speaker; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 606 and then converted.
  • the audio data is then processed by the audio data output processor 608, sent via RF circuitry 601 to, for example, another terminal, or the audio data is output to memory 602 for further processing.
  • the audio circuit 606 may also include an earbud jack to provide communication between the peripheral earphone and the terminal.
  • WiFi is a short-range wireless transmission technology
  • the terminal can help users to send and receive emails , browse web pages, and access streaming media through the WiFi module 607, which provides users with wireless broadband Internet access.
  • FIG. 15 shows the WiFi module 607, it can be understood that it does not belong to the necessary configuration of the terminal, and may be omitted as needed within the scope of not changing the essence of the present application.
  • Processor 608 is the control center of the terminal, connecting various portions of the entire handset with various interfaces and lines, by running or executing computer readable instructions and/or modules stored in memory 602, and recalling data stored in memory 602. , perform various functions of the terminal and process data to monitor the mobile phone as a whole.
  • the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 608.
  • the terminal also includes a power source 609 (such as a battery) for powering various components.
  • the power source can be logically coupled to the processor 608 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the power supply 609 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
  • the terminal may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the processor 608 in the terminal loads the executable file corresponding to the process of one or more applications into the memory 602 according to the following computer readable instructions, and is executed by the processor 608.
  • the application stored in the memory 602 implements various functions:
  • the step of acquiring the motion vector of the second type prediction unit according to the second search algorithm may include: acquiring the polygon model according to the second search algorithm, and acquiring the current motion vector of the second type prediction unit by moving the polygon model; acquiring the image The motion vector of the prediction unit is searched in the frame, and the current motion vector is corrected according to the motion vector of the searched prediction unit to obtain the motion vector of the second type prediction unit.
  • the step of acquiring the polygon model according to the second search algorithm and acquiring the current motion vector of the second type prediction unit by moving the polygon model may include:
  • the step of acquiring the motion vector of the predicted prediction unit in the image frame, and correcting the current motion vector according to the motion vector of the searched prediction unit, to obtain the motion vector of the second type prediction unit may include:
  • the embodiment of the present application may divide an image frame in a video into multiple prediction units, and classify the multiple prediction units, for example, divide the multiple prediction units into a first type prediction unit and a second type prediction. unit.
  • Obtaining motion vectors of different types of prediction units by using different search algorithms for different types of prediction units for example, acquiring motion vectors of the first type prediction unit according to the first search algorithm, and acquiring the second type prediction unit according to the second search algorithm Motion vector.
  • the image frame may be subjected to sub-pixel motion estimation according to the motion vector of the first type prediction unit and the motion vector of the second type prediction unit.
  • the scheme can classify a plurality of prediction units and use different search algorithms to obtain motion vectors of different types of prediction units, the search efficiency is high, and therefore, the same is adopted uniformly for different prediction units in the prior art.
  • the processing method improves the efficiency and flexibility of motion estimation for video.
  • the embodiment of the present application provides a computer readable storage medium, where a plurality of computer readable instructions are executable, and the computer readable instructions can be loaded by a processor to perform any of the embodiments provided by the embodiments of the present application.
  • the steps in the video motion estimation method can perform the following steps:
  • the step of acquiring the motion vector of the second type prediction unit according to the second search algorithm may include: acquiring the polygon model according to the second search algorithm, and acquiring the current motion vector of the second type prediction unit by moving the polygon model; acquiring the image The motion vector of the prediction unit is searched in the frame, and the current motion vector is corrected according to the motion vector of the searched prediction unit to obtain the motion vector of the second type prediction unit.
  • the step of acquiring the polygon model according to the second search algorithm and acquiring the current motion vector of the second type prediction unit by moving the polygon model may include:
  • the storage medium may include: a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
  • ROM read only memory
  • RAM random access memory
  • magnetic disk a magnetic disk or an optical disk.
  • any video motion estimation provided by the embodiments of the present application may be implemented.
  • the beneficial effects that can be achieved by the method are described in detail in the foregoing embodiments, and are not described herein again.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Analysis (AREA)

Abstract

一种视频运动估计方法,包括以下步骤:将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元;按照第一搜索算法获取第一类型预测单元的运动矢量;按照第二搜索算法获取第二类型预测单元的运动矢量;根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计。

Description

视频运动估计方法、装置、终端及存储介质
本申请要求于2018年03月07日提交中国专利局,申请号为201810188556.6,申请名称为“一种视频运动估计方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频压缩技术领域,具体涉及一种视频运动估计方法、装置、终端及存储介质。
背景技术
在对视频进行编码的过程中,一般都需要对视频中的每一帧图像进行帧间预测,其中,帧间预测主要是利用视频时间域的相关性,使用邻近且已编码图像的像素预测当前图像的像素,以达到有效去除视频时域冗余的目的。目前视频编码的帧间预测部分主要采用基于块的运动补偿技术,其原理是为当前图像的每个像素块(即预测单元)在之前已编码图像中寻找一个最佳匹配块,该过程称为运动估计(Motion Estimation,ME)。其中,用于预测的图像称为参考图像,参考图像中的参考块到当前图像中的当前像素块的位移称为运动矢量(Motion Vector,MV)。
现有技术中,对视频中的图像帧进行运动估计的过程中,首先,通过帧间预测单元(Prediction Unit,PU)将图像帧分割为2N×2N、2N×N、N×2N、2N×nU、2N×nD、nL×2N、及nR×2N等模式的预测单元。然后,针对所有的预测单元采用统一的处理方式,在确定每个预测单元的起始搜索点后,分别以起始搜索点为中心,在搜索范围内搜索出率失真代价最小的点,最后将每个预测单元的率失真代价最小的点所在位置作为每个预测单元对应的运动矢量,并根据每个预测单元对应的运动矢量执行对图像帧进行分像素运动补偿等后续操作。
在对现有技术的研究和实践过程中,本申请的发明人发现,由于现有技术中针对所有预测单元均统一采用相同的处理方式,对每个预测单元进行全新独立搜索,例如,对于所有预测单元均采用相同复杂度的搜索方法,使得对视频进行运动估计的过程中不够灵活,而且导致运动估计的效率低下。
发明内容
根据本申请提供的各种实施例,提供了一种视频运动估计方法。
一种视频运动估计方法,包括:
将视频中的图像帧分割为多个预测单元,以及将所述多个预测单元划分为第一类型预测单元和第二类型预测单元;
按照第一搜索算法获取所述第一类型预测单元的运动矢量;
按照第二搜索算法获取所述第二类型预测单元的运动矢量,所述第二搜索算法与所述第一搜索算法不同;及
根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对所述图像帧进行分像素的运动估计。
一种视频运动估计装置,包括:
分割单元,用于将视频中的图像帧分割为多个预测单元,以及将所述多个预测单元划分为第一类型预测单元和第二类型预测单元;
第一获取单元,用于按照第一搜索算法获取所述第一类型预测单元的运动矢量;
第二获取单元,用于按照第二搜索算法获取所述第二类型预测单元的运动矢量,所述第二搜索算法与所述第一搜索算法不同;
运动估计单元,用于根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对所述图像帧进行分像素的运动估计。
一种终端,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:
将视频中的图像帧分割为多个预测单元,以及将所述多个预测单元划分为第一类型预测单元和第二类型预测单元;
按照第一搜索算法获取所述第一类型预测单元的运动矢量;
按照第二搜索算法获取所述第二类型预测单元的运动矢量,所述第二搜索算法与所述第一搜索算法不同;及
根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对所述图像帧进行分像素的运动估计。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:
将视频中的图像帧分割为多个预测单元,以及将所述多个预测单元划分为第一类型预测单元和第二类型预测单元;
按照第一搜索算法获取所述第一类型预测单元的运动矢量;
按照第二搜索算法获取所述第二类型预测单元的运动矢量,所述第二搜索算法与所述第一搜索算法不同;及
根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对所述图像帧进行分像素的运动估计。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的视频运动估计系统的场景示意图;
图2是本申请实施例提供的视频运动估计方法的流程示意图;
图3是本申请实施例提供的对图像帧分割得到的预测单元的示意图;
图4是本申请实施例提供的菱形搜索模板的示意图;
图5是本申请实施例提供的在待定点周围做两点搜索的示意图;
图6是本申请实施例提供的按照预设间隔步长进行搜索的示意图;
图7是本申请实施例提供的移动四边模型的示意图;
图8是本申请实施例提供的移动六边模型的示意图;
图9是本申请实施例提供的不同预测单元的运动矢量搜索顺序的示意图;
图10是本申请实施例提供的对第一类型预测单元的运动矢量进行搜索的流程示意图;
图11是本申请实施例提供的对第二类型预测单元的运动矢量进行搜索的流程示意图;
图12是本申请实施例提供的视频运动估计装置的结构示意图;
图13是本申请实施例提供的视频运动估计装置的另一结构示意图;
图14是本申请实施例提供的视频运动估计装置的另一结构示意图;
图15是本申请实施例提供的终端的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供一种视频运动估计方法、装置和系统。
请参阅图1,图1为本申请实施例所提供的视频运动估计系统的场景示意图,该视频运动估计系统可以包括视频运动估计装置,该视频运动估计装置具体可以集成在平板电脑、手机、笔记本电脑、台式电脑及电视等具备储存单元并安装有微处理器而具有运算能力的终端中,主要用于将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元;其中,该视频可以从终端本地获取到,也可以从服务器下载,该预测单元可以包括预测单元A、预测单元B、预测单元C、预测单元D、预测单元E、及预测单元F等多个预测单元,该第一类型预测单元可以包括预测单元A、预测单元B、预测单元C等多个预测单元,第二类型预测单元可以包括预测单元D、预测单元E、及预测单元F等多个预测单元。按照第一搜索算法获取第一类型预测单元的运动矢量;以及按照第二搜索算法获取第二类型预测单元的运动矢量;其中,按照第二搜索算法获取第二类型预测单元的运动矢量的过程中,可以获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量;其中,该多边模型可以是菱形或六边形等多边模型。在得到第一类型预测单元的运动矢量a及第二类型预测单元的运动矢量b后,可以获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量,其中,已搜索预测单元可以包括第二类型预测单元及第二类型预测单元中的至少一个预测单元。然后,根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计,得到运动估计结果;等等。
此外,该视频运动估计系统还可以包括服务器,视频运动估计装置可以从服务器下载视频,例如,视频运动估计装置可以向服务器发送视频获取请求,并接收服务器基于该获取请求反馈的关于该视频的视频文件等。
需要说明的是,图1所示的视频运动估计系统的场景示意图仅仅是一个示例,本申请实施例描述的视频运动估计系统以及场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着视频运动估计系统的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
以下分别进行详细说明。
在本实施例中,将从视频运动估计装置的角度进行描述,该视频运动估计装置具体可以集成在电脑、手机及电视等具备储存单元并安装有微处理器而具有运算能力的终端中。
一种视频运动估计方法,包括:将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元;按照第一搜索算法获取第一类型预测单元的运动矢量;按照第二搜索算法获取第二类型预测单元的运动矢量;根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计。
请参阅图2,图2是本申请第一实施例提供的视频运动估计方法的流程示意图。该视频运动估计方 法可以包括:
在步骤S101中,将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元。
视频运动估计装置可以从本地或服务器获取视频,当需要对该视频进行编时,需要对视频进行帧间预测编码,在进行帧间预测编码的过程中,需要对视频中的每一图像帧进行运动估计,在对图像帧进行运动估计时,可以通过帧间预测单元PU将视频中的图像帧分割为2N×2N、2N×N、N×2N、2N×nU、2N×nD、nL×2N、及nR×2N等多个预测单元,其中,如图3所示,2N×2N、2N×N、及N×2N等为对称模式的预测单元,例如,2N×N预测单元包括以上下1:1的比例划分为索引为0和索引为1的分割块;2N×nU、2N×nD、nL×2N、及nR×2N等为非对称模式的预测单元,例如,2N×nD预测单元包括以上下3:1的比例划分为索引为0和索引为1的分割块。
由于不同模式的预测单元是存在区别的,为了避免针对不同模式的预测单元均统一采用相同的处理方式,例如,非对称模式的预测单元采用与对称模式的预测单元相同复杂度的搜索方法,因此,为了提高对视频进行运动估计的灵活及效率,在得到多个预测单元后,可以将多个预测单元划分为第一类型预测单元和第二类型预测单元,例如,该第一类型预测单元可以包括2N×2N、2N×N、及N×2N等对称模式的预测单元,第二类型预测单元可以包括2N×nU、2N×nD、nL×2N、及nR×2N等非对称模式的预测单元。
可以理解的是,预测单元的分割方式,及第一类型预测单元和第二类型预测单元的划分方式,可以根据实际需要进行灵活设置,具体内容在此处不作限定。
需要说明的是,本申请实施例中使用的术语“第一”及“第二”等,仅用于描述的目的,而不能理解为指示或暗示的重要性,例如,第一类型预测单元与第二类型预测单元均为预测单元,第一类型预测单元对应的是关于一种类型的预测单元,第二类型预测单元对应的是关于另一种类型的预测单元,而并不能说明第一类型预测单元重要性大于第二类型预测单元等。
在步骤S102中,按照第一搜索算法获取第一类型预测单元的运动矢量。
针对第一类型预测单元和第二类型预测单元,视频运动估计装置可以分别采用不同的搜索算法对预测单元的运动矢量进行搜索,例如,对于第一类型预测单元,可以按照第一搜索算法获取第一类型预测单元的运动矢量;对于第二类型预测单元,可以按照第二搜索算法获取第二类型预测单元的运动矢量,其中,第一搜索算法与第二搜索算法不一致,以下将进行详细说明。
在某些实施方式中,按照第一搜索算法获取第一类型预测单元的运动矢量的步骤可以包括:
(1)获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点;
(2)按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点;
(3)当第二待定点对应的搜索步长为第二预设步长时,获取步长为第二预设步长对应的每个点周围未搜索的第二补充点,计算第二补充点的率失真代价;
(4)当第二待定点及第二补充点中率失真代价最小的点为第二待定点时,将第二待定点所在位置设置为第一类型预测单元的运动矢量;
(5)当第二待定点及第二补充点中率失真代价最小的点不是第二待定点时,将第二待定点及第二补充点中率失真代价最小的点所在位置设置为第一类型预测单元的运动矢量。
具体地,首先,视频运动估计装置确定起始搜索点(即第二起始搜索点),具体可以如下:
视频运动估计装置可以通过高级运动向量预测(Advanced Motion Vector Prediction,AMVP)获取第一类型预测单元对应的第二候选起始搜索点,其中,AMVP技术主要是利用空域和时域上运动向量的相关性,为当前的预测单元建立候选预测MV列表,该列表中存在多个候选预测MV,视频运动估计装置可以从多个候选预测MV列表中选择第二候选起始搜索点;或者是,视频运动估计装置也可以通过Merge模式获取第一类型预测单元对应的第二候选起始搜索点。
在得到第二候选起始搜索点后,视频运动估计装置可以计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点,即该第二起始搜索点为第一类型预测单元对应的最终确定的起始搜索点。其中,率失真代价的计算公式可以是:rdcost=sad+lamda*bit;其中rdcost表示率失真代价,sad表示残差,即运动补偿预测误差,lamda表示常系数,可以是拉格朗日因子,bit表示码率,即运动矢量相关信息的编码比特数。需要说明的是,以下各个率失真代价的计算方式,可以参照该公式进行计算。
其次,视频运动估计装置在搜索窗范围内搜索待定点(即第二待定点),具体可以如下:
视频运动估计装置可以利用菱形模板或正方形模板等进行搜索,如图4所示,以菱形模板为例,以第二起始搜索点为菱形模板的中心,以搜索步长1开始,根据图4所示的菱形模板,按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,其中,第二预设递增步长可以以2的整数次幂递增的步长,即先以搜索步长1开始,在依次以搜索步长为2、4、及8等进行搜索,得到多个第二候选点,该第二候选点可以是每个搜索步长对应的菱形模板的顶点、及两个顶点之间的中点等,如图4中标记的五角星所在的位置。其中,当设置最大的搜索步长为8时,对应的搜索窗范围即为搜索步长为8所对应的菱形模板的内环区域;当设置最大的搜索步长为16时,对应的搜索窗范围即为搜索步长为16所对应的菱形模板的内环区域;等等。然后,计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,将多个第二候选点中率失真代价最小的点设置为第二待定点。
然后,当第二待定点对应的搜索步长为第二预设步长时,在待定点周围做两点搜索,具体可以如下:
在得到第二待定点后,视频运动估计装置可以判断该第二待定点对应的搜索步长是否为第二预设步长,该第二预设步长可以根据实际需要进行灵活设置,例如,可以将第二预设步长设置为1,即当第二待定点对应的搜索步长为1时,可以获取步长为第二预设步长对应的每个点周围未搜索的第二补充点,该第二补充点可以包括一个或多个点,如图5所示。
例如,图5中,当搜索第二待定点的搜索模板为菱形模板时,若得到的第二待定点对应的搜索步长为1,则搜索步长为1的菱形所对应的顶点为2、4、5、7这四个点,此时,若得到率失真代价最小的第二待定点为2所在位置,则在2所在位置补做AB两点,可以将AB两点设置为第二补充点;若得到率失真代价最小的第二待定点为4所在位置,则在4所在位置补做CE两点,可以将CE两点设置为第二补充点;若得到率失真代价最小的第二待定点为5所在位置,则在5所在位置补做DF两点,可以将DF两点设置为第二补充点;若得到率失真代价最小的第二待定点为7所在位置,则在7所在位置补做GH两点,可以将GH两点设置为第二补充点。
最后,从第二补充点及第二待定点中筛选率失真代价最小的点,具体可以如下:
在得到第二补充点后,视频运动估计装置可以计算每个第二补充点的率失真代价,将第二补充点的率失真代价与第二待定点的率失真代价进行比较,判断第二补充点与第二待定点中率失真代价最小 的点是否为第二待定点。当第二待定点及第二补充点中率失真代价最小的点为第二待定点时,将第二待定点所在位置设置为第一类型预测单元的运动矢量。
当第二待定点及第二补充点中率失真代价最小的点不是第二待定点时,将第二待定点及第二补充点中率失真代价最小的点所在位置设置为第一类型预测单元的运动矢量。
可选地,将第二待定点所在位置设置为第一类型预测单元的运动矢量的步骤可以包括:
(a)获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第一类型预测单元对应位置的第二目标率失真代价;
(b)将第二待定点的率失真代价与第二目标率失真代价进行比较;
(c)若第二待定点的率失真代价大于第二目标率失真代价,则将已搜索预测单元的运动矢量设置为第一类型预测单元的运动矢量;
(d)若第二待定点的率失真代价小于或等于第二目标率失真代价,则将第二待定点所在位置设置为第一类型预测单元的运动矢量。
视频运动估计装置在确定第一类型预测单元的运动矢量时,可以根据图像帧中已搜索预测单元的运动矢量,对当前搜索的第一类型预测单元的运动矢量进行修正。具体地,视频运动估计装置在搜索每个预测单元的运动矢量的过程中,可以将已搜索的预测单元的运动矢量进行存储,可以生成预测单元标识与运动矢量之间的映射关系。
在对当前搜索的第一类型预测单元的运动矢量进行修正的过程中,视频运动估计装置可以获取与已搜索的预测单元标识对应的映射关系,根据该映射关系获取图像帧中已搜索预测单元的运动矢量,以及根据已搜索预测单元的运动矢量计算第一类型预测单元对应位置的第二目标率失真代价,例如,可以根据已搜索预测单元的运动矢量确定所指向的对应位置,计算该对应位置的标率失真代价,将计算得到的该对应位置的标率失真代价设置为第二目标率失真代价。然后,可以将第二待定点的率失真代价与第二目标率失真代价进行比较。
若第二待定点的率失真代价大于第二目标率失真代价,则将已搜索预测单元的运动矢量设置为第一类型预测单元的运动矢量,即将第一类型预测单元的运动矢量修正为已搜索预测单元的运动矢量。若第二待定点的率失真代价小于或等于第二目标率失真代价,则将第二待定点所在位置设置为第一类型预测单元的运动矢量。
需要说明的是,已搜索预测单元可以包括一个或多个预测单元,该已搜索预测单元可以包括图像帧中第一类型预测单元的一个或多个预测单元,或者,该已搜索预测单元可以包括图像帧中第二类型预测单元的一个或多个预测单元,或者,该已搜索预测单元可以既包括图像帧中第一类型预测单元的一个或多个预测单元,又包括图像帧中第二类型预测单元的一个或多个预测单元;依次类推,已搜索预测单元的运动矢量也可以包括一个或多个。
例如,若视频运动估计装置已经搜索了2N×2N预测单元和2N×N预测单元的运动矢量,则当前在搜索N×2N预测单元的运动矢量时,可以用2N×2N预测单元和2N×N预测单元的运动矢量,对N×2N预测单元的运动矢量进行修正。
可选地,第二类型预测单元包括第三分割块和第四分割块,获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点的步骤可以包括:
通过高级运动向量预测获取第一类型预测单元中第四分割块对应的至少一个第二候选起始搜索点;
当第一类型预测单元中第三分割块已经预测完成时,获取第三分割块的预测结果,计算每个第二候选起始搜索点的率失真代价,以及根据第三分割块的预测结果计算所述第三分割块所在位置的率失真代价;
从至少一个第二候选起始搜索点及第三分割块中,将率失真代价最小的点设置为第一类型预测单元中第四分割块的起始搜索点,并将第四分割块的起始搜索点设置为第二起始搜索点。
需要说明的是,上述第一类型预测单元可以包括索引为0的第三分割块及索引为1的第四分割块,视频运动估计装置可以分别搜索第一类型预测单元中第三分割块和第四分割块的运动矢量,在确定第一类型预测单元中第四分割块的起始搜索点时,可以借鉴已搜索的第三分割块的运动矢量来指导当前第四分割块的搜索过程,即可以利用已搜索的第三分割块的运动矢量对应的位置作为当前第四分割块的候选起始搜索点之一。或者,利用已搜索的第四分割块的运动矢量对应的位置作为当前第三分割块的候选起始搜索点之一,以下将以利用已搜索的第三分割块的运动矢量对应的位置作为当前第四分割块的起始搜索点之一为例进行说明。
具体地,视频运动估计装置在搜索第一类型预测单元中第四分割块的过程中,可以通过AMVP技术获取第一类型预测单元中第四分割块对应的至少一个第二候选起始搜索点,以及判断第一类型预测单元中第三分割块是否已经搜索完成即判断第一类型预测单元中第三分割块是否已经预测完成。当第一类型预测单元中第三分割块已经预测完成时,获取第三分割块的预测结果,该预测结果可以是第三分割块运动矢量,此时可以根据第三分割块的预测结果计算第三分割块所在位置的率失真代价,即根据第三分割块运动矢量计算第三分割块所在位置的率失真代价,例如,可以根据第三分割块运动矢量确定所指向的对应位置,计算该对应位置的标率失真代价,将计算得到的该对应位置的标率失真代价设置为第三分割块所在位置的率失真代价。以及,计算每个第二候选起始搜索点的率失真代价,从至少一个第二候选起始搜索点及第三分割块中,将率失真代价最小的点设置为第一类型预测单元中第四分割块的起始搜索点,并将第四分割块的起始搜索点设置为第二起始搜索点,以便执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
例如,以2N×N预测单元为例,假设2N×N预测单元中索引为0的分割块已经预测完成,此时在做2N×N预测单元中索引为1的分割块时,可以将索引为0的分割块对应的预测结果中运动矢量对应的位置,作为索引为1的分割块的候选起始搜索点位置之一,从而可以从候选起始搜索点中选择率失真代价最小的点作为起始搜索点,这样使起始搜索点更接近运动估计的最优位置,可以更快退出搜索过程。
在某些实施方式中,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤之后,视频运动估计方法还可以包括:
当第二待定点对应的搜索步长在第三预设步长阈值范围内时,在以第二待定点为中心的预设范围内,按照预设间隔步长进行搜索,得到多个搜索点,计算每个搜索点的率失真代价;
将第二待定点及多个搜索点中率失真代价最小的点作为第二起始搜索点,返回执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
具体地,在得到第二待定点后,视频运动估计装置可以判断该第二待定点对应的搜索步长是否在第三预设步长阈值范围内,其中,第三预设步长阈值范围可以根据实际需要进行灵活设置。或者是,可以获取率失真代价最小的点至搜索窗范围中心的距离,判断该距离是否在第一预设距离阈值范围内,该预设距离阈值范围可以根据实际需要进行灵活设置,例如该第一预设距离阈值范围可以是大于或等 于5,且小于或等于8。当第二待定点对应的搜索步长在第三预设步长阈值范围内(或者率失真代价最小的点至搜索窗范围中心的距离在第一预设距离阈值范围内)时,在以第二待定点为中心的预设范围内,按照预设间隔步长进行搜索,得到多个搜索点,其中,预设范围及预设间隔步长可以根据实际需要进行灵活设置,具体取值在此处不作限定。例如,该预设间隔步长可以设置为每行每列均间隔为5步,如图6所示,在以第二待定点为中心的搜索窗范围内,以光栅扫描的方式,做每间隔5行5列扫描所有点,得到多个搜索点,图6中仅仅是按照预设间隔步长在搜索窗范围内进行搜索的局部示意图,该搜索窗范围可以根据实际需要进行灵活设置,例如,可以是128行×128列。
然后,计算每个搜索点的率失真代价,将第二待定点及多个搜索点中率失真代价最小的点作为第二起始搜索点,返回执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
在某些实施方式中,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤之后,视频运动估计方法还可以包括:
当第二待定点对应的搜索步长在第四预设步长阈值范围内时,将第二待定点作为第二起始搜索点,返回执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
具体地,在得到第二待定点后,视频运动估计装置可以判断该第二待定点对应的搜索步长是否在第四预设步长阈值范围内,其中,第四预设步长阈值范围可以根据实际需要进行灵活设置。或者是,可以获取率失真代价最小的点至搜索窗范围中心的距离,判断该距离是否在第二预设距离阈值范围内,该第二预设距离阈值范围可以根据实际需要进行灵活设置,例如,可以是大于1且小于5。当第二待定点对应的搜索步长在第四预设步长阈值范围内(或者率失真代价最小的点至搜索窗范围中心的距离在第一预设距离阈值范围内)时,将第二待定点作为第二起始搜索点,返回执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
在步骤S103中,按照第二搜索算法获取第二类型预测单元的运动矢量。
针对第二类型预测单元,视频运动估计装置可以采用第二搜索算法获取第二类型预测单元的运动矢量。
在某些实施方式中,按照第二搜索算法获取第二类型预测单元的运动矢量的步骤可以包括:按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量;获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
其中,在某些实施方式中,按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量的步骤可以包括:
(1)按照第二搜索算法获取第二类型预测单元中的第一待定点;
(2)当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型,根据多边模型获取第一目标点;
(3)当第一目标点与第一待定点不一致时,移动多边模型,并根据移动后的多边模型获取最优点;
(4)若最优点与第一目标点一致,则将最优点所在位置设置为第二类型预测单元的当前运动矢量。
具体地,视频运动估计装置可以通过AMVP技术获取第二类型预测单元对应的第一候选起始搜索点,从第一候选起始搜索点筛选出第一起始搜索点,然后以第一起始搜索点为菱形模板或正方形模板的中心进行搜索,得到多个第一候选点,从多个第一候选点中筛选出第一待定点。
在得到第一待定点后,视频运动估计装置可以判断该第一待定点对应的搜索步长是否在第一预设步长阈值范围内,其中,第一预设步长阈值范围可以根据实际需要进行灵活设置。当第一待定点的搜索步长在第一预设步长阈值范围内时,获取多边模型,其中,该多边模型可以是四边形或六边形等。
在得到多边模型后,视频运动估计装置可以根据多边模型获取第一目标点,例如,视频运动估计装置可以计算多边模型的中心及各个顶点所在位置的率失真代价,将多边模型的中心及各个顶点中率失真代价最小的点设置为第一目标点。
在得到第一目标点后,视频运动估计装置可以判断该第一目标点是否与第一待定点一致,当第一目标点与第一待定点不一致时,说明得到的第一目标点可能不是最优点,第一目标点的周围可能存在率失真代价比第一目标点的率失真代价还小的最优点,此时,移动多边模型,并根据移动后的多边模型获取最优点,该最优点可以是移动后的多边模型中率失真代价最小的点。
可选地,当第一目标点与第一待定点不一致时,移动多边模型,并根据移动后的多边模型获取最优点的步骤可以包括:当第一目标点与第一待定点不一致时,将多边模型的中心移动至第一目标点所在的位置;从移动后的多边模型的中心及各个顶点中筛选率失真代价最小的点,得到最优点。
该多边模型在移动后保存原始的形状不变,例如,可以将多边模型的中心移动至第一目标点所在位置。然后计算移动后的多边模型的中心及各个顶点所在位置的率失真代价,将移动后的多边模型的中心及各个顶点中率失真代价最小的点设置为最优点。
在得到最优点后,视频运动估计装置可以判断最优点与第一目标点是否一致,若最优点与第一目标点一致,则将最优点所在位置设置为第二类型预测单元的当前运动矢量。
可选地,根据多边模型获取第一目标点的步骤之后,视频运动估计方法还可以包括:当第一目标点与第一待定点一致时,将第一目标点所在位置设置为第二类型预测单元的当前运动矢量。
例如,如图7所示,当多边模型为菱形模型时,若图7(a)中计算菱形模型的中心及上下左右各个顶点的率失真代价,得到率失真代价最小的点(即最优点)为菱形模型的右顶点所在的位置,则将菱形模型的中心移动至右顶点所在的位置,如图7(b)所示,此时计算移动后的菱形模型的中心及上下左右各个顶点的率失真代价。若得到率失真代价最小的点为菱形模型的下顶点所在的位置,则将菱形模型的中心移动至下顶点所在的位置,如图7(c)所示,此时计算移动后的菱形模型的中心及上下左右各个顶点的率失真代价。若得到率失真代价最小的点为菱形模型的下顶点所在的位置,则将菱形模型的中心移动至下顶点所在的位置,如图7(d)所示,此时计算移动后的菱形模型的中心及上下左右各个顶点的率失真代价。若得到率失真代价最小的点为菱形模型的中心所在位置,即最优点为菱形模型的中心所在位置,则不再移动菱形模型,将菱形模型的中心所在位置(即最优点所在位置)设置为第二类型预测单元的当前运动矢量。
在某些实施方式中,按照第二搜索算法获取第二类型预测单元中的第一待定点,当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型,根据多边模型获取第一目标点的步骤可以包括:
(a)按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点;
(b)当第一待定点对应的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型;
(c)从多边模型的中点及各个顶点中选择率失真代价最小的点,得到第一目标点。
具体地,视频运动估计装置可以通过AMVP技术获取第二类型预测单元对应的第一候选起始搜索点,计算第一候选起始搜索点的率失真代价,将率失真代价最小的点设置为第一起始搜索点,然后以第一起始搜索点为菱形模板或正方形模板的中心进行搜索,得到多个第一候选点,计算每个第一候选点的率失真代价,从多个第一候选点中筛选出率失真代价最小的点设置为第一待定点。
在得到第一待定点后,视频运动估计装置可以判断该第一待定点对应的搜索步长是否在第一预设步长阈值范围内,其中,第一预设步长阈值范围可以根据实际需要进行灵活设置。当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的四边形或六边形等多边模型。
在得到多边模型后,视频运动估计装置可以计算多边模型的中心及各个顶点所在位置的率失真代价,将多边模型的中心及各个顶点中率失真代价最小的点设置为第一目标点。视频运动估计装置还可以计算多边模型的中心及、各个顶点及每条边中点所在位置(或每条边三等分点所在位置)的率失真代价,并将率失真代价最小的点设置为第一目标点。
可选地,按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点的步骤可以包括:
按照第二搜索算法获取第二类型预测单元对应的第一候选起始搜索点;
计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点;
按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内获取多个第一候选点;
从多个第一候选点中筛选出率失真代价最小的点,得到第一待定点。
具体地,视频运动估计装置可以通过AMVP技术或Merge模式获取第二类型预测单元对应的第一候选起始搜索点,然后,计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点,即该第一起始搜索点为第二类型预测单元对应的最终确定的起始搜索点。
在得到第一起始搜索点后,视频运动估计装置可以按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,其中,搜索窗范围可以是菱形模板或正方形模板的搜索范围,例如,搜索窗范围可以是菱形模板或正方形模板最大的搜索步长所对应的内环区域,如当设置菱形模板最大的搜索步长为8时,对应的搜索窗范围即为搜索步长为8所对应的菱形模板的内环区域;第一预设递增步长可以是以2的整数次幂递增的步长,或者根据实际需要进行灵活设置。
以菱形模板为例,如图4所示,以第一起始搜索点为菱形模板的中心,以搜索步长1开始,按照以2的整数次幂递增的步长进行搜索,得到多个第一候选点,该第一候选点可以是每个搜索步长对应的菱形模板的顶点、及两个顶点之间的中点等,如图4中标记的五角星所在的位置。然后,计算每个第一候选点的率失真代价,从多个第一候选点中筛选出率失真代价最小的点,将多个第一候选点中率失真代价最小的点设置为第一待定点。
在某些实施方式中,第二类型预测单元包括第一分割块和第二分割块,按照第二搜索算法获取第二类型预测单元对应的第一候选起始搜索点,计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点的步骤可以包括:
按照第二搜索算法,通过高级运动向量预测获取第二类型预测单元中第二分割块对应的至少一个 第一候选起始搜索点;
当第二类型预测单元中第一分割块已经预测完成时,获取第一分割块的预测结果,计算每个第一候选起始搜索点的率失真代价,以及根据所述第一分割块的预测结果计算所述第一分割块所在位置的率失真代价;
从至少一个第一候选起始搜索点及第一分割块中获取率失真代价最小的点;
将获取到的率失真代价最小的点设置为第二类型预测单元中第二分割块的起始搜索点,并将第二分割块的起始搜索点设置为第一起始搜索点。
需要说明的是,上述第二类型预测单元可以包括索引为0的第一分割块及索引为1的第二分割块,视频运动估计装置可以分别搜索第二类型预测单元中第一分割块和第二分割块的运动矢量,在确定第二类型预测单元中第二分割块的起始搜索点时,可以借鉴已搜索的第一分割块的运动矢量来指导当前第四分割块的搜索过程,即可以利用已搜索的第一分割块的运动矢量对应的位置作为当前第二分割块的起始搜索点之一。或者,利用已搜索的第二分割块的运动矢量对应的位置作为当前第一分割块的候选起始搜索点之一,以下将以利用已搜索的第一分割块的运动矢量对应的位置作为当前第二分割块的起始搜索点之一为例进行说明。
具体地,视频运动估计装置在搜索第二类型预测单元中第二分割块的过程中,可以通过AMVP技术获取第二类型预测单元中第二分割块对应的至少一个第一候选起始搜索点,以及判断第二类型预测单元中第一分割块是否已经搜索完成即判断第二类型预测单元中第一分割块是否已经预测完成。当第二类型预测单元中第一分割块已经预测完成时,获取第一分割块的预测结果,该预测结果可以是预测得到的第一分割块运动矢量,可以根据第一分割块的预测结果计算第一分割块所在位置的率失真代价,即根据第一分割块运动矢量计算第一分割块所在位置的率失真代价,例如,可以根据第一分割块运动矢量确定所指向的对应位置,计算该对应位置的标率失真代价,将计算得到的该对应位置的标率失真代价设置为第一分割块所在位置的率失真代价。以及计算每个第一候选起始搜索点的率失真代价,从至少一个第一候选起始搜索点及第一分割块中,将率失真代价最小的点设置为第二类型预测单元中第二分割块的起始搜索点,并将第二分割块的起始搜索点设置为第二起始搜索点,以便执行按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,并计算每个第一候选点的率失真代价的步骤。
例如,以nR×2N预测单元为例,假设nR×2N预测单元中索引为0的分割块已经预测完成,此时在做nR×2N预测单元中索引为1的分割块时,可以将索引为0的分割块对应的预测结果中运动矢量所在的位置,作为索引为1的分割块的候选起始搜索点位置之一,从而可以从候选起始搜索点中选择率失真代价最小的点作为起始搜索点,这样使起始搜索点更接近运动估计的最优位置,可以更快退出搜索过程。
在某些实施方式中,按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点的步骤之后,视频运动估计方法还可以包括:
当第一待定点对应的搜索步长为第一预设步长时,获取步长为第一预设步长对应的每个点周围未搜索的第一补充点,并计算第一补充点的率失真代价;
当第一待定点及第一补充点中率失真代价最小的点为第一待定点时,将第一待定点所在位置设置为第二类型预测单元的当前运动矢量;
当第一待定点及第一补充点中率失真代价最小的点不是第一待定点时,将第一待定点及第一补充点中率失真代价最小的点所在位置设置为第二类型预测单元的当前运动矢量。
具体地,在得到第一待定点后,视频运动估计装置可以判断该第一待定点对应的搜索步长是否为 第一预设步长,其中,该第一预设步长可以根据实际需要进行灵活设置,例如,可以将第一预设步长设置为1,即当第一待定点对应的搜索步长为1时,可以获取步长为第一预设步长对应的每个点周围未搜索的第二补充点,该第二补充点可以包括一个或多个点,如图5所示。
例如,图5中,当搜索第二待定点的搜索模板为菱形模板时,若得到的第二待定点对应的搜索步长为1,则搜索步长为1的菱形所对应的顶点为2、4、5、7这四个点,此时,若得到率失真代价最小的第二待定点为2所在位置,则在2所在位置补做AB两点,可以将AB两点设置为第二补充点;若得到率失真代价最小的第二待定点为5所在位置,则在5所在位置补做DF两点,可以将DF两点设置为第二补充点;等等。
在得到第一补充点后,视频运动估计装置可以计算第一补充点的率失真代价,将第一补充点的率失真代价与第一待定点的率失真代价进行比较,判断第一补充点与第一待定点中率失真代价最小的点是否为第一待定点。当第一待定点及第一补充点中率失真代价最小的点为第一待定点时,将第一待定点所在位置设置为第二类型预测单元的当前运动矢量。当第一待定点及第一补充点中率失真代价最小的点不是第一待定点时,将第一待定点及第一补充点中率失真代价最小的点所在位置设置为第二类型预测单元的当前运动矢量。
在某些实施方式中,按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点的步骤之后,视频运动估计方法还可以包括:
当第一待定点对应的搜索步长在第二预设步长阈值范围内时,将第一待定点设置为第一起始搜索点,返回执行按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点的步骤。
具体地,在得到第一待定点后,视频运动估计装置可以判断该第一待定点对应的搜索步长是否在第二预设步长阈值范围内,其中,第二预设步长阈值范围可以根据实际需要进行灵活设置。当第一待定点对应的搜索步长在第二预设步长阈值范围内时,将第一待定点设置为第一起始搜索点,返回执行按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,并计算每个第一候选点的率失真代价的步骤。
在得到第二类型预测单元的当前运动矢量,视频运动估计装置可以获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,从而可以得到第二类型预测单元的运动矢量,具体可以如下。
在得到第二类型预测单元的当前运动矢量后,视频运动估计装置可以获取图像帧中已搜索预测单元的运动矢量,其中,已搜索预测单元可以包括一个或多个预测单元,该已搜索预测单元可以包括图像帧中第一类型预测单元的一个或多个预测单元,或者,该已搜索预测单元可以包括图像帧中第二类型预测单元的一个或多个预测单元,或者,该已搜索预测单元可以既包括图像帧中第一类型预测单元的一个或多个预测单元,又包括图像帧中第二类型预测单元的一个或多个预测单元。然后根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
在某些实施方式中,获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量的步骤可以包括:
获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第二类型预测单元对应位置的第一目标率失真代价;
根据第二类型预测单元的当前运动矢量,确定第二类型预测单元的当前率失真代价;
将第二类型预测单元的当前率失真代价与第一目标率失真代价进行比较;
若第二类型预测单元的当前率失真代价大于第一目标率失真代价,则将已搜索预测单元的运动矢量设置为第二类型预测单元的运动矢量;
若第二类型预测单元的当前率失真代价小于或等于第一目标率失真代价,则将当前率失真代价对应点所在位置设置为第二类型预测单元的运动矢量。
具体地,视频运动估计装置在确定第二类型预测单元的运动矢量时,可以根据图像帧中已搜索预测单元的运动矢量,对当前搜索的第二类型预测单元的当前运动矢量进行修正。具体地,视频运动估计装置在搜索每个预测单元的运动矢量的过程中,可以将已搜索的预测单元的运动矢量进行存储,可以生成预测单元标识与运动矢量之间的映射关系。
在对当前搜索的第二类型预测单元的运动矢量进行修正的过程中,视频运动估计装置可以获取与已搜索的预测单元标识对应的映射关系,根据该映射关系获取图像帧中已搜索预测单元的运动矢量,以及根据已搜索预测单元的运动矢量计算第二类型预测单元对应位置的第一目标率失真代价,例如,可以根据已搜索预测单元的运动矢量确定所指向的对应位置,计算该对应位置的标率失真代价,将计算得到的该对应位置的标率失真代价设置为第一目标率失真代价。
然后,视频运动估计装置可以将第二类型预测单元的当前率失真代价与第一目标率失真代价进行比较。若第二类型预测单元的当前率失真代价大于第一目标率失真代价,则将已搜索预测单元的运动矢量设置为第二类型预测单元的运动矢量;若第二类型预测单元的当前率失真代价小于或等于第一目标率失真代价,则将当前率失真代价对应点所在位置设置为第二类型预测单元的运动矢量。
例如,如图9所示,若视频运动估计装置按照的2N×2N预测单元、2N×N预测单元、N×2N预测单元、2N×nU预测单元、2N×nD预测单元、nL×2N预测单元、及nR×2N预测单元等顺序依次搜索每个预测单元对应的运动矢量,则当前搜索到2N×nD预测单元时,可以利用前面已经搜索的2N×2N预测单元、2N×N预测单元、N×2N预测单元、及2N×nU预测单元等的运动矢量,对当前搜索到2N×nD预测单元的运动矢量进行修正。
在步骤S104中,根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计。
在得到第一类型预测单元的运动矢量及第二类型预测单元的运动矢量后,视频运动估计装置可以根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量对图像帧进行分像素的运动估计,其中,得到的第一类型预测单元的运动矢量及第二类型预测单元的运动矢量的过程主要是对图像帧进行整像素运动预测(即整像素搜索)得到的整像素运动矢量。例如,在对图像帧进行分像素的运动估计时,视频运动估计装置可以根据整像素运动预测得到的运动矢量,进行半像素搜索及四分之一像素精度搜索,得到精度运动矢量。对素精度运动矢量进行运动补偿处理,例如,将得到的精度运动矢量进行离散余弦变换(Discrete Cosine Transform,DCT)和量化等处理,得到残差系数。然后将得到的残差系数送入熵编码模块可以输出码流,同时,残差系数经反量化反变换之后,得到重构图像的残差值,再根据残差值获取重构图像,将重构图像再经环内滤波之后,进入参考帧队列,作为下一帧的参考图像,从而一帧帧向后编码。
由上可知,本申请实施例可以将视频中的图像帧分割为多个预测单元,以及对多个预测单元进行分类,例如,将多个预测单元划分为第一类型预测单元和第二类型预测单元。针对不同类型的预测单元采用不同的搜索算法获取不同类型预测单元的运动矢量,例如,按照第一搜索算法获取第一类型预测单元的运动矢量,以及按照第二搜索算法获取第二类型预测单元的运动矢量。后续即可根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量对图像帧进行分像素的运动估计。由于该方案 可以对多个预测单元进行分类,并采用不同的搜索算法获取不同类型预测单元的运动矢量,其搜索效率较高,因此,相对于现有技术中针对不同预测单元均统一采用相同的处理方式,提高了对视频进行运动估计的效率及灵活性。
根据上述实施例所描述的方法,以下将举例作进一步详细说明。
上述视频运动估计装置可以集成在电脑、手机及电视等具备储存单元并安装有微处理器而具有运算能力的终端中,以下将从终端的角度进行描述。
终端可以从本地或服务器获取视频,通过帧间预测单元PU将视频中的图像帧分割为2N×2N、2N×N、N×2N、2N×nU、2N×nD、nL×2N、及nR×2N等多个预测单元。
其中,如图3所示,2N×N预测单元包括以上下1:1的比例划分为索引为0和索引为1的分割块,N×2N预测单元包括以左右1:1的比例划分为索引为0和索引为1的分割块,2N×nU预测单元包括以上下1:3的比例划分为索引为0和索引为1的分割块,2N×nD预测单元包括以上下3:1的比例划分为索引为0和索引为1的分割块,nL×2N预测单元包括以左右1:3的比例划分为索引为0和索引为1的分割块,nR×2N预测单元包括以左右3:1的比例划分为索引为0和索引为1的分割块。
然后,终端可以将得到的多个预测单元按照对称性划分为第一类型预测单元和第二类型预测单元,该第一类型预测单元可以包括2N×2N、2N×N、及N×2N等对称模式的预测单元,第二类型预测单元可以包括2N×nU、2N×nD、nL×2N、及nR×2N等非对称模式的预测单元。
针对第一类型预测单元和第二类型预测单元,终端可以分别采用不同的搜索算法对预测单元的运动矢量进行搜索,以下将进行详细说明。
对于第一类型预测单元,请参阅图10,图10为本申请实施例提供的对第一类型预测单元的运动矢量进行搜索的流程示意图。该方法流程可以包括:
S201、终端获取第一类型预测单元对应的第二候选起始搜索点,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点。
终端可以通过AMVP技术或Merge模式获取一个或多个第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点,即该第二起始搜索点为第一类型预测单元对应的最终确定的起始搜索点。
其中,率失真代价的计算公式可以是:rdcost=sad+lamda*bit;其中rdcost表示率失真代价,sad表示残差,即运动补偿预测误差,lamda表示常系数,可以是拉格朗日因子,bit表示码率,即运动矢量相关信息的编码比特数。
需要说明的是,第一类型预测单元可以包括索引为0的第三分割块及索引为1的第四分割块,终端可以分别搜索第一类型预测单元中第三分割块和第四分割块的运动矢量,在确定第一类型预测单元中第四分割块的起始搜索点时,可以利用已搜索的第三分割块的运动矢量对应的位置作为当前第四分割块的候选起始搜索点之一。具体地,终端在搜索第一类型预测单元中第四分割块的过程中,可以通过AMVP技术获取第一类型预测单元中第四分割块对应的至少一个第二候选起始搜索点,以及判断第一类型预测单元中第三分割块是否已经预测完成。当第一类型预测单元中第三分割块已经预测完成时,获取预测得到的第三分割块运动矢量,确定与预测得到的第三分割块运动矢量对应的预测点,计算每个第二候选起始搜索点及第三分割块的率失真代价。从至少一个第二候选起始搜索点及第三分割块中,将率失真代价最小的点设置为第一类型预测单元中第四分割块的起始搜索点,并将第四分割块的起始搜索点设置为第二起始搜索点,以便执行步骤S202。
例如,以2N×N预测单元为例,假设2N×N预测单元中索引为0的分割块已经预测完成,此时在做 2N×N预测单元中索引为1的分割块时,可以将索引为0的分割块对应的预测结果中运动矢量对应的位置,作为索引为1的分割块的候选起始搜索点位置之一,从而可以从候选起始搜索点中选择率失真代价最小的点作为起始搜索点,这样使起始搜索点更接近运动估计的最优位置,可以更快退出搜索过程。
S202、终端按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点。
在得到第二起始搜索点后,终端可以利用菱形模板或正方形模板等,按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内进行搜索,得到多个第二候选点。
例如,以正方形模板为例,以第二起始搜索点为正方形模板的中心,以搜索步长1开始,按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,其中,第二预设递增步长可以以2的整数次幂递增,即先以搜索步长1开始,在依次以搜索步长为2、4、及8等进行搜索,得到多个第二候选点,该第二候选点可以是每个搜索步长对应的正方形模板的顶点、两个顶点之间四等分对应的点等。其中,当设置最大的搜索步长为8时,对应的搜索窗范围即为搜索步长为8所对应的正方形模板的内环区域;当设置最大的搜索步长为16时,对应的搜索窗范围即为搜索步长为16所对应的正方形模板的内环区域;等等。
然后,计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,将多个第二候选点中率失真代价最小的点设置为第二待定点。
S203、当第二待定点对应的搜索步长为第二预设步长时,终端获取步长为第二预设步长对应的每个点周围未搜索的第二补充点。
在得到第二待定点后,终端可以判断该第二待定点对应的搜索步长是否为第二预设步长,该第二预设步长可以根据实际需要进行灵活设置,例如,可以将第二预设步长设置为1或2等。
当第二待定点对应的搜索步长为第二预设步长时,终端获取步长为第二预设步长对应的每个点周围未搜索的第二补充点。
例如,当搜索第二待定点的搜索模板为正方形模板时,若得到的第二待定点对应的搜索步长为1,则搜索步长为1的正方形所对应的顶点为1、3、6、8这四个点,2、4、5、7为该正方形的每条边的中点。此时,若得到率失真代价最小的第二待定点为1所在位置,则在1所在位置补做AC两点,可以将AC两点设置为第二补充点;若得到率失真代价最小的第二待定点为2所在位置,则在2所在位置补做AB两点,可以将AB两点设置为第二补充点;若得到率失真代价最小的第二待定点为3所在位置,则在3所在位置补做BD两点,可以将BD两点设置为第二补充点;若得到率失真代价最小的第二待定点为4所在位置,则在4所在位置补做CE两点,可以将CE两点设置为第二补充点;若得到率失真代价最小的第二待定点为5所在位置,则在5所在位置补做DF两点,可以将DF两点设置为第二补充点;若得到率失真代价最小的第二待定点为6所在位置,则在6所在位置补做EG两点,可以将EG两点设置为第二补充点;若得到率失真代价最小的第二待定点为7所在位置,则在7所在位置补做GH两点,可以将GH两点设置为第二补充点;若得到率失真代价最小的第二待定点为8所在位置,则在8所在位置补做FH两点,可以将FH两点设置为第二补充点。
S204、终端判断第二待定点及第二补充点中率失真代价最小的点是否为第二待定点;若是,则执行步骤S205;若否,则执行步骤S206。
在得到第二补充点后,终端可以计算每个第二补充点的率失真代价,将第二补充点的率失真代价与第二待定点的率失真代价进行比较,判断第二补充点与第二待定点中率失真代价最小的点是否为第二待定点。
S205、终端将第二待定点所在位置设置为第一类型预测单元的运动矢量,并对运动矢量进行修正。
S206、将第二待定点及第二补充点中率失真代价最小的点所在位置设置为第一类型图像块的运动矢量,并对运动矢量进行修正。
当第二待定点及第二补充点中率失真代价最小的点为第二待定点时,终端将第二待定点所在位置设置为第一类型预测单元的运动矢量。当第二待定点及第二补充点中率失真代价最小的点不是第二待定点时,终端将第二待定点及第二补充点中率失真代价最小的点所在位置设置为第一类型图像块的运动矢量。
此时,终端可以对第一类型预测单元的运动矢量进行修正,具体地,终端可以在搜索每个预测单元的运动矢量的过程中,可以将已搜索预测单元的运动矢量进行存储,可以生成预测单元标识与运动矢量之间的映射关系。
在对当前搜索的第一类型预测单元的运动矢量进行修正的过程中,终端可以获取与已搜索的预测单元标识对应的映射关系,根据该映射关系获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第一类型预测单元的第二目标率失真代价。然后,可以将第二待定点的率失真代价与第二目标率失真代价进行比较。
若第二待定点的率失真代价cost_best大于第二目标率失真代价cost_ref,则将已搜索预测单元的运动矢量mv_ref设置为第一类型预测单元的运动矢量mv_best,即将第一类型预测单元的运动矢量mv_best修正为已搜索预测单元的运动矢量mv_ref:mv_best=mv_ref。若第二待定点的率失真代价小于或等于已第二目标率失真代价,则将第二待定点所在位置设置为第一类型预测单元的运动矢量。
例如,可以预先对每个预测单元的运动矢量进行命名,其命名算法可以是:mv_best_预测单元类型_预测单元索引,如mv_best_2N×N_PU1表示2N×N预测单元中索引为1分割块的运动矢量。假设终端已经搜索了2N×2N预测单元和2N×N预测单元的运动矢量,当前在搜索N×2N预测单元的运动矢量时,可以用2N×2N预测单元和2N×N预测单元的运动矢量,对N×2N预测单元的运动矢量进行修正。例如,对于N×2N预测单元中索引为0的分割块PU0和索引为1的分割块PU1的运动矢量,可以参考2N×2N预测单元和2N×N预测单元的运动矢量={mv_best_2N×2N_PU0,mv_best_2N×2N_PU1,mv_best_2N×N_PU0,mv_best_2N×N_PU1}。
S207、当第二待定点对应的搜索步长在第三预设步长阈值范围内时,终端在以第二待定点为中心的预设范围内,按照预设间隔步长进行搜索,得到多个搜索点,将第二待定点及多个搜索点中率失真代价最小的点作为第二起始搜索点,返回执行步骤S202。
在得到第二待定点后,终端可以判断该第二待定点对应的搜索步长是否在第三预设步长阈值范围内,其中,第三预设步长阈值范围可以根据实际需要进行灵活设置,具体取值在此处不作限定。
当第二待定点对应的搜索步长在第三预设步长阈值范围内时,在以第二待定点为中心的预设范围内,按照预设间隔步长进行搜索,得到多个搜索点,其中,预设范围及预设间隔步长可以根据实际需要进行灵活设置,具体取值在此处不作限定。例如,如图6所示,在以第二待定点为中心的搜索窗范围内,以光栅扫描的方式,做每间隔5行5列扫描所有点,得到多个搜索点。
然后,计算每个搜索点的率失真代价,将第二待定点及多个搜索点中率失真代价最小的点作为第二起始搜索点,返回执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
S208、当第二待定点对应的搜索步长在第四预设步长阈值范围内时,终端将第二待定点作为第二起始搜索点,返回执行步骤S202。
在得到第二待定点后,终端可以判断该第二待定点对应的搜索步长是否在第四预设步长阈值范围内,其中,第四预设步长阈值范围可以根据实际需要进行灵活设置,具体内容在此处不作限定。当第二待定点对应的搜索步长在第四预设步长阈值范围内时,将第二待定点作为第二起始搜索点,返回执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
对于第二类型预测单元,请参阅图11,图11为本申请实施例提供的对第二类型预测单元的运动矢量进行搜索的流程示意图。该方法流程可以包括:
S301、终端获取第二类型预测单元对应的第一候选起始搜索点,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点。终端可以通过AMVP技术或Merge模式获取第二类型预测单元对应的第一候选起始搜索点,然后,计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点,即该第一起始搜索点为第二类型预测单元对应的最终确定的起始搜索点。
需要说明的是,第二类型预测单元可以包括索引为0的第一分割块及索引为1的第二分割块,终端可以分别搜索第二类型预测单元中第一分割块和第二分割块的运动矢量,在确定第二类型预测单元中第二分割块的起始搜索点时,可以利用已搜索的第一分割块的运动矢量对应的位置作为当前第二分割块的起始搜索点之一。具体地,终端在搜索第二类型预测单元中第二分割块的过程中,可以通过AMVP技术获取第二类型预测单元中第二分割块对应的至少一个第一候选起始搜索点,以及判断第二类型预测单元中第一分割块是否已经搜索完成即判断第二类型预测单元中第一分割块是否已经预测完成。当第二类型预测单元中第一分割块已经预测完成时,获取预测得到的第一分割块运动矢量,确定与预测得到的第一分割块运动矢量对应的预测点,计算每个第一候选起始搜索点及第一分割块的率失真代价。从至少一个第一候选起始搜索点及第一分割块中,将率失真代价最小的点设置为第二类型预测单元中第二分割块的起始搜索点,并将第二分割块的起始搜索点设置为第二起始搜索点,以便执行步骤S302。
例如,以2N×nD预测单元为例,若2N×nD预测单元中索引为0的分割块已经预测完成,此时在做2N×nD预测单元中索引为1的分割块时,可以将索引为0的分割块对应的运动矢量所在位置,作为索引为1的分割块的候选起始搜索点位置之一,从而可以从候选起始搜索点中选择率失真代价最小的点作为起始搜索点,这样使起始搜索点更接近运动估计的最优位置,可以更快退出搜索过程。
S302、终端按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内获取多个第一候选点,从多个第一候选点中筛选出率失真代价最小的点,得到第一待定点。
在得到第一起始搜索点后,终端可以按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,其中,搜索窗范围可以是菱形模板或正方形模板的搜索范围,例如,搜索窗范围可以是菱形模板或正方形模板最大的搜索步长所对应的内环区域,如当设置菱形模板最大的搜索步长为8时,对应的搜索窗范围即为搜索步长为8所对应的菱形模板的内环区域;第一预设递增步长可以是以2的整数次幂递增的步长,或者根据实际需要进行灵活设置。
例如,以正方形模板为例,以第一起始搜索点为正方形模板的中心,以搜索步长1开始,按照以2的整数次幂递增的搜索步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,得到多个第一候选点,该第一候选点可以是每个搜索步长对应的正方形模板的顶点、两个顶点之间四等分对应的点等。
然后,计算每个第一候选点的率失真代价,从多个第一候选点中筛选出率失真代价最小的点,将多个第一候选点中率失真代价最小的点设置为第一待定点。
S303、当第一待定点的搜索步长在第一预设步长阈值范围内时,终端获取以第一待定点为中心的多边模型,从多边模型的中点及各个顶点中选择率失真代价最小的点,得到第一目标点。
在得到第一待定点后,终端可以判断该第一待定点对应的搜索步长是否在第一预设步长阈值范围内,其中,第一预设步长阈值范围可以根据实际需要进行灵活设置,具体取值在此处不作限定。
当第一待定点的搜索步长在第一预设步长阈值范围内时,终端获取以第一待定点为中心的多边模型,该多边模型可以是四边形或六边形等。
在得到多边模型后,终端可以计算多边模型的中心及各个顶点所在位置的率失真代价,将多边模型的中心及各个顶点中率失真代价最小的点设置为第一目标点。
S304、当第一目标点与第一待定点一致时,终端将第一目标点所在位置设置为第二类型预测单元的当前运动矢量,并对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
在得到第一目标点后,终端可以判断该第一目标点是否与第一待定点一致,当第一目标点与第一待定点一致时,终端可以将第一目标点所在位置设置为第二类型预测单元的当前运动矢量。
在得到第二类型预测单元的当前运动矢量后,终端可以获取图像帧中已搜索预测单元的运动矢量,其中,已搜索预测单元可以包括一个或多个预测单元,并根据已搜索预测单元的运动矢量对第二类型预测单元的当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
具体地,终端在搜索每个预测单元的运动矢量的过程中,可以将已搜索的预测单元的运动矢量进行存储,可以生成预测单元标识与运动矢量之间的映射关系。在对当前搜索的第二类型预测单元的运动矢量进行修正的过程中,终端可以获取与已搜索的预测单元标识对应的映射关系,根据该映射关系获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第二类型预测单元的第一目标率失真代价。
然后,终端可以将第二类型预测单元的当前率失真代价与第一目标率失真代价进行比较。若第二类型预测单元的当前率失真代价大于第一目标率失真代价,则将已搜索预测单元的运动矢量设置为第二类型预测单元的运动矢量;若第二类型预测单元的当前率失真代价小于或等于第一目标率失真代价,则将当前率失真代价对应点所在位置设置为第二类型预测单元的运动矢量。
例如,可以预先对每个预测单元的运动矢量进行命名,其命名算法可以是:mv_best_预测单元类型_预测单元索引,如mv_best_2N×N_PU1表示2N×N预测单元中索引为1分割块的运动矢量。对于2N×N预测单元,图像帧中已搜索预测单元的运动矢量可以包括:{mv_best_2N×2N_PU0,mv_best_2N×2N_PU1}。
对于N×2N预测单元,图像帧中已搜索预测单元的运动矢量可以包括:{mv_best_2N×2N_PU0,mv_best_2N×2N_PU1,mv_best_2N×N_PU0,mv_best_2N×N_PU1}。
对于2N×nU预测单元,图像帧中已搜索预测单元的运动矢量可以包括:{mv_best_2N×2N_PU0,mv_best_2N×2N_PU1,mv_best_2N×N_PU0,mv_best_2N×N_PU1,mv_best_N×2N_PU0,mv_best_N×2N_PU1}。
对于2N×nD预测单元,图像帧中已搜索预测单元的运动矢量可以包括:{mv_best_2N×2N_PU0,mv_best_2N×2N_PU1,mv_best_2N×N_PU0,mv_best_2N×N_PU1,mv_best_N×2N_PU0,mv_best_N×2N_PU1,mv_best_2N×nU_PU0,mv_best_2N×nU_PU1}。
对于nL×2N预测单元,图像帧中已搜索预测单元的运动矢量可以包括:{mv_best_2N×2N_PU0,mv_best_2N×2N_PU1,mv_best_2N×N_PU0,mv_best_2N×N_PU1,mv_best_N×2N_PU0,mv_best_N×2N_PU1,mv_best_2N×nU_PU0,mv_best_2N×nU_PU1,mv_best_2N×nD_PU0, mv_best_2N×nD_PU1}。
对于nR×2N预测单元,图像帧中已搜索预测单元的运动矢量可以包括:{mv_best_2N×2N_PU0,mv_best_2N×2N_PU1,mv_best_2N×N_PU0,mv_best_2N×N_PU1,mv_best_N×2N_PU0,mv_best_N×2N_PU1,mv_best_2N×nU_PU0,mv_best_2N×nU_PU1,mv_best_2N×nD_PU0,mv_best_2N×nD_PU1,mv_best_nL×2N_PU0,mv_best_nL×2N_PU1}。
S305、当第一目标点与第一待定点不一致时,终端将多边模型的中心移动至第一目标点所在的位置,从移动后的多边模型的中心及各个顶点中筛选率失真代价最小的点,得到最优点。
当第一目标点与第一待定点不一致时,终端可以将多边模型的中心移动至第一目标点所在的位置,该多边模型在移动后保存原始的形状不变。然后计算移动后的多边模型的中心及各个顶点所在位置的率失真代价,将移动后的多边模型的中心及各个顶点中率失真代价最小的点设置为最优点。
例如,如图8所示,当多边模型为六边形模型时,若图8(a)中计算六边形模型的中心及各个顶点的率失真代价,得到率失真代价最小的点(即最优点)为六边形模型的右顶点所在的位置,则将六边形模型的中心移动至右顶点所在的位置,如图8(b)所示,此时计算移动后的六边形模型的中心及各个顶点的率失真代价。若得到率失真代价最小的点为六边形模型的上右方顶点所在的位置,则将六边形模型的中心移动至上右方顶点所在的位置,如图8(c)所示,此时计算移动后的六边形模型的中心及各个顶点的率失真代价。若得到率失真代价最小的点为六边形模型的上左方顶点所在的位置,则将六边形模型的中心移动至上左方顶点所在的位置,如图8(d)所示,此时计算移动后的六边形模型的中心及各个顶点的率失真代价。若得到率失真代价最小的点为六边形模型的中心所在位置,即最优点为六边形模型的中心所在位置,则不再移动六边形模型,将六边形模型的中心所在位置(即最优点所在位置)设置为第二类型预测单元的当前运动矢量。
S306、终端判断最优点与第一目标点是否一致;若是,则执行步骤S307;若否,则执行步骤S308。
在得到最优点后,终端可以判断最优点与第一目标点是否一致。
S307、终端将最优点所在位置设置为第二类型预测单元的当前运动矢量,并对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
若最优点与第一目标点一致,则终端可以将最优点所在位置设置为第二类型预测单元的当前运动矢量。以及,终端可以按照上述对第二类型预测单元的当前运动矢量进行修正的方式,对得到的第二类型预测单元的当前运动矢量进行修正。
S308、终端将最优点设置为第一起始搜索点,返回执行步骤S302。
若最优点与第一目标点不一致,则终端将最优点设置为第一起始搜索点,返回执行按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,从多个第一候选点中筛选出率失真代价最小的点,得到第一待定点的步骤。
S309、当第一待定点对应的搜索步长为第一预设步长时,终端获取步长为第一预设步长对应的每个点周围未搜索的第一补充点。
在得到第一待定点后,终端可以判断该第一待定点对应的搜索步长是否为第一预设步长,其中,该第一预设步长可以根据实际需要进行灵活设置,具体取值在此处不作限定。当第一待定点对应的搜索步长为第一预设步长时,终端可以获取步长为第一预设步长对应的每个点周围未搜索的第一补充点。
例如,当搜索第一待定点的搜索模板为正方形模板时,若得到的第一待定点对应的搜索步长为1,则搜索步长为1的正方形所对应的顶点为1、3、6、8这四个点,2、4、5、7为该正方形的每条边的中点。此时,若得到率失真代价最小的第一待定点为1所在位置,则在1所在位置补做AC两点,可以将AC两 点设置为第一补充点;若得到率失真代价最小的第一待定点为3所在位置,则在3所在位置补做BD两点,可以将BD两点设置为第一补充点;若得到率失真代价最小的第一待定点为6所在位置,则在6所在位置补做EG两点,可以将EG两点设置为第一补充点;若得到率失真代价最小的第一待定点为8所在位置,则在8所在位置补做FH两点,可以将FH两点设置为第一补充点。
S310、终端判断第一待定点及第一补充点中率失真代价最小的点是否为第一待定点;若是,则执行步骤S311;若否,则执行步骤S312。
在得到第一补充点后,终端可以计算第一补充点的率失真代价,将第一补充点的率失真代价与第一待定点的率失真代价进行比较,判断第一补充点与第一待定点中率失真代价最小的点是否为第一待定点。
S311、终端将第一待定点所在位置设置为第二类型预测单元的当前运动矢量,并对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
当第一待定点及第一补充点中率失真代价最小的点为第一待定点时,将第一待定点所在位置设置为第二类型预测单元的当前运动矢量。以及,终端可以按照上述对第二类型预测单元的当前运动矢量进行修正的方式,对得到的第二类型预测单元的当前运动矢量进行修正,得到第二类型图像块的运动矢量。
S312、终端将第一待定点及第一补充点中率失真代价最小的点所在位置设置为第二类型图像块的当前运动矢量,并对当前运动矢量进行修正,得到第二类型图像块的运动矢量。
当第一待定点及第一补充点中率失真代价最小的点不是第一待定点时,终端可以将第一待定点及第一补充点中率失真代价最小的点所在位置设置为第二类型图像块的当前运动矢量。以及,终端可以按照上述对第二类型预测单元的当前运动矢量进行修正的方式,对得到的第二类型预测单元的当前运动矢量进行修正,得到第二类型图像块的运动矢量。
S313、当第一待定点对应的搜索步长在第二预设步长阈值范围内时,终端将第一待定点设置为第一起始搜索点,返回执行步骤S302。
在得到第一待定点后,终端可以判断该第一待定点对应的搜索步长是否在第二预设步长阈值范围内,其中,第二预设步长阈值范围可以根据实际需要进行灵活设置,具体取值在此处不作限定。
当第一待定点对应的搜索步长在第二预设步长阈值范围内时,将第一待定点设置为第一起始搜索点,返回执行按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内搜索多个第一候选点,从多个第一候选点中筛选出率失真代价最小的点,得到第一待定点的步骤。
在得到第一类型预测单元的运动矢量及第二类型预测单元的运动矢量后,终端可以根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量对图像帧进行分像素的运动估计,例如,终端可以根据得到的运动矢量进行离散余弦变换和量化等处理,得到残差系数。然后将得到的残差系数送入熵编码模块可以输出码流,同时,残差系数经反量化反变换之后,得到重构图像的残差值,再根据残差值获取重构图像,将重构图像经环内滤波之后,进入参考帧队列,作为下一帧的参考图像,从而一帧帧向后编码。
本申请实施例可以将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元。针对第一类型预测单元可以采用较复杂的搜索算法进行搜索,针对第二类型预测单元可以采用快速搜索算法进行搜索,从可以加速运动估计的过程;并且,对于一个预测单元中存在两个分割块时,后搜索的分割块可以参考将已搜索的分割块的最终搜索结果,也加速了运动估计过程;以及,通过修正策略将一些可能搜索到局部最优位置的结果得到校正,避免了搜索错误, 编码速度得到了较大提升,且压缩比损失较少。
为便于更好的实施本申请实施例提供的视频运动估计方法,本申请实施例还提供一种基于上述视频运动估计方法的装置。其中名词的含义与上述视频运动估计的方法中相同,具体实现细节可以参考方法实施例中的说明。
请参阅图12,图12为本申请实施例提供的视频运动估计装置的结构示意图,其中该视频运动估计装置可以包括分割单元401、第一获取单元402、第二获取单元403、及运动估计单元404。
其中,分割单元401,用于将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元。
关于分割单元401的具体实施可参见前面针对步骤S101所描述的实施例。
第一获取单元402,用于按照第一搜索算法获取第一类型预测单元的运动矢量。
关于第一获取单元402的具体实施可参见前面针对步骤S102所描述的实施例。
在某些实施方式中,如图14所示,第一获取单元402可以包括第二获取子单元4021、计算子单元4022、第三获取子单元4023、第三设置子单元4024及第四设置子单元4025等,具体可以如下:
第二获取子单元4021,用于获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点;
计算子单元4022,用于按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点;
第三获取子单元4023,用于当所述第二待定点对应的搜索步长为第二预设步长时,获取步长为所述第二预设步长对应的每个点周围未搜索的第二补充点,计算所述第二补充点的率失真代价;
第三设置子单元4024,用于当所述第二待定点及第二补充点中率失真代价最小的点为所述第二待定点时,将所述第二待定点所在位置设置为所述第一类型预测单元的运动矢量;
第四设置子单元4025,用于当所述第二待定点及第二补充点中率失真代价最小的点不是所述第二待定点时,将所述第二待定点设置为第二起始搜索点,由所述计算子单元执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
关于上述第二获取子单元4021、计算子单元4022、第三获取子单元4023、第三设置子单元4024及第四设置子单元4025的具体实施可参见前面针对按照第一搜索算法获取第一类型预测单元的运动矢量的步骤所描述的实施例。
可选地,第三设置子单元4024具体用于:
获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第一类型预测单元对应位置的第二目标率失真代价;
将第二待定点的率失真代价与第二目标率失真代价进行比较;
若第二待定点的率失真代价大于第二目标率失真代价,则将已搜索预测单元的运动矢量设置为第一类型预测单元的运动矢量;
若第二待定点的率失真代价小于或等于第二目标率失真代价,则将第二待定点所在位置设置为第一类型预测单元的运动矢量。
关于第三设置子单元4024的具体实施可参见前面针对将第二待定点所在位置设置为第一类型预测单元的运动矢量的步骤所描述的实施例。
可选地,第二类型预测单元包括第三分割块和第四分割块,第二获取子单元4021具体用于:
通过高级运动向量预测获取第一类型预测单元中第四分割块对应的至少一个第二候选起始搜索点;
当第一类型预测单元中第三分割块已经预测完成时,获取第三分割块的预测结果,计算每个第二候选起始搜索点的率失真代价,以及根据第三分割块的预测结果计算第三分割块所在位置的率失真代价;
从至少一个第二候选起始搜索点及第三分割块中,将率失真代价最小的点设置为第一类型预测单元中第四分割块的起始搜索点,并将第四分割块的起始搜索点设置为第二起始搜索点。
关于第二获取子单元4021的具体实施可参见前面针对获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点的步骤所描述的实施例。
在某些实施方式中,第一获取单元402还可以包括:
搜索子单元,用于当第二待定点对应的搜索步长在第三预设步长阈值范围内时,在以第二待定点为中心的预设范围内,按照预设间隔步长进行搜索,得到多个搜索点,计算每个搜索点的率失真代价;
第一执行子单元,用于将第二待定点及多个搜索点中率失真代价最小的点作为第二起始搜索点,由计算子单元执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。关于搜索子单元和第一执行子单元的具体实施可参见前面针对当第二待定点对应的搜索步长在第三预设步长阈值范围内时所描述的实施例。
在某些实施方式中,第一获取单元402还可以包括:
第二执行子单元,用于当第二待定点对应的搜索步长在第四预设步长阈值范围内时,将第二待定点作为第二起始搜索点,由计算子单元执行按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点的步骤。
关于第二执行子单元的具体实施可参见前面针对当第二待定点对应的搜索步长在第四预设步长阈值范围内时所描述的实施例。
第二获取单元403,用于按照第二搜索算法获取所述第二类型预测单元的运动矢量。
在某些实施方式中,如图13所示,第二获取单元403可以包括第一获取子单元4031及修正子单元4032等,具体可以如下:
第一获取子单元4031,用于按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量;
修正子单元4032,用于获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
关于第二获取单元403的具体实施可参见前面针对步骤S103所描述的实施例。
其中,在某些实施方式中,第一获取子单元4031可以包括:
搜索模块,用于按照第二搜索算法获取第二类型预测单元中的第一待定点;
获取模块,用于当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型,根据多边模型获取第一目标点;
移动模块,用于当第一目标点与第一待定点不一致时,移动多边模型,并根据移动后的多边模型获取最优点;
第一设置模块,用于若最优点与第一目标点一致,则将最优点所在位置设置为第二类型预测单元的当前运动矢量。
关于上述搜索模块、获取模块和移动模块的具体实施可参见前面针对按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量的步骤所描述的实施例。
可选地,移动模块可以具体用于:
当第一目标点与第一待定点不一致时,将多边模型的中心移动至第一目标点所在的位置;
从移动后的多边模型的中心及各个顶点中筛选率失真代价最小的点,得到最优点。
关于上述移动模块的具体实施可参见前面针对当第一目标点与第一待定点不一致时,移动多边模型,并根据移动后的多边模型获取最优点的步骤所描述的实施例。
可选地,第一获取子单元4031还可以包括:
第二设置模块,用于当第一目标点与第一待定点一致时,将第一目标点所在位置设置为第二类型预测单元的当前运动矢量。
在某些实施方式中,搜索模块可以包括:
搜索子模块,用于按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点;
获取模块具体用于:
当第一待定点对应的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型;
从多边模型的中点及各个顶点中选择率失真代价最小的点,得到第一目标点。
关于上述搜索子模块、获取模块的具体实施可参见前面针对按照第二搜索算法获取第二类型预测单元中的第一待定点,当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型,根据多边模型获取第一目标点的步骤所描述的实施例。
可选地,搜索子模块可以具体用于:
按照第二搜索算法获取第二类型预测单元对应的第一候选起始搜索点;
计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点;
按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内获取多个第一候选点;
从多个第一候选点中筛选出率失真代价最小的点,得到第一待定点。
关于上述搜索子模块的具体实施可参见前面针对按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点的步骤所描述的实施例。
在某些实施方式中,第二类型预测单元包括第一分割块和第二分割块,搜索子模块还具体用于:
按照第二搜索算法,通过高级运动向量预测获取第二类型预测单元中第二分割块对应的至少一个第一候选起始搜索点;
当第二类型预测单元中第一分割块已经预测完成时,获取第一分割块的预测结果,计算每个第一候选起始搜索点的率失真代价,以及根据第一分割块的预测结果计算第一分割块所在位置的率失真代价;
从至少一个第一候选起始搜索点及第一分割块中获取率失真代价最小的点;
将获取到的率失真代价最小的点设置为第二类型预测单元中第二分割块的起始搜索点,并将第二分割块的起始搜索点设置为第一起始搜索点。
关于上述第一分割块、第二分割块和搜索子模块的具体实施可参见前面针对按照第二搜索算法获取第二类型预测单元对应的第一候选起始搜索点,计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点的步骤所描述的实施例。
在某些实施方式中,获取模块还可以具体用于:
当第一待定点对应的搜索步长为第一预设步长时,获取步长为第一预设步长对应的每个点周围未搜索的第一补充点,并计算第一补充点的率失真代价;
当第一待定点及第一补充点中率失真代价最小的点为第一待定点时,将第一待定点所在位置设置为第二类型预测单元的当前运动矢量;
当第一待定点及第一补充点中率失真代价最小的点不是第一待定点时,将第一待定点及第一补充点中率失真代价最小的点所在位置设置为第二类型预测单元的当前运动矢量。
关于上述获取模块的具体实施可参见前面针对按照第二搜索算法获取第二类型预测单元中率失真代价最小的点,得到第一待定点的步骤之后所描述的实施例。
在某些实施方式中,获取模块还可以具体用于:
当第一待定点对应的搜索步长在第二预设步长阈值范围内时,将第一待定点设置为第一起始搜索点,返回执行按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内获取多个第一候选点的步骤。
在某些实施方式中,修正子单元4032具体用于:
获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第二类型预测单元对应位置的第一目标率失真代价;
根据第二类型预测单元的当前运动矢量,确定第二类型预测单元的当前率失真代价;
将第二类型预测单元的当前率失真代价与第一目标率失真代价进行比较;
若第二类型预测单元的当前率失真代价大于第一目标率失真代价,则将已搜索预测单元的运动矢量设置为第二类型预测单元的运动矢量;
若第二类型预测单元的当前率失真代价小于或等于第一目标率失真代价,则将当前率失真代价对应点所在位置设置为第二类型预测单元的运动矢量。
关于上述修正子单元4032的具体实施可参见前面针对获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量的步骤所描述的实施例。
运动估计单元404,用于根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计。
关于运动估计单元404的具体实施可参见前面针对步骤S104所描述的实施例。
相应的,本申请实施例还提供一种终端,如图15所示,该终端可以包括射频(RF,Radio Frequency)电路601、包括有一个或一个以上计算机可读存储介质的存储器602、输入单元603、显示单元604、传感器605、音频电路606、无线保真(WiFi,W ireless  Fidelity )模块607、包括有一个或者一个以上处理核心的处理器608、以及电源609等部件。本领域技术人员可以理解,图15中示出的终端结构并不构成 对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
RF电路601可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器608处理;另外,将涉及上行的数据发送给基站。通常,RF电路601包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM,Subscriber Identity Module)卡、收发信机、耦合器、低噪声放大器(LNA,Low Noise Amplifier)、双工器等。此外,RF电路601还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GSM,Global System of Mobile communication)、通用分组无线服务(GPRS,General Packet Radio Service)、码分多址(CDMA,Code Division Multiple Access)、宽带码分多址(WCDMA,Wideband Code Division Multiple Access)、长期演进(LTE,Long Term Evolution)、电子邮件、短消息服务(SMS,Short Messaging Service)等。
存储器602可用于存储计算机可读指令以及模块,处理器608通过运行存储在存储器602的计算机可读指令以及模块,从而执行各种功能应用以及数据处理。存储器602可主要包括存储计算机可读指令区和存储数据区,其中,存储计算机可读指令区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器602可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器602还可以包括存储器控制器,以提供处理器608和输入单元603对存储器602的访问。
输入单元603可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,在一个具体的实施例中,输入单元603可包括触敏表面以及其他输入设备。触敏表面,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面上或在触敏表面附近的操作),并根据预先设置的程式驱动相应的连接装置。可选的,触敏表面可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器608,并能接收处理器608发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面。除了触敏表面,输入单元603还可以包括其他输入设备。具体地,其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元604可用于显示由用户输入的信息或提供给用户的信息以及终端的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元604可包括显示面板,可选的,可以采用液晶显示器(LCD,Liquid Crystal Display)、有机发光二极管(OLED,Organic Light-Emitting Diode)等形式来配置显示面板。进一步的,触敏表面可覆盖显示面板,当触敏表面检测到在其上或附近的触摸操作后,传送给处理器608以确定触摸事件的类型,随后处理器608根据触摸事件的类型在显示面板上提供相应的视觉输出。虽然在图15中,触敏表面与显示面板是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面与显示面板集成而实现输入和输出功能。
终端还可包括至少一种传感器605,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在终端移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加 速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路606、扬声器,传声器可提供用户与终端之间的音频接口。音频电路606可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路606接收后转换为音频数据,再将音频数据输出处理器608处理后,经RF电路601以发送给比如另一终端,或者将音频数据输出至存储器602以便进一步处理。音频电路606还可能包括耳塞插孔,以提供外设耳机与终端的通信。
WiFi属于短距离无线传输技术,终端通过WiFi模块607可以帮助用户收发 电子邮件 、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图15示出了WiFi模块607,但是可以理解的是,其并不属于终端的必须构成,完全可以根据需要在不改变本申请的本质的范围内而省略。
处理器608是终端的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器602内的计算机可读指令和/或模块,以及调用存储在存储器602内的数据,执行终端的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器608可包括一个或多个处理核心;优选的,处理器608可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器608中。
终端还包括给各个部件供电的电源609(比如电池),优选的,电源可以通过电源管理系统与处理器608逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源609还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
尽管未示出,终端还可以包括摄像头、蓝牙模块等,在此不再赘述。具体在本实施例中,终端中的处理器608会按照如下的计算机可读指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器602中,并由处理器608来运行存储在存储器602中的应用程序,从而实现各种功能:
将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元;按照第一搜索算法获取第一类型预测单元的运动矢量;按照第二搜索算法获取第二类型预测单元的运动矢量;根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计。
可选地,按照第二搜索算法获取第二类型预测单元的运动矢量的步骤可以包括:按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量;获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
可选地,按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量的步骤可以包括:
按照第二搜索算法获取第二类型预测单元中的第一待定点;当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型,根据多边模型获取第一目标点;当第一目标点与第一待定点不一致时,移动多边模型,并根据移动后的多边模型获取最优点;若最优点与第一目标点一致,则将最优点所在位置设置为第二类型预测单元的当前运动矢量。
可选地,获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量的步骤可以包括:
获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量计算第二类型预测单元对应位置的第一目标率失真代价;根据第二类型预测单元的当前运动矢量,确定第二类型预测单元的当前率失真代价;将第二类型预测单元的当前率失真代价与第一目标率失真代价进行比较;若第二类型预测单元的当前率失真代价大于第一目标率失真代价,则将已搜索预测单元的运动矢量设置为第二类型预测单元的运动矢量;若第二类型预测单元的当前率失真代价小于或等于第一目标率失真代价,则将当前率失真代价对应点所在位置设置为第二类型预测单元的运动矢量。
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。
由上可知,本申请实施例可以将视频中的图像帧分割为多个预测单元,以及对多个预测单元进行分类,例如,将多个预测单元划分为第一类型预测单元和第二类型预测单元。针对不同类型的预测单元采用不同的搜索算法获取不同类型预测单元的运动矢量,例如,按照第一搜索算法获取第一类型预测单元的运动矢量,以及按照第二搜索算法获取第二类型预测单元的运动矢量。后续即可根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量对图像帧进行分像素的运动估计。由于该方案可以对多个预测单元进行分类,并采用不同的搜索算法获取不同类型预测单元的运动矢量,其搜索效率较高,因此,相对于现有技术中针对不同预测单元均统一采用相同的处理方式,提高了对视频进行运动估计的效率及灵活性。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过计算机可读指令来完成,或通过计算机可读指令控制相关的硬件来完成,该计算机可读指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例提供一种计算机可读存储介质,其中存储有多条计算机可读指令,该计算机可读指令能够被处理器进行加载,以执行本申请实施例所提供的任一种视频运动估计方法中的步骤。例如,该计算机可读指令可以执行如下步骤:
将视频中的图像帧分割为多个预测单元,以及将多个预测单元划分为第一类型预测单元和第二类型预测单元;按照第一搜索算法获取第一类型预测单元的运动矢量;按照第二搜索算法获取第二类型预测单元的运动矢量;根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对图像帧进行分像素的运动估计。
可选地,按照第二搜索算法获取第二类型预测单元的运动矢量的步骤可以包括:按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量;获取图像帧中已搜索预测单元的运动矢量,根据已搜索预测单元的运动矢量对当前运动矢量进行修正,得到第二类型预测单元的运动矢量。
可选地,按照第二搜索算法获取多边模型,并通过移动多边模型获取第二类型预测单元的当前运动矢量的步骤可以包括:
按照第二搜索算法获取第二类型预测单元中的第一待定点;当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以第一待定点为中心的多边模型,根据多边模型获取第一目标点;当第一目标点与第一待定点不一致时,移动多边模型,并根据移动后的多边模型获取最优点;若最优点与第一目标点一致,则将最优点所在位置设置为第二类型预测单元的当前运动矢量。
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
由于该存储介质中所存储的计算机可读指令,可以执行本申请实施例所提供的任一种视频运动估计方法中的步骤,因此,可以实现本申请实施例所提供的任一种视频运动估计方法所能实现的有益效果,详见前面的实施例,在此不再赘述。
以上对本申请实施例所提供的一种视频运动估计方法、装置和系统进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种视频运动估计方法,由终端执行,所述方法包括:
    将视频中的图像帧分割为多个预测单元,以及将所述多个预测单元划分为第一类型预测单元和第二类型预测单元;
    按照第一搜索算法获取所述第一类型预测单元的运动矢量;
    按照第二搜索算法获取所述第二类型预测单元的运动矢量,所述第二搜索算法与所述第一搜索算法不同;及
    根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对所述图像帧进行分像素的运动估计。
  2. 根据权利要求1所述的视频运动估计方法,其特征在于,所述按照第二搜索算法获取所述第二类型预测单元的运动矢量包括:
    按照第二搜索算法获取多边模型,并通过移动所述多边模型获取所述第二类型预测单元的当前运动矢量;及
    获取所述图像帧中已搜索预测单元的运动矢量,根据所述已搜索预测单元的运动矢量对所述当前运动矢量进行修正,得到所述第二类型预测单元的运动矢量。
  3. 根据权利要求2所述的视频运动估计方法,其特征在于,所述按照第二搜索算法获取多边模型,并通过移动所述多边模型获取所述第二类型预测单元的当前运动矢量包括:
    按照第二搜索算法获取所述第二类型预测单元中的第一待定点;
    当所述第一待定点的搜索步长在第一预设步长阈值范围内时,获取以所述第一待定点为中心的多边模型,根据所述多边模型获取第一目标点;
    当所述第一目标点与所述第一待定点一致时,将所述第一目标点所在位置设置为所述第二类型预测单元的当前运动矢量;及
    当所述第一目标点与所述第一待定点不一致时,移动所述多边模型,并根据移动后的多边模型获取最优点;若所述最优点与所述第一目标点一致,则将所述最优点所在位置设置为所述第二类型预测单元的当前运动矢量。
  4. 根据权利要求3所述的视频运动估计方法,其特征在于,所述当所述第一目标点与所述第一待定点不一致时,移动所述多边模型,并根据移动后的多边模型获取最优点包括:
    当所述第一目标点与所述第一待定点不一致时,将所述多边模型的中心移动至所述第一目标点所在的位置;及
    从移动后的多边模型的中心及各个顶点中筛选率失真代价最小的点,得到最优点。
  5. 根据权利要求3所述的视频运动估计方法,其特征在于,所述按照第二搜索算法获取所述第二类型预测单元中的第一待定点,当所述第一待定点的搜索步长在第一预设步长阈值范围内时,获取以所述第一待定点为中心的多边模型,根据所述多边模型获取第一目标点包括:
    按照第二搜索算法获取所述第二类型预测单元中率失真代价最小的点,得到第一待定点;
    当所述第一待定点对应的搜索步长在第一预设步长阈值范围内时,获取以所述第一待定点为中心的多边模型;及
    从所述多边模型的中点及各个顶点中选择率失真代价最小的点,得到第一目标点。
  6. 根据权利要求5所述的视频运动估计方法,其特征在于,所述按照第二搜索算法获取所述第二 类型预测单元中率失真代价最小的点,得到第一待定点包括:
    按照第二搜索算法获取第二类型预测单元对应的第一候选起始搜索点;
    计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点;
    按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内获取多个第一候选点;及
    从多个第一候选点中筛选出率失真代价最小的点,得到第一待定点。
  7. 根据权利要求6所述的视频运动估计方法,其特征在于,所述第二类型预测单元包括第一分割块和第二分割块,所述按照第二搜索算法获取第二类型预测单元对应的第一候选起始搜索点,计算每个第一候选起始搜索点的率失真代价,将率失真代价最小的第一候选起始搜索点设置为第一起始搜索点包括:
    按照第二搜索算法,通过高级运动向量预测获取第二类型预测单元中第二分割块对应的第一候选起始搜索点;
    当第二类型预测单元中第一分割块已经预测完成时,获取第一分割块的预测结果,计算每个第一候选起始搜索点的率失真代价,以及根据所述第一分割块的预测结果计算所述第一分割块所在位置的率失真代价;
    从所述第一候选起始搜索点及第一分割块中获取率失真代价最小的点;及
    将获取到的率失真代价最小的点设置为所述第二类型预测单元中第二分割块的起始搜索点,并将所述第二分割块的起始搜索点设置为第一起始搜索点。
  8. 根据权利要求5所述的视频运动估计方法,其特征在于,在所述按照第二搜索算法获取所述第二类型预测单元中率失真代价最小的点,得到第一待定点之后,所述方法还包括:
    当所述第一待定点对应的搜索步长为第一预设步长时,获取步长为所述第一预设步长对应的每个点周围未搜索的第一补充点,并计算所述第一补充点的率失真代价;
    当所述第一待定点及第一补充点中率失真代价最小的点为所述第一待定点时,将所述第一待定点所在位置设置为所述第二类型预测单元的当前运动矢量;及
    当所述第一待定点及第一补充点中率失真代价最小的点不是所述第一待定点时,将所述第一待定点及第一补充点中率失真代价最小的点所在位置设置为所述第二类型预测单元的当前运动矢量。
  9. 根据权利要求5所述的视频运动估计方法,其特征在于,在所述按照第二搜索算法获取所述第二类型预测单元中率失真代价最小的点,得到第一待定点之后,所述方法还包括:
    当所述第一待定点对应的搜索步长在第二预设步长阈值范围内时,将所述第一待定点设置为第一起始搜索点,返回执行所述按照第一预设递增步长在以第一起始搜索点为中心的搜索窗范围内获取多个第一候选点的步骤。
  10. 根据权利要求2所述的视频运动估计方法,其特征在于,所述获取所述图像帧中已搜索预测单元的运动矢量,根据所述已搜索预测单元的运动矢量对所述当前运动矢量进行修正,得到所述第二类型预测单元的运动矢量包括:
    获取所述图像帧中已搜索预测单元的运动矢量,根据所述已搜索预测单元的运动矢量计算所述第二类型预测单元对应位置的第一目标率失真代价;
    根据所述第二类型预测单元的当前运动矢量,确定所述第二类型预测单元的当前率失真代价;
    将所述第二类型预测单元的当前率失真代价与所述第一目标率失真代价进行比较;
    若所述第二类型预测单元的当前率失真代价大于所述第一目标率失真代价,则将所述已搜索预测 单元的运动矢量设置为所述第二类型预测单元的运动矢量;及
    若所述第二类型预测单元的当前率失真代价小于或等于所述第一目标率失真代价,则将所述当前率失真代价对应点所在位置设置为所述第二类型预测单元的运动矢量。
  11. 根据权利要求1至10任一项所述的视频运动估计方法,其特征在于,按照第一搜索算法获取第一类型预测单元的运动矢量的步骤包括:
    获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点;
    按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点;
    当所述第二待定点对应的搜索步长为第二预设步长时,获取步长为所述第二预设步长对应的每个点周围未搜索的第二补充点,计算所述第二补充点的率失真代价;
    当所述第二待定点及第二补充点中率失真代价最小的点为所述第二待定点时,将所述第二待定点所在位置设置为所述第一类型预测单元的运动矢量;及
    当所述第二待定点及第二补充点中率失真代价最小的点不是所述第二待定点时,将所述第二待定点及第二补充点中率失真代价最小的点所在位置设置为所述第一类型预测单元的运动矢量。
  12. 根据权利要求11所述的视频运动估计方法,其特征在于,所述将所述第二待定点所在位置设置为所述第一类型预测单元的运动矢量的步骤包括:
    获取所述图像帧中已搜索预测单元的运动矢量,根据所述已搜索预测单元的运动矢量计算所述第一类型预测单元对应位置的第二目标率失真代价;
    将所述第二待定点的率失真代价与第二目标率失真代价进行比较;
    若所述第二待定点的率失真代价大于第二目标率失真代价,则将已搜索预测单元的运动矢量设置为所述第一类型预测单元的运动矢量;及
    若所述第二待定点的率失真代价小于或等于第二目标率失真代价,则将所述第二待定点所在位置设置为所述第一类型预测单元的运动矢量。
  13. 根据权利要求11所述的视频运动估计方法,其特征在于,所述第二类型预测单元包括第三分割块和第四分割块,所述获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点的步骤包括:
    通过高级运动向量预测获取第一类型预测单元中第四分割块对应的第二候选起始搜索点;
    当第一类型预测单元中第三分割块已经预测完成时,获取第三分割块的预测结果,计算每个第二候选起始搜索点的率失真代价,以及根据第三分割块的预测结果计算所述第三分割块所在位置的率失真代价;及
    从所述第二候选起始搜索点及第三分割块中,将率失真代价最小的点设置为第一类型预测单元中第四分割块的起始搜索点,并将所述第四分割块的起始搜索点设置为第二起始搜索点。
  14. 一种视频运动估计装置,包括:
    分割单元,用于将视频中的图像帧分割为多个预测单元,以及将所述多个预测单元划分为第一类型预测单元和第二类型预测单元;
    第一获取单元,用于按照第一搜索算法获取所述第一类型预测单元的运动矢量;
    第二获取单元,用于按照第二搜索算法获取所述第二类型预测单元的运动矢量,所述第二搜索算法与所述第一搜索算法不同;及
    运动估计单元,用于根据第一类型预测单元的运动矢量及第二类型预测单元的运动矢量,对所述图像帧进行分像素的运动估计。
  15. 根据权利要求14所述的视频运动估计装置,其特征在于,所述第二获取单元包括:
    第一获取子单元,用于按照第二搜索算法获取多边模型,并通过移动所述多边模型获取所述第二类型预测单元的当前运动矢量;及
    修正子单元,用于获取所述图像帧中已搜索预测单元的运动矢量,根据所述已搜索预测单元的运动矢量对所述当前运动矢量进行修正,得到所述第二类型预测单元的运动矢量。
  16. 根据权利要求15所述的视频运动估计装置,其特征在于,所述第一获取子单元包括:
    搜索模块,用于按照第二搜索算法获取所述第二类型预测单元中的第一待定点;
    获取模块,用于所述当第一待定点的搜索步长在第一预设步长阈值范围内时,获取以所述第一待定点为中心的多边模型,根据所述多边模型获取第一目标点;
    移动模块,用于当所述第一目标点与所述第一待定点不一致时,移动所述多边模型,并根据移动后的多边模型获取最优点;及
    第一设置模块,用于若所述最优点与所述第一目标点一致,则将所述最优点所在位置设置为所述第二类型预测单元的当前运动矢量。
  17. 根据权利要求14所述的视频运动估计装置,其特征在于,所述第一获取单元包括:
    第二获取子单元,用于获取第一类型预测单元对应的第二候选起始搜索点,计算每个第二候选起始搜索点的率失真代价,将率失真代价最小的第二候选起始搜索点设置为第二起始搜索点;
    计算子单元,用于按照第二预设递增步长在以第二起始搜索点为中心的搜索窗范围内获取多个第二候选点,并计算每个第二候选点的率失真代价,从多个第二候选点中筛选出率失真代价最小的点,得到第二待定点;
    第三获取子单元,用于当所述第二待定点对应的搜索步长为第二预设步长时,获取步长为所述第二预设步长对应的每个点周围未搜索的第二补充点,计算所述第二补充点的率失真代价;
    第三设置子单元,用于当所述第二待定点及第二补充点中率失真代价最小的点为所述第二待定点时,将所述第二待定点所在位置设置为所述第一类型预测单元的运动矢量;
    第四设置子单元,用于当所述第二待定点及第二补充点中率失真代价最小的点不是所述第二待定点时,将所述第二待定点设置为第二起始搜索点。
  18. 根据权利要求17所述的视频运动估计装置,其特征在于,所述第一获取单元包括:
    搜索子单元,用于当所述第二待定点对应的搜索步长在第三预设步长阈值范围内时,在以所述第二待定点为中心的预设范围内,按照预设间隔步长进行搜索,得到多个搜索点,计算每个搜索点的率失真代价;
    第一执行子单元,用于将所述第二待定点及多个搜索点中率失真代价最小的点作为第二起始搜索点。
  19. 一种终端,包括存储器和处理器,所述存储器存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行权利要求1至13任一项所述的视频运动估计方法中的步骤。
  20. 一种非易失性的计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行权利要求1至13任一项所述的视频运动估计方法中的步骤。
PCT/CN2019/075548 2018-03-07 2019-02-20 视频运动估计方法、装置、终端及存储介质 WO2019169997A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP19764644.1A EP3764648A4 (en) 2018-03-07 2019-02-20 METHOD AND DEVICE FOR MOTION ESTIMATION FOR VIDEO, TERMINAL DEVICE AND STORAGE MEDIUM
JP2020540622A JP7024099B2 (ja) 2018-03-07 2019-02-20 ビデオ動き推定方法、装置、端末、及び記憶媒体
US16/910,938 US11375227B2 (en) 2018-03-07 2020-06-24 Video motion estimation method and apparatus, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810188556.6A CN110213591B (zh) 2018-03-07 2018-03-07 一种视频运动估计方法、装置及存储介质
CN201810188556.6 2018-03-07

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/910,938 Continuation US11375227B2 (en) 2018-03-07 2020-06-24 Video motion estimation method and apparatus, and storage medium

Publications (1)

Publication Number Publication Date
WO2019169997A1 true WO2019169997A1 (zh) 2019-09-12

Family

ID=67778816

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/075548 WO2019169997A1 (zh) 2018-03-07 2019-02-20 视频运动估计方法、装置、终端及存储介质

Country Status (5)

Country Link
US (1) US11375227B2 (zh)
EP (1) EP3764648A4 (zh)
JP (1) JP7024099B2 (zh)
CN (1) CN110213591B (zh)
WO (1) WO2019169997A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770345A (zh) * 2020-07-22 2020-10-13 腾讯科技(深圳)有限公司 编码单元的运动估计方法、装置、设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112203095B (zh) * 2020-12-04 2021-03-09 腾讯科技(深圳)有限公司 视频运动估计方法、装置、设备及计算机可读存储介质
CN113963433B (zh) * 2021-09-15 2024-03-26 北京百度网讯科技有限公司 运动搜索方法、装置、电子设备及存储介质
CN114627559B (zh) * 2022-05-11 2022-08-30 深圳前海运动保网络科技有限公司 基于大数据分析的运动计划规划方法、装置、设备及介质
WO2024216412A1 (zh) * 2023-04-16 2024-10-24 Oppo广东移动通信有限公司 一种编码方法、编码器以及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494757A (zh) * 2009-01-23 2009-07-29 上海广电(集团)有限公司中央研究院 一种基于时空域混合信息的运动估计方法
CN101754022A (zh) * 2008-12-01 2010-06-23 三星电子株式会社 低复杂度的运动估计方法
CN102170567A (zh) * 2010-06-22 2011-08-31 上海盈方微电子有限公司 一种基于预测运动矢量搜索的自适应运动估计算法
CN107135392A (zh) * 2017-04-21 2017-09-05 西安电子科技大学 基于异步模式的hevc运动搜索并行方法

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3299671B2 (ja) * 1996-03-18 2002-07-08 シャープ株式会社 画像の動き検出装置
WO2004030369A1 (en) * 2002-09-27 2004-04-08 Videosoft, Inc. Real-time video coding/decoding
TWI279145B (en) * 2004-07-20 2007-04-11 Mediatek Inc Motion estimation method for video encoding
TWI256259B (en) * 2005-03-21 2006-06-01 Pixart Imaging Inc Improved diamond search and dynamic estimation method
US8913660B2 (en) * 2005-04-14 2014-12-16 Fastvdo, Llc Device and method for fast block-matching motion estimation in video encoders
CN101170696B (zh) * 2007-11-26 2010-12-01 电子科技大学 一种运动估计方法
CN101431675B (zh) * 2008-12-09 2010-12-08 青岛海信电子产业控股股份有限公司 一种像素运动估计方法和装置
WO2011096770A2 (ko) * 2010-02-02 2011-08-11 (주)휴맥스 영상 부호화/복호화 장치 및 방법
BR122020018527B1 (pt) * 2011-01-13 2022-05-24 Nec Corporation Dispositivo de criptografia de vídeo, dispositivo de decodificação de vídeo, método de criptografia de vídeo e método de decodificação de vídeo.
US11245912B2 (en) * 2011-07-12 2022-02-08 Texas Instruments Incorporated Fast motion estimation for hierarchical coding structures
US10757437B2 (en) * 2014-07-17 2020-08-25 Apple Inc. Motion estimation in block processing pipelines
WO2016031253A1 (ja) * 2014-08-28 2016-03-03 日本電気株式会社 ブロックサイズ決定方法及びプログラム記録媒体
US10516882B2 (en) * 2015-01-29 2019-12-24 Vid Scale, Inc. Intra-block copy searching

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754022A (zh) * 2008-12-01 2010-06-23 三星电子株式会社 低复杂度的运动估计方法
CN101494757A (zh) * 2009-01-23 2009-07-29 上海广电(集团)有限公司中央研究院 一种基于时空域混合信息的运动估计方法
CN102170567A (zh) * 2010-06-22 2011-08-31 上海盈方微电子有限公司 一种基于预测运动矢量搜索的自适应运动估计算法
CN107135392A (zh) * 2017-04-21 2017-09-05 西安电子科技大学 基于异步模式的hevc运动搜索并行方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JIANG JIE ET AL.: "Fast Intra Coding Algorithm using smooth region detection for HEVC", JOURNAL OF XIDIAN UNIVERSITY, vol. 40, no. 03, 20 June 2013 (2013-06-20), pages 194 - 200, XP055636313 *
See also references of EP3764648A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770345A (zh) * 2020-07-22 2020-10-13 腾讯科技(深圳)有限公司 编码单元的运动估计方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110213591A (zh) 2019-09-06
EP3764648A1 (en) 2021-01-13
US11375227B2 (en) 2022-06-28
EP3764648A4 (en) 2021-05-12
JP2021513771A (ja) 2021-05-27
US20200322624A1 (en) 2020-10-08
JP7024099B2 (ja) 2022-02-22
CN110213591B (zh) 2023-02-28

Similar Documents

Publication Publication Date Title
US10986332B2 (en) Prediction mode selection method, video encoding device, and storage medium
WO2019169997A1 (zh) 视频运动估计方法、装置、终端及存储介质
JP7229261B2 (ja) ビデオ符号化のビットレート制御方法、装置、機器、記憶媒体及びプログラム
CN115002463B (zh) 图像处理方法、智能终端及存储介质
WO2018036352A1 (zh) 视频数据的编解码方法、装置、系统及存储介质
KR102225235B1 (ko) 비디오 인코딩 방법, 장치, 및 디바이스, 및 저장 매체
CN110209449B (zh) 一种游戏中光标定位方法和装置
CN105992001A (zh) 一种对图片进行量化处理的方法及装置
US10887586B2 (en) Picture encoding method and terminal
US10827198B2 (en) Motion estimation method, apparatus, and storage medium
CN115379214A (zh) 图像处理方法、智能终端及存储介质
CN105184750A (zh) 一种在移动终端对实时视频图像去噪的方法和装置
CN112866710B (zh) 一种编码单元处理方法和相关装置
CN105187831B (zh) 一种对图像进行压缩的方法和装置
CN109003313B (zh) 一种传输网页图片的方法、装置和系统
CN116847088B (zh) 图像处理方法、处理设备及存储介质
CN110213593B (zh) 一种运动矢量的确定方法、编码压缩方法和相关装置
CN105208391A (zh) 帧内预测方法及装置

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: 19764644

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020540622

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019764644

Country of ref document: EP

Effective date: 20201007