WO2017005146A1 - 视频编码和解码方法、视频编码和解码装置 - Google Patents

视频编码和解码方法、视频编码和解码装置 Download PDF

Info

Publication number
WO2017005146A1
WO2017005146A1 PCT/CN2016/088157 CN2016088157W WO2017005146A1 WO 2017005146 A1 WO2017005146 A1 WO 2017005146A1 CN 2016088157 W CN2016088157 W CN 2016088157W WO 2017005146 A1 WO2017005146 A1 WO 2017005146A1
Authority
WO
WIPO (PCT)
Prior art keywords
search
image
pixel
motion vector
current
Prior art date
Application number
PCT/CN2016/088157
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 EP16820797.5A priority Critical patent/EP3306936B1/en
Priority to CN201680037414.9A priority patent/CN108141607A/zh
Publication of WO2017005146A1 publication Critical patent/WO2017005146A1/zh
Priority to US15/860,531 priority patent/US10523965B2/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/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/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • 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/56Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search
    • 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/136Incoming video signal characteristics or properties
    • 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/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence 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/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/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/533Motion estimation using multistep search, e.g. 2D-log search or one-at-a-time search [OTS]
    • 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
    • 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/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • 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/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to a video encoding and decoding method, a video encoding and decoding apparatus.
  • MPEG is responsible for the development of standards in the multimedia field, mainly for storage, broadcast television, Internet or streaming media on the wireless network.
  • ITU-T mainly develops video coding standards for real-time video communication, such as video telephony, video conferencing and other applications.
  • video coding standards for various applications have been successfully developed internationally, including: MPEG-1 standard for Video Compact Disc (VCD) for digital MPEG-2 standard for Digital Video Disc (“DVD”) and Digital Video Broadcasting (“DVB”), H.261 standard for video conferencing and H.263 standard,
  • the H.264 standard allows the MPEG-4 standard for encoding objects of any shape, as well as the latest High Efficiency Video Coding (“HEVC”) standard.
  • HEVC High Efficiency Video Coding
  • each image of the image sequence can be The image is divided into a number of coded blocks that do not overlap each other, and the motion of all the pixels in the coded block is considered to be the same, and the motion vector is allocated in units of coded blocks.
  • the relative displacement of the spatial position between the current coding block and the matching block in the reference image is the motion vector (Motion Vector, MV), and the process of obtaining the motion vector is called Motion Estimation (ME).
  • Motion Vector Motion Vector
  • the reference image information, the motion vector information, and the difference (residual difference) between the matching block reconstructed pixel value and the original block original pixel value are encoded and transmitted to the decoding end.
  • the decoding end finds the block pointed to by the motion vector from the decoded reference image, and adds the residual value to recover the current block.
  • Motion estimation can be used to remove inter-image redundancy of video sequences, resulting in a significant reduction in the number of bits transmitted by the video.
  • the motion vectors of the blocks are not all based on the whole pixel, and the actual motion displacement is 1/4 pixel, even 1/8 pixel.
  • Subpixels are in units.
  • Both H.264 and HEVC use fixed luminance 1/4 pixel motion vector accuracy and chrominance 1/8 pixel motion vector accuracy, which greatly improves coding performance compared to integer pixel motion vector accuracy.
  • the search step size in the process of searching for a matching block within a given search range of the current block in the reference image is also sub-pixel motion vector precision.
  • the search block used in the reference image of the current block of each video image employs a fixed sub-pixel motion vector accuracy.
  • Embodiments of the present invention provide a video encoding and decoding method, a video encoding and decoding apparatus, which can perform encoding and decoding in combination with video characteristics.
  • a first aspect of the embodiments of the present invention provides a video encoding method, including:
  • Obtaining a current image acquiring motion vector precision of the current image according to the current image, where the motion vector precision includes a search step set, and each search step in the search step set is less than one pixel unit;
  • the motion vector information including a search step number and a search direction of the matching block relative to the search start point, the prediction residual signal being used to indicate the current block and the matching The residual between blocks;
  • the information of the reference image, the motion vector information, and the prediction residual signal are written into a code stream, and the information of the reference image is used to indicate the reference image.
  • the method further includes:
  • the search step set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the searching for the matching block from the target integer pixel point according to the motion vector precision includes:
  • the target 1/2 j pixel is used as a starting point, and the preset step is repeated after the value of j is incremented by one.
  • the motion vector accuracy further includes a threshold set, the threshold set including at least one threshold
  • the method further includes:
  • Determining, according to each threshold value in the threshold set and the search starting point, a search area corresponding to the threshold, where the search starting point is located in the search area, and search steps in the search area corresponding to each threshold respectively are Searching for each element in the step size collection one by one; among them,
  • the search area corresponding to the threshold corresponding to the size of the step size y1 and y2, y1 ⁇ y2, y2 in the search step size set is surrounded by the search area corresponding to the threshold corresponding to y1, and The search areas corresponding to the thresholds corresponding to y1 are connected.
  • the threshold set includes m1 and m2, where the m1 is a positive integer multiple of 2 or 0, The m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the determining the search area corresponding to the threshold according to each threshold of the threshold set and the search starting point includes:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step size set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2, m1 ⁇ m2;
  • the searching for the matching block from the target integer pixel point according to the motion vector precision includes:
  • the target y1 pixel point is obtained from the y1 pixel point located in the search area corresponding to the m1, and the target y1 pixel point is determined.
  • the location is the location of the matching block.
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2 , 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the acquiring, by the current image, the motion vector accuracy of the current image includes:
  • Acquiring encoding information of each encoded image in the encoded image set the encoding information including a motion vector difference value of each coding block in the encoded image and a pixel point included in each coding block in the encoded image a number, wherein the motion vector difference value of the coding block is used to indicate the motion vector information when the coding block is a current block;
  • a motion severity of the encoded image is an average of a first value of each coded block in the encoded image, the encoded block
  • the first value is a sum of an absolute value of a horizontal component of the motion vector difference value of the coding block and an absolute value of a vertical component of the motion vector difference value and a multiplication of the number of pixel points included in the coding block product;
  • the acquiring, by the current image, the motion vector accuracy of the current image further includes:
  • the reference parameter including one of texture complexity of the current image, texture complexity of the encoded image set, and inter-image noise of the encoded image set, or including the current image
  • the acquiring the reference parameter includes:
  • the obtaining reference parameters includes:
  • the obtaining reference parameters includes:
  • Determining the motion vector accuracy of the current image according to the preset policy according to the motion severity of the encoded image set and the quantization parameter of the current image specifically includes:
  • the acquiring, by the current image, the motion vector accuracy of the current image includes:
  • a second aspect of the present invention provides a video decoding method, including:
  • the motion vector precision comprising a search step size set, each search step size in the search step size set being less than one pixel unit;
  • the motion vector information includes a search step number and a search direction of a matching block of the current block in the reference image with respect to the search start point, where the prediction residual signal is used to indicate the current block and the Match the residuals between blocks;
  • the search step set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the motion vector accuracy further includes a threshold set, the threshold set including at least one threshold
  • the method further includes:
  • the search area corresponding to the threshold Determining, according to each threshold value in the threshold set, the search area corresponding to the threshold, the search starting point is located in the search area, and the search step lengths in the search areas corresponding to different thresholds are respectively Search for different elements in the step size collection;
  • Each element in the set of thresholds respectively corresponds to a different element in the set of search steps; wherein a threshold corresponding to the size of the adjacent y1 and y2, y1 ⁇ y2, y2 in the search step size set corresponds to The search area is surrounded by the search area corresponding to the threshold corresponding to y1, and is connected to the search area corresponding to the threshold corresponding to the y1.
  • the threshold set includes m1 and m2, wherein the m1 is a positive integer multiple of 2 or 0, the m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the determining the search area corresponding to the threshold according to each threshold of the threshold set and the search starting point includes:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the set of search steps include y1, y2, y1 ⁇ y2; elements in the threshold set Including m1, m2;
  • the searching for the matching block according to the reference image, the search starting point, the motion vector information, and the motion vector precision of the current image includes:
  • Determining a temporary point, a motion vector of the temporary point relative to the search starting point is a number of search steps and a search direction in the motion vector information, and a search step size is a minimum element in the search step set;
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/16 ⁇ , or It is ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the obtaining the current image and the motion vector accuracy of the current image include:
  • the obtaining the current image and the motion vector accuracy of the current image include:
  • the decoding information includes a motion vector difference value of each decoded block in the decoded image and a pixel point included in each decoded block in the decoded image a number, wherein the motion vector difference value of the decoding block is used to indicate the motion vector information when the decoding block is the current block;
  • a motion severity of the decoded image is an average of a first value of each decoded block in the decoded image, the decoded block
  • the first value is a product of a sum of an absolute value of a horizontal component of the motion vector difference value of the decoding block and an absolute value of a vertical component of the motion vector difference value and a number of pixel points included in the decoding block;
  • the acquiring the current image and the motion vector accuracy of the current image further includes:
  • the obtaining the motion vector accuracy of the current image according to the preset strategy according to the motion severity of the decoded image set and the quantization parameter of the current image specifically includes:
  • the texture complexity of the decoded image set determines a motion vector accuracy of the current image according to a preset strategy.
  • the obtaining the motion vector accuracy of the current image includes:
  • a video encoding apparatus includes:
  • a first acquiring unit configured to acquire a motion vector accuracy of the current image according to the current image, where the motion vector accuracy includes a search step set, where each search step in the search step set is less than one Pixel unit
  • a second acquiring unit configured to acquire a current block and a reference image of the current block, where the current block is an image block to be currently encoded in the current image
  • a first determining unit configured to determine a search starting point in the reference image, and search for a target integer pixel in a pixel unit as a search step from the beginning of the search;
  • a searching unit configured to search for a matching block of the current block from the target integer pixel point according to the motion vector precision
  • a third acquiring unit configured to acquire motion vector information and a prediction residual signal, where the motion vector information includes a search step number and a search direction of the matching block relative to the search start point, where the prediction residual signal is used to indicate Determining a residual between the current block and the matching block;
  • a writing unit configured to write information of the reference image, the motion vector information, and the prediction residual signal into a code stream, where information of the reference image is used to indicate the reference image.
  • the writing unit is further configured to write the information of the motion vector accuracy and/or the information of the search starting point into the code stream, where The information of the motion vector accuracy is used to indicate the motion vector accuracy, and the information of the search starting point is used to indicate the search starting point.
  • the search step size set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the searching unit is specifically configured to:
  • the target 1/2 j pixel is used as a starting point, and the preset step is repeated after the value of j is incremented by one.
  • the motion vector precision further includes a threshold set, The threshold set includes at least one threshold;
  • the video encoding device further includes:
  • a second determining unit configured to determine, according to each threshold value in the threshold set and the search starting point, a search area corresponding to the threshold, where the search starting point is located in the search area, and each threshold corresponds to a search area Search step sizes respectively correspond to each element in the search step set;
  • the search area corresponding to the threshold corresponding to the size of the step size y1 and y2, y1 ⁇ y2, y2 in the search step size set is surrounded by the search area corresponding to the threshold corresponding to y1, and The search areas corresponding to the thresholds corresponding to y1 are connected.
  • the threshold set includes m1 and m2, where the m1 is a positive integer multiple of 2 or 0, The m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the second determining unit is specifically configured to:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step size set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2, m1 ⁇ m2;
  • the search unit is specifically configured to:
  • the target y1 pixel point is obtained from the y1 pixel point located in the search area corresponding to the m1, and the target y1 pixel point is determined.
  • the location is the location of the matching block.
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2 , 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the first acquiring unit is specifically configured to: obtain a quantization parameter of the current image, and an encoded image set, where the encoded image set includes at least one encoded image;
  • Acquiring encoding information of each encoded image in the encoded image set the encoding information including a motion vector difference value of each coding block in the encoded image and a pixel point included in each coding block in the encoded image a number, wherein the motion vector difference value of the coding block is used to indicate the motion vector information when the coding block is a current block;
  • a motion severity of the encoded image is an average of a first value of each coded block in the encoded image, the encoded block
  • the first value is a product of a sum of an absolute value of a horizontal component of the motion vector difference value of the coding block and an absolute value of a vertical component of the motion vector difference value and a number of pixel points included in the coding block;
  • the first acquiring unit is further configured to:
  • the reference parameter including one of texture complexity of the current image, texture complexity of the encoded image set, and inter-image noise of the encoded image set, or including the current image
  • the first acquiring unit is configured to:
  • the first acquisition when the reference parameter includes a texture complexity of the encoded image set Unit is used to:
  • the first acquiring unit is configured to:
  • Determining the motion vector accuracy of the current image according to the preset policy according to the motion severity of the encoded image set and the quantization parameter of the current image specifically includes:
  • the first acquiring unit is specifically configured to:
  • a fourth aspect of the present invention provides a video decoding apparatus, including:
  • a first acquiring unit configured to acquire a current image and a motion vector accuracy of the current image, where the motion vector accuracy includes a search step size set, where each search step size in the search step size set is less than one pixel unit;
  • a second acquiring unit configured to acquire motion vector information, a prediction residual signal, and a reference image of the current block, and a search starting point in the reference image, where the current block is The image block to be decoded in the current image, the motion vector information includes a search step number and a search direction of a matching block of the current block in the reference image with respect to the search start point, and the prediction residual signal Used to indicate a residual between the current block and the matching block;
  • a searching unit configured to search for a matching block of the current block according to the reference image, the search starting point, the motion vector information, and a motion vector precision of the current image
  • a reconstruction unit configured to acquire, according to the matching block and the prediction residual signal, a reconstructed pixel value of the current block.
  • the search step set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the video encoding device further includes:
  • a determining unit configured to determine, according to each threshold value in the threshold set and the search starting point, a search area corresponding to the threshold, where the search starting point is located in the search area, and search steps in a search area corresponding to different thresholds
  • the lengths are respectively different elements in the set of search steps
  • Each element in the set of thresholds respectively corresponds to a different element in the set of search steps; wherein a threshold corresponding to the size of the adjacent y1 and y2, y1 ⁇ y2, y2 in the search step size set corresponds to The search area is surrounded by the search area corresponding to the threshold corresponding to y1, and is connected to the search area corresponding to the threshold corresponding to the y1.
  • the threshold set includes m1 and m2, wherein the m1 is a positive integer multiple of 2 or 0, the m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the determining unit is specifically configured to:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square with the side of the search starting point and 2m2* the smallest pixel unit being the side length shape;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2;
  • the searching unit is specifically configured to:
  • Determining a temporary point, a motion vector of the temporary point relative to the search starting point is a number of search steps and a search direction in the motion vector information, and a search step size is a minimum element in the search step set;
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/16 ⁇ , or It is ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the first acquiring unit is specifically configured to:
  • the first acquiring unit is specifically configured to:
  • the decoding information includes a motion vector difference value of each decoded block in the decoded image and a pixel point included in each decoded block in the decoded image a number, wherein the motion vector difference value of the decoding block is used to indicate the motion vector information when the decoding block is the current block;
  • a motion severity of the decoded image is an average of a first value of each decoded block in the decoded image, the decoded block
  • the first value is a product of a sum of an absolute value of a horizontal component of the motion vector difference value of the decoding block and an absolute value of a vertical component of the motion vector difference value and a number of pixel points included in the decoding block;
  • the preset strategy acquires motion vector accuracy of the current image.
  • the first obtaining unit is further configured to:
  • the obtaining the motion vector accuracy of the current image according to the preset strategy according to the motion severity of the decoded image set and the quantization parameter of the current image specifically includes:
  • the first acquiring unit is specifically configured to:
  • the inventors of the present application have found that adaptively selecting the motion vector accuracy of a video image in the video sequence for a video sequence of different content characteristics is more advantageous for encoding the video image, for example, a video with slow motion and less texture details.
  • Image when searching for matching blocks in the reference image, the motion vector with smaller precision can be saved compared to the motion vector with larger precision, and the steps required for motion vector coding can be saved, and the steps of motion search in motion estimation can be reduced.
  • the calculation amount of interpolating the reference image saves the encoding and decoding time; for the video image with strong motion and complex texture, when searching for the matching block in the reference image, the motion vector with smaller precision can be compared with the motion with larger precision.
  • the vector obtains a matching block that is more similar to the current block, reduces the prediction residual, and improves the coding efficiency.
  • the content characteristic of the current image is obtained according to the current image, or in other embodiments. Obtaining a content characteristic of the current image according to the current image and the encoded image, thereby determining a motion vector precision that matches a content characteristic of the current image, so as to search for a matching block of the current block in the reference image of the current block, according to the target
  • the integer pixel and the motion vector precision are used to search for matching blocks.
  • FIG. 1 is a schematic flowchart of a video encoding method according to an embodiment of the present invention
  • FIG. 2 and FIG. 3 are schematic structural diagrams of a search area in a video encoding method according to the present invention.
  • FIG. 4 is a schematic flow chart of another embodiment of a video encoding method according to the present invention.
  • FIG. 5 is a schematic flowchart diagram of a video encoding method according to an embodiment of the present invention.
  • FIG. 6 is a schematic flow chart of another embodiment of a video decoding method according to the present invention.
  • FIG. 7 is a schematic structural diagram of a video encoding apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a video decoding apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of another video encoding apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another video decoding apparatus according to an embodiment of the present invention.
  • Embodiments of the present invention provide a video encoding and decoding method, a video encoding and decoding apparatus, which can perform encoding and decoding in combination with video characteristics.
  • the video encoding method provided by the embodiment of the present invention is described.
  • the main body of the video encoding method provided by the embodiment of the present invention is a video encoding device, where the video encoding device can be any device that needs to output and store video, such as a mobile phone or a notebook. Computers, tablets, personal computers and other equipment.
  • FIG. 1 is a schematic flowchart diagram of a video encoding method according to an embodiment of the present invention.
  • a video encoding method provided by an embodiment of the present invention may include the following content:
  • Obtaining a plurality of methods of motion vector accuracy of the current image according to the current image For example, a parameter that can indicate the content characteristics of the current image is first calculated.
  • the video encoding device is provided with a list, and the list has different motion vector precisions corresponding to different parameters.
  • the motion vector accuracy of the current image is determined according to the table lookup method.
  • the motion vector precision is used to indicate a search step size when searching for a matching block of the current block starting from a preset starting point.
  • the preset starting point is the target integer pixel in step 103.
  • the motion vector accuracy includes a search step set, the search step set including at least one search step, and each search step being less than one pixel unit.
  • the motion vector accuracy may be a single motion vector precision, or, preferably, may be a stepped motion vector precision.
  • the search step size set is ⁇ 1/2 x ⁇ , where x is a positive integer. That is, the search step size set includes only one search step size, and the search step size is 1/2 x pixel units.
  • the search step size may be 1/2 pixel unit, 1/4 pixel unit, 1/8 pixel unit, or 1/16 pixel unit, etc., and is not limited herein.
  • the motion vector accuracy also includes a threshold set that includes at least one threshold. Wherein each threshold is used to indicate a search area in the reference image. Each search step in the search step set in the motion vector accuracy corresponds to each threshold in the threshold set, and the search step corresponding to the threshold in the search area indicated by each threshold is used as the search step.
  • the current block is an image block to be currently encoded in the current image.
  • a block that is most similar to the current block is found in the reference image according to a certain matching criterion, and is called a matching block of the current block. Therefore, it is necessary to determine the reference image of the current block.
  • an advanced motion vector prediction method (English name: Advanced Motion Vector Prediction, abbreviation: AMVP) can be used to obtain a motion vector predictor of the current block (MVP) is set, and the MVP with the lowest rate distortion cost in the MVP set is taken as the MVP of the current block.
  • AMVP Advanced Motion Vector Predictor
  • the position in the reference image pointed to by the MVP is the position of the predicted matching block of the current block in the reference image.
  • the prediction matching block pointed to by the MVP is not actually the matching block with the highest similarity with the current block in the reference image.
  • the prediction matching block pointed to by the MVP is also used.
  • the position is the search starting point, and the position of the matching block of the current image is further searched in the reference image.
  • the whole pixel motion search is performed in one pixel unit as the search step starting from the search starting point.
  • the whole pixel motion search There are various methods for the whole pixel motion search, such as a diamond search, a full search, or a fast search. These methods are prior art and will not be described here.
  • the entire pixel point with the lowest rate distortion cost searched is used as the target integer pixel point.
  • the target pixel is used as a starting point, and the matching block of the current block is searched according to the search step size in the search step set included in the motion vector precision.
  • the matching block is searched for by searching for the point in the upper left corner of the matching block.
  • the matching block may be searched for by searching other points in the matching block, which is not limited herein.
  • the following is a single motion with motion vector accuracy.
  • the vector precision is an example to describe the process of searching for matching blocks.
  • the search matching block specifically includes:
  • the target 1/2 j pixel is used as a starting point, and the preset step is repeated after the value of j is incremented by one.
  • the eight adjacent 1/2 pixel points around the target integer pixel point are searched, and one of the target points is determined as the target 1 according to the preset principle.
  • the preset principle may be a pixel point with the lowest cost of selection rate distortion, or other principles, which are not limited herein.
  • the eight 1/4 pixel points adjacent to the target 1/2 pixel point are searched, and one of them is determined as the target 1/4 pixel point according to the preset principle.
  • the target 1/4 pixel point find eight adjacent 1/8 pixel points around the target 1/4 pixel point, and determine one of them as the target 1/8 pixel according to the preset principle.
  • the position of the target 1/8 pixel is the position of the matching block.
  • the motion vector information of the matching block relative to the search starting point may be calculated according to the position of the matching block and the position of the search starting point, that is, the number of searching steps and the searching direction of the matching block relative to the search starting point.
  • the difference between the pixel value of each pixel on the matching block and the pixel value of each pixel on the current block may be calculated to obtain a prediction residual signal of the matching block and the current block.
  • the information of the reference image is used to indicate the reference image, so that the video decoding device can determine the reference image from each decoded image according to the information of the reference image.
  • the reference The information of the image may be an index of the reference image, which is not limited herein.
  • the position of the search starting point in the reference image may be determined according to the information of the reference image and the information of the search starting point. Since the motion vector information does not indicate the step size corresponding to each search step in the search step, the video decoding device also needs to acquire the motion vector accuracy of the current block, that is, the search step size, so that the video decoding device can be relatively
  • the search step number, search direction, and search step size of the search starting point are used to determine the position of the matching block.
  • the information of the motion vector accuracy is used to indicate the motion vector accuracy.
  • a motion vector precision set is pre-set in each of the video encoding device and the video decoding device.
  • the information of the motion vector accuracy is specifically an index of the motion vector precision, so that the video decoding device searches for the motion vector precision of the current image from the motion vector precision set according to the information of the motion vector precision.
  • the information of the motion vector accuracy may also be a specific value of the motion vector accuracy, which is not limited herein.
  • the information of the search starting point is used to indicate the search starting point.
  • the information of the starting point of the search is the motion vector of the search starting point relative to the current block, which is not limited herein.
  • the video decoding apparatus can also use the same method to calculate the motion vector accuracy of the current image, the video encoding apparatus may not write the motion vector accuracy of the current image into the code stream when encoding the current block, thereby reducing The number of bits required for the current block coding is calculated by the video decoding device.
  • the video decoding apparatus may also use the same method to acquire the MVP of the current block, that is, the location of the search starting point.
  • the standard 264 specifies that the encoding end and the decoding end acquire the MVP by the same method. Therefore, the video encoding apparatus is When encoding the current block, the information of the search starting point may not be written into the code stream to reduce the number of bits required for the current block encoding, but is acquired by the video decoding device.
  • the inventors of the present application have found that adaptively selecting the motion vector accuracy of a video image in the video sequence for a video sequence of different content characteristics is more advantageous for encoding the video image, for example, a video with slow motion and less texture details.
  • Image when searching for matching blocks in the reference image, the motion vector with smaller precision can be saved compared to the motion vector with larger precision, and the steps required for motion vector coding can be saved, and the steps of motion search in motion estimation can be reduced.
  • a meter that interpolates the reference image Calculate the coding and save time; for video images with severe motion and complex texture, when searching for matching blocks in the reference image, the motion vector with smaller precision can be more similar to the current block than the motion vector with larger precision.
  • the content characteristic of the current image is obtained by the current image, thereby determining the motion vector accuracy corresponding to the content characteristic of the current image, so that When searching for a matching block of the current block in the reference image of the current block, the matching block is searched for according to the target integer pixel point and the motion vector precision.
  • the motion vector accuracy further includes a threshold set, the threshold set including at least one threshold.
  • the method further includes: determining, according to each threshold in the set of thresholds and the search starting point, a search area corresponding to the threshold. The search starting point is located in the search area, and the search step sizes in the search areas corresponding to the thresholds are respectively in one-to-one correspondence with the elements in the search step set.
  • the search range corresponding to the threshold corresponding to the size of the step size y1 and y2, y1 ⁇ y2, y2 in the search step set is surrounded by the threshold corresponding to y1 Outside the corresponding search area, the search area corresponding to the threshold corresponding to the y1 is connected.
  • the value of the search step set is likely.
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ , there is no limit here.
  • search area There are various shapes of the search area corresponding to the threshold.
  • the search step set is ⁇ y1, y2 ⁇
  • the threshold set is ⁇ m1, m2 ⁇ , where y1 ⁇ y2, m1 ⁇ m2, y1 corresponds to m1, and y2 corresponds to m2, where m1 is a positive integer multiple of 2 or 0.
  • the m2 is a positive integer multiple of 4.
  • the determining the search area corresponding to the threshold according to each threshold of the threshold set and the search starting point includes:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square with the side of the search starting point and 2m2* the smallest pixel unit being the side length shape;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • FIG. 2 and FIG. 3 are respectively schematic structural diagrams of a search area in the video encoding method of the present invention.
  • the circle in the figure is 1/2 pixel
  • the square is 1/4 pixel
  • the triangle is 1/8 pixel.
  • the search starting point (identified as a shaded block in the figure) is located at 1/2 pixel point, then:
  • the search area corresponding to m1 is the first square, and the search step used in the search area is 1/8 pixel unit.
  • the search area corresponding to m2 is an area between the first square and the second square, and the search step used in the search area is 1/4 pixel unit.
  • the circle in the figure is 1/2 pixel
  • the square is 1/4 pixel
  • the triangle is 1/8 pixel.
  • the search starting point (identified as a shaded block in the figure) is located at 1/8 pixel, then:
  • the search area corresponding to m1 is a third square, and the search step used in searching in the search area It is 1/8 pixel unit long.
  • the search area corresponding to m2 is an area between the third square and the fourth square, and the search step used in the search area is 1/4 pixel unit.
  • the y2 pixel point and the y3 pixel point closest to the search starting point respectively have at least one of them, and any one of the y2 pixel points and the y3 pixel point may be taken as the center of the third square P3 and the fourth square P4, respectively.
  • the y2 pixel point and the y3 pixel point located on the same side of the search starting point are taken as the centers of the third square P3 and the fourth square P4, respectively, to prevent the third square P3 from being completely located in the fourth square P4.
  • the above embodiment has been exemplified by taking the shape of the search area as a square.
  • the shape of the search area may also be a circle, a regular hexagon or other shapes, which is not limited herein.
  • the step 104: searching for the matching block from the target integer pixel point according to the motion vector precision comprises:
  • FIG. 4 is a schematic flowchart diagram of another embodiment of a video encoding method according to the present invention.
  • the video encoding method includes:
  • the motion vector accuracy specifically includes a search step set ⁇ 1/8, 1/4 ⁇ , and a threshold set ⁇ m1, m2 ⁇ .
  • step 406 is performed.
  • the area in the first square is used as the search area corresponding to the m1; and the area between the first square and the second square is used as the search area corresponding to the m2.
  • the first square is a square centered on the search starting point
  • 2m1* the minimum pixel unit is a side length
  • the second square is centered on the search starting point
  • 2m2* the minimum pixel unit is side length square.
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the area in the third square is used as the search area corresponding to the m1, and the area between the third square and the fourth square is used as the search area corresponding to the m2.
  • the third square is a square centered on a 1/4 pixel closest to the search starting point, and 2m1* the minimum pixel unit is a square of a side length; the fourth square is 1 closest to the search starting point The /2 pixel is centered, and the 2m2* minimum pixel unit is a square with a side length; The minimum pixel unit is the smallest element in the set of search steps.
  • Ce(Ce x , Ce y ) points to the center of the third square
  • Cq(Cq x , Cq y ) points to the center of the fourth square.
  • Ce(Ce x , Ce y ) and Cq(Cq x , Cq y ) can be calculated by the following two formulas .
  • MVP x is the component of the MVP of the current block in the horizontal direction
  • MVP y is the component of the MVP of the current block in the vertical direction.
  • step 409 Determine whether all the 1/4 pixel points are located outside the search area corresponding to the m2, and if yes, execute step 410; if no, perform step 411.
  • step 410 is performed; if at least one 1/4 pixel point does not satisfy the formula (1), step 411 is performed.
  • the motion vector MVD of the matching block relative to the search starting point may be calculated by the following formula, in the following formula, MVD x is the component of the MVD in the horizontal direction, and MVD y is the component of the MVD in the vertical direction, MV Half is the motion vector of the target 1/2 pixel point relative to the same position of the current block in the reference frame.
  • the MVD x is calculated by the following formula.
  • MVD x Ce x -TH e +((Cq x -THq)-(Ce x -THe))/2+(MV halfx -(Cq x -THq))/4-MVP x ,
  • MVD y (MV half y -Cq y )/4
  • the MVD x is calculated by the following formula.
  • MVD x Ce x +TH e +((Cq x +THq)-(Ce x +THe))/2+(MV halfx -(Cq x +THq))/4-MVP x ,
  • MVD y (MV half y -Cq y )/4
  • MVD y Ce y -TH e +((Cq y -THq)-(Ce y -THe))/2+(MV halfy -(Cq y -THq))/4-MVP y ,
  • MVD x (MV half x -Cq y )/4
  • MVD y Ce y +TH e +((Cq y +THq)-(Ce y +THe))/2+(MV halfy -(Cq y +THq))/4-MVP x ,411,
  • MVD x (MV half x -Cq x )/4
  • a target 1/4 pixel point is acquired from a 1/4 pixel point located in the search area corresponding to the m2.
  • all 1/4 pixel points located in the search area corresponding to the m2 may be traversed, and the target 1/4 pixel point is determined according to a preset principle (for example, a pixel point with the smallest selection rate distortion cost).
  • step 414 is performed; if at least one 1/8 pixel point does not satisfy the formula (2), step 415 is performed.
  • the motion vector MVD of the matching block relative to the search starting point can be calculated by the following formula.
  • MVD x is the component of the MVD in the horizontal direction
  • MVD y is the component of the MVD in the vertical direction
  • MV quater is the target 1/4 pixel point relative to the same position of the current block in the reference frame.
  • the MVD x is calculated by the following formula.
  • MVD x Ce x -TH e +(MV quate rx -(Ce x -THe))/2-MVP x ,
  • MVD x Ce x +TH e +(MV quater x -(Ce x +THe))/2-MVP x ,
  • MVD y Ce y -TH e +(MV quater y -(Ce y -THe))/2-MVP y ,
  • MVD x (MV quate rx -Ce x )/2
  • MVD y Ce y +TH e +(MV quater y -(Ce y +THe))/2-MVP y ,
  • MVD x (MV quater x -Ce x )/2
  • the motion vector of the matching block relative to the search starting point can be calculated by the following formula MVD.
  • MVD x MV eightx -MVP x
  • MVD y MV eighty -MVP y
  • the motion vector information includes a search step number and a search direction of the matching block relative to the search start point, and the prediction residual signal is used to indicate a residual between the current block and the matching block.
  • the motion vector accuracy of the current image is acquired according to the current image.
  • acquiring motion vector accuracy of the current image according to the current image includes: acquiring a quantization parameter of the current image; acquiring a resolution of the current image a width value; determining a motion vector accuracy of the current image according to the preset value according to the width value and the quantization parameter of the current image.
  • the preset strategy may be a table lookup method, or a threshold method, or a formula is used to calculate a decision factor, and the motion vector accuracy of the current image is selected according to a result of comparing the decision factor with the preset value, or other strategies. There are no restrictions here.
  • the preset policy is a table lookup method.
  • the video encoding apparatus prestores the following Table 1, wherein the first row in Table 1 indicates the range of the value of the quantization parameter of the current image, and the first column indicates the range of the width value in the resolution of the current image. After acquiring the width value in the resolution of the current image and the quantization parameter of the current image, the motion vector precision of the current image is looked up in Table 1.
  • the content characteristics of the current image may also be acquired according to the encoded image set and the current image, and then the current image is determined according to the content characteristic. Motion vector accuracy.
  • the encoded image set includes at least one encoded image.
  • Each encoded image in the encoded image set may be an encoded image adjacent to the current image in the video sequence, or may be an encoded image separated from the current image by at least one image, which is not limited herein.
  • acquiring motion vector accuracy of the current image according to the current image and the encoded image set includes:
  • the encoded image set includes at least one encoded image.
  • there is only one element in the encoded image set which is an encoded image temporally adjacent to the current image. Since the encoded image adjacent to the current image is similar to the content characteristic of the current image, using the encoded image to obtain the motion vector accuracy of the current image can make the motion vector accuracy of the current image more consistent with the current image.
  • the content characteristics, and the encoded image set includes only one element, which can reduce the amount of calculation.
  • the encoding information includes a motion vector difference value of each coding block in the encoded image and a number of pixel points included in each coding block in the encoded image, where a motion vector difference value of the coding block is used for
  • the motion vector information when the coded block is the current block is indicated. That is, when the coding block is the current block, the motion vector difference value of the coding block is a motion vector of the matching block of the coding block relative to the search starting point on the reference image of the coding block.
  • the motion intensity of the encoded image is a weighted average of the first values of the code blocks in the encoded image, and the first value of the coded block is the level of the motion vector difference of the coded block.
  • the motion intensity of the encoded image is represented by M
  • the horizontal component of the motion vector difference value of the coding block is represented by mvd x
  • the vertical component of the motion vector difference value of the coding block is represented by mvd y
  • pusize represents the number of pixels included in the coding block
  • a weighted average of the degree of motion intensity of each coded image in the encoded image set is used as the motion intensity of the coded image set.
  • weighting values of the motion severity of each coded image may be the same or different, and are not limited herein.
  • the preset strategy may be a table lookup method, or a threshold method, or a formula is used to calculate a decision factor, and the motion vector accuracy of the current image is selected according to a result of comparing the decision factor with the preset value, or other strategies are This is not a limitation.
  • the preset strategy is a look-up table method.
  • the video encoding apparatus prestores the following Table 2, wherein the first row in Table 2 indicates the range of the value of the quantization parameter of the current image, and the first column indicates the range of the value of the motion severity of the encoded image set. After obtaining the motion severity of the encoded image set and the quantization parameter of the current image, the motion vector accuracy of the current image is looked up in Table 2.
  • the obtaining the motion vector accuracy of the current image according to the current image and the encoded image set further includes:
  • the reference parameter includes one of texture complexity of the current image, texture complexity of the encoded image set, and inter-image noise of the encoded image set, or includes texture complexity of the current image And one of texture complexity of the encoded image set, and the edited Inter-image noise of a set of code images.
  • the acquiring reference parameters includes:
  • An average value of a sum of squares of differences between pixel values of the pixel points and adjacent pixel points in the current image is calculated, and the average value is used as a texture complexity of the current image.
  • the texture complexity of the current image is represented by A
  • the pixel value of the pixel point in the current image is represented by s x, y , where x, y are the coordinates of the pixel point, then,
  • the obtaining reference parameters includes:
  • a weighted average of the texture complexity of each encoded image in the encoded image set is taken as the texture complexity of the encoded image set.
  • the texture complexity of the i-th encoded image is represented by B i
  • the pixel value of the pixel in the encoded image is represented by s x, y , where x, y is the coordinate of the pixel
  • B represents the texture complexity of the encoded image set
  • the acquiring reference parameters includes:
  • a weighted average of the second average of each encoded image in the encoded image set is used as inter-image noise for the encoded image set.
  • the prediction error of the i-th encoded image is represented by N i
  • the original pixel value of the pixel in the encoded image is represented by s x, y
  • s′ x+u, y+v represents the a predicted pixel value of a pixel at a corresponding position in the encoded image, where x, y is the coordinates of the pixel, and N represents the texture complexity of the encoded image set, then,
  • the step S14 is specifically to determine the motion vector accuracy of the current image according to the motion severity of the encoded image set and the quantization parameter of the current image, and the reference parameter according to a preset policy.
  • the method for obtaining the initial motion vector accuracy of the current image may refer to the lookup table method for searching the table 1 described in the step S14.
  • the motion vector precision set is ⁇ 1/2, (0, 4), (0, 8), 1/4, (2, 4), (2, 8), (4, 8 ), 1/8 ⁇ .
  • the index values of the motion vector precisions in each motion vector precision set are as shown in Table 3.
  • the index value is incremented by 1; when the Offset value is 3, the index value is decremented by 1; when the Offset value is 0, 1, 2, the index value is unchanged.
  • F 12M+7N-5A.
  • M, N, and A may also be other, and are not limited herein.
  • the inter-image noise N of the encoded image set may not be used, that is, only according to the texture complexity of the current image or the texture complexity A of the encoded image set.
  • a motion severity M of the encoded image set calculates a decision factor F.
  • F 12M-5A.
  • M and A may also be other, and are not limited herein.
  • the thresholds Th0 and Th1 can be calculated according to the following formula:
  • Th 0 a 0 QP 2 + b 0 QP + C 0
  • Th 1 a 1 QP 2 + b 1 QP + C 1
  • the coefficients a0, a1, b0, b1, c0, and c1 are -0.02, 0.57, 16, -0.03, 0.6, 38, respectively; of course, the coefficients in the formula may also be other values, which are not limited herein.
  • MVR1 can be obtained according to the following formula:
  • the absolute values of the horizontal component mvdx of the motion vector difference and the absolute value of the vertical component mvdy of the motion vector difference are respectively obtained in the following five intervals:
  • the video encoding method of the embodiment of the present invention has been described above.
  • the video decoding method provided by the embodiment of the present invention is described below.
  • the execution body of the video decoding method provided by the embodiment of the present invention is a video decoding device, where the video decoding device may be any device that needs to output and play video, such as a mobile phone or a notebook. Computers, tablets, personal computers and other equipment.
  • FIG. 5 is a schematic flowchart diagram of a video encoding method according to an embodiment of the present invention.
  • a video encoding method provided by an embodiment of the present invention may include the following content:
  • step 501 may be performed before or after step 502, or step 501 and step 502 may be performed synchronously, or step 501 and step 502 may also be performed interspersedly. .
  • the video decoding device After receiving the video code stream, the video decoding device decodes the video code stream to restore each video image in the original video sequence.
  • the current image is an image image to be currently decoded.
  • the reconstructed pixel value of the current image is obtained by sequentially reconstructing each image block in the current image, and the image block to be decoded currently is referred to as a current block.
  • the video code stream includes information of a reference image of a current block, the motion vector information, and the prediction residual signal.
  • the reference image indicated by the information is found according to the information by extracting the information of the reference image from the video code stream.
  • the information of the reference image may be an index of the reference image, which is not limited herein.
  • the position of the search starting point in the reference image is used to indicate the position of the predicted matching block of the current block in the reference image.
  • the motion vector information is used to indicate the number of search steps and the search direction of the matching block of the current block in the reference image with respect to the predicted matching block.
  • the motion vector accuracy includes a search step size set, each search step size in the search step size set being less than one pixel unit, wherein the search step size set is used to indicate information of the step size of the search step number. Specifically, the step size of each search step in the number of search steps in the motion vector information is the smallest element in the search step set.
  • the prediction residual signal is used to indicate a residual between the current block and the matching block.
  • the video stream also contains information about the starting point of the search.
  • the video decoding device searches for the search starting point indicated by the information by extracting the information of the search starting point from the video code stream.
  • the same method is used in the encoding end and the decoding end to calculate the search starting point of the current image in the reference image. In this way, the video code stream received by the video decoding device does not have the information of the search starting point, but is calculated and acquired by the video decoding device.
  • the video stream also contains information on motion vector accuracy.
  • the video decoding device After receiving the video code stream, the video decoding device reads the motion vector accuracy information from the video code stream, and determines the motion vector accuracy based on the information.
  • the motion vector fine The information of the degree may be an index of the motion vector precision or a value of the motion vector precision, which is not limited herein.
  • the same method is used uniformly on the encoding end and the decoding end to calculate the motion vector accuracy of the current image.
  • the video code stream received by the video decoding device has no motion vector accuracy information, but is calculated and acquired by the video decoding device.
  • the motion vector accuracy may be a single motion vector precision, or, preferably, may be a stepped motion vector precision.
  • the search step size set is ⁇ 1/2 x ⁇ , where x is a positive integer. That is, the search step size set includes only one search step size, and the search step size is 1/2 x pixel units.
  • the search step size may be 1/2 pixel unit, 1/4 pixel unit, 1/8 pixel unit, or 1/16 pixel unit, etc., and is not limited herein.
  • the motion vector accuracy also includes a threshold set that includes at least one threshold. Wherein each threshold is used to indicate a search area in the reference image. Each search step in the search step set in the motion vector accuracy corresponds to each threshold in the threshold set, and the search step corresponding to the threshold in the search area indicated by each threshold is used as the search step.
  • the search image may be searched on the reference image.
  • the starting point is the starting point, and the matching block of the current block is found according to the motion vector information and the information of the motion vector accuracy of the current image.
  • the motion vector of the matching block can be calculated by the following formula, where MVR is the motion vector precision.
  • the prediction residual signal is a residual of the pixel value of each pixel on the matching block and the pixel value of each pixel on the current block, and therefore, the pixel value of each pixel on the matching block and the corresponding pixel in the prediction residual signal respectively
  • the pixel values of the points are added to obtain the reconstructed pixel values of the current block.
  • the inventors of the present application have found that adaptively selecting the motion vector accuracy of a video image in the video sequence for a video sequence of different content characteristics is more advantageous for encoding the video image, for example, a video with slow motion and less texture details.
  • Image when searching for matching blocks in the reference image, the motion vector with smaller precision can be saved compared to the motion vector with larger precision, and the steps required for motion vector coding can be saved, and the steps of motion search in motion estimation can be reduced.
  • the calculation amount of interpolating the reference image saves the encoding and decoding time; for the video image with strong motion and complex texture, when searching for the matching block in the reference image, the motion vector with smaller precision can be compared with the motion with larger precision.
  • the vector obtains a matching block that is more similar to the current block, reduces the prediction residual, and improves the coding efficiency.
  • the content characteristic of the current image is obtained by the current image and the encoded image set at the encoding end, and further Determining the motion vector essence that matches the content characteristics of the current image ;
  • the decoder first obtains the current search block matching motion vector accuracy and the motion vector information of the image, the matching block from the search motion vector accuracy and the motion vector information.
  • the motion vector accuracy further includes a threshold set, the threshold set including at least one threshold.
  • the method further includes: determining, according to each threshold in the set of thresholds and the search starting point, a search area corresponding to the threshold. The search starting point is located in the search area, and the search step sizes in the search areas corresponding to the thresholds are respectively in one-to-one correspondence with the elements in the search step set.
  • the search range corresponding to the threshold corresponding to the size of the step size y1 and y2, y1 ⁇ y2, y2 in the search step set is surrounded by the threshold corresponding to y1 Outside the corresponding search area, the search area corresponding to the threshold corresponding to the y1 is connected.
  • the value of the search step set is likely.
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ , there is no limit here.
  • search area There are various shapes of the search area corresponding to the threshold.
  • the search step set is ⁇ y1, y2 ⁇
  • the threshold set is ⁇ m1, m2 ⁇ , where y1 ⁇ y2, m1 ⁇ m2, y1 corresponds to m2, and y2 corresponds to m1, where m1 is a positive integer multiple of 2 or 0.
  • the m2 is a positive integer multiple of 4.
  • the determining the search area corresponding to the threshold according to each threshold of the threshold set and the search starting point includes:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the search area corresponding to m1 is the first square, and the search step used in the search area is 1/8 pixel unit.
  • the search area corresponding to m2 is the area between the first square and the second square
  • the search step used in the search area is 1/4 pixel unit.
  • the circle in the figure is 1/2 pixel
  • the square is 1/4 pixel
  • the triangle is 1/8 pixel.
  • the search starting point (identified as a shaded block in the figure) is located at 1/8 pixel, then:
  • the search area corresponding to m1 is a third square, and the search step used in searching in the search area is 1/8 pixel unit.
  • the search area corresponding to m2 is an area between the third square and the fourth square, and the search step used in the search area is 1/4 pixel unit.
  • the y2 pixel point and the y3 pixel point closest to the search starting point respectively have at least one of them, and any one of the y2 pixel points and the y3 pixel point may be taken as the center of the third square P3 and the fourth square P4, respectively.
  • the y2 pixel point and the y3 pixel point located on the same side of the search starting point are taken as the centers of the third square P3 and the fourth square P4, respectively, to prevent the third square P3 from being completely located in the fourth square P4.
  • the above embodiment has been exemplified by taking the shape of the search area as a square.
  • the shape of the search area may also be a circle, a regular hexagon or other shapes, which is not limited herein.
  • the motion vector accuracy is a stepped motion vector precision, that is, different search step sizes are used for different search regions.
  • the maximum search step size which is one pixel unit. That is, the video decoding device acquires the search step corresponding to each search step in the number of search steps in the received motion vector information.
  • the video decoding apparatus first needs to determine whether the encoding end has searched in the search area divided by the motion vector accuracy when searching for the matching block.
  • the determination is made by determining the reference search area and the temporary point, which will be specifically described below.
  • step 503 according to the reference image, the search start point, the motion vector information, and the motion vector accuracy of the current image, searching for the matching block includes: :
  • Ce Ce x, Ce y
  • Ce1 x, Ce1 y the coordinates of the center of Ce1
  • Ce2 x, Ce2 y the coordinates of the center of Ce2
  • Ce x (Ce1 x +Ce2 x )/2
  • Ce y (Ce1 y +Ce2 y )/2.
  • Ce x (Ce1 x + Ce2 x )/2
  • Ce y (Ce1 y + Ce2 y )/2
  • L (L1 + L2)/2.
  • the motion vector of the temporary point relative to the search starting point is the number of search steps and the search direction in the motion vector information, and the search step is the smallest element in the search step set;
  • the search step number is a sum of the third step number and the fourth step number; wherein the third step number actually corresponds to a search step size of y1, and the four step number actually corresponds to the search
  • the step size is y2.
  • the position of the matching block may be determined according to the search step number, the search step size and the search direction.
  • FIG. 6 is a schematic flowchart diagram of another embodiment of a video decoding method according to the present invention.
  • the video decoding method includes:
  • the motion vector accuracy specifically includes a search step set ⁇ 1/8, 1/4 ⁇ , and a threshold set ⁇ m1, m2 ⁇ .
  • step 604 is performed.
  • step 605 is performed.
  • the area in the first square is used as the search area corresponding to the m1; and the area between the first square and the second square is used as the search area corresponding to the m2.
  • the first square is a square centered on the search starting point
  • 2m1* the minimum pixel unit is a side length
  • the second square is centered on the search starting point
  • 2m2* the minimum pixel unit is side length square.
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the area in the third square is used as the search area corresponding to the m1, and the area between the third square and the fourth square is used as the search area corresponding to the m2.
  • the third square is a square centered on a 1/4 pixel closest to the search starting point, and 2m1* the minimum pixel unit is a square of a side length; the fourth square is 1 closest to the search starting point The /2 pixel is centered, and the 2m2* minimum pixel unit is a square with a side length; The minimum pixel unit is the smallest element in the set of search steps.
  • the motion vector Ce1(Ce1 x , Ce1 y ) point to the center of the third square, that is, to the center of the search area corresponding to m1
  • the motion vector Ce2(Ce2 x , Ce2 y ) points to the center of the fourth square. That is, it points to the center of the search area corresponding to m2.
  • Equation (1) is calculated Ce1 (Ce1 x, Ce1 y) , by the equation (2) calculated Ce2 (Ce2 x, Ce2 y) .
  • MVP x is the component of the MVP of the current block in the horizontal direction
  • MVP y is the component of the MVP of the current block in the vertical direction.
  • Ce Ce x, Ce y
  • Ce1 x, Ce1 y the coordinates of the center of Ce1
  • Ce2 x, Ce2 y the coordinates of the center of Ce2
  • Ce x (Ce1 x +Ce2 x )/2
  • Ce y (Ce1 y +Ce2 y )/2.
  • Ce x (Ce1 x + Ce2 x )/2
  • Ce y (Ce1 y + Ce2 y )/2
  • L (L1 + L2)/2.
  • the motion vector of the temporary point relative to the search starting point is the number of search steps and the search direction in the motion vector information, and the search step is the smallest element in the search step set.
  • step 608. Determine whether the temporary point is outside the reference search area. If yes, go to step 609. If no, go to step 610.
  • step 609 is performed; if the formula (3) is not satisfied, step 610 is performed.
  • MV x is the component of the MV in the horizontal direction
  • MV y is the component of the MV in the vertical direction.
  • MV x is calculated by the following formula.
  • MV x MVt x ⁇ 4-(Ce x -THe) ⁇ 4-((Cq x -THq)-(Ce x -THe)) ⁇ 2+(Cq x -THq)
  • MV y MVD y ⁇ 4+ If Cq y is the right side, MV x is calculated by the following formula.
  • MV x MVt x ⁇ 4-(Ce x +THe) ⁇ 4-((Cq x +THq)-(Ce x +THe)) ⁇ 2+(Cq x +THq)
  • MV y MVD y ⁇ 4+ Cq y otherwise, when
  • MV y MVt y ⁇ 4-(Ce y -THe) ⁇ 4-((Cq y -THq)-(Ce y -THe)) ⁇ 2+(Cq y -THq)
  • MV x MVD x ⁇ 4+ If Cq x is the lower side, MV y is calculated by the following formula.
  • whether the temporary point is located outside the search area corresponding to the m1 may be calculated by using a formula (4).
  • step 611 is performed; if the formula (4) is not satisfied, step 612 is performed.
  • the search step number is a sum of the third step number and the fourth step number; wherein the third step number actually corresponds to a search step size of y1, and the four step number actually corresponds to the search
  • the step size is y2.
  • the third step number and the fourth step number corresponding to the search step sizes y1 and y2 respectively are determined in the search step number in the motion vector information, and the motion vector MV of the matching block can be calculated according to the motion vector MVt of the temporary point. Specifically, the calculation can be performed by the following steps and formulas.
  • MV x is the component of the MV in the horizontal direction
  • MV y is the component of the MV in the vertical direction.
  • MV x is calculated by the following formula.
  • MV x MVt x ⁇ 2-(Ce x -THe) ⁇ 2+(Cq x -THe)
  • MV y MVD y ⁇ 2+Ce y
  • MV x is calculated by the following formula.
  • MV x MVt x ⁇ 2-(Ce x +THe) ⁇ 2+(Cq x +THe)
  • MV y MVD y ⁇ 2+Ce y
  • MV y MVt y ⁇ 2-(Ce y -THe) ⁇ 2+(Cq y -THe)
  • MV x MVD x ⁇ 2+Ce x
  • MV y MVt y ⁇ 2-(Ce y +THe) ⁇ 2+(Cq y +THe)
  • MV x MVD x ⁇ 2+Ce x
  • the motion vector MV of the matching block can be directly calculated according to the following formula.
  • MV x MVD x +MVP x
  • MV y MVD y +MVP y
  • the position of the matching block is determined from the reference frame according to the motion vector, and the pixel value of each pixel of the matching block is obtained, and then the pixel values of each pixel on the matching block are respectively The pixel values of the corresponding pixel points in the prediction residual signal are added to obtain the reconstructed pixel value of the current block.
  • the motion vector accuracy of the current image needs to be acquired.
  • the video decoding device may calculate the motion vector accuracy of the current image by using a preset method, where the video encoding device also uses the preset method to calculate the motion vector accuracy of the current image to ensure the motion adopted by the encoding end and the decoding end.
  • the vector accuracy is consistent.
  • acquiring motion vector accuracy of the current image includes: acquiring a quantization parameter of the current image; acquiring a width value in a resolution of the current image; Decoding the width value and the quantization parameter of the current image according to a preset policy to determine the current The motion vector accuracy of the image.
  • the preset strategy may be a table lookup method, or a threshold method, or a formula is used to calculate a decision factor, and the motion vector accuracy of the current image is selected according to a result of comparing the decision factor with the preset value, or other strategies. There are no restrictions here.
  • the preset policy is a table lookup method.
  • the video encoding apparatus prestores the above Table 1, wherein the first row in Table 1 indicates the range of the value of the quantization parameter of the current image, and the first column indicates the range of the width value in the resolution of the current image. After acquiring the width value in the resolution of the current image and the quantization parameter of the current image, the motion vector precision of the current image is looked up in Table 1.
  • the decoding end may acquire the content characteristics of the current image according to the encoded image set and the current image, and further determine the current image according to the content characteristic.
  • Motion vector precision wherein the encoded image set includes at least one encoded image.
  • Each encoded image in the encoded image set may be an encoded image adjacent to the current image in the video sequence, or may be an encoded image separated from the current image by at least one image, which is not limited herein.
  • the obtaining the motion vector accuracy of the current image includes:
  • the encoded image set includes at least one encoded image.
  • there is only one element in the encoded image set which is an encoded image temporally adjacent to the current image. Since the encoded image adjacent to the current image is similar to the content characteristic of the current image, using the encoded image to obtain the motion vector accuracy of the current image can make the motion vector accuracy of the current image more consistent with the current image.
  • the content characteristics, and the encoded image set includes only one element, which can reduce the amount of calculation.
  • the decoding information includes a motion vector difference value of each decoded block in the decoded image and a number of pixel points included in each decoded block in the decoded image, where a motion vector difference value of the decoded block is used for And indicating the motion vector information when the decoding block is the current block. That is, when the decoding block is the current block, the motion vector difference value of the decoding block is a motion vector of the matching block of the decoding block relative to the search starting point on the reference image of the decoding block.
  • the motion severity of the decoded image is an average value of a first value of each decoded block in the decoded image
  • the first value of the decoded block is an absolute value of a horizontal component of a motion vector difference of the decoded block. The sum of the absolute value of the vertical component of the value and the motion vector difference value and the number of pixel points included in the decoded block.
  • the motion intensity of the decoded image is represented by M
  • the horizontal component of the motion vector difference value of the decoded block is represented by mvd x
  • the vertical component of the motion vector difference value of the decoded block is represented by mvd y
  • pusize represents the number of pixels included in the decoding block
  • a weighted average value of the motion severity of each decoded image in the decoded image set is used as the motion intensity of the decoded image set.
  • weighting values of the motion severity of each decoded image may be the same or different, and are not limited herein.
  • the preset strategy may be a table lookup method, or a threshold method, or a formula is used to calculate a decision factor, and the motion vector accuracy of the current image is selected according to a result of comparing the decision factor with the preset value, or other strategies are This is not a limitation.
  • the preset strategy is a look-up table method.
  • the video decoding apparatus prestores the above Table 2, wherein the first row in Table 2 indicates the range of the value of the quantization parameter of the current image, and the first column indicates the range of the value of the motion severity of the decoded image set. After obtaining the motion severity of the decoded image set and the quantization parameter of the current image, the motion vector accuracy of the current image is looked up in Table 2.
  • the obtaining the motion vector accuracy of the current image according to the current image and the encoded image set further includes:
  • the obtaining the texture complexity of the decoded image set includes:
  • a weighted average of the texture complexity of each decoded image in the decoded image set is used as the texture complexity of the decoded image set.
  • the texture complexity of the i-th decoded image in the decoded image set is represented by A i
  • the pixel value of the pixel point in the current image is represented by s x, y , where x, y are the pixel
  • A representing the texture complexity of the encoded image set
  • the step S14 is specifically: determining a motion vector accuracy of the current image according to a preset strategy according to a motion severity of the encoded image set and a quantization parameter of the current image, and a texture complexity of the decoded image set. .
  • F 12M-5A.
  • M and A may also be other, and are not limited herein.
  • the thresholds Th0 and Th1 can be calculated according to the following formula:
  • Th 0 a 0 QP 2 + b 0 QP + C 0
  • Th 1 a 1 QP 2 + b 1 QP + C 1
  • the coefficients a 0 , a 1 , b 0 , b 1 , c 0 , and c 1 are -0.02, 0.57, 16, -0.03, 0.6, 38, respectively; of course, the coefficients in the formula may also be other values. There are no restrictions here.
  • MVR 1 can be obtained according to the following formula:
  • the absolute values of the horizontal component mvdx of the motion vector difference and the absolute value of the vertical component mvdy of the motion vector difference are respectively obtained in the following five intervals:
  • a video encoding apparatus may include:
  • a first acquiring unit 701 configured to acquire a motion vector accuracy of the current image according to the current image, where the motion vector accuracy includes a search step set, where each search step in the search step set is smaller than One pixel unit;
  • a second acquiring unit 702 configured to acquire a current block and a reference image of the current block, where the current block is an image block to be currently encoded in the current image;
  • a first determining unit 703 configured to determine a search starting point in the reference image, and search for a target integer pixel in a pixel unit as a search step from the beginning of the search;
  • a searching unit 704 configured to search for a matching block of the current block from the target integer pixel point according to the motion vector precision
  • a third obtaining unit 705 configured to acquire motion vector information and a prediction residual signal, where the motion vector information includes a search step number and a search direction of the matching block relative to the search starting point, where the prediction residual a difference signal is used to indicate a residual between the current block and the matching block;
  • the writing unit 706 is configured to write information of the reference image, the motion vector information, and the prediction residual signal into a code stream, where information of the reference image is used to indicate the reference image.
  • the writing unit 706 is further configured to write information of the motion vector accuracy and/or information of the search starting point to the code stream, where the motion vector The information of the precision is used to indicate the motion vector accuracy, and the information of the search starting point is used to indicate the search starting point.
  • the search step size set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • search unit search unit 704 is specifically configured to:
  • the target 1/2 j pixel is used as a starting point, and the preset step is repeated after the value of j is incremented by one.
  • the video encoding device further includes:
  • a second determining unit 707 configured to determine, according to each threshold value in the threshold set and the search starting point, a search area corresponding to the threshold, where the search starting point is located in the search area, and each threshold corresponds to a search area Search step sizes respectively correspond to each element in the search step set;
  • the search area corresponding to the threshold corresponding to the size of the step size y1 and y2, y1 ⁇ y2, y2 in the search step size set is surrounded by the search area corresponding to the threshold corresponding to y1, and The search areas corresponding to the thresholds corresponding to y1 are connected.
  • the threshold set includes m1 and m2, wherein the m1 is a positive integer multiple of 2 or 0, and the m2 is a positive integer multiple of 4, m1 ⁇ m2 ;
  • the second determining unit 707 is specifically configured to:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2, m1 ⁇ m2;
  • the searching unit 704 is specifically configured to:
  • the target y1 pixel point is obtained from the y1 pixel point located in the search area corresponding to the m1, and the target y1 pixel point is determined.
  • the location is the location of the matching block.
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4 , 1/8, 1/16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the first acquiring unit 701 is specifically configured to: acquire a quantization parameter of the current image, and an encoded image set, where the encoded image set includes at least one encoded image;
  • Acquiring encoding information of each encoded image in the encoded image set the encoding information including a motion vector difference value of each coding block in the encoded image and a pixel point included in each coding block in the encoded image a number, wherein the motion vector difference value of the coding block is used to indicate the motion vector information when the coding block is a current block;
  • a motion severity of the encoded image is an average of a first value of each coded block in the encoded image, the encoded block
  • the first value is a product of a sum of an absolute value of a horizontal component of the motion vector difference value of the coding block and an absolute value of a vertical component of the motion vector difference value and a number of pixel points included in the coding block;
  • the first obtaining unit 701 is further configured to:
  • the reference parameter including one of texture complexity of the current image, texture complexity of the encoded image set, and inter-image noise of the encoded image set, or including the current image Texture complexity and one of the texture complexity of the encoded image collection And an inter-image noise of the encoded image set;
  • the first acquiring unit 701 is configured to:
  • the first obtaining unit is configured to:
  • the first acquiring unit 701 is configured to:
  • Determining the motion vector accuracy of the current image according to the preset policy according to the motion severity of the encoded image set and the quantization parameter of the current image specifically includes:
  • the first acquiring unit is specifically configured to:
  • a video decoding apparatus may include:
  • a first acquiring unit 801 configured to acquire a current image and a motion vector accuracy of the current image, where the motion vector precision includes a search step set, where each search step in the search step set is less than one pixel unit;
  • a second acquiring unit 802 configured to acquire motion vector information, a prediction residual signal, and a reference image of the current block, and a search starting point in the reference image, where the current block is the An image block to be decoded currently in the current image, the motion vector information including a search step number and a search direction of a matching block of the current block in the reference image with respect to the search start point, and the prediction residual signal is used for Indicates a residual between the current block and the matching block;
  • the searching unit 803 is configured to search for a matching block of the current block according to the reference image, the search starting point, the motion vector information, and the motion vector precision of the current image;
  • the reconstruction unit 804 is configured to acquire the reconstructed pixel value of the current block according to the matching block and the prediction residual signal.
  • the search step size set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the motion vector precision further includes a threshold set, the threshold set includes at least one threshold;
  • the video encoding device further includes:
  • a determining unit 805 configured to determine, according to each threshold value in the threshold set and the search starting point, a search area corresponding to the threshold, where the search starting point is located in the search area, and a search in a search area corresponding to different thresholds
  • the step size is respectively a different element in the search step set;
  • Each element in the set of thresholds respectively corresponds to a different element in the set of search steps; wherein a threshold corresponding to the size of the adjacent y1 and y2, y1 ⁇ y2, y2 in the search step size set corresponds to The search area is surrounded by the search area corresponding to the threshold corresponding to y1, and is connected to the search area corresponding to the threshold corresponding to the y1.
  • the threshold set includes m1 and m2, wherein the m1 is a positive integer multiple of 2 or 0, the m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the determining unit 805 is specifically configured to:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2;
  • the searching unit 803 is specifically configured to:
  • Determining a temporary point, a motion vector of the temporary point relative to the search starting point is a number of search steps and a search direction in the motion vector information, and a search step size is a minimum element in the search step set;
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4 , 1/8, 1/16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the first obtaining unit 801 is specifically configured to:
  • the first obtaining unit 801 is specifically configured to:
  • the decoding information includes a motion vector difference value of each decoded block in the decoded image and a pixel point included in each decoded block in the decoded image a number, wherein the motion vector difference value of the decoding block is used to indicate the motion vector information when the decoding block is the current block;
  • a motion severity of the decoded image is an average of a first value of each decoded block in the decoded image, the decoded block
  • the first value is the absolute value of the horizontal component of the motion vector difference of the decoded block
  • the first acquiring unit 801 is further configured to:
  • the obtaining the motion vector accuracy of the current image according to the preset strategy according to the motion severity of the decoded image set and the quantization parameter of the current image specifically includes:
  • the first obtaining unit 801 is specifically configured to:
  • FIG. 9 is a structural block diagram of a video encoding apparatus 900 according to another embodiment of the present invention.
  • the video encoding apparatus 900 may include at least one processor 901, a memory 905, and at least one communication bus 902.
  • the video encoding device 900 may further include: at least one network interface 904 and/or a user interface 903.
  • the user interface 903 includes, for example, a display (eg, a touch screen, an LCD, a Holographic, a CRT, or a Projector), a pointing device (such as a mouse or a trackball touch panel or a touch screen, etc.), a camera, and/or Or pickup Wait.
  • the memory 905 can include a read only memory and a random access memory and provides instructions and data to the processor 901. A portion of the memory 905 may also include a non-volatile random access memory.
  • the memory 905 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the operating system 9051 includes various system programs for implementing various basic services and processing hardware-based tasks.
  • the application module 9052 includes various applications for implementing various application services.
  • the processor 901 is configured to acquire a current image according to a program or an instruction stored in the memory 905, and acquire motion vector precision of the current image according to the current image, where the motion vector accuracy includes a search step. a long set, each search step in the search step set is less than one pixel unit; acquiring a current block and a reference image of the current block, where the current block is an image block to be currently encoded in the current image; Search starting point in the reference image, searching for a target integer pixel point in a pixel unit as a search step from the beginning of the search; searching for the matching of the current block from the target integer pixel point according to the motion vector precision Obtaining motion vector information and a prediction residual signal, the motion vector information including a search step number and a search direction of the matching block relative to the search start point, where the prediction residual signal is used to indicate the current block and the location Determining a residual between the matching blocks; writing information of the reference image, the motion vector information, and the prediction residual signal Stream
  • the processor 901 is further configured to: write information about the motion vector accuracy and/or information of the search start point to the code stream, where the motion vector accuracy information is used to indicate the Motion vector accuracy, the information of the search starting point is used to indicate the search starting point.
  • the search step set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the searching for the matching block from the target integer pixel point according to the motion vector precision includes:
  • the target 1/2 j pixel is used as a starting point, and the preset step is repeated after the value of j is incremented by one.
  • the motion vector accuracy further includes a threshold set, the threshold set including at least one threshold
  • the processor 901 is further configured to determine, according to each threshold value in the threshold set, the search area corresponding to the threshold, where the search starting point is located in the search area, and each threshold corresponds to a search area.
  • the search step lengths are respectively in one-to-one correspondence with the elements in the search step size set; wherein, the threshold values corresponding to the size order adjacent y1 and y2, y1 ⁇ y2, y2 in the search step size set are respectively
  • the corresponding search area is surrounded by the search area corresponding to the threshold corresponding to y1, and is connected to the search area corresponding to the threshold corresponding to the y1.
  • the threshold set includes m1 and m2, where the m1 is a positive integer multiple of 2 or 0, and the m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the determining the search area corresponding to the threshold according to each threshold of the threshold set and the search starting point includes:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2, m1 ⁇ m2;
  • the searching for the matching block from the target integer pixel point according to the motion vector precision includes:
  • the target y1 pixel point is obtained from the y1 pixel point located in the search area corresponding to the m1, and the target y1 pixel point is determined.
  • the location is the location of the matching block.
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/ 16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the acquiring the motion vector accuracy of the current image according to the current image includes:
  • Acquiring encoding information of each encoded image in the encoded image set the encoding information including a motion vector difference value of each coding block in the encoded image and a pixel point included in each coding block in the encoded image a number, wherein the motion vector difference value of the coding block is used to indicate the motion vector information when the coding block is a current block;
  • a motion severity of the encoded image is an average of a first value of each coded block in the encoded image
  • the first value of the coding block is a sum of an absolute value of a horizontal component of a motion vector difference value of the coding block and an absolute value of a vertical component of a motion vector difference value, and a number of pixel points included in the coding block. product;
  • the acquiring the motion vector accuracy of the current image according to the current image further includes:
  • the reference parameter including one of texture complexity of the current image, texture complexity of the encoded image set, and inter-image noise of the encoded image set, or including the current image
  • the acquiring the reference parameter includes:
  • the obtaining reference parameters includes:
  • the obtaining reference parameters includes:
  • Determining the motion vector accuracy of the current image according to the preset policy according to the motion severity of the encoded image set and the quantization parameter of the current image specifically includes:
  • the acquiring the motion vector accuracy of the current image according to the current image includes:
  • FIG. 10 is a structural block diagram of a video decoding apparatus 900 according to another embodiment of the present invention.
  • the video decoding device 1000 is shown in FIG. 10.
  • FIG. 10 is a structural block diagram of a video decoding device 1000 according to another embodiment of the present invention.
  • the video decoding device 1000 may include at least one processor 1001, a memory 1005, and at least one communication bus 1002.
  • the video decoding device 1000 may further include: at least one network interface 1004 and/or a user interface 1003.
  • the user interface 1003 includes, for example, a display (eg, a touch screen, an LCD, a Holographic, a CRT, or a Projector), a pointing device (such as a mouse or a trackball touch panel or a touch screen, etc.), a camera, and/or Or a pickup device, etc.
  • a display eg, a touch screen, an LCD, a Holographic, a CRT, or a Projector
  • a pointing device such as a mouse or a trackball touch panel or a touch screen, etc.
  • a camera e.g., a camera, etc.
  • the memory 1005 can include read only memory and random access memory and provides instructions and data to the processor 1001.
  • a portion of the memory 1005 may also include a non-volatile random access memory.
  • the memory 1005 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the operating system 10051 includes various system programs for implementing various basic services and processing hardware-based tasks.
  • the application module 10052 includes various applications for implementing various application services.
  • the processor is executed by calling a program or instruction stored in the memory 1005.
  • 1001 can include: at least one processor 1001, memory 1005, and at least one communication bus 1002.
  • the video decoding device 1000 may further include: at least one network interface 1004 and/or a user interface 1003.
  • the user interface 1003 includes, for example, a display (eg, a touch screen, an LCD, a Holographic, a CRT, or a Projector), a pointing device (such as a mouse or a trackball touch panel or a touch screen, etc.), a camera, and/or Or a pickup device, etc.
  • the memory 1005 can include read only memory and random access memory and provides instructions and data to the processor 1001.
  • a portion of the memory 1005 may also include a non-volatile random access memory.
  • the memory 1005 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the operating system 10051 includes various system programs for implementing various basic services and processing hardware-based tasks.
  • the application module 10052 includes various applications for implementing various application services.
  • the processor 1001 is configured to acquire a current image and a motion vector accuracy of the current image by calling a program or an instruction stored in the memory 1005, the motion vector accuracy including a search step size set, the search Each search step in the step set is less than one pixel unit; acquiring motion vector information of the current block, a prediction residual signal, and a reference image of the current block, and a search starting point in the reference image;
  • the current block is an image block to be decoded in the current image, and the motion vector information includes a search step number and a search direction of a matching block of the current block in the reference image with respect to the search start point, Predicting a residual signal for indicating a residual between the current block and the matching block; searching for the reference image, the search start point, the motion vector information, and a motion vector accuracy of the current image a matching block of the current block; acquiring a reconstructed pixel value of the current block according to the matching block and the prediction residual signal.
  • the search step set is ⁇ 1/2 x ⁇ , and x is a positive integer.
  • the motion vector accuracy further includes a threshold set, where the threshold set includes at least one threshold; the processor is further configured to determine, according to each threshold value in the threshold set, the threshold corresponding to the threshold a search area in which the search starting point is located in the search area, and search steps in the search area corresponding to different thresholds are respectively different elements in the search step set;
  • Each element in the set of thresholds respectively corresponds to a different element in the set of search steps; wherein a threshold corresponding to the size of the adjacent y1 and y2, y1 ⁇ y2, y2 in the search step size set corresponds to The search area is surrounded by the search area corresponding to the threshold corresponding to y1, and is connected to the search area corresponding to the threshold corresponding to the y1.
  • the threshold set includes m1 and m2, where the m1 is a positive integer multiple of 2 or 0, and the m2 is a positive integer multiple of 4, m1 ⁇ m2;
  • the determining the search area corresponding to the threshold according to each threshold of the threshold set and the search starting point includes:
  • the area in the first square is used as the search area corresponding to the m1, and the first square is a square centered on the search starting point, and 2m1* the minimum pixel unit is a side length;
  • the area between the first square and the second square is used as the search area corresponding to the m2, and the second square is a square centered on the search starting point, and 2m2* the minimum pixel unit is a side length;
  • the area in the third square is taken as the search area corresponding to the m1; the third square is a square centered on the y2 pixel closest to the search starting point, and 2m1* the smallest pixel unit is a side length;
  • the minimum pixel unit is the smallest element in the set of search steps.
  • the elements in the search step set include y1, y2, y1 ⁇ y2; the elements in the threshold set include m1, m2;
  • the searching for the matching block according to the reference image, the search starting point, the motion vector information, and the motion vector precision of the current image includes:
  • Determining a temporary point, a motion vector of the temporary point relative to the search starting point is a number of search steps and a search direction in the motion vector information, and a search step size is a minimum element in the search step set;
  • the search step set is ⁇ 1/4, 1/8 ⁇ , or ⁇ 1/2, 1/4, 1/8 ⁇ , or ⁇ 1/4, 1/8, 1/ 16 ⁇ , or ⁇ 1/2, 1/4, 1/8, 1/16 ⁇ .
  • the acquiring the current image and the motion vector accuracy of the current image include:
  • Receiving a video code stream Reading the current image and motion vector accuracy of the current image from the video code stream.
  • the acquiring the current image and the motion vector accuracy of the current image include:
  • the decoding information includes a motion vector difference value of each decoded block in the decoded image and a pixel point included in each decoded block in the decoded image a number, wherein the motion vector difference value of the decoding block is used to indicate the motion vector information when the decoding block is the current block;
  • a motion severity of the decoded image is an average of a first value of each decoded block in the decoded image, the decoded block
  • the first value is a product of a sum of an absolute value of a horizontal component of the motion vector difference value of the decoding block and an absolute value of a vertical component of the motion vector difference value and a number of pixel points included in the decoding block;
  • the acquiring the current image and the motion vector accuracy of the current image further includes:
  • the obtaining the motion vector accuracy of the current image according to the preset strategy according to the motion severity of the decoded image set and the quantization parameter of the current image specifically includes:
  • the acquiring the motion vector accuracy of the current image includes:
  • the disclosed system, device and method The law can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

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

Abstract

本发明实施例公开了一种视频编码和解码方法、视频编码和解码装置。本发明实施例方法包括:获取当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;获取当前块以及所述当前块的参考图像;确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;获取运动矢量信息和预测残差信号,将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。本发明实施例能够结合视频特性进行编码和解码。

Description

视频编码和解码方法、视频编码和解码装置
本申请要求于2015年7月3日提交中国专利局、申请号为201510391858.X、发明名称为“视频编码和解码方法、视频编码和解码装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及图像处理技术领域,尤其涉及一种视频编码和解码方法、视频编码和解码装置。
背景技术
随着互联网科技的迅猛发展以及人们物质精神文化的日益丰富,在互联网中针对视频的应用需求尤其是针对高清视频的应用需求越来越多,而高清视频的数据量非常大,要想高清视频能在带宽有限的互联网中传输,必须首先解决的问题就是高清视频压缩编码问题。目前,国际上有两个国际组织专门进行视频编码标准的制定工作,即国际标准化组织(International Organization for Standardization,简称为“ISO”)/国际电工委员会(International Electrotechnical Commission,简称为“IEC”)下的运动图像专家组(Motion Picture Experts Group,简称为“MPEG”)和国际电信联盟电信标准化组(International Telecommunication Union-Telecommunication standardization sector,简称为“ITU-T”)的视频编码专家组(Video Coding Experts Group,简称为“VCEG”)。成立于1986年的MPEG专门负责制定多媒体领域内的相关标准,主要应用于存储、广播电视、因特网或无线网上的流媒体等。ITU-T则主要制定面向实时视频通信领域的视频编码标准,如视频电话、视频会议等应用。
在过去的几十年里,国际上已经成功制定了面向各种应用的视频编码标准,主要包括:用于影音光碟(Video Compact Disc,简称为“VCD”)的MPEG-1标准,用于数字多功能光盘(Digital Video Disc,简称为“DVD”)和数字视频广播(Digital Video Broadcasting,简称为“DVB”)的MPEG-2标准,用于视频会议的H.261标准以及H.263标准、H.264标准,允许对任意形状的对象编码的MPEG-4标准,以及最新的高性能视频编码(High Efficiency Video Coding,简称为“HEVC”)标准。
由于视频序列相邻图像之间存在很大的时间相关性,可将图像序列的每图 像图像分成若干互不重叠的编码块,并认为编码块内所有像素点的运动都相同,以编码块为单位分配运动矢量。在对当前编码图像中的当前编码块进行图像间预测时,将已重建的编码图像作为参考图像,对当前编码块在参考图像中一定搜索区域内进行运动搜索,找到与当前编码块满足匹配准则的块,即为匹配块。当前编码块与参考图像中匹配块之间空间位置相对偏移量即为运动矢量(Motion Vector,MV),得到运动矢量的过程被称为运动估计(Motion Estimation,ME)。对视频进行压缩编码时,将参考图像信息、运动矢量信息和匹配块重建像素值与当前块原始像素值之间的差异(残差值)进行编码后发送到解码端。解码端从已解码的参考图像中找到运动矢量所指向位置的块,和残差值相加后恢复出当前块。利用运动估计可去除视频序列的图像间冗余,使视频传输的比特数大为减少。
由于物体运动的连续性,在相邻图像之间,块的运动矢量并不都是以整像素为基本单位,可能真正的运动位移量是以1/4的像素,甚至1/8的像素等亚像素为单位的。H.264和HEVC都采用固定的亮度1/4像素运动矢量精度,色度1/8像素运动矢量精度,相比于整像素运动矢量精度极大地提高了编码性能。当采用亚像素运动矢量精度时,相应地,对当前块在参考图像中给定搜索范围内搜索其匹配块过程中的搜索步长也是亚像素运动矢量精度。而且,在对一个视频序列中的所有视频图像进行编码时,各视频图像的当前块在参考图像中所使用的搜索步长均采用固定的亚像素运动矢量精度。
然而,本申请的发明人发现,对不同内容特性的视频序列,采用固定的运动矢量精度不利于视频序列的编码。
发明内容
本发明实施例提供了一种视频编码和解码方法、视频编码和解码装置,能够结合视频特性进行编码和解码。
本发明实施例第一方面提供了一种视频编码方法,包括:
获取当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当 前待编码的图像块;
确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;
根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;
获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。
结合第一方面,在第一种可能的实施方式中,所述方法还包括:
将所述运动矢量精度的信息和/或所述搜索起点的信息写入所述码流,其中,所述运动矢量精度的信息用于指示所述运动矢量精度,所述搜索起点的信息用于指示所述搜索起点。
结合第一方面,在第二种可能的实施方式中,所述搜索步长集合为{1/2x},x为正整数。
结合第一方面的第二种可能的实施方式,在第一方面的第三种可能的实施方式中,所述根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
将所述目标整像素点作为起始点;
设置j的初始值为1,执行预置步骤:
从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
结合第一方面,在第四种可能的实施方式中,所述搜索步长集合为{y I y=1/2x,x为正整数};
所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述方法还包括:
根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应;其中,
其中,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
结合第一方面的第四种可能的实施方式,在第一方面的第五种可能的实施方式中,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
结合第一方面的第四种可能的实施方式或者第五种可能的实施方式,在第一方面的第六种可能的实施方式中,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2,m1<m2;
所述根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
根据所述目标整像素点获取当前起始点;
获取与所述当前起始点相邻的所有y2像素点;
当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
获取与所述目标y2像素点相邻的所有y1像素点;
当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
结合第一方面的第四种可能的实施方式,在第一方面的第七种可能的实施方式中,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
结合第一方面,在第八种可能的实施方式中,所述根据所述当前图像获取所述当前图像的运动矢量精度包括:
获取所述当前图像的量化参数以及已编码图像集合,所述已编码图像集合包括至少一个已编码图像;
获取所述已编码图像集合中各已编码图像的编码信息,所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息;
计算所述已编码图像集合中每个已编码图像的运动剧烈程度,其中,所述编码图像的运动剧烈程度为所述编码图像中各编码块的第一数值的平均值,所述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘 积;
将所述已编码图像集合中各编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度;
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
结合第一方面的第八种可能的实施方式,在第一方面的第九种可能的实施方式中,所述根据所述当前图像获取所述当前图像的运动矢量精度还包括:
获取参考参数,所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一项,以及所述已编码图像集合的图像间噪声;
其中,
当所述参考参数包括所述当前图像的纹理复杂度时,所述获取参考参数包括:
获取所述当前图像中各像素点的像素值;
计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度;
当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述获取参考参数包括:
获取所述已编码图像集合中各已编码图像中各像素点的像素值;
计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
将所述已编码图像集合中各编码图像的纹理复杂度的加权平均值作为所述已编码图像集合的纹理复杂度;
当所述参考参数包括所述已编码图像集合的图像间噪声时,所述获取参考参数包括:
获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各像素点的预测误差绝对值的平均值;
将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声;
所述根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度具体包括:
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
结合第一方面,在第一方面的第十种可能的实施方式中,所述根据所述当前图像获取所述当前图像的运动矢量精度包括:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
本发明第二方面提供一种视频解码方法,包括:
获取当前图像以及所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点;其中,所述目前块为所述当前图像中当前待解码的图像块,所述运动矢量信息包括所述目前块在所述参考图像中的匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述目前块的匹配块;
根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
结合第二方面,在第一种可能的实施方式中,
所述搜索步长集合为{1/2x},x为正整数。
结合第二方面,在第二种可能的实施方式中,
所述搜索步长集合为{yIy=1/2x,x∈N+};
所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述方法还包括:
根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,不同阈值对应的搜索区域内的搜索步长分别为所述搜索步长集合中的不同元素;其中,
所述阈值集合中的各元素分别对应所述搜索步长集合中的不同元素;其中,对所述搜索步长集合中大小排序相邻的y1和y2,y1<y2,y2对应的阈值对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
结合第二方面的第二种可能的实施方式,在第三种可能的实施方式中,
所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
结合第二方面的第三种可能的实施方式,在第四种可能的实施方式中,
所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素 包括m1,m2;
所述根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述匹配块包括:
确定参照搜索区域,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2);所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2);f1(x1,x2)=f2(x1,x2);
确定临时点,所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2,所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
当所述临时点位于所述参照搜索区域内时,执行以下步骤:
当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2;
当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
结合第二方面的第二种可能的实施方式,在第五种可能的实施方式中,
所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
结合第二方面,在第六种可能的实施方式中,
所述获取当前图像以及所述当前图像的运动矢量精度包括:
接收视频码流;
从所述视频码流中读取所述当前图像以及所述当前图像的运动矢量精度。
结合第二方面,在第七种可能的实施方式中,
所述获取当前图像以及所述当前图像的运动矢量精度包括:
接收视频压缩码流;
从所述视频压缩码流中读取所述当前图像;
获取所述当前图像的量化参数;
确定已解码图像集合,所述已解码图像集合包括当前的至少一个已解码图像;
获取所述已解码图像集合中各已解码图像的解码信息,所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息;
计算所述已解码图像集合中的每个解码图像的运动剧烈程度,其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积;
将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度;
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度。
结合第二方面的第七种可能的实施方式,在第八种可能的实施方式中,
所述获取当前图像以及所述当前图像的运动矢量精度还包括:
获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度;
所述根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度具体包括:
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数,以 及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
结合第二方面,在第九种可能的实施方式中,
所述获取所述当前图像的运动矢量精度包括:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
本发明实施例第三方面一种视频编码装置,包括:
第一获取单元,用于当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
第二获取单元,用于获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块;
第一确定单元,用于确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;
搜索单元,用于根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;
第三获取单元,用于获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
写入单元,用于将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。
结合第三方面,在第一种可能的实施方式中,所述写入单元还用于将所述运动矢量精度的信息和/或所述搜索起点的信息写入所述码流,其中,所述运动矢量精度的信息用于指示所述运动矢量精度,所述搜索起点的信息用于指示所述搜索起点。
结合第三方面,在第二种可能的实施方式中,所述搜索步长集合为{1/2x},x为正整数。
结合第三方面的第二种可能的实施方式,在第三方面的第三种可能的实施方式中,所述搜索单元具体用于:
将所述目标整像素点作为起始点;
设置j的初始值为1,执行预置步骤:
从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
结合第三方面,在第四种可能的实施方式中,所述搜索步长集合为{y I y=1/2x,x为正整数};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述视频编码装置还包括:
第二确定单元,用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应;其中,
其中,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
结合第三方面的第四种可能的实施方式,在第三方面的第五种可能的实施方式中,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述第二确定单元具体用于:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
结合第三方面的第四种可能的实施方式或者第五种可能的实施方式,在第三方面的第六种可能的实施方式中,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2,m1<m2;
所述搜索单元具体用于:
根据所述目标整像素点获取当前起始点;
获取与所述当前起始点相邻的所有y2像素点;
当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
获取与所述目标y2像素点相邻的所有y1像素点;
当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
结合第三方面的第四种可能的实施方式,在第三方面的第七种可能的实施方式中,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
结合第三方面,在第八种可能的实施方式中,所述第一获取单元具体用于:获取所述当前图像的量化参数以及已编码图像集合,所述已编码图像集合包括至少一个已编码图像;
获取所述已编码图像集合中各已编码图像的编码信息,所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息;
计算所述已编码图像集合中每个已编码图像的运动剧烈程度,其中,所述编码图像的运动剧烈程度为所述编码图像中各编码块的第一数值的平均值,所述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘积;
将所述已编码图像集合中各编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度;
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
结合第三方面的第八种可能的实施方式,在第三方面的第九种可能的实施方式中,所述第一获取单元还用于:
获取参考参数,所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一项,以及所述已编码图像集合的图像间噪声;
其中,
当所述参考参数包括所述当前图像的纹理复杂度时,所述第一获取单元用于:
获取所述当前图像中各像素点的像素值;
计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度;
当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述第一获取 单元用于:
获取所述已编码图像集合中各已编码图像中各像素点的像素值;
计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
将所述已编码图像集合中各编码图像的纹理复杂度的加权平均值作为所述已编码图像集合的纹理复杂度;
当所述参考参数包括所述已编码图像集合的图像间噪声时,所述第一获取单元用于:
获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各像素点的预测误差绝对值的平均值;
将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声;
所述根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度具体包括:
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
结合第三方面,在第三方面的第十种可能的实施方式中,所述第一获取单元具体用于:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
本发明第四方面提供一种视频解码装置,包括:
第一获取单元,用于获取当前图像以及所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
第二获取单元,用于获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点;其中,所述目前块为 所述当前图像中当前待解码的图像块,所述运动矢量信息包括所述目前块在所述参考图像中的匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
查找单元,用于根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述目前块的匹配块;
重建单元,用于根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
结合第四方面,在第一种可能的实施方式中,
所述搜索步长集合为{1/2x},x为正整数。
结合第四方面,在第二种可能的实施方式中,
所述搜索步长集合为{yIy=1/2x,x∈N+};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述视频编码装置还包括:
确定单元,用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,不同阈值对应的搜索区域内的搜索步长分别为所述搜索步长集合中的不同元素;其中,
所述阈值集合中的各元素分别对应所述搜索步长集合中的不同元素;其中,对所述搜索步长集合中大小排序相邻的y1和y2,y1<y2,y2对应的阈值对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
结合第四方面的第二种可能的实施方式,在第三种可能的实施方式中,
所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述确定单元具体用于:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方 形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
结合第四方面的第三种可能的实施方式,在第四种可能的实施方式中,
所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2;
所述查找单元具体用于:
确定参照搜索区域,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2);所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2);f1(x1,x2)=f2(x1,x2);
确定临时点,所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2,所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
当所述临时点位于所述参照搜索区域内时,执行以下步骤:
当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数 实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2;
当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
结合第四方面的第二种可能的实施方式,在第五种可能的实施方式中,
所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
结合第四方面,在第六种可能的实施方式中,
所述第一获取单元具体用于:
接收视频码流;
从所述视频码流中读取所述当前图像以及所述当前图像的运动矢量精度。
结合第四方面,在第七种可能的实施方式中,
所述第一获取单元具体用于:
接收视频压缩码流;
从所述视频压缩码流中读取所述当前图像;
获取所述当前图像的量化参数;
确定已解码图像集合,所述已解码图像集合包括当前的至少一个已解码图像;
获取所述已解码图像集合中各已解码图像的解码信息,所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息;
计算所述已解码图像集合中的每个解码图像的运动剧烈程度,其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积;
将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度;
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按 预置策略获取所述当前图像的运动矢量精度。
结合第四方面的第七种可能的实施方式,在第八种可能的实施方式中,
所述第一获取单元还用于:
获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度;
所述根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度具体包括:
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
结合第四方面,在第九种可能的实施方式中,
所述第一获取单元具体用于:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
从以上技术方案可以看出,本发明实施例具有以下优点:
本申请的发明人发现,对不同的内容特性的视频序列,自适应地选择该视频序列中的视频图像的运动矢量精度更利于该视频图像的编码,例如,对应运动缓慢、纹理细节少的视频图像,在参考图像中搜索匹配块时,采用较小精度的运动矢量相比于采用较大精度的运动矢量,可以节约对运动矢量编码所需的比特,同时减少运动估计过程中运动搜索的步骤以及对参考图像进行内插的计算量,节省编码和解码时间;对于运动剧烈、纹理复杂的视频图像,在参考图像中搜索匹配块时,采用较小精度的运动矢量可比采用较大精度的运动矢量得到与当前块更加相似的匹配块,减小预测残差,提高编码效率;基于上述发现,本发明实施例中,根据当前图像获取当前图像的内容特性,或者其他实施例中 的根据当前图像以及已编码图像获取当前图像的内容特性,进而确定与该当前图像的内容特性相符合的运动矢量精度,以便在当前块的参考图像中搜索该当前块的匹配块时,根据目标整像素点和该运动矢量精度来搜索匹配块。
附图说明
图1为本发明的一个实施例提供的一种视频编码方法的流程示意图;
图2和图3分别为本发明的视频编码方法中搜索区域的结构示意图;
图4为本发明的视频编码方法的另一个实施例的流程示意图;
图5为本发明的一个实施例提供的一种视频编码方法的流程示意图;
图6为本发明的视频解码方法的另一个实施例的流程示意图;
图7为本发明实施例的一种视频编码装置的结构示意图;
图8为本发明实施例的一种视频解码装置的结构示意图;
图9为本发明实施例的另一种视频编码装置的结构示意图;
图10为本发明实施例的另一种视频解码装置的结构示意图。
具体实施方式
本发明实施例提供了一种视频编码和解码方法、视频编码和解码装置,能够结合视频特性进行编码和解码。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
以下分别进行详细说明。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
以下分别进行详细说明。
先介绍本发明实施例提供的视频编码方法,本发明实施例提供的视频编码方法的执行主体是视频编码装置,其中,该视频编码装置可以是任何需要输出、存储视频的装置,如手机,笔记本电脑,平板电脑,个人电脑等设备。
参见图1,图1为本发明的一个实施例提供的一种视频编码方法的流程示意图。如图1所示,本发明的一个实施例提供的一种视频编码方法可包括以下内容:
101、获取当前图像,根据所述当前图像获取所述当前图像的运动矢量精度。
根据所述当前图像获取所述当前图像的运动矢量精度多种方法。例如,首先计算能够指示当前图像的内容特性的参数。视频编码装置内设置有列表,该列表内存有不同的参数分别对应的运动矢量精度,获取到当前图像的参数后,根据查表法来确定当前图像的运动矢量精度。
本实施例中,运动矢量精度用于指示以预设起始点开始进行搜索当前块的匹配块时的搜索步长。其中,该预设起始点为步骤103中的目标整像素点。运动矢量精度包括搜索步长集合,所述搜索步长集合包括至少一个搜索步长,且每个搜索步长小于一个像素单位。
本实施例中,运动矢量精度可以是单一运动矢量精度,或者,优选的,也可以是分阶运动矢量精度。当运动矢量精度为单一运动矢量时,搜索步长集合为{1/2x},其中x为正整数。也即搜索步长集合中仅包括一个搜索步长,该搜索步长为1/2x像素单位。例如,该搜索步长可以为1/2像素单位、1/4像素单位、1/8像素单位或者1/16像素单位等等,在此不做限制。
当运动矢量精度为分阶运动矢量精度时,搜索步长集合为{yIy=1/2x,x位正整数}。也即搜索步长集合中包括至少一个搜索步长,各搜索步长的取值为=1/2x,也即各搜索步长为1/2x像素单位,其中不同的搜索步长对应的x的取值不同。运动矢量精度还包括阈值集合,该阈值集合包括至少一个阈值。其中,各阈值分别用于指示参考图像中的一个搜索区域。运动矢量精度中的搜索步长集合中的各搜索步长与阈值集合中的各阈值一一对应,每个阈值所指示的搜索区域内以该阈值所对应的搜索步长作为搜索步长。
102、获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块。
其中,所述当前块为所述当前图像中当前待编码的图像块。对当前块进行编码时,在参考图像中根据一定的匹配准则找出与当前块最相似的块,称为该当前块的匹配块。因此,需确定当前块的参考图像。确定的方法有多种,此为现有技术,在此不再赘述。
103、确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点。
确定参考图像中的搜索起点的方法多种。例如,在HEVC使用的其中一种图像间预测模式,也即Inter模式中,可采用先进的运动矢量预测方法(英文全称:Advanced Motion Vector Prediction,缩写:AMVP)得到当前块的运动矢量预测值(英文全称:Motion Vector Predictor,MVP)集合,再将该MVP集合中率失真代价最小的MVP作为当前块的MVP。当然,实际应用中还有其他方法来确定当前块的MVP,此为现有技术,在此不再赘述。该MVP所指向的参考图像中的位置为当前块在参考图像中的预测匹配块的位置。
然而,MVP所指向的预测匹配块实际上并不是参考图像中与当前块相似度最高的匹配块,为减少计算当前块与匹配块之间的残差,还以该MVP所指向的预测匹配块的位置为搜索起点,在参考图像内进一步搜索当前图像的匹配块的位置。
确定参考图像中的搜索起点后,以该搜索起点为起始点进行以一个像素单位为搜索步长进行整像素运动搜索。整像素运动搜索的方法有多种,例如采用钻石型搜索、全搜索或者快速搜索等方法,这些方法为现有技术,在此不再赘述。在搜索中,将所搜索到的率失真代价最小的整像素点作为目标整像素点。
104、根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块。
获取到目标整像素点后,以该目标整像素点为起始点,根据运动矢量精度所包含的搜索步长集合中的搜索步长来搜索当前块的匹配块。实际应用中,一般通过搜索匹配块的左上角的点来搜索匹配块,当然,也可以是通过搜索匹配块中的其他点来搜索匹配块,在此不作限制。下面以运动矢量精度为单一运动 矢量精度为例对搜索匹配块的过程进行描述。
具体的,在运动矢量精度为单一运动矢量精度时,也即运动矢量精度中的搜索步长集合中仅有的一个元素为1/2x时,搜索匹配块具体包括:
将所述目标整像素点作为起始点,设置j的初始值为1,执行预置步骤:
从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
具体举例来说,运动矢量精度中的搜索步长为1/8像素单位时,查找目标整像素点周围相邻的八个1/2像素点,根据预置原则将其中的一个确定为目标1/2像素点。该预置原则可以为选择率失真代价最小的像素点,或者其他原则,在此不作限制。以目标1/2像素点为起始点,查找目标1/2像素点周围相邻的八个1/4像素点,根据预置原则将其中的一个确定为目标1/4像素点。以目标1/4像素点为起始点,查找目标1/4像素点周围相邻的八个1/8像素点,根据预置原则将其中的一个确定为目标1/8像素点。该目标1/8像素点的位置即为匹配块的位置。
105、获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差。
获取到匹配块后,可根据匹配块的位置和搜索起点的位置计算匹配块相对于所述搜索起点的运动矢量信息,也即该匹配块相对该搜索起点的搜索步数和搜索方向。
获取到匹配块后,可计算匹配块上各像素点的像素值与当前块上各像素点的像素值的差值,得到匹配块与当前块的预测残差信号。
106、将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流。
本实施例中,所述参考图像的信息用于指示所述参考图像,以便视频解码装置可以根据该参考图像的信息从各解码图像中确定参考图像。例如,该参考 图像的信息可以是参考图像的索引,在此不作限制。
视频解码装置接收到视频码流后,在对当前块进行解码时,可根据参考图像的信息和搜索起点的信息确定参考图像中的搜索起点的位置。由于运动矢量信息中没有指示搜索步数中各搜索步对应的步长,因此,视频解码装置还需要获取当前块的运动矢量精度,也即搜索步长,以使得视频解码装置可以根据匹配块相对搜索起点的搜索步数、搜索方向和搜索步长来确定匹配块的位置。
因此,对当前块编码时,需将该当前块的参考图像的信息、运动矢量信息、预测残差信号、运动矢量精度的信息以及搜索起点的信息写入码流。
其中,该运动矢量精度的信息用于指示该运动矢量精度。例如,在视频编码装置和视频解码装置内各预设有运动矢量精度集合。该运动矢量精度的信息具体为该运动矢量精度的索引,以便视频解码装置根据该运动矢量精度的信息从运动矢量精度集合中查找到该当前图像的运动矢量精度。或者,该运动矢量精度的信息也可以是该运动矢量精度的具体数值,在此不作限制。
其中,该搜索起点的信息用于指示所述搜索起点。例如,该搜索起点的信息为该搜索起点相对于当前块的运动矢量,在此不作限制。
然而,由于视频解码装置也可以采用相同的方法来计算当前图像的运动矢量精度,因此,视频编码装置在对当前块编码时,也可以不将当前图像的运动矢量精度写入码流,以减少当前块编码所需的比特数,而是由视频解码装置来自行计算。
或者,由于视频解码装置也可以采用相同的方法来获取当前块的MVP,也即所述搜索起点的位置,例如标准264中规定编码端和解码端采用相同方法获取MVP,因此,视频编码装置在对当前块编码时,也可以不将所述搜索起点的信息写入码流,以减少当前块编码所需的比特数,而是由视频解码装置来自行获取。
本申请的发明人发现,对不同的内容特性的视频序列,自适应地选择该视频序列中的视频图像的运动矢量精度更利于该视频图像的编码,例如,对应运动缓慢、纹理细节少的视频图像,在参考图像中搜索匹配块时,采用较小精度的运动矢量相比于采用较大精度的运动矢量,可以节约对运动矢量编码所需的比特,同时减少运动估计过程中运动搜索的步骤以及对参考图像进行内插的计 算量,节省编码和解码时间;对于运动剧烈、纹理复杂的视频图像,在参考图像中搜索匹配块时,采用较小精度的运动矢量可比采用较大精度的运动矢量得到与当前块更加相似的匹配块,减小预测残差,提高编码效率;基于上述发现,本发明实施例中,通过当前图像获取当前图像的内容特性,进而确定与该当前图像的内容特性相符合的运动矢量精度,以便在当前块的参考图像中搜索该当前块的匹配块时,根据目标整像素点和该运动矢量精度来搜索匹配块。
可选的,在本发明的一些可能的实施方式中,当前图像的运动矢量精度为分阶运动矢量精度,也即所述搜索步长集合为{yIy=1/2x,x为正整数};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值。在步骤104之前,还包括:根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域。其中,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应。其中,当阈值集合包括至少两个元素时,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
其中,搜索步长集合的取值有多可能。例如,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16},在此不作限制。
其中,阈值所对应的搜索区域的形状有多种。下面以搜索区域的形状为正方形进行举例描述。
搜索步长集合为{y1,y2},阈值集合为{m1,m2},其中y1<y2,m1<m2,y1与m1对应,y2与m2对应,其中,m1为2的正整数倍或0,所述m2为4的正整数倍。所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方 形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
为方便理解,下面以y1=1/8,y2=1/4,m1=2,m2=4进行举例描述。
请参阅图2和图3,图2和图3分别为本发明的视频编码方法中搜索区域的结构示意图。如图2所示,图中的圆块为1/2像素点,正方块为1/4像素点,三角块为1/8像素点。所述搜索起点(图中标识为阴影块)位于1/2像素点上,那么:
第一正方形(图中标记为P1)为:以搜索起点为中心,2*2*最小像素单元(也即1/8像素单位)=1/2像素单位为边长。
第二正方形(图中标记为P2)为:以搜索起点为中心,2*4*最小像素单元(也即1/8像素单位)=1像素单位为边长。
m1对应的搜索区域为第一正方形,在该搜索区域内搜索时采用的搜索步长为1/8像素单位。m2对应的搜索区域为第一正方形和第二正方形之间的区域,在该搜索区域内搜索时采用的搜索步长为1/4像素单位。
如图3所示,图中的圆块为1/2像素点,正方块为1/4像素点,三角块为1/8像素点。所述搜索起点(图中标识为阴影块)位于1/8像素点上,那么:
第三正方形(图中标记为P3)为:以距离搜索起点最近的1/4像素点为中心,2*2*最小像素单元(也即1/8像素单位)=1/2像素单位为边长。
第四正方形(图中标记为P4)为:以距离搜索起点最近的1/2像素点为中心,2*4*最小像素单元(也即1/8像素单位)=1像素单位为边长。
m1对应的搜索区域为第三正方形,在该搜索区域内搜索时采用的搜索步 长为1/8像素单位。m2对应的搜索区域为第三正方形和第四正方形之间的区域,在该搜索区域内搜索时采用的搜索步长为1/4像素单位。
其中,距离搜索起点最近的y2像素点和y3像素点分别有至少一个,可取其中任意一个y2像素点和y3像素点分别作为第三正方形P3和第四正方形P4的中心。优选的,取位于所述搜索起点的同一侧的y2像素点和y3像素点分别作为第三正方形P3和第四正方形P4的中心,以避免第三正方形P3不能全部位于第四正方形P4内。
上面实施例中以搜索区域的形状为正方形进行了举例描述。实际应用中,该搜索区域的形状还可以是圆形、正六边形或者其他形状,在此不作限制。
进一步,可选的,在本发明的一些可能的实施方式中,步骤104根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
S1、根据所述目标整像素点获取当前起始点;
S2、获取与所述当前起始点相邻的所有y2像素点;
S3、当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
S4、当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
S5、从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
S6、获取与所述目标y2像素点相邻的所有y1像素点;
S7、当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
S8、当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
其中,在步骤S1中,如何根据目标整像素点获取当前起始点取决于y2的取值。例如,当y2=1/4时,首先查找目标整像素点周围相邻的所有1/2像素点,然后根据预置原则(例如选择率失真代价最小的像素点)从中确定目标1/2像素点,并将该目标1/2像素点作为当前起始点。当y2=1/8时,首先根据目标整像素点获取目标1/2像素点,查找目标1/2像素点周围相邻的所有1/4 像素点,然后根据预置原则(例如选择率失真代价最小的像素点)从中确定目标1/4像素点,并将该目标1/4像素点作为当前起始点。同理,当y2=1/16时,可获取目标1/8像素点作为当前起始点。以此类推。
为便于更好的理解和实施本发明实施例的上述方案,下面通过一些具体应用场景进行举例说明。
请参见图4,图4为本发明的视频编码方法的另一个实施例的流程示意图。本实施例中,视频编码方法包括:
401、获取当前图像,根据所述当前图像获取所述当前图像的运动矢量精度。
其中,所述运动矢量精度具体包括搜索步长集合{1/8,1/4},以及阈值集合{m1,m2}。
402、获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块。
403、确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点。
404、判断所述搜索起点是否位于整像素点或者1/2像素点上。
若是,则执行步骤405。
若否,则执行步骤406。
405、将第一正方形内的区域作为所述m1对应的搜索区域;将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域。
其中,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形。所述最小像素单元为所述搜索步长集合中的最小元素。
406、将第三正方形内的区域作为所述m1对应的搜索区域,将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域。
其中,所述第三正方形为以距离所述搜索起点最近的1/4像素点为中心,2m1*最小像素单元为边长的正方形;所述第四正方形为以距离所述搜索起点最近的1/2像素点为中心,2m2*最小像素单元为边长的正方形;其中。所述最小像素单元为所述搜索步长集合中的最小元素。
为描述方便,设运动矢量Ce(Cex,Cey)指向第三正方形的中心,运动矢量Cq(Cqx,Cqy)指向第四正方形的中心。具体的,可通过以下两个公式分别计算Ce(Cex,Cey)和Cq(Cqx,Cqy)
Figure PCTCN2016088157-appb-000001
Figure PCTCN2016088157-appb-000002
其中,MVPx为当前块的MVP在水平方向上的分量,MVPy为当前块的MVP在竖直方向上的分量。
407、根据所述目标整像素点获取当前起始点。
查找目标整像素点周围相邻的所有1/2像素点,然后根据预置原则(例如选择率失真代价最小的像素点)从中确定目标1/2像素点,并将该目标1/2像素点作为当前起始点。
408、获取与所述当前起始点相邻的所有1/4像素点。
409、判断所述所有1/4像素点是否全部位于所述m2对应的搜索区域外,若是,则执行步骤410;若否,则执行步骤411。
具体的,可通过公式(1)计算所述所有1/4像素点是否全部位于所述m2对应的搜索区域外。
|MV'quater x-Cqx|>m2或者|MV'quater y-Cqy|>m2     (1)
其中,MV‘quater为每一个1/4像素点相对于所述当前块在参考帧中相同位置的运动矢量,MV‘quater x为MV‘quater的水平分量,MV‘quater y为MV‘quater的竖直分量。当全部1/4像素点满足公式(1)时,执行步骤410;若至少一个1/4像素点不满足公式(1),则执行步骤411。
410、确定所述目标1/2像素点的位置为所述匹配块的位置。
具体的,可通过以下公式计算所述匹配块相对于搜索起点的运动矢量MVD,在下面公式中,MVDx为MVD在水平方向上的分量,MVDy为MVD在竖直方向上的分量,MVhalf为目标1/2像素点相对于所述当前块在参考帧中相同位置的运动矢量。
当|MVhalf x-Cqx|>THq时,判断MVhalf所指向位置在Cq的左边还是右边。
若是左边,则通过下面公式计算MVDx
MVDx=Cex-THe+((Cqx-THq)-(Cex-THe))/2+(MVhalfx-(Cqx-THq))/4-MVPx,
MVDy=(MVhalf y-Cqy)/4
若是右边,则通过下面公式计算MVDx
MVDx=Cex+THe+((Cqx+THq)-(Cex+THe))/2+(MVhalfx-(Cqx+THq))/4-MVPx,
MVDy=(MVhalf y-Cqy)/4
否则,当|MVhalf y-Cqy|>THq时,判断MVhalf所指向位置在Cq的上边还是下边。
若是上边,则通过下面公式计算MVDy
MVDy=Cey-THe+((Cqy-THq)-(Cey-THe))/2+(MVhalfy-(Cqy-THq))/4-MVPy,
MVDx=(MVhalf x-Cqy)/4
若是下边,则通过下面公式计算MVDy
MVDy=Cey+THe+((Cqy+THq)-(Cey+THe))/2+(MVhalfy-(Cqy+THq))/4-MVPx,411、
MVDx=(MVhalf x-Cqx)/4
从位于所述m2对应的搜索区域内的1/4像素点中获取目标1/4像素点。
具体的,可遍历位于所述m2对应的搜索区域内的所有1/4像素点,根据预置原则(例如选择率失真代价最小的像素点)确定目标1/4像素点。
412、获取与所述目标1/4像素点相邻的所有1/8像素点。
413、判断所述所有1/8像素点是否全部位于所述m1对应的搜索区域外,若是,则执行步骤414;若否,则执行步骤415。
具体的,可通过公式(2)计算所述所有1/8像素点是否全部位于所述m1对应的搜索区域外。
|MV'eight x-Cex|>m1,或|MV'eight y-Cey|>m1    (2),
其中,MV‘eight为各1/8像素点相对于所述当前块的运动矢量,MV‘eightx为MV‘eight的水平分量,MV‘eighty为MV‘eight的竖直分量。当全部1/8像素点满足公 式(2)时,执行步骤414;若至少一个1/8像素点不满足公式(2),则执行步骤415。
414、确定所述目标1/4像素点的位置为所述匹配块的位置。
具体的,可通过以下公式计算所述匹配块相对于搜索起点的运动矢量MVD。在下面公式中,MVDx为MVD在水平方向上的分量,MVDy为MVD在竖直方向上的分量,MVquater为目标1/4像素点相对于所述当前块在参考帧中相同位置的运动矢量。
当|MVquater x-Cex|>THe时,判断MVquater所指向位置在Ce的左边还是右边。
若是左边,则通过下面公式计算MVDx
MVDx=Cex-THe+(MVquate rx-(Cex-THe))/2-MVPx,
MVDy=(MVquater y-Cey)/2
若是右边,则通过下面公式计算MVDx
MVDx=Cex+THe+(MVquater x-(Cex+THe))/2-MVPx,
MVDy=(MVquater y-Cey)/2
否则,当|MVquater y-Cey|>THe时,判断MVquater所指向位置在Ce的上边还是下边。
若是上边,则通过下面公式计算MVDy
MVDy=Cey-THe+(MVquater y-(Cey-THe))/2-MVPy,
MVDx=(MVquate rx-Cex)/2
若是下边,则通过下面公式计算MVDy
MVDy=Cey+THe+(MVquater y-(Cey+THe))/2-MVPy,
MVDx=(MVquater x-Cex)/2
415、从位于所述m1对应的搜索区域内的1/8像素点中获取目标1/8像素点,确定所述目标1/8像素点的位置为所述匹配块的位置。
具体的,可通过下面公式计算所述匹配块相对于搜索起点的运动矢量 MVD。
MVDx=MVeightx-MVPx,MVDy=MVeighty-MVPy
416、获取运动矢量信息和预测残差信号。
其中,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差。
417、将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流。
本发明实施例中,根据所述当前图像获取所述当前图像的运动矢量精度。实际应用中,有多种方法根据所述当前图像获取所述当前图像的运动矢量精度。
可选的,在本发明的一些可能的实施方式中,根据所述当前图像获取所述当前图像的运动矢量精度包括:获取所述当前图像的量化参数;获取所述当前图像的分辨率中的宽度值;根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。其中,所述预置策略可以是查表法,或者是阈值法,或者是利用公式计算出决策因子,根据决策因子与预设值比较的结果来选择当前图像的运动矢量精度,或者是其他策略,在此不作限制。
具体举例来说,所述预置策略为查表法。视频编码装置内预存有如下表1,其中,表1中第一行表示所述当前图像的量化参数的值所在范围,第一列表示所述当前图像的分辨率中的宽度值的所在范围。获取到获取所述当前图像的分辨率中的宽度值和所述当前图像的量化参数后,在表1中查找当前图像的运动矢量精度。
表1
  <25 25~30 30~35 35~40 >40
<1 (2,8) (0,8) (0,4) (0,4) (0,4)
1~2 (4,8) (0,8) (0,8) (0,4) 1/2
2~4 (0,8) (0,8) (0,4) (0,4) 1/2
4~6 (0,4) (0,4) (0,4) (0,4) 1/2
6~8 (0,8) 1/2 1/2 1/2 1/2
>8 1/2 1/2 1/2 1/2 1/2
可选的,在本发明的一些可能的实施方式中,由于运动的连续性,还可根据已编码图像集合和当前图像获取到该当前图像的内容特性,进而根据该内容特性来确定当前图像的运动矢量精度。其中,所述已编码图像集合包括至少一个已编码图像。已编码图像集合中的各已编码图像可以是视频序列中与该当前图像相邻的已编码图像,也可以是与该当前图像相隔至少一个图像的已编码图像,在此不作限制。
进一步,可选的,在本发明的一些可能的实施方式中,根据所述当前图像和所述已编码图像集合获取所述当前图像的运动矢量精度包括:
S10、获取所述当前图像的量化参数以及已编码图像集合。
S11、获取所述已编码图像集合中各已编码图像的编码信息。
本实施例中,所述已编码图像集合包括至少一个已编码图像。优选的,所述已编码图像集合中仅有一个元素,该元素为与所述当前图像时间上相邻的已编码图像。由于与当前图像时间上相邻的已编码图像与该当前图像的内容特性较相似,采用该已编码图像来获取当前图像的运动矢量精度能够让该当前图像的运动矢量精度更加符合该当前图像的内容特性,而且,所述已编码图像集合仅包括一个元素,能够减少计算量。
所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息。也即所述编码块为当前块时,所述编码块的运动矢量差值为该编码块的匹配块相对于该编码块的参考图像上的搜索起点的运动矢量。
S12、计算所述已编码图像集合中每个已编码图像的运动剧烈程度。
其中,所述已编码图像的运动剧烈程度为所述已编码图像中各编码块的第一数值的加权平均值,所述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘积。
具体的,以M表示所述已编码图像的运动剧烈程度,以mvdx表示所述编码块的运动矢量差值的水平分量,以mvdy表示所述编码块的运动矢量差值的竖直分量,以pusize表示所述编码块所包含的像素点个数,则,
Figure PCTCN2016088157-appb-000003
S13、将所述已编码图像集合中各已编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度。
具体的,各已编码图像的运动剧烈程度的加权值可以相同,也可以不同,在此不作限制。
S14、根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
所述预置策略可以是查表法,或者是阈值法,或者是利用公式计算出决策因子,根据决策因子与预设值比较的结果来选择当前图像的运动矢量精度,或者是其他策略,在此不作限制。
例如,所述预置策略为查表法。视频编码装置内预存有如下表2,其中,表2中第一行表示所述当前图像的量化参数的值所在范围,第一列表示所述已编码图像集合的运动剧烈程度的值所在范围。获取到所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数后,在表2中查找当前图像的运动矢量精度。
表2
  <25 25~30 30~35 35~40 >40
<1 (2,8) (0,8) (0,4) (0,4) (0,4)
1~2 (4,8) (0,8) (0,8) (0,4) 1/2
2~4 (0,8) (0,8) (0,4) (0,4) 1/2
4~6 (0,4) (0,4) (0,4) (0,4) 1/2
6~8 (0,8) 1/2 1/2 1/2 1/2
>8 1/2 1/2 1/2 1/2 1/2
进一步,可选的,在本发明的一些可能的实施方式中,所述根据所述当前图像和已编码图像集合获取所述当前图像的运动矢量精度还包括:
S15、获取参考参数。
所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一项,以及所述已编 码图像集合的图像间噪声。
其中,当所述参考参数包括所述当前图像的纹理复杂度时,所述获取参考参数包括:
获取所述当前图像中各像素点的像素值;
计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度。
具体的,以A表示所述当前图像的纹理复杂度,以sx,y表示所述当前图像中的像素点的像素值,其中x,y为该像素点的坐标,则,
Figure PCTCN2016088157-appb-000004
其中,当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述获取参考参数包括:
获取所述已编码图像集合中各已编码图像中各像素点的像素值;
计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
将所述已编码图像集合中各已编码图像的纹理复杂度的加权平均值作为所述已编码图像集合的纹理复杂度。
具体的,以Bi表示第i个所述已编码图像的纹理复杂度,以sx,y表示所述编码图像中的像素点的像素值,其中x,y为该像素点的坐标,以B表示所述已编码图像集合的纹理复杂度,则,
Figure PCTCN2016088157-appb-000005
其中,当所述参考参数包括所述已编码图像集合的图像间噪声时,所述获取参考参数包括:
获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各像素点的预测误差绝对值的平均值;
将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声。
具体的,以Ni表示第i个所述已编码图像的预测误差,以sx,y表示所述编 码图像中的像素点的原始像素值,s′x+u,y+v表示所述编码图像中相应位置上像素点的预测像素值,其中x,y为该像素点的坐标,以N表示所述已编码图像集合的纹理复杂度,则,
Figure PCTCN2016088157-appb-000006
所述步骤S14具体为根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
其中,预置策略有多种,下面对其中的几种进行举例描述:
方法一:
S21、根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数确定所述当前图像的初始运动矢量精度。
其中,获取所述当前图像的初始运动矢量精度的方法可参考所述步骤S14中举例所描述的查找所述表1的查表法。
S22、获取运动矢量精度集合以及所述运动矢量精度集合中各元素的索引。
具体的,本实施例中,运动矢量精度集合为{1/2,(0,4),(0,8),1/4,(2,4),(2,8),(4,8),1/8}。各运动矢量精度集合中的各运动矢量精度的索引值如表3所示。
表3
运动矢量精度 1/2 (0,4) (0,8) 1/4 (2,4) (2,8) (4,8) 1/8
索引值 0 1 2 3 4 5 6 7
S23、计算第一比值RN,所述第一比值RN为当前图像的预测误差所消耗的比特BN与所述已编码图像集合的预测误差所消耗的比特BF的比值。
S24、计算第二比值RMVD,所述第二比值RMVD为当前图像的运动矢量差值MVD所消耗的比特第二比值BMVD与所述已编码图像集合的预测误差所消耗的比特BF的比值。
S25、根据RN和RMVD获取调整步长Offset。
其中,Offset为-1≤Offset≤3内的整数;根据以下公式获取Offset,其中, 式中
Figure PCTCN2016088157-appb-000007
表示向下取整函数。
Offset=F1-F2
Figure PCTCN2016088157-appb-000008
S26、根据调整步长Offset对所述初始运动矢量精度进行调整。
其中,当Offset值为-1时,将索引值加1;当Offset值为3时,将索引值减1;当Offset值为0,1,2时,索引值不变。
方法二:
S31、根据所述当前图像的纹理复杂度或者所述已编码图像集合的纹理复杂度A、所述已编码图像集合的图像间噪声N以及所述已编码图像集合的运动剧烈程度M计算决策因子F。
具体的,F=12M+7N-5A。当然,M、N、A的参数也可以是其他,在此不作限制。
实际应用中,在计算决策因子F时,也可以不采用所述已编码图像集合的图像间噪声N,即只根据所述当前图像的纹理复杂度或者所述已编码图像集合的纹理复杂度A以及所述已编码图像集合的运动剧烈程度M计算决策因子F。
具体的,F=12M-5A。当然,M、A的参数也可以是其他,在此不作限制。
S32、根据所述当前图像的量化参数QP获取阈值Th0和Th1。
其中,可根据以下公式计算阈值Th0和Th1:
Th0=a0QP2+b0QP+C0
Th1=a1QP2+b1QP+C1
具体的,式中系数a0,a1,b0,b1,c0,c1分别是-0.02,0.57,16,-0.03,0.6,38;当然,式中系数也可以为其他数值,在此不作限制。
S33、将F与阈值Th0和Th1进行比较得到MVR1。
具体的,可根据以下公式获取MVR1:
Figure PCTCN2016088157-appb-000009
S34、统计所述已编码图像集合中运动矢量差值MVD的绝对值的分布情况。
其中,分别统计运动矢量差值的水平分量mvdx的绝对值和运动矢量差值的竖直分量mvdy的绝对值在以下五个区间这些区间的分布概率得到:
Figure PCTCN2016088157-appb-000010
S35、利用如下公式获得当前图像的运动矢量精度MVR。
Figure PCTCN2016088157-appb-000011
上面对本发明实施例的视频编码方法进行了描述。下面介绍本发明实施例提供的视频解码方法,本发明实施例提供的视频解码方法的执行主体是视频解码装置,其中,该视频解码装置可以是任何需要输出、播放视频的装置,如手机,笔记本电脑,平板电脑,个人电脑等设备。
参见图5,图5为本发明的一个实施例提供的一种视频编码方法的流程示意图。如图5所示,本发明的一个实施例提供的一种视频编码方法可包括以下内容:
501、获取当前图像以及所述当前图像的运动矢量精度。
502、获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点。
其中,步骤501和步骤502之间没有必然的执行先后顺序,例如步骤501可先于或晚于步骤502执行,或者步骤501和步骤502也可同步执行,或者步骤501和步骤502也可穿插执行。
视频解码装置接收到视频码流后,对该视频码流进行解码,以还原原始视频序列中的各视频图像。本实施例中,当前图像为当前待解码的图像图像。在对当前图像解码时,通过依次对当前图像中的每一个图像块进行重建来获得该当前图像的重建像素值,当前待解码的图像块称为目前块。其中,视频码流中包含目前块的参考图像的信息、所述运动矢量信息以及所述预测残差信号。
其中,获取所述目前块的参考图像时,通过从视频码流中提取出所述参考图像的信息,根据该信息查找到该信息所指示的参考图像。例如,该参考图像的信息可以是参考图像的索引,在此不作限制。
其中,搜索起点在参考图像中的位置用于指示所述目前块在参考图像中的预测匹配块的位置。运动矢量信息用于指示所述目前块在参考图像中的匹配块相对于预测匹配块的搜索步数和搜索方向。运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位,其中所述搜索步长集合用于指示所述搜索步数的步长的信息。具体的,运动矢量信息中的搜索步数中各搜索步的步长为所述搜索步长集合中的最小元素。所述预测残差信号用于指示所述当前块和所述匹配块之间的残差。
获取所述参考图像中的搜索起点的方法有多种。例如,视频码流中还包含有搜索起点的信息。视频解码装置通过从视频码流中提取出所述搜索起点的信息,根据该信息查找到该信息所指示的搜索起点。或者,在编码端和解码端统一使用相同的方法计算当前图像在参考图像中的搜索起点。这样,视频解码装置所接收到的视频码流中没有搜索起点的信息,而是由视频解码装置自行计算获取。
获取所述运动矢量精度的方法有多种。例如,视频码流中还包含有运动矢量精度的信息。视频解码装置接收到视频码流后,通过从视频码流中读取出所述运动矢量精度的信息,根据该信息确定运动矢量精度。其中,该运动矢量精 度的信息可以是运动矢量精度的索引,或者是运动矢量精度的数值,在此不作限制。或者,在编码端和解码端统一使用相同的方法计算当前图像的运动矢量精度。这样,视频解码装置所接收到的视频码流中没有运动矢量精度的信息,而是由视频解码装置自行计算获取。
本实施例中,运动矢量精度可以是单一运动矢量精度,或者,优选的,也可以是分阶运动矢量精度。当运动矢量精度为单一运动矢量时,搜索步长集合为{1/2x},其中x为正整数。也即搜索步长集合中仅包括一个搜索步长,该搜索步长为1/2x像素单位。例如,该搜索步长可以为1/2像素单位、1/4像素单位、1/8像素单位或者1/16像素单位等等,在此不做限制。
当运动矢量精度为分阶运动矢量精度时,搜索步长集合为{yIy=1/2x,x位正整数}。也即搜索步长集合中包括至少一个搜索步长,各搜索步长的取值为=1/2x,也即各搜索步长为1/2x像素单位,其中不同的搜索步长对应的x的取值不同。运动矢量精度还包括阈值集合,该阈值集合包括至少一个阈值。其中,各阈值分别用于指示参考图像中的一个搜索区域。运动矢量精度中的搜索步长集合中的各搜索步长与阈值集合中的各阈值一一对应,每个阈值所指示的搜索区域内以该阈值所对应的搜索步长作为搜索步长。
503、根据所述参考图像的信息、所述搜索起点的信息、所述运动矢量信息、所述当前图像的运动矢量精度的信息查找所述目前块的匹配块。
由于运动矢量信息包含有匹配块相对于搜索起点的搜索步数和搜索方向,而当前图像的运动矢量精度的信息包含有该搜索步数所对应的搜索步长,因此可以在参考图像上以搜索起点为起始点,根据运动矢量信息以及当前图像的运动矢量精度的信息查找到目前块的匹配块。
在根据运动矢量信息以及当前图像的运动矢量精度的信息查找到目前块的匹配块时,运动矢量精度为单一运动矢量精度还是分阶运动矢量精度时分别对应的算法并不相同。例如,当运动矢量精度为单一运动矢量精度时,可通过以下公式来计算出匹配块的运动矢量,其中,MVR为运动矢量精度。
Figure PCTCN2016088157-appb-000012
504、根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
预测残差信号为匹配块上各像素点的像素值与目前块上各像素点的像素值的残差,因此,将匹配块上各像素点的像素值分别与预测残差信号中对应的像素点的像素值相加,即可得到目前块的重建像素值。
本申请的发明人发现,对不同的内容特性的视频序列,自适应地选择该视频序列中的视频图像的运动矢量精度更利于该视频图像的编码,例如,对应运动缓慢、纹理细节少的视频图像,在参考图像中搜索匹配块时,采用较小精度的运动矢量相比于采用较大精度的运动矢量,可以节约对运动矢量编码所需的比特,同时减少运动估计过程中运动搜索的步骤以及对参考图像进行内插的计算量,节省编码和解码时间;对于运动剧烈、纹理复杂的视频图像,在参考图像中搜索匹配块时,采用较小精度的运动矢量可比采用较大精度的运动矢量得到与当前块更加相似的匹配块,减小预测残差,提高编码效率;基于上述发现,本发明实施例中,在编码端通过当前图像和已编码图像集合获取当前图像的内容特性,进而确定与该当前图像的内容特性相符合的运动矢量精度;这样,在解码端搜索匹配块时先获取当前图像的运动矢量精度和运动矢量信息,根据该运动矢量精度和运动矢量信息来搜索匹配块。
可选的,在本发明的一些可能的实施方式中,当前图像的运动矢量精度为分阶运动矢量精度,也即所述搜索步长集合为{yIy=1/2x,x为正整数};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值。在步骤503之前,还包括:根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域。其中,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应。其中,当阈值集合包括至少两个元素时,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
其中,搜索步长集合的取值有多可能。例如,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16},在此不作限制。
其中,阈值所对应的搜索区域的形状有多种。下面以搜索区域的形状为正方形进行举例描述。
搜索步长集合为{y1,y2},阈值集合为{m1,m2},其中y1<y2,m1<m2,y1与m2对应,y2与m1对应,其中,m1为2的正整数倍或0,所述m2为4的正整数倍。所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
为方便理解,下面以y1=1/8,y2=1/4,m1=2,m2=4进行举例描述。
请参阅图2和图3。如图2所示,图中的圆块为1/2像素点,正方块为1/4像素点,三角块为1/8像素点。所述搜索起点(图中标识为阴影块)位于1/2像素点上,那么:
第一正方形(图中标记为P1)为:以搜索起点为中心,2*2*最小像素单元(也即1/8像素单位)=1/2像素单位为边长。
第二正方形(图中标记为P2)为:以搜索起点为中心,2*4*最小像素单元(也即1/8像素单位)=1像素单位为边长。
m1对应的搜索区域为第一正方形,在该搜索区域内搜索时采用的搜索步长为1/8像素单位。m2对应的搜索区域为第一正方形和第二正方形之间的区 域,在该搜索区域内搜索时采用的搜索步长为1/4像素单位。
如图3所示,图中的圆块为1/2像素点,正方块为1/4像素点,三角块为1/8像素点。所述搜索起点(图中标识为阴影块)位于1/8像素点上,那么:
第三正方形(图中标记为P3)为:以距离搜索起点最近的1/4像素点为中心,2*2*最小像素单元(也即1/8像素单位)=1/2像素单位为边长。
第四正方形(图中标记为P4)为:以距离搜索起点最近的1/2像素点为中心,2*4*最小像素单元(也即1/8像素单位)=1像素单位为边长。
m1对应的搜索区域为第三正方形,在该搜索区域内搜索时采用的搜索步长为1/8像素单位。m2对应的搜索区域为第三正方形和第四正方形之间的区域,在该搜索区域内搜索时采用的搜索步长为1/4像素单位。
其中,距离搜索起点最近的y2像素点和y3像素点分别有至少一个,可取其中任意一个y2像素点和y3像素点分别作为第三正方形P3和第四正方形P4的中心。优选的,取位于所述搜索起点的同一侧的y2像素点和y3像素点分别作为第三正方形P3和第四正方形P4的中心,以避免第三正方形P3不能全部位于第四正方形P4内。
上面实施例中以搜索区域的形状为正方形进行了举例描述。实际应用中,该搜索区域的形状还可以是圆形、正六边形或者其他形状,在此不作限制。
本实施例中,由于运动矢量精度为分阶运动矢量精度,也即对不同的搜索区域采用不同的搜索步长。但视频解码装置并不确定编码端中对当前块进行编码时,在当前块的参考图像上根据搜索起点搜索匹配块时,是否采用了该搜索区域内的搜索步长,还是仅仅采用了默认的最大搜索步长,也即一个像素单位。也即视频解码装置要获取所接收到的运动矢量信息中的搜索步数中各搜索步所对应的搜索步长。
因此,视频解码装置需首先判断编码端在搜索匹配块时,是否曾在运动矢量精度所划分出的搜索区域内进行搜索。本实施例中,通过确定参照搜索区域以及临时点来进行判断,下面进行具体描述。
进一步,可选的,在本发明的一些可能的实施方式中,步骤503根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述匹配块包括:
S1、确定参照搜索区域。
其中,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2)。具体举例来说,中心Ce的坐标为(Cex,Cey),中心Ce1的坐标为(Ce1x,Ce1y),中心Ce2的坐标为(Ce2x,Ce2y),那么Cex=(Ce1x+Ce2x)/2,Cey=(Ce1y+Ce2y)/2。
其中,所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2),f1(x1,x2)=f2(x1,x2),也即根据中心Ce1和中心Ce2计算中心Ce所用的计算规则,与根据边长L1和边长L2计算边长L所用的计算规则一样。具体举例来说,当Cex=(Ce1x+Ce2x)/2,Cey=(Ce1y+Ce2y)/2时,L=(L1+L2)/2。
S2、确定临时点。
所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
S3、当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数。
所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2,所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
S4、当所述临时点位于所述参照搜索区域内时,执行以下步骤:
S5、当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数。
其中,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2。
S6、当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
确定运动矢量信息终的搜索步数实际对应的搜索步长后,即可根据该搜搜步数、搜索步长以及搜索方向确定匹配块的位置。
为便于更好的理解和实施本发明实施例的上述方案,下面通过一些具体应 用场景进行举例说明。
请参见图6,图6为本发明的视频解码方法的另一个实施例的流程示意图。本实施例中,视频解码方法包括:
601、获取当前图像以及所述当前图像的运动矢量精度。
其中,所述运动矢量精度具体包括搜索步长集合{1/8,1/4},以及阈值集合{m1,m2}。
602、获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点。
603、判断所述搜索起点是否位于整像素点或者1/2像素点上。
若是,则执行步骤604。
若否,则执行步骤605。
604、将第一正方形内的区域作为所述m1对应的搜索区域;将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域。
其中,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形。所述最小像素单元为所述搜索步长集合中的最小元素。
为描述方便,设运动矢量Ce1(Ce1x,Ce1y)指向m1对应的搜索区域的中心,运动矢量Ce2(Ce2x,Ce2y)指向m2对应的搜索区域的中心。
605、将第三正方形内的区域作为所述m1对应的搜索区域,将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域。
其中,所述第三正方形为以距离所述搜索起点最近的1/4像素点为中心,2m1*最小像素单元为边长的正方形;所述第四正方形为以距离所述搜索起点最近的1/2像素点为中心,2m2*最小像素单元为边长的正方形;其中。所述最小像素单元为所述搜索步长集合中的最小元素。
为描述方便,设运动矢量Ce1(Ce1x,Ce1y)指向第三正方形的中心,也即指向m1对应的搜索区域的中心,运动矢量Ce2(Ce2x,Ce2y)指向第四正方形的中心,也即指向m2对应的搜索区域的中心。
具体的,可通过公式(1)计算Ce1(Ce1x,Ce1y),通过公式(2)计算Ce2(Ce2x,Ce2y)。
Figure PCTCN2016088157-appb-000013
Figure PCTCN2016088157-appb-000014
其中,MVPx为当前块的MVP在水平方向上的分量,MVPy为当前块的MVP在竖直方向上的分量。
606、确定参照搜索区域。
其中,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2)。具体举例来说,中心Ce的坐标为(Cex,Cey),中心Ce1的坐标为(Ce1x,Ce1y),中心Ce2的坐标为(Ce2x,Ce2y),那么Cex=(Ce1x+Ce2x)/2,Cey=(Ce1y+Ce2y)/2。
其中,所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2),f1(x1,x2)=f2(x1,x2),也即根据中心Ce1和中心Ce2计算中心Ce所用的计算规则,与根据边长L1和边长L2计算边长L所用的计算规则一样。具体举例来说,当Cex=(Ce1x+Ce2x)/2,Cey=(Ce1y+Ce2y)/2时,L=(L1+L2)/2。
607、确定临时点。
所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素。
具体的,设临时点的坐标为MVt(MVtx,MVty)。那么,MVtx=MVDx+MVPx,MVty=MVDy+MVPy
608、判断所述临时点是否位于所述参照搜索区域外,若是,执行步骤609,若否,则执行步骤610。
具体的,可通过公式(3)计算所述临时点是否位于所述参照搜索区域外。
|MVtx-Cex|>L或者|MVty-Cey|>L     (3)
当满足公式(3)时,执行步骤609;若不满足公式(3),则执行步骤610。
609、确定第一步数、第二步数和第三步数。
其中,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1(也即1/8),所述第二步数实际对应的 搜索步长为y2(也即1/4),所述第三步数实际对应的搜索步长为y3(也即1/2),其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
确定运动矢量信息中的搜索步数中分别对应搜索步长为y1、y2和y3的第一步数、第二步数和第三步数,即可根据临时点的运动矢量MVt计算匹配块的运动矢量MV。具体的,可通过以下步骤和公式进行计算。在下面公式中,MVx为MV在水平方向上的分量,MVy为MV在竖直方向上的分量。
当|MVtx-Cex|>L时,则判断MVt所指向位置在Ce的左边还是右边。
若是左边,则通过下面公式计算MVx
MVx=MVtx×4-(Cex-THe)×4-((Cqx-THq)-(Cex-THe))×2+(Cqx-THq),MVy=MVDy×4+Cqy若是右边,则通过下面公式计算MVx
MVx=MVtx×4-(Cex+THe)×4-((Cqx+THq)-(Cex+THe))×2+(Cqx+THq),MVy=MVDy×4+Cqy否则,当|MVty-Cey|>L时,则判断MVt所指向位置在Ce的上边还是下边。
若是上边,则通过下面公式计算MVy
MVy=MVty×4-(Cey-THe)×4-((Cqy-THq)-(Cey-THe))×2+(Cqy-THq),MVx=MVDx×4+Cqx若是下边,则通过下面公式计算MVy
MVy=MVty×4-(Cey+THe)×4-((Cqy+THq)-(Cey+THe))×2+(Cqy+THq),MVx=MVDx×4+Cqy610、判断所述临时点是否位于所述m1对应的搜索区域外,若是,执行步骤611,若否,则执行步骤612。
具体的,可通过公式(4)计算所述临时点是否位于所述m1对应的搜索区域外。
|MVtx-Cex|>m1或者|MVty-Cey|>m1    (4)
当满足公式(4)时,执行步骤611;若不满足公式(4),则执行步骤612。
611、确定第三步数和第四步数。
其中,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2。
确定运动矢量信息中的搜索步数中分别对应搜索步长为y1和y2的第三步数和所述第四步数,即可根据临时点的运动矢量MVt计算匹配块的运动矢量MV。具体的,可通过以下步骤和公式进行计算。在下面公式中,MVx为 MV在水平方向上的分量,MVy为MV在竖直方向上的分量
当|MVtx-Cex|>m1时,则判断MVt所指向位置在Ce的左边还是右边。
若是左边,则通过下面公式计算MVx
MVx=MVtx×2-(Cex-THe)×2+(Cqx-THe),MVy=MVDy×2+Cey
若是左边,则通过下面公式计算MVx
MVx=MVtx×2-(Cex+THe)×2+(Cqx+THe),MVy=MVDy×2+Cey
否则,当|MVty-Cey|>m1时,则判断MVt所指向位置在Ce的左边还是右边。
若是上边,则通过下面公式计算MVy
MVy=MVty×2-(Cey-THe)×2+(Cqy-THe),MVx=MVDx×2+Cex
若是下边,则通过下面公式计算MVy
MVy=MVty×2-(Cey+THe)×2+(Cqy+THe),MVx=MVDx×2+Cex
612、确定所述搜索步数实际对应的搜索步长为y1。
那么,可根据下面公式直接计算匹配块的运动矢量MV。
MVx=MVDx+MVPx,MVy=MVDy+MVPy
613、根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
获取到运动匹配块的运动矢量后,可根据该运动矢量从参考帧中确定匹配块的位置,并获取匹配块的各像素点的像素值,进而将匹配块上各像素点的像素值分别与预测残差信号中对应的像素点的像素值相加,即可得到目前块的重建像素值。
本发明实施例中,需获取所述当前图像的运动矢量精度包括。实际应用中,有多种方法获取所述当前图像的运动矢量精度包括。例如,视频解码装置可采用预设方法自行计算当前图像的运动矢量精度,其中,视频编码装置也采用该预设方法来计算当前图像的运动矢量精度,以保证编码端和解码端所采用的运动矢量精度一致。
可选的,在本发明的一些可能的实施方式中,获取所述当前图像的运动矢量精度包括:获取所述当前图像的量化参数;获取所述当前图像的分辨率中的宽度值;根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前 图像的运动矢量精度。其中,所述预置策略可以是查表法,或者是阈值法,或者是利用公式计算出决策因子,根据决策因子与预设值比较的结果来选择当前图像的运动矢量精度,或者是其他策略,在此不作限制。
具体举例来说,所述预置策略为查表法。视频编码装置内预存有如上表1,其中,表1中第一行表示所述当前图像的量化参数的值所在范围,第一列表示所述当前图像的分辨率中的宽度值的所在范围。获取到获取所述当前图像的分辨率中的宽度值和所述当前图像的量化参数后,在表1中查找当前图像的运动矢量精度。
可选的,在本发明的一些可能的实施方式中,由于运动的连续性,解码端可根据已编码图像集合和当前图像获取到该当前图像的内容特性,进而根据该内容特性来确定当前图像的运动矢量精度。其中,所述已编码图像集合包括至少一个已编码图像。已编码图像集合中的各已编码图像可以是视频序列中与该当前图像相邻的已编码图像,也可以是与该当前图像相隔至少一个图像的已编码图像,在此不作限制。所述获取所述当前图像的运动矢量精度包括:
S10、获取所述当前图像的量化参数;
S11、确定已解码图像集合,获取所述已解码图像集合中各已解码图像的解码信息。
本实施例中,所述已编码图像集合包括至少一个已编码图像。优选的,所述已编码图像集合中仅有一个元素,该元素为与所述当前图像时间上相邻的已编码图像。由于与当前图像时间上相邻的已编码图像与该当前图像的内容特性较相似,采用该已编码图像来获取当前图像的运动矢量精度能够让该当前图像的运动矢量精度更加符合该当前图像的内容特性,而且,所述已编码图像集合仅包括一个元素,能够减少计算量。
所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息。也即所述解码块为当前块时,所述解码块的运动矢量差值为该解码块的匹配块相对于该解码块的参考图像上的搜索起点的运动矢量。
S12、计算所述已解码图像集合中的每个解码图像的运动剧烈程度。
其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积。
具体的,以M表示所述已解码图像的运动剧烈程度,以mvdx表示所述解码块的运动矢量差值的水平分量,以mvdy表示所述解码块的运动矢量差值的竖直分量,以pusize表示所述解码块所包含的像素点个数,则,
Figure PCTCN2016088157-appb-000015
S13、将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度。
具体的,各已解码图像的运动剧烈程度的加权值可以相同,也可以不同,在此不作限制。
S14、根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度。
所述预置策略可以是查表法,或者是阈值法,或者是利用公式计算出决策因子,根据决策因子与预设值比较的结果来选择当前图像的运动矢量精度,或者是其他策略,在此不作限制。
例如,所述预置策略为查表法。视频解码装置内预存有如上表2,其中,表2中第一行表示所述当前图像的量化参数的值所在范围,第一列表示所述已解码图像集合的运动剧烈程度的值所在范围。获取到所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数后,在表2中查找当前图像的运动矢量精度。
进一步,可选的,在本发明的一些可能的实施方式中,所述根据所述当前图像和已编码图像集合获取所述当前图像的运动矢量精度还包括:
S15、获取所述已解码图像集合的纹理复杂度。
其中,所述获取所述已解码图像集合的纹理复杂度包括:
获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度。
具体的,以Ai表示所述已解码图像集合中第i个已解码图像的纹理复杂度,以sx,y表示所述当前图像中的像素点的像素值,其中x,y为该像素点的坐标,以A表示所述已编码图像集合的纹理复杂度,则,
Figure PCTCN2016088157-appb-000016
所述步骤S14具体为根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
其中,预置策略有多种,下面对其中的一种进行举例描述:
S21、根据所述已解码图像集合的纹理复杂度A以及所述已解码图像集合的运动剧烈程度M计算决策因子F。
具体的,F=12M-5A。当然,M、A的参数也可以是其他,在此不作限制。
S22、根据所述当前图像的量化参数QP获取阈值Th0和Th1。
其中,可根据以下公式计算阈值Th0和Th1:
Th0=a0QP2+b0QP+C0
Th1=a1QP2+b1QP+C1
具体的,式中系数a0,a1,b0,b1,c0,c1分别是-0.02,0.57,16,-0.03,0.6,38;当然,式中系数也可以为其他数值,在此不作限制。
S23、将F与阈值Th0和Th1进行比较得到MVR1
具体的,可根据以下公式获取MVR1
Figure PCTCN2016088157-appb-000017
S24、统计所述已解码图像集合中运动矢量差值MVD的绝对值的分布情况。
其中,分别统计运动矢量差值的水平分量mvdx的绝对值和运动矢量差值的竖直分量mvdy的绝对值在以下五个区间这些区间的分布概率得到:
Figure PCTCN2016088157-appb-000018
S25、利用如下公式获得当前图像的运动矢量精度MVR。
Figure PCTCN2016088157-appb-000019
上面对本发明的视频编码方法和视频解码方法进行了描述。为便于更好的理解和实施本发明实施的上述技术方案,下面还提供用于实施上述方案的相关装置。
参见图7,本发明实施例提供的一种视频编码装置,可包括:
第一获取单元701,用于当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
第二获取单元702,用于获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块;
第一确定单元703,用于确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;
搜索单元704,用于根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;
第三获取单元705,用于获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残 差信号用于指示所述当前块和所述匹配块之间的残差;
写入单元706,用于将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。
在本发明的一些可能的实施方式中,所述写入单元706还用于将所述运动矢量精度的信息和/或所述搜索起点的信息写入所述码流,其中,所述运动矢量精度的信息用于指示所述运动矢量精度,所述搜索起点的信息用于指示所述搜索起点。
在本发明的一些可能的实施方式中,所述搜索步长集合为{1/2x},x为正整数。
进一步的,在本发明的一些可能的实施方式中,所述搜索单元搜索单元704具体用于:
将所述目标整像素点作为起始点;
设置j的初始值为1,执行预置步骤:
从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
在本发明的一些可能的实施方式中,所述搜索步长集合为{yIy=1/2x,x为正整数};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述视频编码装置还包括:
第二确定单元707,用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应;其中,
其中,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
进一步的,在本发明的一些可能的实施方式中,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述第二确定单元707具体用于:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
又进一步的,在本发明的一些可能的实施方式中,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2,m1<m2;
所述搜索单元704具体用于:
根据所述目标整像素点获取当前起始点;
获取与所述当前起始点相邻的所有y2像素点;
当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
获取与所述目标y2像素点相邻的所有y1像素点;
当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
在本发明的一些可能的实施方式中,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
在本发明的一些可能的实施方式中,所述第一获取单元701具体用于:获取所述当前图像的量化参数以及已编码图像集合,所述已编码图像集合包括至少一个已编码图像;
获取所述已编码图像集合中各已编码图像的编码信息,所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息;
计算所述已编码图像集合中每个已编码图像的运动剧烈程度,其中,所述编码图像的运动剧烈程度为所述编码图像中各编码块的第一数值的平均值,所述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘积;
将所述已编码图像集合中各编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度;
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
进一步的,在本发明的一些可能的实施方式中,所述第一获取单元701还用于:
获取参考参数,所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一 项,以及所述已编码图像集合的图像间噪声;
其中,
当所述参考参数包括所述当前图像的纹理复杂度时,所述第一获取单元701用于:
获取所述当前图像中各像素点的像素值;
计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度;
当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述第一获取单元用于:
获取所述已编码图像集合中各已编码图像中各像素点的像素值;
计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
将所述已编码图像集合中各编码图像的纹理复杂度的加权平均值作为所述已编码图像集合的纹理复杂度;
当所述参考参数包括所述已编码图像集合的图像间噪声时,所述第一获取单元701用于:
获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各像素点的预测误差绝对值的平均值;
将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声;
所述根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度具体包括:
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
在本发明的一些可能的实施方式中,所述第一获取单元具体用于:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图 像的运动矢量精度。
上面对本发明的视频解码装置进行了描述,下面对本发明的视频解码装置进行描述。
参见图8,本发明实施例提供的一种视频解码装置,可包括:
第一获取单元801,用于获取当前图像以及所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
第二获取单元802,用于获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点;其中,所述目前块为所述当前图像中当前待解码的图像块,所述运动矢量信息包括所述目前块在所述参考图像中的匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
查找单元803,用于根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述目前块的匹配块;
重建单元804,用于根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
在本发明的一些可能的实施方式中,所述搜索步长集合为{1/2x},x为正整数。
在本发明的一些可能的实施方式中,所述搜索步长集合为{yIy=1/2x,x∈N+};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述视频编码装置还包括:
确定单元805,用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,不同阈值对应的搜索区域内的搜索步长分别为所述搜索步长集合中的不同元素;其中,
所述阈值集合中的各元素分别对应所述搜索步长集合中的不同元素;其中,对所述搜索步长集合中大小排序相邻的y1和y2,y1<y2,y2对应的阈值对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
进一步,在本发明的一些可能的实施方式中,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述确定单元805具体用于:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
又进一步,在本发明的一些可能的实施方式中,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2;
所述查找单元803具体用于:
确定参照搜索区域,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2);所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2);f1(x1,x2)=f2(x1,x2);
确定临时点,所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2,所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
当所述临时点位于所述参照搜索区域内时,执行以下步骤:
当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2;
当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
在本发明的一些可能的实施方式中,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
在本发明的一些可能的实施方式中,所述第一获取单元801具体用于:
接收视频码流;
从所述视频码流中读取所述当前图像以及所述当前图像的运动矢量精度。
在本发明的一些可能的实施方式中,所述第一获取单元801具体用于:
接收视频压缩码流;
从所述视频压缩码流中读取所述当前图像;
获取所述当前图像的量化参数;
确定已解码图像集合,所述已解码图像集合包括当前的至少一个已解码图像;
获取所述已解码图像集合中各已解码图像的解码信息,所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息;
计算所述已解码图像集合中的每个解码图像的运动剧烈程度,其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运 动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积;
将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度;
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度。
进一步的,在本发明的一些可能的实施方式中,所述第一获取单元801还用于:
获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度;
所述根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度具体包括:
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
在本发明的一些可能的实施方式中,所述第一获取单元801具体用于:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
参见图9,图9是本发明的另一个实施例提供的视频编码装置900的结构框图。其中,视频编码装置900可包括:至少1个处理器901、存储器905和至少1个通信总线902。可选的,视频编码装置900还可包括:至少1个网络接口904和/或用户接口903。其中,用户接口903例如包括显示器(例如触摸屏、LCD、全息成像(Holographic)、CRT或者投影(Projector)等)、点击设备(例如鼠标或轨迹球(trackball)触感板或触摸屏等)、摄像头和/或拾音装 置等。
其中,存储器905可以包括只读存储器和随机存取存储器,并向处理器901提供指令和数据。存储器905中的一部分还可以包括非易失性随机存取存储器。
在一些实施方式中,存储器905存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:
操作系统9051,包含各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
应用程序模块9052,包含各种应用程序,用于实现各种应用业务。
在本发明的实施例中,通过调用存储器905存储的程序或指令,处理器901用于获取当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块;确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。
可选的,所述处理器901还用于将所述运动矢量精度的信息和/或所述搜索起点的信息写入所述码流,其中,所述运动矢量精度的信息用于指示所述运动矢量精度,所述搜索起点的信息用于指示所述搜索起点。
可选的,所述搜索步长集合为{1/2x},x为正整数。
可选的,所述根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
将所述目标整像素点作为起始点;
设置j的初始值为1,执行预置步骤:
从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
可选的,所述搜索步长集合为{yIy=1/2x,x为正整数};
所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
所述处理器901还用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应;其中,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
可选的,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时, 所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
可选的,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2,m1<m2;
所述根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
根据所述目标整像素点获取当前起始点;
获取与所述当前起始点相邻的所有y2像素点;
当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
获取与所述目标y2像素点相邻的所有y1像素点;
当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
可选的,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
可选的,所述根据所述当前图像获取所述当前图像的运动矢量精度包括:
获取所述当前图像的量化参数以及已编码图像集合,所述已编码图像集合包括至少一个已编码图像;
获取所述已编码图像集合中各已编码图像的编码信息,所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息;
计算所述已编码图像集合中每个已编码图像的运动剧烈程度,其中,所述编码图像的运动剧烈程度为所述编码图像中各编码块的第一数值的平均值,所 述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘积;
将所述已编码图像集合中各编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度;
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
可选的,所述根据所述当前图像获取所述当前图像的运动矢量精度还包括:
获取参考参数,所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一项,以及所述已编码图像集合的图像间噪声;
其中,
当所述参考参数包括所述当前图像的纹理复杂度时,所述获取参考参数包括:
获取所述当前图像中各像素点的像素值;
计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度;
当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述获取参考参数包括:
获取所述已编码图像集合中各已编码图像中各像素点的像素值;
计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
将所述已编码图像集合中各编码图像的纹理复杂度的加权平均值作为所述已编码图像集合的纹理复杂度;
当所述参考参数包括所述已编码图像集合的图像间噪声时,所述获取参考参数包括:
获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各 像素点的预测误差绝对值的平均值;
将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声;
所述根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度具体包括:
根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
可选的,所述根据所述当前图像获取所述当前图像的运动矢量精度包括:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
参见图10,图10是本发明的另一个实施例提供的视频解码装置900的结构框图。其中,视频解码装置1000参见图10,图10是本发明的另一个实施例提供的视频解码装置1000的结构框图。其中,视频解码装置1000可包括:至少1个处理器1001、存储器1005和至少1个通信总线1002。可选的,视频解码装置1000还可包括:至少1个网络接口1004和/或用户接口1003。其中,用户接口1003例如包括显示器(例如触摸屏、LCD、全息成像(Holographic)、CRT或者投影(Projector)等)、点击设备(例如鼠标或轨迹球(trackball)触感板或触摸屏等)、摄像头和/或拾音装置等。
其中,存储器1005可以包括只读存储器和随机存取存储器,并向处理器1001提供指令和数据。存储器1005中的一部分还可以包括非易失性随机存取存储器。
在一些实施方式中,存储器1005存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:
操作系统10051,包含各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
应用程序模块10052,包含各种应用程序,用于实现各种应用业务。
在本发明的实施例中,通过调用存储器1005存储的程序或指令,处理器 1001可包括:至少1个处理器1001、存储器1005和至少1个通信总线1002。可选的,视频解码装置1000还可包括:至少1个网络接口1004和/或用户接口1003。其中,用户接口1003例如包括显示器(例如触摸屏、LCD、全息成像(Holographic)、CRT或者投影(Projector)等)、点击设备(例如鼠标或轨迹球(trackball)触感板或触摸屏等)、摄像头和/或拾音装置等。
其中,存储器1005可以包括只读存储器和随机存取存储器,并向处理器1001提供指令和数据。存储器1005中的一部分还可以包括非易失性随机存取存储器。
在一些实施方式中,存储器1005存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:
操作系统10051,包含各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。
应用程序模块10052,包含各种应用程序,用于实现各种应用业务。
在本发明的实施例中,通过调用存储器1005存储的程序或指令,处理器1001用于获取当前图像以及所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点;其中,所述目前块为所述当前图像中当前待解码的图像块,所述运动矢量信息包括所述目前块在所述参考图像中的匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述目前块的匹配块;根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
可选的,所述搜索步长集合为{1/2x},x为正整数。
可选的,所述搜索步长集合为{yIy=1/2x,x∈N+};
可选的,所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;所述处理器还用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,不同阈值对应的搜索区域内的搜索步长分别为所述搜索步长集合中的不同元素;其中,
所述阈值集合中的各元素分别对应所述搜索步长集合中的不同元素;其中,对所述搜索步长集合中大小排序相邻的y1和y2,y1<y2,y2对应的阈值对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
可选的,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i,所述y3=1/2i-1
其中,所述最小像素单元为所述搜索步长集合中的最小元素。
可选的,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2;
所述根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述匹配块包括:
确定参照搜索区域,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce= f1(Ce1,Ce2);所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2);f1(x1,x2)=f2(x1,x2);
确定临时点,所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2,所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
当所述临时点位于所述参照搜索区域内时,执行以下步骤:
当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2;
当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
可选的,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
可选的,所述获取当前图像以及所述当前图像的运动矢量精度包括:
接收视频码流;从所述视频码流中读取所述当前图像以及所述当前图像的运动矢量精度。
可选的,所述获取当前图像以及所述当前图像的运动矢量精度包括:
接收视频压缩码流;从所述视频压缩码流中读取所述当前图像;
获取所述当前图像的量化参数;确定已解码图像集合,所述已解码图像集合包括当前的至少一个已解码图像;
获取所述已解码图像集合中各已解码图像的解码信息,所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息;
计算所述已解码图像集合中的每个解码图像的运动剧烈程度,其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积;
将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度;
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度。
可选的,所述获取当前图像以及所述当前图像的运动矢量精度还包括:
获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度;
所述根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度具体包括:
根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
可选的,所述获取所述当前图像的运动矢量精度包括:
获取所述当前图像的量化参数;
获取所述当前图像的分辨率中的宽度值;
根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方 法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (42)

  1. 一种视频编码方法,其特征在于,包括:
    获取当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
    获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块;
    确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;
    根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;
    获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
    将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。
  2. 根据权利要求1所述的视频编码方法,其特征在于,所述方法还包括:
    将所述运动矢量精度的信息和/或所述搜索起点的信息写入所述码流,其中,所述运动矢量精度的信息用于指示所述运动矢量精度,所述搜索起点的信息用于指示所述搜索起点。
  3. 根据权利要求1所述的视频编码方法,其特征在于,所述搜索步长集合为{1/2x},x为正整数。
  4. 根据权利要求3所述的视频编码方法,其特征在于,所述根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
    将所述目标整像素点作为起始点;
    设置j的初始值为1,执行预置步骤:
    从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
    确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
    若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
  5. 根据权利要求1所述的视频编码方法,其特征在于,所述搜索步长集合为{y|y=1/2x,x为正整数};
    所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
    所述方法还包括:
    根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应;其中,
    其中,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
  6. 根据权利要求5所述的视频编码方法,其特征在于,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
    所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
    当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
    将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
    将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
    当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
    将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
    将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像 素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
    其中,所述最小像素单元为所述搜索步长集合中的最小元素。
  7. 根据权利要求5或6所述的视频编码方法,其特征在于,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2,m1<m2;
    所述根据所述运动矢量精度从所述目标整像素点开始搜索匹配块包括:
    根据所述目标整像素点获取当前起始点;
    获取与所述当前起始点相邻的所有y2像素点;
    当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
    当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
    从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
    获取与所述目标y2像素点相邻的所有y1像素点;
    当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
    当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
  8. 根据权利要求5所述的视频编码方法,其特征在于,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
  9. 根据权利要求1所述的视频编码方法,其特征在于,所述根据所述当前图像获取所述当前图像的运动矢量精度包括:
    获取所述当前图像的量化参数以及已编码图像集合,所述已编码图像集合包括至少一个已编码图像;
    获取所述已编码图像集合中各已编码图像的编码信息,所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块 所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息;
    计算所述已编码图像集合中每个已编码图像的运动剧烈程度,其中,所述编码图像的运动剧烈程度为所述编码图像中各编码块的第一数值的平均值,所述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘积;
    将所述已编码图像集合中各编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度;
    根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
  10. 根据权利要求9所述的视频编码方法,其特征在于,所述根据所述当前图像获取所述当前图像的运动矢量精度还包括:
    获取参考参数,所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一项,以及所述已编码图像集合的图像间噪声;
    其中,
    当所述参考参数包括所述当前图像的纹理复杂度时,所述获取参考参数包括:
    获取所述当前图像中各像素点的像素值;
    计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度;
    当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述获取参考参数包括:
    获取所述已编码图像集合中各已编码图像中各像素点的像素值;
    计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
    将所述已编码图像集合中各编码图像的纹理复杂度的加权平均值作为所 述已编码图像集合的纹理复杂度;
    当所述参考参数包括所述已编码图像集合的图像间噪声时,所述获取参考参数包括:
    获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
    计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各像素点的预测误差绝对值的平均值;
    将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声;
    所述根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度具体包括:
    根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
  11. 根据权利要求1所述的视频编码方法,其特征在于,所述根据所述当前图像获取所述当前图像的运动矢量精度包括:
    获取所述当前图像的量化参数;
    获取所述当前图像的分辨率中的宽度值;
    根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
  12. 一种视频解码方法,其特征在于,包括:
    获取当前图像以及所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
    获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点;其中,所述目前块为所述当前图像中当前待解码的图像块,所述运动矢量信息包括所述目前块在所述参考图像中的匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
    根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述目前块的匹配块;
    根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
  13. 根据权利要求12所述的视频解码方法,其特征在于,所述搜索步长集合为{1/2x},x为正整数。
  14. 根据权利要求12所述的视频解码方法,其特征在于,所述搜索步长集合为{y|y=1/2x,x∈N+};
    所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
    所述方法还包括:
    根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,不同阈值对应的搜索区域内的搜索步长分别为所述搜索步长集合中的不同元素;其中,
    所述阈值集合中的各元素分别对应所述搜索步长集合中的不同元素;其中,对所述搜索步长集合中大小排序相邻的y1和y2,y1<y2,y2对应的阈值对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
  15. 根据权利要求14所述的视频解码方法,其特征在于,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
    所述根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域包括:
    当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
    将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
    将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
    当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
    将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
    将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域, 所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i,所述y3=1/2i-1
    其中,所述最小像素单元为所述搜索步长集合中的最小元素。
  16. 根据权利要求15所述的视频解码方法,其特征在于,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2;
    所述根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述匹配块包括:
    确定参照搜索区域,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2);所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2);f1(x1,x2)=f2(x1,x2);
    确定临时点,所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
    当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2,所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
    当所述临时点位于所述参照搜索区域内时,执行以下步骤:
    当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2;
    当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
  17. 根据权利要求14所述的视频解码方法,其特征在于,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
  18. 根据权利要求12所述的视频解码方法,其特征在于,所述获取当前图像以及所述当前图像的运动矢量精度包括:
    接收视频码流;
    从所述视频码流中读取所述当前图像以及所述当前图像的运动矢量精度。
  19. 根据权利要求12所述的视频解码方法,其特征在于,所述获取当前图像以及所述当前图像的运动矢量精度包括:
    接收视频压缩码流;
    从所述视频压缩码流中读取所述当前图像;
    获取所述当前图像的量化参数;
    确定已解码图像集合,所述已解码图像集合包括当前的至少一个已解码图像;
    获取所述已解码图像集合中各已解码图像的解码信息,所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息;
    计算所述已解码图像集合中的每个解码图像的运动剧烈程度,其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积;
    将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度;
    根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度。
  20. 根据权利要求19所述的视频解码方法,其特征在于,所述获取当前图像以及所述当前图像的运动矢量精度还包括:
    获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
    计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
    将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度;
    所述根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度具体包括:
    根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
  21. 根据权利要求12所述的视频编码方法,其特征在于,所述获取所述当前图像的运动矢量精度包括:
    获取所述当前图像的量化参数;
    获取所述当前图像的分辨率中的宽度值;
    根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
  22. 一种视频编码装置,其特征在于,包括:
    第一获取单元,用于当前图像,根据所述当前图像获取所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
    第二获取单元,用于获取当前块以及所述当前块的参考图像,所述当前块为所述当前图像中当前待编码的图像块;
    第一确定单元,用于确定所述参考图像中的搜索起点,从所述搜索起点开始以一个像素单位为搜索步长搜索目标整像素点;
    搜索单元,用于根据所述运动矢量精度从所述目标整像素点开始搜索所述当前块的匹配块;
    第三获取单元,用于获取运动矢量信息和预测残差信号,所述运动矢量信息包括所述匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
    写入单元,用于将所述参考图像的信息、所述运动矢量信息以及所述预测残差信号写入码流,所述参考图像的信息用于指示所述参考图像。
  23. 根据权利要求22所述的视频编码装置,其特征在于,
    所述写入单元还用于将所述运动矢量精度的信息和/或所述搜索起点的信息写入所述码流,其中,所述运动矢量精度的信息用于指示所述运动矢量精度,所述搜索起点的信息用于指示所述搜索起点。
  24. 根据权利要求22所述的视频编码装置,其特征在于,所述搜索步长集合为{1/2x},x为正整数。
  25. 根据权利要求24所述的视频编码装置,其特征在于,所述搜索单元具体用于:
    将所述目标整像素点作为起始点;
    设置j的初始值为1,执行预置步骤:
    从与所述起始点相邻的所有1/2j像素点中获取目标1/2j像素点;
    确定j是否等于x,若等于,则确定所述目标1/2j像素点的位置为所述匹配块的位置;
    若所述j不等于x,将所述目标1/2j像素点作为起始点,将j的值加1后重复所述预置步骤。
  26. 根据权利要求22所述的视频编码装置,其特征在于,所述搜索步长集合为{y|y=1/2x,x为正整数};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
    所述视频编码装置还包括:
    第二确定单元,用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,各阈值对应的搜索区域内的搜索步长分别与所述搜索步长集合中的各元素一一对应;其中,其中,对所述搜索步长集合中大小排序相邻的步长y1和y2,y1<y2,y2对应的阈值所对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
  27. 根据权利要求26所述的视频编码装置,其特征在于,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
    所述第二确定单元具体用于:
    当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
    将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
    将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
    当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
    将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
    将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
    其中,所述最小像素单元为所述搜索步长集合中的最小元素。
  28. 根据权利要求26或27所述的视频编码装置,其特征在于,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2,m1<m2;
    所述搜索单元具体用于:
    根据所述目标整像素点获取当前起始点;
    获取与所述当前起始点相邻的所有y2像素点;
    当所述所有y2像素点全部位于所述m2对应的搜索区域外时,确定所述当前起始点的位置为所述匹配块的位置;
    当所述所有y2像素点的至少部分位于所述m2对应的搜索区域内时,执行以下步骤:
    从位于所述m2对应的搜索区域内的y2像素点中获取目标y2像素点;
    获取与所述目标y2像素点相邻的所有y1像素点;
    当所述所有y1像素点全部位于所述m1对应的搜索区域外时,确定所述目标y2像素点的位置为所述匹配块的位置;
    当所述所有y1像素点的至少部分位于所述m1对应的搜索区域内时,从 位于所述m1对应的搜索区域内的y1像素点中获取目标y1像素点,确定所述目标y1像素点的位置为所述匹配块的位置。
  29. 根据权利要求26所述的视频编码装置,其特征在于,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
  30. 根据权利要求22所述的视频编码装置,其特征在于,所述第一获取单元具体用于:
    获取所述当前图像的量化参数以及已编码图像集合,所述已编码图像集合包括至少一个已编码图像;
    获取所述已编码图像集合中各已编码图像的编码信息,所述编码信息包括所述已编码图像中各编码块的运动矢量差值以及所述已编码图像中各编码块所包含的像素点个数,其中,所述编码块的运动矢量差值用于指示所述编码块为当前块时的所述运动矢量信息;
    计算所述已编码图像集合中每个已编码图像的运动剧烈程度,其中,所述编码图像的运动剧烈程度为所述编码图像中各编码块的第一数值的平均值,所述编码块的第一数值为所述编码块的运动矢量差值的水平分量的绝对值与运动矢量差值的竖直分量的绝对值的和与所述编码块所包含的像素点个数的乘积;
    将所述已编码图像集合中各编码图像的运动剧烈程度的加权平均值作为所述已编码图像集合的运动剧烈程度;
    根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
  31. 根据权利要求30所述的视频编码装置,其特征在于,所述第一获取单元还用于:
    获取参考参数,所述参考参数包括所述当前图像的纹理复杂度、所述已编码图像集合的纹理复杂度和所述已编码图像集合的图像间噪声中的一项,或者包括所述当前图像的纹理复杂度和所述已编码图像集合的纹理复杂度中的一项,以及所述已编码图像集合的图像间噪声;
    其中,
    当所述参考参数包括所述当前图像的纹理复杂度时,所述第一获取单元用于:
    获取所述当前图像中各像素点的像素值;
    计算所述当前图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述当前图像的纹理复杂度;
    当所述参考参数包括所述已编码图像集合的纹理复杂度时,所述第一获取单元用于:
    获取所述已编码图像集合中各已编码图像中各像素点的像素值;
    计算所述已编码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已编码图像的纹理复杂度;
    将所述已编码图像集合中各编码图像的纹理复杂度的加权平均值作为所述已编码图像集合的纹理复杂度;
    当所述参考参数包括所述已编码图像集合的图像间噪声时,所述第一获取单元用于:
    获取所述已编码图像集合中各已编码图像中各像素点的预测误差;
    计算所述各编码图像的第二平均值,所述第二平均值为所述编码图像的各像素点的预测误差绝对值的平均值;
    将所述已编码图像集合中各已编码图像的第二平均值的加权平均值作为所述已编码图像集合的图像间噪声;
    所述根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度具体包括:
    根据所述已编码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述参考参数按预置策略确定所述当前图像的运动矢量精度。
  32. 根据权利要求22所述的视频编码装置,其特征在于,所述第一获取单元具体用于:
    获取所述当前图像的量化参数;
    获取所述当前图像的分辨率中的宽度值;
    根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
  33. 一种视频解码装置,其特征在于,包括:
    第一获取单元,用于获取当前图像以及所述当前图像的运动矢量精度,所述运动矢量精度包括搜索步长集合,所述搜索步长集合中的各搜索步长小于一个像素单位;
    第二获取单元,用于获取所述目前块的运动矢量信息、预测残差信号,以及所述目前块的参考图像、所述参考图像中的搜索起点;其中,所述目前块为所述当前图像中当前待解码的图像块,所述运动矢量信息包括所述目前块在所述参考图像中的匹配块相对所述搜索起点的搜索步数和搜索方向,所述预测残差信号用于指示所述当前块和所述匹配块之间的残差;
    查找单元,用于根据所述参考图像、所述搜索起点、所述运动矢量信息、所述当前图像的运动矢量精度查找所述目前块的匹配块;
    重建单元,用于根据所述匹配块和所述预测残差信号获取所述目前块的重建像素值。
  34. 根据权利要求33所述的视频解码装置,其特征在于,所述搜索步长集合为{1/2x},x为正整数。
  35. 根据权利要求33所述的视频解码装置,其特征在于,所述搜索步长集合为{y|y=1/2x,x∈N+};所述运动矢量精度还包括阈值集合,所述阈值集合包括至少一个阈值;
    所述视频编码装置还包括:
    确定单元,用于根据所述阈值集合中的每一个阈值和所述搜索起点确定所述阈值对应的搜索区域,所述搜索起点位于所述搜索区域内,不同阈值对应的搜索区域内的搜索步长分别为所述搜索步长集合中的不同元素;其中,
    所述阈值集合中的各元素分别对应所述搜索步长集合中的不同元素;其中,对所述搜索步长集合中大小排序相邻的y1和y2,y1<y2,y2对应的阈值对应的搜索区域环绕在y1对应的阈值所对应的搜索区域外,并与所述y1对应的阈值对应的搜索区域相接。
  36. 根据权利要求35所述的视频解码装置,其特征在于,所述阈值集合包括m1和m2,其中,所述m1为2的正整数倍或0,所述m2为4的正整数倍,m1<m2;
    所述确定单元具体用于:
    当所述搜索起点位于整像素点或者1/2像素点上时,执行以下步骤:
    将第一正方形内的区域作为所述m1对应的搜索区域,所述第一正方形为以所述搜索起点为中心,2m1*最小像素单元为边长的正方形;
    将所述第一正方形和第二正方形之间的区域作为所述m2对应的搜索区域,所述第二正方形为以所述搜索起点为中心,2m2*最小像素单元为边长的正方形;
    当所述搜索起点不位于整像素点且不位于1/2像素点上时,执行以下步骤:
    将第三正方形内的区域作为所述m1对应的搜索区域;所述第三正方形为以距离所述搜索起点最近的y2像素点为中心,2m1*最小像素单元为边长的正方形;
    将所述第三正方形和第四正方形之间的区域作为所述m2对应的搜索区域,所述第四正方形为以距离所述搜索起点最近的y3像素点为中心,2m2*最小像素单元为边长的正方形;其中,当所述搜索步长集合中最大的元素为1/2i,所述y3=1/2i-1
    其中,所述最小像素单元为所述搜索步长集合中的最小元素。
  37. 根据权利要求36所述的视频解码装置,其特征在于,所述搜索步长集合中的元素包括y1,y2,y1<y2;所述阈值集合中的元素包括m1,m2;
    所述查找单元具体用于:
    确定参照搜索区域,所述参照搜索区域的中心Ce位于所述m1对应的搜索区域的中心Ce1与所述m2对应的搜索区域的中心Ce2之间,且Ce=f1(Ce1,Ce2);所述参照搜索区域的边长L大于所述m1对应的搜索区域的边长L1且小于所述m2对应的搜索区域的边长L2,且L=f2(L1,L2);f1(x1,x2)=f2(x1,x2);
    确定临时点,所述临时点相对所述搜索起点的运动矢量为所述运动矢量信息中的搜索步数和搜索方向,搜索步长为所述搜索步长集合中的最小元素;
    当所述临时点位于所述参照搜索区域外时,确定第一步数、第二步数和第三步数,所述搜索步数为所述第一步数、第二步数和第三步数的和;其中所述第一步数实际对应的搜索步长为y1,所述第二步数实际对应的搜索步长为y2, 所述第三步数实际对应的搜索步长为y3,其中,当所述搜索步长集合中最大的元素为1/2i时,所述y3=1/2i-1
    当所述临时点位于所述参照搜索区域内时,执行以下步骤:
    当所述临时点位于所述m1对应的搜索区域外时,确定第三步数和第四步数,所述搜索步数为所述第三步数和所述第四步数的和;其中,所述第三步数实际对应的搜索步长为y1,所述四步数实际对应的搜索步长为y2;
    当所述临时点位于所述m1对应的搜索区域内时,确定所述搜索步数实际对应的搜索步长为y1。
  38. 根据权利要求35所述的视频解码装置,其特征在于,所述搜索步长集为{1/4,1/8},或者为{1/2,1/4,1/8},或者为{1/4,1/8,1/16},或者为{1/2,1/4,1/8,1/16}。
  39. 根据权利要求33所述的视频解码装置,其特征在于,所述第一获取单元具体用于:
    接收视频码流;
    从所述视频码流中读取所述当前图像以及所述当前图像的运动矢量精度。
  40. 根据权利要求33所述的视频解码装置,其特征在于,所述第一获取单元具体用于:
    接收视频压缩码流;
    从所述视频压缩码流中读取所述当前图像;
    获取所述当前图像的量化参数;
    确定已解码图像集合,所述已解码图像集合包括当前的至少一个已解码图像;
    获取所述已解码图像集合中各已解码图像的解码信息,所述解码信息包括所述已解码图像中各解码块的运动矢量差值以及所述已解码图像中各解码块所包含的像素点个数,其中,所述解码块的运动矢量差值用于指示所述解码块为所述目前块时的所述运动矢量信息;
    计算所述已解码图像集合中的每个解码图像的运动剧烈程度,其中,所述解码图像的运动剧烈程度为所述解码图像中各解码块的第一数值的平均值,所述解码块的第一数值为所述解码块的运动矢量差值的水平分量的绝对值与运 动矢量差值的竖直分量的绝对值的和与所述解码块所包含的像素点个数的乘积;
    将所述已解码图像集合中各解码图像的运动剧烈程度的加权平均值作为所述已解码图像集合的运动剧烈程度;
    根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度。
  41. 根据权利要求40所述的视频解码装置,其特征在于,所述第一获取单元还用于:
    获取所述已解码图像集合中各已解码图像中的所有像素点的像素值;
    计算所述已解码图像中各像素点与相邻的像素点的像素值之差的平方和的平均值,将所述平均值作为所述已解码图像的纹理复杂度;
    将所述已解码图像集合中各已解码图像的纹理复杂度的加权平均值作为所述已解码图像集合的纹理复杂度;
    所述根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数按预置策略获取所述当前图像的运动矢量精度具体包括:
    根据所述已解码图像集合的运动剧烈程度和所述当前图像的量化参数,以及所述已解码图像集合的纹理复杂度按预置策略确定所述当前图像的运动矢量精度。
  42. 根据权利要求33所述的视频解码装置,其特征在于,所述第一获取单元具体用于:
    获取所述当前图像的量化参数;
    获取所述当前图像的分辨率中的宽度值;
    根据所述宽度值和所述当前图像的量化参数按预置策略确定所述当前图像的运动矢量精度。
PCT/CN2016/088157 2015-07-03 2016-07-01 视频编码和解码方法、视频编码和解码装置 WO2017005146A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP16820797.5A EP3306936B1 (en) 2015-07-03 2016-07-01 Video encoding and decoding method
CN201680037414.9A CN108141607A (zh) 2015-07-03 2016-07-01 视频编码和解码方法、视频编码和解码装置
US15/860,531 US10523965B2 (en) 2015-07-03 2018-01-02 Video coding method, video decoding method, video coding apparatus, and video decoding apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510391858.X 2015-07-03
CN201510391858.XA CN106331703B (zh) 2015-07-03 2015-07-03 视频编码和解码方法、视频编码和解码装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/860,531 Continuation US10523965B2 (en) 2015-07-03 2018-01-02 Video coding method, video decoding method, video coding apparatus, and video decoding apparatus

Publications (1)

Publication Number Publication Date
WO2017005146A1 true WO2017005146A1 (zh) 2017-01-12

Family

ID=57684763

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/088157 WO2017005146A1 (zh) 2015-07-03 2016-07-01 视频编码和解码方法、视频编码和解码装置

Country Status (4)

Country Link
US (1) US10523965B2 (zh)
EP (1) EP3306936B1 (zh)
CN (2) CN106331703B (zh)
WO (1) WO2017005146A1 (zh)

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3264768A1 (en) * 2016-06-30 2018-01-03 Thomson Licensing Method and apparatus for video coding with adaptive motion information refinement
US10750181B2 (en) 2017-05-11 2020-08-18 Mediatek Inc. Method and apparatus of adaptive multiple transforms for video coding
CN107087171B (zh) * 2017-05-26 2020-02-07 中国科学技术大学 Hevc整像素运动估计方法及装置
US11272207B2 (en) 2017-06-12 2022-03-08 Futurewei Technologies, Inc. Selection and signaling of motion vector (MV) precisions
CN109218733B (zh) * 2017-06-30 2022-03-29 华为技术有限公司 一种确定预测运动矢量预测的方法以及相关设备
CN109660800B (zh) * 2017-10-12 2021-03-12 北京金山云网络技术有限公司 运动估计方法、装置、电子设备及计算机可读存储介质
CN109905714B (zh) 2017-12-08 2022-12-27 华为技术有限公司 帧间预测方法、装置及终端设备
CN110166778A (zh) * 2018-02-12 2019-08-23 华为技术有限公司 视频解码方法、视频解码器以及电子设备
TW202029755A (zh) * 2018-09-26 2020-08-01 美商Vid衡器股份有限公司 視訊編碼雙預測
CN109561315B (zh) * 2018-10-31 2020-10-02 北京金山云网络技术有限公司 一种运动估计方法、装置、电子设备及存储介质
WO2020098810A1 (en) 2018-11-17 2020-05-22 Beijing Bytedance Network Technology Co., Ltd. Merge with motion vector difference in video processing
CN111263152B (zh) 2018-11-30 2021-06-01 华为技术有限公司 视频序列的图像编解码方法和装置
WO2020125754A1 (en) 2018-12-21 2020-06-25 Beijing Bytedance Network Technology Co., Ltd. Motion vector derivation using higher bit-depth precision
JP7201906B2 (ja) * 2019-01-15 2023-01-11 日本電信電話株式会社 参照領域決定装置及びプログラム
WO2020177118A1 (en) * 2019-03-07 2020-09-10 Alibaba Group Holding Limited Subsampled residual coding for video compression system
CN112672156B (zh) 2019-03-11 2022-07-29 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
CN111567044A (zh) * 2019-03-13 2020-08-21 北京大学 一种视频处理方法、装置、编码设备及解码设备
WO2021047540A1 (en) 2019-09-09 2021-03-18 Beijing Bytedance Network Technology Co., Ltd. Coefficient scaling for high precision image and video coding
CN112492249B (zh) * 2019-09-11 2024-04-09 瑞昱半导体股份有限公司 图像处理方法及电路
CN114731392A (zh) 2019-09-21 2022-07-08 北京字节跳动网络技术有限公司 用于图像和视频编解码的高精度变换和量化
CN111246208B (zh) * 2020-01-22 2022-04-08 北京字节跳动网络技术有限公司 视频处理方法、装置及电子设备
US11758151B2 (en) * 2020-12-29 2023-09-12 Qualcomm Incorporated Template matching in video coding
US11936877B2 (en) * 2021-04-12 2024-03-19 Qualcomm Incorporated Template matching based affine prediction for video coding
CN115529459B (zh) * 2022-10-10 2024-02-02 格兰菲智能科技有限公司 中心点搜索方法、装置、计算机设备、存储介质
CN116962708B (zh) * 2023-09-21 2023-12-08 北京国旺盛源智能终端科技有限公司 一种智能服务云终端数据优化传输方法及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1700736A (zh) * 2004-12-31 2005-11-23 北京中星微电子有限公司 优化搜索算法的视频数据压缩方法及装置
US20050265454A1 (en) * 2004-05-13 2005-12-01 Ittiam Systems (P) Ltd. Fast motion-estimation scheme
CN101267556A (zh) * 2008-03-21 2008-09-17 海信集团有限公司 快速运动估计方法及视频编解码方法
CN101699865A (zh) * 2009-10-28 2010-04-28 山东大学 一种块运动自适应的亚像素快速搜索方法
CN102075760A (zh) * 2010-10-27 2011-05-25 无锡中星微电子有限公司 快速运动估计方法及装置
CN103414899A (zh) * 2013-08-16 2013-11-27 武汉大学 一种视频编码的运动估计方法
CN104469380A (zh) * 2014-12-25 2015-03-25 中国电子科技集团公司第四十一研究所 基于h.264/avc标准的视频图像预测搜索方法

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970003107B1 (ko) * 1993-04-09 1997-03-14 대우전자 주식회사 단계적인 영역분할을 통한 움직임벡터 검출방법 및 장치
JP2000308064A (ja) * 1999-04-22 2000-11-02 Mitsubishi Electric Corp 動きベクトル検出装置
US6968008B1 (en) 1999-07-27 2005-11-22 Sharp Laboratories Of America, Inc. Methods for motion estimation with adaptive motion accuracy
US6442203B1 (en) * 1999-11-05 2002-08-27 Demografx System and method for motion compensation and frame rate conversion
US7227896B2 (en) * 2001-10-04 2007-06-05 Sharp Laboratories Of America, Inc. Method and apparatus for global motion estimation
US20060002474A1 (en) * 2004-06-26 2006-01-05 Oscar Chi-Lim Au Efficient multi-block motion estimation for video compression
US20060233258A1 (en) * 2005-04-15 2006-10-19 Microsoft Corporation Scalable motion estimation
US20070121728A1 (en) * 2005-05-12 2007-05-31 Kylintv, Inc. Codec for IPTV
EP1897375B1 (en) 2005-06-10 2018-08-15 Nxp B.V. Alternating up- and down-ward motion vector rounding
EP1960967B1 (en) * 2005-12-15 2013-03-13 Analog Devices, Inc. Motion estimation using prediction guided decimated search
CN100496130C (zh) * 2006-01-26 2009-06-03 深圳艾科创新微电子有限公司 视频快速运动估计方法
WO2009131544A1 (en) * 2008-04-25 2009-10-29 Agency For Science, Technology And Research Computed tomography method and apparatus for centre-of-rotation determination
CN101902632B (zh) * 2009-05-25 2013-03-20 华为技术有限公司 像素插值滤波方法及装置,解码方法及系统
KR101356613B1 (ko) 2009-08-21 2014-02-06 에스케이텔레콤 주식회사 적응적 움직임 벡터 해상도를 이용한 영상 부호화/복호화 방법 및 장치
EP2489189A1 (en) 2009-10-14 2012-08-22 Thomson Licensing Methods and apparatus for adaptive coding of motion information
CN101815218B (zh) * 2010-04-02 2012-02-08 北京工业大学 基于宏块特征的快速运动估计视频编码方法
US10327008B2 (en) 2010-10-13 2019-06-18 Qualcomm Incorporated Adaptive motion vector resolution signaling for video coding
KR101479130B1 (ko) * 2010-10-18 2015-01-07 에스케이 텔레콤주식회사 차분 움직임벡터 부호화/복호화 장치 및 방법, 및 그것을 이용한 영상 부호화/복호화 장치 및 방법
CN102790884B (zh) * 2012-07-27 2016-05-04 上海交通大学 一种基于分层运动估计的搜索方法及其实现系统
CN103957420B (zh) * 2014-04-30 2017-02-15 华南理工大学 一种h.264运动估计编码的全面运动估计改进算法
CN104702957B (zh) * 2015-02-28 2018-10-16 北京大学 运动矢量压缩方法和装置
US10200713B2 (en) * 2015-05-11 2019-02-05 Qualcomm Incorporated Search region determination for inter coding within a particular picture of video data
US20160337662A1 (en) * 2015-05-11 2016-11-17 Qualcomm Incorporated Storage and signaling resolutions of motion vectors
US10477237B2 (en) * 2017-06-28 2019-11-12 Futurewei Technologies, Inc. Decoder side motion vector refinement in video coding

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050265454A1 (en) * 2004-05-13 2005-12-01 Ittiam Systems (P) Ltd. Fast motion-estimation scheme
CN1700736A (zh) * 2004-12-31 2005-11-23 北京中星微电子有限公司 优化搜索算法的视频数据压缩方法及装置
CN101267556A (zh) * 2008-03-21 2008-09-17 海信集团有限公司 快速运动估计方法及视频编解码方法
CN101699865A (zh) * 2009-10-28 2010-04-28 山东大学 一种块运动自适应的亚像素快速搜索方法
CN102075760A (zh) * 2010-10-27 2011-05-25 无锡中星微电子有限公司 快速运动估计方法及装置
CN103414899A (zh) * 2013-08-16 2013-11-27 武汉大学 一种视频编码的运动估计方法
CN104469380A (zh) * 2014-12-25 2015-03-25 中国电子科技集团公司第四十一研究所 基于h.264/avc标准的视频图像预测搜索方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3306936A4 *

Also Published As

Publication number Publication date
US10523965B2 (en) 2019-12-31
EP3306936A1 (en) 2018-04-11
CN106331703A (zh) 2017-01-11
CN108141607A (zh) 2018-06-08
EP3306936A4 (en) 2018-06-13
US20180131960A1 (en) 2018-05-10
EP3306936B1 (en) 2021-09-22
CN106331703B (zh) 2020-09-08

Similar Documents

Publication Publication Date Title
WO2017005146A1 (zh) 视频编码和解码方法、视频编码和解码装置
US20210006818A1 (en) Picture prediction method and related apparatus
JP7313816B2 (ja) 画像予測方法および関連装置
US20200244986A1 (en) Picture prediction method and related apparatus
CN107710761B (zh) 图像预测方法和相关设备
CN110519600B (zh) 帧内帧间联合预测方法、装置、编解码器及存储装置
CN118055253A (zh) 用于视频代码化中的运动补偿预测的光流估计
KR20090094595A (ko) 복수 참조에 의한 움직임 예측을 이용한 부호화 방법 및장치, 그리고 복수 참조에 의한 움직임 예측을 이용한복호화 방법 및 장치
WO2016065872A1 (zh) 图像预测方法及相关装置
US20220086485A1 (en) Systems and Methods for Encoding Image Data
CN114979631A (zh) 用于利用光流的预测细化、双向光流和解码器侧运动矢量细化的方法和装置
KR101590875B1 (ko) 복수 참조에 의한 움직임 예측을 이용한 부호화 방법 및 장치, 그리고 복수 참조에 의한 움직임 예측을 이용한 복호화 방법 및 장치
KR20150106866A (ko) 복수 참조에 의한 움직임 예측을 이용한 부호화 방법 및 장치, 그리고 복수 참조에 의한 움직임 예측을 이용한 복호화 방법 및 장치

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2016820797

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE