WO2019029590A1 - 视频图像编码和解码的方法、装置及设备 - Google Patents

视频图像编码和解码的方法、装置及设备 Download PDF

Info

Publication number
WO2019029590A1
WO2019029590A1 PCT/CN2018/099512 CN2018099512W WO2019029590A1 WO 2019029590 A1 WO2019029590 A1 WO 2019029590A1 CN 2018099512 W CN2018099512 W CN 2018099512W WO 2019029590 A1 WO2019029590 A1 WO 2019029590A1
Authority
WO
WIPO (PCT)
Prior art keywords
image block
length
affine
sub
vertical direction
Prior art date
Application number
PCT/CN2018/099512
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
Priority to RU2020110025A priority Critical patent/RU2771955C2/ru
Priority to CN202010734355.9A priority patent/CN111935482B/zh
Priority to JP2020507658A priority patent/JP2020529811A/ja
Priority to AU2018315106A priority patent/AU2018315106B2/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP18843177.9A priority patent/EP3664452A4/en
Priority to KR1020207006267A priority patent/KR102357575B1/ko
Priority to SG11202001199QA priority patent/SG11202001199QA/en
Priority to CN201880052255.9A priority patent/CN110999302A/zh
Priority to BR112020002656-5A priority patent/BR112020002656A2/pt
Priority to MX2020001646A priority patent/MX2020001646A/es
Priority to CA3072712A priority patent/CA3072712A1/en
Publication of WO2019029590A1 publication Critical patent/WO2019029590A1/zh
Priority to US16/786,660 priority patent/US11039127B2/en
Priority to PH12020500307A priority patent/PH12020500307A1/en
Priority to US17/234,976 priority patent/US11496732B2/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/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/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • 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/527Global motion vector estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • 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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • 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/537Motion estimation other than block-based
    • H04N19/54Motion estimation other than block-based using feature points or meshes

Definitions

  • the present invention relates to the field of video image processing, and more particularly to a method for encoding and decoding video images, an encoding device and a decoding device, an encoding device, and a decoding device.
  • 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 vertical MPEG-2 standard for Digital Video Disc (“Digital Video Disc” (Digital Video Disc) and Digital Video Broadcasting (“DVB”), H.261 standard for video conferencing and H.263 standard
  • VCD Video Compact Disc
  • DVD Digital Video Broadcasting
  • H.261 standard for video conferencing
  • H.263 standard for video conferencing
  • 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
  • An image block refers to an array of two-dimensional sampling points, which may be a square array or a rectangular array.
  • a 4 ⁇ 4 image block can be regarded as a square sampling point array composed of 4 ⁇ 4 total 16 sampling points, as shown in FIG. 1 .
  • the image block can be recorded as B.
  • an image can also be represented as a two-dimensional array of sample points, labeled in a similar way to an image block.
  • the sampling points may also be referred to as pixels, which will be used without distinction in the present document.
  • the video sequence is composed of an image arrangement of one frame and one frame.
  • the time interval for generating continuous images is short, and the variation between images is small, resulting in little difference between successive images.
  • the temporal correlation of successive images can be utilized to encode only the difference between the current image and the reference image, which is typically a temporally adjacent encoded reconstructed image. Thereby reducing the amount of information to be encoded and achieving the effect of signal compression.
  • video coding techniques such methods are known as interframe predictive coding techniques, which are widely adopted by current video coding standards.
  • FIG. 2 shows an interframe predictive coding architecture, in which an image to be encoded is input, usually for each frame/frame image in a video, which is divided into image blocks that do not overlap each other, and the encoder obtains a motion vector of the image block by motion estimation, and the encoder utilizes The motion vector of the image block obtains a motion compensated prediction signal for the image block by motion compensation.
  • the motion compensated prediction signal is then subtracted from the original signal of the image block to obtain a prediction residual signal.
  • the prediction residual signal is transformed, quantized, and entropy encoded into the code stream.
  • the more accurate the motion compensated prediction signal of the obtained image block the smaller the obtained prediction residual signal, the smaller the number of coded bits required, and the higher the compression ratio of the image block.
  • the above motion estimation refers to searching for a similarly-sized and best-matched image block B' in the reference image using the current image block B, and the spatial offset of the image block B relative to B' is called the motion vector of the image block B.
  • Motion compensation refers to a process of obtaining a prediction signal from a reference image according to a motion vector of the image block B. The obtained signal is called a motion compensated prediction signal.
  • the prediction residual signal of the image block is inverse quantized and inverse transformed to obtain a reconstructed residual signal, and then the motion compensation prediction signal is obtained from the reference image according to the motion vector of the image block, and the motion of the image block is obtained.
  • the compensated prediction signal is added to the reconstructed residual signal to obtain a reconstructed signal of the image block.
  • FIG. 3 shows the division of an image block and the relationship between an image block and a motion vector.
  • the image A(t) at time t is divided into image blocks of different sizes and not overlapping, and the arrows in each image block schematically represent the coding end.
  • the determined motion vector, length and direction represent the severity and direction of the current image block motion.
  • the motion vector of each image block will be applied to all sample points in the image block, ie all sample points in the image block will acquire their prediction signals in the specified reference image based on the position offset represented by the motion vector.
  • the motion compensation prediction based on block structure is easy to implement by hardware and software, has low complexity, and can provide better compression efficiency when the computing resources are limited, but there are also some shortcomings.
  • a motion vector is used to represent the motion of all pixel points in an image block.
  • the motion direction and size of all the pixel points are the same, that is, translational motion
  • the method can be well represented; when the pixels in the image block are
  • the direction or magnitude of the motion of the point is different, such as scaling and rotational motion, the method cannot accurately represent the motion of all the pixel points, so that an accurate prediction signal cannot be obtained, and the compression performance is lowered.
  • the motion vector field refers to the motion vector field of the image block, the image block is divided into more detailed sub-units, the sub-units can be as small as one pixel, each sub-unit has one motion vector, and the motion vector of all sub-units in the image block
  • the motion vector field of the image block is composed.
  • the motion vector field of an image block may vary linearly or non-linearly.
  • the motion vector field of an image block is linearly varied means that the motion vectors of adjacent sub-units within the image block are uniformly varied. If the motion vector of adjacent cells in the image block changes unevenly, the motion vector field of the image block changes nonlinearly.
  • the motion vectors of the four vertices of the image block are obtained from the motion vectors of the surrounding image blocks, and the motion vectors of the respective 4x4 units constitute the motion vector field of the image block.
  • a motion compensated prediction signal of the image block is obtained from the reference image.
  • the motion vector prediction based motion compensation prediction technique reduces the size of cells with independent motion vectors, and can more accurately represent non-translational motions, such as rotation and scaling, to obtain better motion compensated prediction signals.
  • the motion vector field mentioned above is obtained by bilinear interpolation of the motion vector of the control point, and the motion vector field satisfies the bilinear model.
  • the bilinear interpolation is a mathematical interpolation method. Referring to FIG. 4, the specific interpolation method is introduced as follows:
  • the motion vector of the control point is selected from the motion vector of the surrounding image block, and the selected motion vector may be inaccurate. If the motion vector of the control point is obtained by the motion estimation search, the motion vector of the control point needs to be written. Into the code stream, a more efficient method is needed at this time, for example, the affine transformation model is used to represent the motion vector field of the image block, and a motion compensation prediction technique based on affine transformation is proposed.
  • the affine transformation represents the mapping of two spaces.
  • the common affine transformations have rotation, scaling and translation.
  • the motion vector field of the image block obtained by the affine transformation model is linearly varied, and the motion vector field satisfies the affine transformation.
  • a common 6-parameter affine transformation model can represent the above three motions. Specifically, as shown in the formula (3), where (x, y) is the coordinate of the pixel point P in the current image, and (x', y') is the coordinate of the pixel point P' at which the pixel point P matches in the reference image.
  • a, b, c, d, e, and f are parameters of the affine transformation. If the affine parameter is known, the position (x', y') of the pixel point (x, y) in the reference image can be obtained, so that the predicted signal of the pixel point can be obtained from the reference image.
  • the general affine parameters are calculated according to the motion vector of some pixel points in the image block, and the motion vector can be expressed as the formula (4).
  • the specific values of the respective affine transformation parameters can be obtained, thereby using equations (3) and (4).
  • the motion vector of all points in the image block can be obtained.
  • the motion vector of the image block corner point (control point) is obtained first by motion estimation, and then the affine transformation parameter is obtained according to the corner point motion vector, thereby obtaining the motion vector of all the pixel points in the image block.
  • the motion vector of the corner point is shown in Fig. 5.
  • (a) shows the image block X.
  • the width of the image block is w
  • the height is h
  • the coordinates of the upper left corner point are (0, 0)
  • the motion vector is The coordinates of the upper right corner are (w, 0)
  • the motion vector is The coordinates of the lower left corner point are (0, h)
  • the motion vector is The above three motion vectors
  • the motion vectors of the three vertices of the image block may be different. As shown in (b), the mapping relationship of the image block in the reference image is as shown by the dashed line. After the motion vectors of all the points in the image block are obtained, the motion compensation prediction signals of all points in the image block are obtained according to the motion compensation prediction.
  • the above content takes the 6-parameter affine transformation model as an example, but the affine transformation is not limited to the 6-parameter model, and can be a 4-parameter affine transformation model-reference formula (7), (8), 2-parameter scaling model-reference Formula (9), and so on.
  • the image block uses the 4-parameter affine transformation model for motion compensation prediction, then there are 4 unknown parameters of the affine model.
  • the parameters of the model can be obtained by using two sets of motion vectors.
  • the two sets of motion vectors may be motion vectors of two corner points of the image block, or motion vectors of some two points in the image block.
  • motion compensated prediction techniques based on linearly varying motion vector fields can significantly improve coding performance for video frame/image sequences containing rotational, scaled motion, linearly varying motion vector fields as described above.
  • These include motion vector fields generated using affine transformations, motion vector fields generated using bilinear models, and the like.
  • the motion compensation prediction technique based on affine transformation as an example, after obtaining the affine transformation parameters of the image block, the motion vector of each point in the image block is calculated, and the motion compensation prediction is performed according to the motion vector of each point.
  • the motion compensation prediction signal for each point Since the motion vectors of each pixel in the image block may be different, different operations need to be performed for each pixel according to the motion vector.
  • the pixel-based motion compensation prediction complexity is very high.
  • the related art attempts to subdivide the sub-image blocks in the image block, obtain the motion vector of each sub-image block, and obtain the sub-image block. Motion compensated prediction signal.
  • the size of the sub-image block in the related art is fixed, and the size of the sub-image block is too small to cause a high complexity of codec, and the size of the sub-image block is excessively reduced to reduce the codec performance, thereby causing such efficiency.
  • the coding method faces enormous limitations in practical applications.
  • the invention provides a video image decoding and encoding method, a decoding device, an encoding device, a decoding device and an encoding device, which can be divided into a plurality of sizes by selecting a sub-image block of an appropriate size.
  • the sub-image block is processed to reduce the complexity of the codec and improve the codec performance.
  • a video image decoding method including: determining a motion vector difference of an affine image block; determining a motion vector accuracy of the affine image block; according to the motion vector difference, the motion vector accuracy, the Determining the size of the affine motion compensating sub-image block within the affine image block, the length of the affine image block, and the size of the affine image block, the size including the length in the horizontal direction, and the vertical
  • the length of the direction such that the length of the horizontal direction of the affine image block is an integral multiple of the length of the affine motion compensated sub-image block in the horizontal direction, and the length of the affine image block in the vertical direction is the affine
  • the image block is subjected to
  • the distance between the control points in the affine image block and the affine image are combined by the determined two parameters, that is, the motion vector difference and the motion vector precision.
  • the size of the affine motion compensated sub-image block is adaptively determined, so that the affine image block can be divided into a plurality of affine motion compensated sub-image blocks of the same size, thereby greatly reducing the complexity of the decoding end. And improve the efficiency of decoding.
  • the process of determining and adjusting the affine motion compensation sub-image block size may specifically be based on the ratio of the motion vector accuracy to the first component/second component of the motion vector difference to the first level/
  • the vertical distance is equally adjusted to obtain the length of the horizontal/vertical direction of the affine motion compensating sub-image block, and determining whether the length of the horizontal/vertical direction of the affine image block is the affine motion compensating sub-image block
  • An integer multiple of the length of the horizontal/vertical direction if not, adjusting the length of the horizontal/vertical direction of the affine motion compensated sub-image block such that the length of the horizontal/vertical direction of the affine image block is the imitation
  • the motion compensates for an integer multiple of the length of the adjusted horizontal/vertical direction of the sub-image block.
  • the first horizontal/vertical distance between the control points is adjusted by the proportional relationship between the motion vector precision and the first component/second component of the motion vector difference to obtain an affine motion compensation sub-image block.
  • the length of the horizontal/vertical direction so that the size of the affine motion compensated sub-image block can match the accuracy of the motion vector of the affine image block, and the decoding complexity is reduced while ensuring the decoding quality.
  • the length of the horizontal/vertical direction of the affine motion compensating sub-image block is adjusted such that the length of the horizontal/vertical direction of the affine image block is the affine motion compensating sub-image block.
  • the integer multiple of the adjusted horizontal/vertical length may be specifically increased/decreased by one or more unit lengths by the horizontal/vertical length of the affine motion compensated sub-image block, and then executed cyclically.
  • the above-described scheme up to the length of the horizontal/vertical direction of the affine image block is an integral multiple of the adjusted length of the horizontal/vertical direction of the affine motion compensating sub-image block.
  • the unit length is usually one unit pixel, that is, the length of the horizontal direction of the affine motion compensation sub-image block is adjusted by one/minus one.
  • the above adjustment may also be an adjustment of increasing/decreasing the length of the horizontal/vertical direction of the affine motion compensation sub-image block according to a fixed step size, where the step size is an adjustment value, that is, each cycle
  • the basic unit for adjusting the length of the horizontal/vertical direction of the affine motion compensation sub-image block may be any value, and is usually one unit pixel as described above, or may be another unit value of 2.5 unit pixels.
  • the step/adjustment value used in the above adjustment may also compensate for the parity change of the horizontal/vertical initial length (ie, the unadjusted length) of the affine motion compensation sub-image block, for example, when The initial length of the affine motion compensated sub-picture block in the horizontal direction is an odd number, and an odd step size is selected, for example, an odd number of unit lengths, such as a unit length, is adjusted in steps, when the affine motion compensates the horizontal direction of the sub-image block When the initial length is an even number, an even number of steps is selected, for example, an even number of steps of unit length.
  • This embodiment can ensure that the horizontal/vertical length of the affine motion compensated sub-image block can quickly approximate the value of the horizontal/vertical length of the affine image, thereby further reducing the complexity.
  • the length of the horizontal/vertical direction of the affine motion compensated sub-image block may be oriented to the nearest level of the affine image block.
  • Directional adjustment of the length of the vertical direction if, the length distance of the horizontal/vertical direction of the affine motion compensated sub-image block is two phases adjacent to and divisible from the horizontal/vertical direction of the affine image block
  • the distances of the neighbors are equal, and can be adjusted in a certain direction according to the requirements of the codec. For example, if low latency is required, then the direction can be adjusted in the increasing direction. If high quality is required, the selection is toward decreasing.
  • Direction adjustment if low latency is required, then the direction can be adjusted in the increasing direction. If high quality is required, the selection is toward decreasing.
  • the coding and decoding ends may be respectively Create the same table to allow the minimum integer divisor, for example, 2 N is the starting value, and divide the possible maximum length of the horizontal/vertical direction of the affine image block into multiple intervals, the span of the interval is 2 N+i , i ⁇ (0, (log 2 Wmax)-1), W max is the maximum possible length of the horizontal/vertical direction of the affine image block.
  • the upper and lower limit acquisition rules may be referred to the two ends of the codec, and may be explicitly indicated by the code stream, or the adjacent upper or lower limit value may be selected by rounding.
  • the final length of the horizontal/vertical direction of the affine motion compensation sub-image block can be determined by using a look-up table according to the initial length of the horizontal/vertical direction of the affine motion compensation sub-image block, thereby Reduce system complexity and save time.
  • the affine motion compensating sub-image block in addition to determining the length of the horizontal/vertical direction of the affine image block is the affine motion compensating sub-image block.
  • the length of the horizontal/vertical direction of the affine image block is an integral multiple of the length of the horizontal/vertical direction of the affine motion compensating sub-image block
  • the length of the horizontal/vertical direction of the affine motion compensating sub-image block is an integer multiple of the predetermined length S;
  • the length of the direction is an integral multiple of the length of the adjusted horizontal/vertical direction of the affine motion compensated sub-image block
  • the adjusted horizontal/vertical direction length of the affine motion compensated sub-image block is the pre- Set an integer multiple of the length.
  • the preset length S is usually 4, or 8, 16, 32, etc., or S is equal to 2 n , n is zero or a positive integer. It should be noted that the value of S should not be greater than the affine image block itself. size.
  • This scheme is applicable to affine image blocks of arbitrary shape. If the affine image block is in the Qual Tree rule division mode, or the size of the affine image block is 2Nx2N, that is, a square, due to the above It is judged that the satisfaction of any one of the conditions (1) and (2) can satisfy the other condition at the same time, and therefore, it is only necessary to retain one of the determination conditions. The order of judging whether the above condition (1) and condition (2) are satisfied and the order of adjusting the length of the horizontal/vertical direction of the affine motion compensating sub-image block according to the judgment result can be arbitrarily exchanged.
  • the method determined in the above manner may be selected.
  • the length of the horizontal/vertical direction of the affine motion compensating sub-image block needs to be subjected to a limiting operation, that is, the length of the horizontal/vertical direction of the affine motion compensating sub-image block is lower than the lower limit Tm/Tn by comparison.
  • Tm/Tn is a preset value, usually 4, and W/H is the length in the horizontal/vertical direction of the affine image block.
  • the affine transformation model applicable to the three control points and the affine transformation model of the two control points need to acquire the affine independently.
  • the motion compensates the vertical and horizontal lengths of the sub-image block and adjusts them independently.
  • the affine transformation model of the two control points it only needs to acquire the affine motion compensation sub-image independently.
  • the length of the block in the horizontal or vertical direction which in turn is pushed to the length in the other direction, and the length in both directions is independently adjusted as needed.
  • the size of the affine image block is a regular square of 2Nx2N, since the lengths of the horizontal direction and the vertical direction are the same, it is only necessary to determine and adjust one of the horizontal or vertical direction lengths.
  • a video image encoding method which mainly includes: determining a motion vector difference of an affine image block; determining a motion vector accuracy of the affine image block; according to the motion vector difference, the motion vector accuracy,
  • the distance between the control points in the affine image block and the size of the affine image block, the size of the affine motion compensating sub-image block within the affine image block is determined, the size including the length in the horizontal direction, and the vertical a length in the straight direction such that the length of the horizontal direction of the affine image block is an integral multiple of the length of the affine motion compensating sub-image block in the horizontal direction, and the length of the affine image block in the vertical direction is the imitation
  • the motion compensation compensates an integer multiple of the length of the vertical direction of the sub-image block, wherein the control point is a pixel point for determining the motion vector difference; and the imitation is compensated according to the size of the affine motion compensation sub-image block
  • the image block is subject
  • the video image encoding method provided by the second aspect of the present invention combines the distance between the control points in the affine image block and the affine by the determined two parameters, that is, the motion vector difference, the motion vector precision
  • the size of the image adaptively determines the affine motion compensation sub-image block size, so that the affine image block can be divided into a plurality of affine motion compensation sub-image blocks of the same size, thereby greatly reducing the complexity of the encoding end. And improve the efficiency of coding.
  • the video image encoding method of the second aspect of the present invention is different from the video image decoding method of the first aspect of the present invention, except for the last step, the core steps of determining the affine motion compensation sub-image block size and adjusting the affine motion compensator The method steps of the image block size are identical. Therefore, the solution in the video image decoding method of the first aspect can be fully applied to the video image encoding method of the second aspect of the present invention. For details, refer to the foregoing decoding of the video image of the first aspect. Introduction of the method.
  • a video image decoding apparatus which mainly includes: a motion vector difference determining module, configured to determine a motion vector difference of an affine image block; and a motion vector accuracy determining module, configured to determine the affine image block a motion vector accuracy; a sub-image block size determining module, configured to determine the imitation according to the motion vector difference, the motion vector precision, the distance between the control points in the affine image block, and the size of the affine image block
  • the affine motion in the image block compensates for the size of the sub-image block, the size including the length in the horizontal direction, and the length in the vertical direction such that the length in the horizontal direction of the affine image block is the affine motion compensating sub-image
  • An integer multiple of the length of the horizontal direction of the block, and the length of the vertical direction of the affine image block is an integer multiple of the length of the vertical direction of the affine motion compensating sub-image block, wherein the control point is for determining a pixel point of the
  • a video image decoding apparatus corresponding to the video image decoding method provided by the first aspect of the present invention, has the function of implementing all the steps in the video image decoding method provided by the first aspect of the invention, and can have the same
  • the technical effect is to greatly reduce the complexity of the decoding end and improve the efficiency of decoding.
  • a video image encoding apparatus which mainly includes: a motion vector difference determining module, configured to determine a motion vector difference of an affine image block; and a motion vector accuracy determining module, configured to determine the affine image block a motion vector accuracy; a sub-image block size determining module, configured to determine the imitation according to the motion vector difference, the motion vector precision, the distance between the control points in the affine image block, and the size of the affine image block
  • the affine motion in the image block compensates for the size of the sub-image block, the size including the length in the horizontal direction, and the length in the vertical direction such that the length in the horizontal direction of the affine image block is the affine motion compensating sub-image
  • An integer multiple of the length of the horizontal direction of the block, and the length of the vertical direction of the affine image block is an integer multiple of the length of the vertical direction of the affine motion compensating sub-image block, wherein the control point is for determining a pixel point of
  • a video image encoding apparatus corresponds to the video image encoding method provided by the second aspect of the present invention, and has the functions of implementing all the steps in the video image encoding method provided by the second aspect of the invention, and can have the same
  • the technical effect is to greatly reduce the complexity of the encoding end and improve the efficiency of encoding.
  • a video image decoding apparatus comprising a processor and a non-volatile memory, the processor invoking program code stored in the memory to implement the method provided by the first aspect of the present invention Decoding method.
  • a video image encoding apparatus comprising a processor and a non-volatile memory, the processor calling program code stored in the memory to implement the encoding method provided by the second aspect .
  • the video image encoding and decoding method, the encoding device, the decoding device, the encoding device, and the decoding device of the embodiment of the present invention pass the determined two parameters, that is, the motion vector difference, the motion vector accuracy, And adaptively determining the affine motion compensation sub-image block size according to the distance between the control points in the affine image block and the size of the affine image, so that the affine image block can be divided into multiple sizes.
  • the same affine motion compensates the sub-picture block, which reduces the complexity of the codec and improves the codec performance.
  • FIG. 1 is a schematic diagram of an image block in a process of encoding a video image
  • FIG. 2 is a schematic diagram of a basic flow of encoding a video image
  • FIG. 3 is a schematic diagram showing the division of an image block and the relationship between an image block and a motion vector in a video image encoding process
  • FIG. 4 is a schematic diagram of a motion vector field for acquiring an image block using bilinear interpolation
  • FIG. 5 is a schematic diagram of acquiring a motion vector field of an image block using an affine transformation model
  • FIG. 6 is a schematic diagram of a frame of a video decoder that implements a decoding method provided by an embodiment of the present invention
  • FIG. 7 is a schematic flowchart of a video image decoding method according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of an affine image block and a control point according to an embodiment of the present invention.
  • FIG. 9 is another schematic diagram of an affine image block and control points in accordance with an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of three non-coincident pixel points in an affine image block according to an embodiment of the present invention.
  • FIG. 11 is still another schematic diagram of an affine image block according to an embodiment of the present invention.
  • FIG. 12 is another schematic flowchart of a video image decoding method according to an embodiment of the present invention.
  • FIG. 13 is still another schematic flowchart of a video image decoding method according to an embodiment of the present invention.
  • FIG. 14 is a schematic flowchart of a video image encoding method according to an embodiment of the present invention.
  • FIG. 15 is another schematic flowchart of a video image encoding method according to an embodiment of the present invention.
  • FIG. 16 is still another schematic flowchart of a method for encoding a video image according to an embodiment of the present invention.
  • FIG. 17 is a schematic block diagram of a decoding apparatus according to an embodiment of the present invention.
  • Figure 18 is a schematic block diagram of an encoding apparatus according to an embodiment of the present invention.
  • FIG. 19 is a schematic block diagram of a decoding device according to an embodiment of the present invention.
  • 20 is a schematic block diagram of an encoding device in accordance with an embodiment of the present invention.
  • the object of the present invention is to reduce the complexity of codec under the premise of maintaining the predictive performance of affine transformation motion compensation, so that the method can be effectively put into practical application.
  • an image block having independent affine transformation parameters is called an affine image block, that is, an Affine block.
  • a sub-image block that is internally divided by an affine image block for motion compensation prediction is called an Affine Motion Compensation (Affine-MC), and is referred to as an Affine-MC block.
  • the technical solution proposed by the present invention is to adaptively divide a plurality of Affine-MC blocks having the same size according to encoding/decoding requirements, according to the motion vector precision of the Affine block, the motion vector of the Affine block, and the Affine block.
  • the distance between the control points adaptively divides the Affine block into Affine-MC blocks that meet the requirements.
  • the decoding end usually decodes and reconstructs the encoded video code stream by using a decoder as a main body of the decoding method.
  • the basic logical structure of the decoder is as shown in FIG. 6.
  • the video decoder 60 includes an entropy decoding unit 650, a prediction processing unit 652, and inverse quantization. Unit 654, inverse transform processing unit 656, reconstruction unit 658, filter unit 659, and decoded image buffer 660.
  • the prediction processing unit 652 includes a motion compensation unit 662 and an intra prediction processing unit 664.
  • Entropy decoding unit 650 includes a regular CABAC codec engine 666 and a bypass codec engine 668. In other examples, video decoder 60 may include more, fewer, or different functional components.
  • the basic workflow of video decoder 60 is that after receiving the encoded video code stream (hereinafter referred to as the code stream), entropy decoding unit 650 parses the code stream to extract syntax elements from the code stream, where A portion of the code stream is parsed, and entropy decoding unit 650 can parse the entropy encoded syntax elements in the code stream.
  • the prediction processing unit 652, the inverse quantization unit 654, the inverse transform processing unit 656, the reconstruction unit 658, and the filter unit 659 may decode the video data according to the syntax elements extracted from the code stream, that is, generate the decoded video data.
  • the syntax elements may include a regular CABAC codec binary codeword and a bypass codec binary codeword.
  • Entropy decoding unit 650 can decode the regular CABAC codec binary codeword using regular CABAC codec engine 666, and can use the bypass codec engine 668 to decode the bypass codec binary codeword.
  • the prediction processing unit 652 includes a motion compensation unit 662 and an intra prediction processing unit 664.
  • the motion compensation unit 662 may determine one or more reference blocks according to the image block motion information to be decoded, and generate a predictive pixel block of the image block to be decoded according to the reference block.
  • intra prediction is performed by intra prediction processing unit 664 to generate a predictive pixel block of the image block.
  • Intra prediction processing unit 664 may use an intra prediction mode to generate a predictive pixel block of an image block to be decoded based on pixels of spatially adjacent image blocks.
  • the residual pixel data acquired by the prediction processing unit 652 and the residual data of the image block to be decoded processed by the inverse quantization unit 654 and the inverse transform processing unit 656 are reconstructed at the reconstruction unit 658, thereby obtaining reconstruction of the image block to be decoded.
  • the image block is stored in the decoded image buffer 660 after the one frame image composed of the plurality of image blocks is filtered in the filter unit 659 to complete decoding of the encoded video code stream, and is stored in the decoded image buffer 660.
  • the decoded image can be directly output to the display device for display, and can also be used as a reference image in the decoding process of the subsequent code stream.
  • the technical solution of the present invention is applied to the motion compensation prediction decoding process by the motion compensation unit 662, and an exemplary decoding process is shown in FIG.
  • the decoding method and the encoding method in the present invention are generally the same, and the decoding method is the inverse process of the encoding method.
  • the decoding method is taken as an example, the method is basically the same as the encoding method except that it is explicitly stated. Therefore, in the decoding process described below, the occurrence of coding-related explanations does not constitute a conflict or inconsistency of the scheme.
  • FIG. 7 is a schematic flowchart of a method for encoding a video image according to an embodiment of the present invention. Specifically, as shown in FIG. 7, the method 700 includes:
  • S730 Determine an affine motion compensation sub-image block in the affine image block according to the motion vector difference, the motion vector precision, the distance between the control points in the affine image block, and the size of the affine image block.
  • a size including a length in the horizontal direction and a length in the vertical direction such that the length of the horizontal direction of the affine image block is an integral multiple of the length of the horizontal direction of the affine motion compensating sub-image block, and
  • the length of the vertical direction of the affine image block is an integer multiple of the length of the vertical direction of the affine motion compensation sub-image block, wherein the control point is a pixel point for determining the motion vector difference;
  • the decoding/encoding device determines a motion vector difference of the affine image block according to the determined control point, and determines a motion vector precision of the affine image block, according to the determined motion vector difference, motion vector precision, and control point
  • the distance between the affine image block and the size of the affine image block is determined, and the size of the affine motion compensated sub-image block is the size of the affine image block;
  • the affine image block is divided into a plurality of affine motion compensated sub-image blocks having the same size, and then the affine image block is decoded based on the affine motion compensation sub-image block.
  • the affine image block is a regular rectangle or a square
  • the corresponding affine motion compensation sub-image block is also a regular rectangle or a square. Therefore, when the affine motion compensation sub-image is determined to be horizontal After the length of the direction and the length in the vertical direction, the overall size of the affine motion compensating sub-image can be determined.
  • the horizontal direction and the vertical direction are reference coordinate systems commonly used in the art for locating the position of an image block/affine image block in a video image, wherein the horizontal direction generally represents the direction of the long side of the regular rectangular video image.
  • the vertical direction generally represents the direction in which the short sides of the regular rectangular video image are located, wherein the horizontal direction and the vertical direction are perpendicular to each other; for the sake of versatility, the horizontal direction can be replaced by the first direction, and the vertical direction The direction may be replaced by a second direction that is perpendicular to the first direction, but for simplicity of explanation, the horizontal direction and the vertical direction are used herein to describe.
  • the "decoded affine image block” mentioned in the decoding method herein refers to the process of parsing the encoded data from the code stream and reconstructing and restoring the encoded image with the affine image block as a basic unit, and cannot be because The "decoded affine image block” is used and it is considered that the affine image block has been reconstructed.
  • the motion compensation unit 662 determines the affine by using the method of video image decoding of the embodiment of the present invention, using the motion vector difference of the determined affine image block, the motion vector accuracy, and the distance between the control points and the size of the affine image block.
  • the size of the motion compensation sub-image block is divided into a plurality of affine motion compensation sub-images of uniform size according to the size of the affine motion compensation sub-image block, and then subjected to decoding processing, thereby being in the decoding process
  • the affine motion compensation sub-image block of an appropriate size can be adaptively selected according to the change of the above parameters, thereby reducing the complexity of decoding and improving the performance.
  • the affine image (Affine) block is that the motion vectors of all the units in the image block conform to the same affine model, for example, the same affine model, and the same parameters can be used, and Or an image block represented by the same set of parameters.
  • the unit is a group of pixels, for example, a pixel, or a block structure of 1 ⁇ 3, 2 ⁇ 4, etc., which is not limited in the present invention.
  • any non-coincident pixel point may be selected as a control point to determine a motion vector difference of the Affine block, which is not limited by the present invention.
  • S710 comprises:
  • the first control point and the second control point have a first horizontal distance
  • the third control point and the fourth control point have a first vertical distance
  • Scheme 1 A method for determining a motion vector difference of an affine image block based on three control points
  • a motion vector difference determination method for an affine image block based on two control points in a horizontal direction includes: determining the motion vector according to a difference between motion vectors of a first control point and a second control point located on a same horizontal line The first component of the difference.
  • a motion vector difference determination method for an affine image block based on two control points in a vertical direction comprising: determining, according to a difference between motion vectors of a third control point and a fourth control point on the same vertical line The second component of the motion vector difference.
  • the first component of the motion vector difference refers to a horizontal component of the motion vector difference
  • the second component of the motion vector difference refers to a vertical component of the motion vector difference.
  • the first component of the motion vector difference and the second component of the motion vector difference together represent a motion vector difference of the affine image block
  • the first component of the motion vector difference and the motion vector difference The second component separately reflects the motion vector difference of the affine image block.
  • the motion vector difference of the affine image block includes the first component of the motion vector difference and the second component of the motion vector difference; in the scheme 2, the motion vector difference of the affine image block A first component comprising a motion vector difference; in scheme 3, the motion vector difference of the affine image block comprises a second component of the motion vector difference.
  • the first, second, third, and fourth are only for distinguishing pixel points, and should not constitute any limitation on the protection scope of the present invention.
  • the first control point may also be referred to as The second control point, the second control point may become the first control point or the like.
  • the first control point and the third control point are the same pixel point, that is, the number of selected control points is three, and among the three control points One control point is on the same horizontal line as one of the other two control points, and is located on the same vertical line as the other of the other two control points.
  • the first control point, the second control point, the third control point, and the fourth control point are vertices of the Affine block, and respectively, four vertices of an Affine block are respectively Marked as the top left corner, the bottom left corner, the top right corner, and the bottom right corner, then:
  • any three vertices located in two orthogonal directions may be selected to determine a motion vector difference of the Affine block. For example, an upper left corner vertex, a lower left corner vertex, and an upper right corner vertex may be selected, and the upper left corner may be selected. Vertex, upper right corner vertex and lower right corner vertex;
  • any two vertices located on the same horizontal line may be selected to determine a motion vector difference of the Affine block, for example, an upper left corner vertex and an upper right corner vertex may be selected, or a lower left corner vertex and a lower right corner vertex may be selected;
  • any two vertices located on the same vertical line may be selected to determine the motion vector difference of the Affine block, for example, the upper left corner vertex and the lower left corner vertex may be selected, or the upper right corner vertex and the lower right corner vertex may be selected.
  • the invention is not limited thereto.
  • the components in the two directions (horizontal direction, vertical direction, or become, x direction, y direction) of the motion vector of the first control point and the second control point may be
  • the difference of the components in any one direction is determined as the first component of the motion vector difference of the Affine block, and may be in any one of the components in the two directions of the motion vector of the third control point and the fourth control point.
  • the difference of the components is determined as the second component of the motion vector difference of the Affine block, and the manner of determining the motion vector difference is applicable to the foregoing schemes 1, 2, and 3; and may also be based on actual requirements for coding complexity and coding performance.
  • the value between the two differences of the components in the two directions of the motion vector is determined as the second component, which is not limited in the present invention.
  • the motion vector of each of the first control point to the fourth control point includes two components, that is, a horizontal component and a vertical component, and therefore, in the foregoing steps, according to the first control point located on the same horizontal line Determining the first component of the motion vector difference from the difference of the motion vector of the second control point, and determining the difference according to the difference between the motion vector of the third control point and the fourth control point on the same vertical line
  • the second component of the motion vector difference can be implemented in the following ways:
  • determining a second horizontal component difference and a second vertical component difference of the motion vector of the third control point and the fourth control point, the second horizontal component difference and the second vertical component difference The maximum value in the value is determined as the second component of the motion vector difference.
  • ⁇ mv hor max(
  • ⁇ mv ver max(
  • max represents the maximum value
  • ⁇ mv hor represents the horizontal component of the motion vector difference of the Affine block
  • ⁇ mv ver represents the vertical component of the motion vector difference of the Affine block
  • W represents the first level of the first control point and the second control point Distance
  • H represents the first vertical distance of the third control point and the fourth control point.
  • formula (13) indicates that the motion vector level difference ⁇ mv hor is the maximum change of each component of the motion vector of the two control points in the same horizontal direction, that is, the absolute value of the motion vector difference is the largest, for example, Vertex 0 and 1 or vertices 2 and 3 are used as control points to calculate ⁇ mv hor ;
  • Equation (14) indicates that the motion vector vertical difference ⁇ mv ver is the maximum of the components of the motion vectors of the two control points in the same vertical direction
  • the change, that is, the absolute value of the motion vector difference is the largest, for example, vertices 0 and 2 or vertices 1 and 3 can be selected as control points to calculate ⁇ mv ver . It can be understood that the above formulas (13) and (14) are applicable to any one of the foregoing schemes 1, 2, and 3, specifically:
  • the motion vector difference of the affine image block is determined based on the three control points, the motion vector difference including the first component and the second component, and therefore, it is obtained by using a combination of the formula (13) and the formula (14) Motion vector difference of affine image blocks;
  • the motion vector difference of the affine image block is determined based on the two control points in the horizontal direction, the motion vector difference includes only the first component, and therefore, the motion vector difference of the affine image block is obtained by using the formula (13) .
  • the motion vector of the apex of the Affine block is known. In this case, the motion vector difference can be directly calculated from the motion vector of the apex of the Affine block.
  • the motion vector of the control point used in the above scheme can be obtained according to the affine transformation model, for example, when a 4-parameter affine transformation model is employed, and the position of the upper left corner (0, 0) and the upper right corner of the affine image block (W) , 0) as the control point, the model formula is
  • (vx 0 , vy 0 ) and (vx 1 , vy 1 ) are the motion vectors of the upper left and upper right control points, respectively. Substituting the lower left and lower right control point coordinates (0, h) and (w, h) into the formula, you can get (vx 2 , vy 2 ) and (vx 3 , vy 3 );
  • the motion vector difference of the affine image block is determined based on the two control points in the vertical direction, the motion vector difference includes only the second component, and therefore, the motion vector of the affine image block is obtained by using equation (14) difference.
  • equation (14) difference Taking FIG. 8 as an example, in most cases, the motion vector of the apex of the Affine block is known. In this case, the motion vector difference can be directly calculated from the motion vector of the apex of the Affine block.
  • the motion vector of the control point used in the above scheme can be obtained according to the affine transformation model, for example, when a 4-parameter affine transformation model is adopted, and the upper left position (0, 0) and the lower left position (0, H) are used as the control. Point, the model formula is
  • (vx 0 , vy 0 ) and (vx 2 , vy 2 ) are the motion vectors of the upper left and lower left control points, respectively. Substituting the upper right and lower right control point coordinates (w, 0) and (w, h) into the formula, you can get (vx 1 , vy 1 ) and (vx 3 , vy 3 ).
  • obtaining the motion vector difference value according to the affine model that is, determining the difference of the motion vector by determining the affine transformation parameter of the pixel point in the affine image block, It is noted that the pixels in the affine image block have the same affine transformation parameters;
  • determining a first horizontal component difference value and a first vertical component difference value of the motion vector of the first control point and the second control point specifically: according to the affine transformation parameter and the first Determining the first horizontal component difference value and the first vertical component difference value in a horizontal distance
  • determining a second horizontal component difference value of the motion vector of the third control point and the fourth control point determining a second vertical component difference value, specifically: determining the second horizontal component difference value and the second vertical component difference value according to the affine transformation parameter and the first vertical distance.
  • the affine transformation model may adopt a 6-parameter affine transformation model in the prior art, or a 4-parameter or 2-parameter affine transformation model, and a main application of a 6-parameter affine transformation model.
  • the 4-parameter affine transformation model is mainly applied to the scenes of the two control points in the foregoing schemes 2 and 3. The following is a description of the process of obtaining the difference of the motion vector from the affine transformation parameters by taking the 6-parameter affine transformation model and the 4-parameter affine transformation model as examples.
  • (x, y) is the coordinate of the pixel point P in the current image
  • (x', y') is the coordinate of the pixel point P' at which the pixel point P matches in the reference image.
  • a, b, c, d, e, and f are affine transformation parameters. If the affine transformation parameters are known, the position (x', y') of the pixel point (x, y) in the reference image can be obtained, so that the prediction signal of the pixel point can be obtained from the reference image:
  • the affine transformation parameters can be calculated from the motion vectors of some pixel points in the affine image block.
  • the horizontal and vertical components of the motion vector can be expressed as equations (23) and (24), respectively:
  • Vx (1-a)x-by-e (25)
  • Equations (13) and (14) are converted to equations (27) and (28), respectively:
  • the first component and the second component of the motion vector difference of the Affine block can be determined by determining the affine transformation parameters a, b, c, and d, and the distance between the control points.
  • (x, y) is the coordinate of the pixel point P in the current image
  • (x', y') is the coordinate of the pixel point P' at which the pixel point P matches in the reference image.
  • a, b, e, and f are affine transformation parameters. If the affine transformation parameters are known, the position (x', y') of the pixel point (x, y) in the reference image can be obtained, so that the prediction signal of the pixel point can be obtained from the reference image:
  • the formula (29) corresponds to the scenario in which the motion vector difference of the affine image block is determined based on the two control points in the horizontal direction in the foregoing scheme 2.
  • the formula (30) corresponds to the scenario in which the motion vector difference of the affine image block is determined based on the two control points in the vertical direction in the foregoing scheme 3.
  • the affine transformation parameters can be calculated from the motion vectors of some pixel points in the image block.
  • the horizontal and vertical components of the motion vector can be referred to the aforementioned formulas (23) and (24). Equations (29) and (30) are respectively introduced into equations (23) and (24), and the horizontal and vertical components of the motion vector of the pixel with coordinates (x, y) are obtained as equations (31) and ( respectively). 32):
  • equations (31) and (32) into equations (13) and (14), and equations (13) and (14) to equations (33) and (34), respectively:
  • the first component or the second component of the motion vector difference of the Affine block in the aforementioned square 2 and scheme 3 scenarios can be determined by determining the affine transformation parameters a and b, and the distance between the control points.
  • the affine transformation parameter may be obtained by iteratively calculating each parameter, for example, adding a parameter a to determine whether the motion compensation prediction signal is optimal under the model.
  • the affine transformation parameters may also be derived from affine transformation parameters of adjacent Affine blocks. However, the invention is not limited to this.
  • the motion vector of the first control point, the motion vector of the second control point, the motion vector of the third control point, and the motion vector of the fourth control point may be determined. Thereby determining a motion vector difference of the affine image block;
  • the difference between the horizontal component of the motion vector of the first control point and the horizontal component of the motion vector of the second control point is determined as the first horizontal component difference; a difference between a vertical component of the motion vector of the first control point and a vertical component of the motion vector of the second control point is determined as the first vertical component difference value; a level of the motion vector of the third control point a difference between a component and a horizontal component of a motion vector of the fourth control point is determined as the second horizontal component difference; a vertical component of the motion vector of the third control point and a vertical motion vector of the fourth control point
  • the difference of the direct components is determined as the second vertical component difference.
  • the difference between the horizontal component of the motion vector of the first control point and the horizontal component of the motion vector of the second control point is determined as the first horizontal component difference;
  • the difference between the vertical component of the motion vector of the point and the vertical component of the motion vector of the second control point is determined as the first vertical component difference.
  • the difference between the horizontal component of the motion vector of the third control point and the horizontal component of the motion vector of the fourth control point is determined as the second horizontal component difference;
  • the difference between the vertical component of the motion vector of the point and the vertical component of the motion vector of the fourth control point is determined as the second vertical component difference.
  • the motion vector of the control point can be directly determined.
  • the first component and the second component of the motion vector difference of the Affine block can be directly obtained.
  • Figure 9 is a schematic illustration of an affine image block and control points in accordance with an embodiment of the present invention.
  • Two of the control points A and B are on the same horizontal line, the distance is w, the two control points C and D are on the same vertical line, and the distance is h. If the movement of the control points A, B, C and D is known Vector, then the first component and the second component of the motion vector difference of the Affine block can be determined according to equations (11) and (12):
  • control points A and C may be the same pixel.
  • control points A, B, C, and D may be the vertices of the Affine block.
  • the distance between the control points A and B is the width W of the Affine block
  • the control points C and D The pitch is the height H of the Affine block.
  • the first control point and the second control point are two adjacent pixel points
  • the third control point and the fourth control point are two adjacent pixel points.
  • the control point is not necessarily selected in the four corner points of the affine image block, also called the vertices, but may be set according to the codec end, or explicitly indicated in the code stream by signaling, or according to
  • the control point estimate of the surrounding affine image block is either a copy of the arbitrary position in the affine image block, in this case; determining the first horizontal and vertical component difference, and the second horizontal and vertical component difference The value is specifically:
  • the above is the three control points of the foregoing scheme 1 as an example.
  • the two control points in the foregoing scheme 2 or scheme 3 are different from the three control points in the scheme 1, only the first component difference in the scheme 1 is taken or The second component difference is used as the motion vector difference of the affine image of the two control points.
  • A, B, and C are three pixel points in the image block that do not coincide with each other.
  • the positions of the three pixel points are as shown in FIG. 10, and the motion vectors of the three points are respectively (vx A , vy A ), (vx B , vy B ) and (vx C , vy C ).
  • the distance between point A and point B in the horizontal direction is w 1
  • the distance in the vertical direction is h 1
  • the distance between point A and point C in the horizontal direction is w 2
  • the distance in the vertical direction is h 2
  • point B and point The distance of C in the horizontal direction is w 2 - w 1
  • the distance in the vertical direction is h 1 + h 2 .
  • the differences of the components of the motion vectors of the two adjacent pixels in the horizontal direction in the horizontal direction are ⁇ mvx hor and ⁇ mvy hor , respectively, and the motion vectors of the two adjacent pixels in the vertical direction are in the vertical direction.
  • the differences of the components are ⁇ mvx ver and ⁇ mvy ver respectively .
  • ⁇ mvx hor , ⁇ mvy hor , ⁇ mvx ver and ⁇ mvy ver can be determined by determining the motion vectors of the points A, B and C.
  • the motion vector difference of adjacent pixel points of the image block can be determined. Specifically, it can be determined according to formulas (37) to (40):
  • Vx B vx A +w 1 ⁇ mvx hor +h 1 ⁇ mvx ver (37)
  • Vy B vy A +w 1 ⁇ mvy hor +h 1 ⁇ mvy ver (38)
  • Vx C vx A +w 2 ⁇ mvx hor +h 2 ⁇ mvx ver (39)
  • Vy C vy A +w 2 ⁇ mvy hor +h 2 ⁇ mvy ver (40)
  • Vx C vx B +(w 2 -w 1 ) ⁇ mvx hor +(h 2 +h 1 ) ⁇ mvx ver (41)
  • Vy C vy B +(w 2 -w 1 ) ⁇ mvy hor +(h 2 +h 1 ) ⁇ mvy ver (42)
  • the decoding device may obtain motion vectors of all control points from the motion estimation search; motion vectors of all control points may be obtained from surrounding image blocks; all control may be calculated according to the affine transformation model The motion vector of the point; the motion vector of the partial control point can be obtained by motion estimation, and the motion vector of other control points can be obtained from the adjacent image block; the motion vector of the partial control point can be obtained by affine motion estimation, according to the affine transformation model The motion vectors of the other control points are calculated; the motion vectors of the partial control points can be obtained from the adjacent image blocks, and the motion vectors of the other control points are calculated according to the affine transformation model; however, the present invention is not limited thereto.
  • the first preset value may be determined as the motion vector precision of the affine image block; or the motion vector accuracy of the affine image block may be determined according to the characteristics of the adjacent image block of the affine image block.
  • the neighboring image block is an image block that is spatially and/or temporally adjacent to the affine image block.
  • the value of the motion vector of the Affine block may be an integer.
  • the motion vector is called the integer pixel precision, that is, the pixel precision is 1; the value of the motion vector may also be a non-integer, and the motion vector is called the sub-pixel precision. , including 1/2, 1/4, 1/8 and other precision.
  • Figure 11 shows a 4 ⁇ 4 image block, where x represents the pixel at the entire pixel position, and the acquired image is only the pixel at the entire pixel position.
  • O represents a pixel at a 1/2 precision position and needs to be interpolated by pixels at the entire pixel position. Pixel values at other precision positions need to be further interpolated using integer pixel precision pixels or 1/2 precision pixels. If the motion vector of the current pixel is an integer, it points to the position where ⁇ in the reference image, and if the motion vector of the current pixel is 1/2 precision, it points to the position where O in the reference image.
  • the motion vector precision of an Affine block refers to the highest precision of the motion vector of all pixels in the Affine block.
  • the motion vector accuracy of the Affine block can be preset, such as integer pixel precision, 1/2, 1/4, 1/8, 1/16, etc. It may also be determined according to the characteristics of the adjacent image block of the Affine block. For example, if the surrounding image is smoother and the current Affine block can be predicted to be smoother, a higher motion vector precision may be selected, for example, 1/8, 1/16. Accuracy, etc., instead use lower motion vector accuracy, such as integer pixel precision, 1/2 precision, and so on. The accuracy obtained is expressed by MvAc.
  • S730 specifically includes:
  • S1201 Perform equal-scale adjustment of the first horizontal distance according to the ratio of the motion vector precision to the first component of the motion vector difference to obtain a length of the affine motion compensation sub-image block in a horizontal direction, and determine the affine image block. Whether the length in the horizontal direction is an integral multiple of the length of the horizontal direction of the affine motion compensating sub-image block, and if not, adjusting the length of the horizontal direction of the affine motion compensating sub-image block to make the level of the affine image block The length of the direction is an integral multiple of the length of the adjusted horizontal direction of the affine motion compensation sub-image block.
  • the ratio of the motion vector precision to the first component of the motion vector difference is a ratio of the motion vector precision to the first component of the motion vector difference
  • the product of the ratio and the first horizontal distance is the affine motion compensation
  • the length of the horizontal direction of the sub-image block may also be referred to as the initial length in the horizontal direction; it can be understood that the initial length of the horizontal direction of the affine motion compensation sub-image block may be a non-integer in some cases, and is required at this time.
  • the initial length value is 8.35 (ie, the length of 8.35 unit pixels), and 8 is directly taken as the affine
  • the initial length value is 8.35 (ie, the length of 8.35 unit pixels)
  • 8 is directly taken as the affine
  • the adjustment method is a method of gradually increasing/decreasing the initial length of the horizontal direction or the initial length of the horizontal direction, that is, if it is determined that the length of the horizontal direction of the affine image block is not the affine motion compensation sub-image.
  • the length of the horizontal direction of the affine motion compensating sub-image block is increased/decreased by one or more unit length adjustments, and then the above scheme is cyclically executed until the affine image block
  • the length in the horizontal direction is an integral multiple of the adjusted length of the horizontal direction of the affine motion compensation sub-image block.
  • the unit length is usually one unit pixel, that is, the length of the horizontal direction of the affine motion compensation sub-image block is adjusted by one/minus one, so that the versatility is not lost, and it can be said that the imitation is
  • the length of the horizontal direction of the motion compensation sub-image block is adjusted according to a fixed step size, and the step size is an adjustment value, that is, the horizontal direction of the affine motion compensation sub-image block in each cycle
  • the basic unit of the length is adjusted or called the amplitude; the step is usually one unit pixel as described above, and may be other values, such as two pixel units.
  • the step/adjustment value used in the above adjustment may also compensate for the parity variation of the initial length in the horizontal direction of the affine motion compensation image block, for example, when the affine motion compensates the horizontal direction of the sub-image block.
  • the initial length is an odd number, and an odd step is selected.
  • an odd number of unit lengths such as a unit length, is used to adjust the step size.
  • the even number is selected.
  • the step size for example, the step size of an even number of unit lengths.
  • the decoding end may refer to the selection, or may be obtained by using a neighboring block motion vector precision value.
  • the derivation is determined according to a ratio relationship between the affine image block and the length of the affine motion compensated sub-image block in the horizontal direction. For example, if the ratio is smaller than the threshold, the selection is decreased, otherwise the selection is increased.
  • the length of the horizontal direction of the affine image block is not an integer multiple of the length of the horizontal direction of the affine motion compensation sub-image block, and the affine motion compensation sub-image block is compensated for
  • the length of the horizontal direction is increased by an adjustment of a preset unit length, and then the above-described scheme is cyclically executed until the length of the horizontal direction of the affine image block is the adjusted length of the horizontal direction of the affine motion compensation sub-image block. Integer multiple.
  • the length of the horizontal direction of the affine motion compensation sub-image block may be adjusted toward a direction closest to the value of the length of the horizontal direction of the affine image block, for example, the imitation
  • the length of the horizontal motion direction of the motion compensation sub-image block is 7, and the length of the horizontal direction of the affine image block is 16, and at this time, the length of the horizontal direction of the affine motion compensation sub-image block is increased to 8, thereby
  • the length of the affine motion compensating sub-image block in the horizontal direction is 5, and at this time, the length of the horizontal direction of the affine motion compensating sub-image block is reduced to 4, so that 16 can be divisible.
  • the affine motion compensator is 6 the length of the horizontal direction of the affine image block is 16, and the two adjacent values of the adjacent length 6 and divisible by 16 are 4 and 8, respectively, in this case, according to the codec end.
  • the demand selection is adjusted in a certain direction. For example, if a low delay is required, the adjustment in the direction of increasing may be selected at this time, and if the quality is required, the adjustment is made in the decreasing direction, and the present invention is not limited thereto.
  • the codec may be The same table is respectively established to allow the minimum integer divisor, for example, 2 N is the starting value, and the possible maximum length in the horizontal direction of the affine image block is divided into a plurality of intervals, and the span of the interval is 2 N+i . i ⁇ (0, (log 2 Wmax)-1), W max is the maximum possible length of the affine image block in the horizontal direction.
  • the upper and lower limit acquisition rules may be referred to the two ends of the codec, and may be explicitly indicated by the code stream, or the adjacent upper or lower limit value may be selected by rounding.
  • the final length of the horizontal direction of the affine motion compensation sub-image block can be determined by using a look-up table according to the initial length of the horizontal direction of the affine motion compensation sub-image block, so that the foregoing step S1201 can be replaced.
  • the step of adjusting the length of the affine motion compensated sub-image block in the horizontal direction is performed to reduce system complexity and reduce computation time.
  • step S1201 in addition to determining that the length of the horizontal direction of the affine image block is an integer multiple of the length of the horizontal direction of the affine motion compensation sub-image block, It is necessary to determine whether the length of the horizontal direction of the affine motion compensating sub-image block is an integer multiple of a predetermined length S that is convenient for calculation, that is, whether the length of the horizontal direction of the affine motion compensating sub-image block is determined to satisfy the condition:
  • the length of the horizontal direction of the affine image block is an integral multiple of the length of the affine motion compensating sub-image block in the horizontal direction, and (2) the length of the affine motion compensating sub-image block in the horizontal direction is a predetermined length Integer multiple of S;
  • the length of the horizontal direction of the affine motion compensating sub-image block is adjusted so as to satisfy the above condition (1) and condition (2), that is, the length of the horizontal direction of the affine image block is the imitation
  • the motion compensation sub-image block is an integer multiple of the length of the adjusted horizontal direction
  • the length of the adjusted horizontal direction of the affine motion compensation sub-image block is an integer multiple of the preset length.
  • the order in which the above conditions (1) and (2) are satisfied and the order in which the length of the affine motion compensation sub-image block is adjusted in the horizontal direction according to the judgment result can be arbitrarily exchanged.
  • the first adjustment can be called The first adjustment
  • the second adjustment (if needed) is called a secondary adjustment.
  • the length of the horizontal direction of the affine motion compensated sub-image block determined by the foregoing manner needs to be a limiting operation, that is, the M is located between the lower limit Tm and the upper limit W by a comparison manner, and the Tm is a preset value. , usually 4, W is the length of the affine image block in the horizontal direction.
  • S1203 Perform equal-scale adjustment of the first vertical distance according to the ratio of the motion vector precision to the second component of the motion vector difference to obtain a length of the affine motion compensation sub-image block in a vertical direction, and determine the affine image. Whether the length of the vertical direction of the block is an integral multiple of the vertical length of the affine motion compensating sub-image block, and if not, adjusting the length of the affine motion compensating sub-image block in the vertical direction to make the imitation The length of the vertical direction of the image block is an integral multiple of the length of the adjusted vertical direction of the affine motion compensated sub-image block.
  • the ratio of the motion vector precision to the second component of the motion vector difference is a ratio of the motion vector precision to the second component of the motion vector difference
  • the ratio of the ratio to the first vertical distance product is the affine motion compensation
  • the length of the vertical direction of the sub-image block may also be referred to as the initial length of the vertical direction; it can be understood that the initial length of the vertical direction of the affine motion compensated sub-image block may be a non-integer in some cases. In this case, the initial length needs to be rounded. To ensure the accuracy, it is usually rounded down, that is, the small part is directly discarded. For example, the initial length value is 8.35 (that is, the length of 8.35 unit pixels), and 8 is taken directly.
  • the rounding principle of rounding is also adopted, that is, the fractional part is less than 5, and is rounded down, and the fractional part is greater than 5, and then rounded up, for example, when calculating the obtained length is 8.86, 9 taking as its length, in order to ensure efficiency, minimum length should not be less than the initial predetermined value, for example, not less than 2 N or the like 2,4,8 preset
  • the preset value is typically set to a length of 4, not in a vertical direction should be greater than the affine-transformed image block.
  • the adjustment method is a method of gradually increasing/decreasing the initial length of the vertical direction or the initial length of the vertical direction, that is, if it is determined that the length of the vertical direction of the affine image block is not the affine motion.
  • the length of the affine image block in the vertical direction is an integral multiple of the adjusted length of the vertical direction of the affine motion compensating sub-image block.
  • the unit length is usually one unit pixel, that is, the length of the vertical direction of the affine motion compensation sub-image block is adjusted by one/minus one.
  • the length of the vertical direction of the affine motion compensation sub-image block is increased/decreased according to a fixed step size
  • the step size is an adjustment value, that is, each The basic unit or amplitude of the vertical direction of the affine motion compensation sub-image block is performed in the loop;
  • the step length is usually one unit pixel as described above, and may be other values, such as two pixel units.
  • the step/adjustment value used in the above adjustment may also compensate for the parity variation of the initial length of the vertical direction of the sub-image block according to the affine motion, for example, when the affine motion compensates the sub-image block.
  • the initial length in the straight direction is an odd number
  • an odd step size is selected, for example, an odd number of unit lengths, such as a unit length, is adjusted in steps, when the initial length of the vertical direction of the affine motion compensating sub-image block is an even number, Then select an even step size, for example, an even number of steps of unit length.
  • the adjustment is increased or decreased may be selected according to a common agreement between the decoding end and the encoding end, or may be explicitly indicated by the encoding end in the code stream, the decoding end refers to the selection, or may be derived by the neighboring block motion vector precision values. Or according to the ratio relationship between the affine image block and the length of the affine motion compensation sub-image block in the vertical direction, for example, the ratio is less than the threshold, then the selection is decreased, otherwise the selection is increased.
  • the length of the vertical direction of the affine image block is not an integer multiple of the length of the vertical direction of the affine motion compensation sub-image block, and the affine motion compensation sub-image is The length of the vertical direction of the block is adjusted by adding a preset unit length, and then the above-described scheme is cyclically executed until the length of the vertical direction of the affine image block is the vertical direction adjustment of the affine motion compensation sub-image block. An integer multiple of the length after.
  • the length of the vertical direction of the affine motion compensating sub-image block may be adjusted toward a direction closest to the length of the vertical direction of the affine image block, for example, the imitation
  • the length of the vertical direction of the motion compensation sub-image block is 7, and the length of the vertical direction of the affine image block is 16, at which time the length of the vertical direction of the affine motion compensation sub-image block is increased by one. 8, so that it can be divided by 16; similarly, the length of the vertical direction of the affine motion compensating sub-image block is 5, and at this time, the length of the vertical direction of the affine motion compensating sub-image block is reduced to 4, Thus, 16 can be divisible.
  • the length of the vertical direction of the affine motion compensating sub-image block is equal to the distance between two adjacent values adjacent to and divisible from the length of the vertical direction of the affine image block, for example, the affine motion
  • the length of the vertical direction of the compensated sub-image block is 6, the length of the vertical direction of the affine image block is 16, and the two adjacent values of the adjacent length 6 and divisible by 16 are 4 and 8, respectively.
  • the selection is adjusted in a certain direction. For example, if a low delay is required, the adjustment may be selected in the increasing direction. If high quality is required, the adjustment is selected in the decreasing direction. No restrictions.
  • step S1203 when it is determined that the length of the vertical direction of the affine image block is not an integer multiple of the length of the vertical direction of the affine motion compensation sub-image block, in order to further simplify the algorithm,
  • the codec side respectively establishes the same table to allow the minimum integer divisor, for example, 2 N is the starting value, and divides the maximum possible length of the affine image block in the vertical direction into multiple intervals, and the span of the interval is 2 N +i , i ⁇ (0, (log 2 Wmax)-1), W max is the maximum possible length of the affine image block in the vertical direction.
  • the upper and lower limit acquisition rules may be referred to the two ends of the codec, and may be explicitly indicated by the code stream, or the adjacent upper or lower limit value may be selected by rounding.
  • the final length of the vertical direction of the affine motion compensation sub-image block can be determined by using a look-up table according to the initial length of the vertical direction of the affine motion compensation sub-image block, so that the foregoing steps can be replaced.
  • the step of adjusting the length of the affine motion compensating sub-image block in the vertical direction in S1203 reduces system complexity and computation time.
  • the length of the vertical direction of the affine image block is an integer of the length of the vertical direction of the affine motion compensated sub-image block.
  • the length of the vertical direction of the affine image block is an integral multiple of the length of the affine motion compensating sub-image block in the vertical direction, and (2) the length of the affine motion compensating sub-image block in the vertical direction Is an integer multiple of the predetermined length S;
  • adjusting the length of the affine motion compensating sub-image block in the vertical direction so as to satisfy the above condition (1) and condition (2) that is, the length of the affine image block in the vertical direction is
  • the order in which the above conditions (1) and (2) are satisfied and the order in which the length of the affine motion compensation sub-image block is adjusted in the horizontal direction according to the judgment result can be arbitrarily exchanged.
  • the first adjustment can be called The first adjustment
  • the second adjustment (if needed) is called a secondary adjustment.
  • the above steps S1201 and S1203 are applicable to the three control point scenes in the foregoing scheme 1.
  • the lengths of the affine motion compensation sub-image blocks in the horizontal direction and the vertical direction are respectively calculated.
  • the length of the affine motion compensation sub-image block in the horizontal direction may be separately calculated using only step S1201 or S1203 or the affine motion compensation sub-image block is vertical.
  • the length of the vertical direction of the affine motion compensation sub-image block determined by the foregoing manner needs to be a limiting operation, that is, the M is located between the lower limit Tm and the upper limit W by comparing, and the Tm is preset.
  • the value, usually 4 is the length of the affine image block in the vertical direction.
  • the Affine block is divided into a plurality of Affine-MC blocks according to the previously obtained desired motion vector precision MvAc, and the motion vector accuracy of each Affine-MC block is guaranteed to reach MvAc, where ⁇ mv hor and ⁇ mv ver The minimum value is not less than MvAc.
  • the horizontal distance between the first control point and the second control point is W
  • the vertical distance between the third control point and the fourth control point is H, assuming Affine-
  • the width of the MC block is aMcW, or is recorded as M
  • the height is aMcH, or is denoted as N;
  • the motion vector difference of the affine image block determined based on the three control points and the size of the affine motion compensation sub-image block can be obtained by the following formula (43), that is, according to formula (43) Determine M and N:
  • the motion vector difference of the affine image block determined based on the two control points in the horizontal direction and the size of the affine motion compensation sub-image block can be obtained by the following formula (46), that is, according to the formula (46) Determine M and N:
  • the motion vector difference of the affine image block determined based on the two control points in the vertical direction, and the size of the affine motion compensation sub-image block obtained may be implemented by the following formula (48), that is, according to Equation (48) determines M and N:
  • M, N is convenient for calculation, that is, whether an affine image having a width W and a height H can be obtained.
  • the block is evenly divided into an integer number of affine motion compensated sub-image blocks, that is, whether W can be divisible by M, whether H can be divisible by N, and if it cannot be divisible, the values that cannot be divisible, ie, M and/or N are performed. Adjusted so that W can be divisible by M, H can be divisible by N, and within the limit range Tm ⁇ M ⁇ W, Tn ⁇ N ⁇ H.
  • the adjustment method can be:
  • a limit is imposed on the upper and lower limits of M and N such that Tm ⁇ M ⁇ W, Tn ⁇ N ⁇ H, and Tm and Tn are generally set to 4.
  • the adjustment method can be:
  • a limit is imposed on the upper and lower limits of M and N such that Tm ⁇ M ⁇ W, Tn ⁇ N ⁇ H, and Tm and Tn are generally set to 4.
  • the decoding device determines the affine motion compensation by determining the motion vector difference of the affine image block, the motion vector accuracy, the distance between the control points, and the size of the affine image block.
  • the sub-image block is sized such that the affine image block can be evenly divided into a plurality of affine motion compensated sub-image blocks of the same size, thereby facilitating hardware/software implementation of the method while reducing complexity.
  • the invention can reduce the complexity of the coding end by 50%, the complexity of the decoding end by 70%, and maintain the performance of 90-95%, which can make the motion compensation prediction technology based on the Affine model can be effectively invested. Practical applications.
  • S740 includes:
  • S1305 Decode each of the affine motion compensation sub-image blocks according to the motion compensation prediction signal of each affine motion compensation sub-image block.
  • each Affine-MC block may include a plurality of pixel points, and a motion vector of one pixel point needs to be selected from each Affine-MC as a motion vector of the Affine-MC block.
  • a motion vector of a pixel at a center position of the Affine-MC block may be selected as a motion vector of the Affine-MC block, and an average value of motion vectors of all pixels in the Affine-MC block may be selected.
  • the motion vector of the Affine-MC block the motion vector of the pixel located at the upper left corner of the Affine-MC block can be selected as the motion vector of the Affine-MC block, but the present invention is not limited thereto.
  • filtering a signal of a boundary pixel point of each affine motion compensation sub-image block optionally, filtering a signal of a boundary pixel point of each affine motion compensation sub-image block, where the boundary pixel point is a line located at a boundary of each affine motion compensation sub-image block Or multiple rows of pixels.
  • the signal of the boundary pixel includes a motion compensation prediction signal and/or a reconstruction signal, where the reconstruction signal is a sum of the motion compensation prediction signal and the reconstructed residual signal.
  • a thick solid line block represents an Affine block
  • a thin solid line block represents an Affine-MC block
  • a broken line frame represents a pixel of a boundary of an adjacent Affine-MC block
  • an intersection point represents a pixel.
  • the area of the dotted line frame in FIG. 11 includes two or two columns of pixels in the boundary of the adjacent Affine-MC blocks, and may also include one row or one column, three rows or three columns, and the like of the respective boundaries.
  • the prediction signals taken from the reference image are not adjacent in the reference image, which may cause discontinuities between prediction signals of adjacent Affine-MC block boundaries, As a result, the discontinuity of the residuals affects the image encoding/decoding performance of the residual, so it is considered to filter the motion compensated prediction signal at the boundary of the Affine-MC block.
  • the reconstructed signal is typically obtained by adding a motion compensated prediction signal to the reconstructed residual signal.
  • the residual signal typically uses lossy coding, which results in distortion between the reconstructed residual signal and the original residual signal.
  • the direction of distortion of pixels at the boundary of adjacent Affine-MC blocks may be inconsistent. For example, the pixels on the right side of the first Affine-MC block become larger due to distortion, and the pixels on the left side of the adjacent Affine-MC block on the right side become smaller due to distortion. This can result in discontinuities in pixel values at the boundaries of the reconstructed pixels of the Affine-MC block, affecting subjective and objective effects. Therefore, the reconstructed signal needs to be filtered.
  • the filtering may be performed by a low-pass filter such that the pixel value of the boundary region changes more gently, for example, using a Gaussian filter, but the present invention is not limited thereto.
  • the overlapped block motion compensation (abbreviated as “OBMC” method may be used for filtering.
  • the pixel to be filtered uses the motion vector of its adjacent Affine-MC block to perform motion. Compensating the prediction, weighting and averaging the obtained motion compensation prediction signal and the motion compensation prediction signal obtained by using the motion vector of the pixel to be filtered to obtain a final motion compensation prediction signal.
  • the decoding device determines the size of the affine motion compensation sub-image block by determining the motion vector difference of the affine image block, the motion vector precision, and the distance between the control points, and according to the simulation
  • the size of the projected image block and the size relationship of the affine motion compensated sub-image block are further adjusted so that the size of the affine motion compensated sub-image block is more easily realized while reducing complexity.
  • the invention can reduce the complexity of the coding end by 50%, the complexity of the decoding end by 70%, and maintain the performance of 90-95%, which can make the motion compensation prediction technology based on the Affine model can be effectively invested. Practical applications.
  • the decoding method in the present invention may also be:
  • a size of the affine motion compensating sub-image block in the affine image block according to the motion vector difference, the motion vector precision, and a distance between the control points in the affine image block, the size including the length in the horizontal direction And a length in the vertical direction such that the length of the affine image block in the horizontal direction is an integral multiple of the length of the affine motion compensating sub-image block in the horizontal direction, and the affine image block is in the vertical direction
  • the length is an integer multiple of the length of the affine motion compensated sub-image block in the vertical direction, wherein the control point is a pixel point for determining the motion vector difference;
  • the affine image block is subjected to decoding processing according to the size of the affine motion compensated sub-image block.
  • a size of the affine motion compensating sub-image block in the affine image block the size including a length in a horizontal direction, and a length in a vertical direction, and the horizontal direction of the affine image block
  • the length of the affine motion compensated sub-image block is an integer multiple of the length in the horizontal direction
  • the length of the affine image block in the vertical direction is an integer of the length of the affine motion compensated sub-image block in the vertical direction.
  • the affine image block is subjected to decoding processing according to the size of the affine motion compensated sub-image block.
  • the decoding end can directly determine the size of the affine motion compensation sub-image block by directly using the parameters transmitted from the encoding end to the decoding end without recalculating, thereby further reducing the computational complexity.
  • FIG. 14 shows a schematic flow chart of a method of video image decoding according to an embodiment of the present invention.
  • the method shown in FIG. 14 may be performed by an encoding device, such as an encoder similar to a decoder, which generally includes a prediction processing unit, a residual generation unit, a transform processing unit, a quantization unit, an inverse quantization unit, an inverse transform processing unit, a reconstruction unit, and filtering.
  • Unit decoded picture buffer, and entropy coding unit.
  • the entropy coding unit includes a regular CABAC codec engine and a bypass codec engine.
  • the prediction processing unit includes an inter prediction processing unit and an intra prediction processing unit.
  • the inter prediction processing unit includes a motion estimation unit and a motion compensation unit.
  • the encoder may contain more, fewer, or different functional components.
  • the encoding method of the present invention is mainly applied in the process of inter-frame prediction processing unit for inter-frame prediction, and the detailed structure of each functional unit of the encoder can refer to the provisions and descriptions in the prior art such as the H.265 standard.
  • the present invention is not described again.
  • the present invention merely illustrates how to implement the basic process of adaptively determining the size and encoding of the affine motion compensated sub-image block in the method of the embodiment of the present invention.
  • the method 1400 includes:
  • S1450 Determine, according to the motion vector difference, the motion vector precision, the distance between the control points in the affine image block, and the size of the affine image block, the affine motion compensation sub-image block in the affine image block. a size including a length in the horizontal direction and a length in the vertical direction such that the length of the affine image block in the horizontal direction is an integral multiple of the length of the affine motion compensating sub-image block in the horizontal direction, and The length of the affine image block in the vertical direction is an integer multiple of the length of the affine motion compensation sub-image block in the vertical direction, wherein the control point is a pixel point for determining the motion vector difference;
  • S1470 Perform encoding processing on the affine image block according to the size of the affine motion compensation sub-image block.
  • the decoding device determines a motion vector difference of the affine image block according to the determined control point, and determines a motion vector accuracy of the affine image block, according to the determined motion vector difference, the motion vector precision, and the control point Determining a size of the affine motion compensating sub-image block in the affine image block, the size of the affine image compensating sub-image block is a dividing size of the affine image block; Dividing the size, the affine image block is divided into a plurality of affine motion compensated sub-image blocks having the same size, and then the affine image block is encoded based on the affine motion compensated sub-image block.
  • the inter prediction processing unit uses the motion image coding difference of the determined affine image block, the motion vector precision and the distance between the control points, and the size of the affine image block by running the video image coding method of the embodiment of the present invention. Determining a size of the affine motion compensating sub-image block, and dividing the affine image block into a plurality of affine motion compensating sub-images of uniform size according to the size of the affine motion compensating sub-image block, and then performing encoding processing, thereby During the encoding process, an appropriate affine motion compensated sub-image block can be adaptively selected according to the change of the above parameters, thereby reducing the coding complexity and improving the coding performance, ie, compression efficiency.
  • S1410 comprises:
  • the first control point and the second control point have a first horizontal distance
  • the third control point and the fourth control point have a first vertical distance
  • Scheme 1 A method for determining a motion vector difference of an affine image block based on three control points
  • a motion vector difference determination method for an affine image block based on two control points in a horizontal direction includes: determining the motion vector according to a difference between motion vectors of a first control point and a second control point located on a same horizontal line The first component of the difference.
  • a motion vector difference determination method for an affine image block based on two control points in a vertical direction comprising: determining, according to a difference between motion vectors of a third control point and a fourth control point on the same vertical line The second component of the motion vector difference.
  • the first component of the motion vector difference refers to a horizontal component of the motion vector difference
  • the second component of the motion vector difference refers to a vertical component of the motion vector difference.
  • the first component of the motion vector difference and the second component of the motion vector difference together represent a motion vector difference of the affine image block
  • the first component of the motion vector difference and the motion vector difference The second component separately reflects the motion vector difference of the affine image block.
  • the motion vector difference of the affine image block includes the first component of the motion vector difference and the second component of the motion vector difference; in the scheme 2, the motion vector difference of the affine image block A first component comprising a motion vector difference; in scheme 3, the motion vector difference of the affine image block comprises a third component of the motion vector difference.
  • the first, second, third, and fourth are only for distinguishing pixel points, and should not constitute any limitation on the protection scope of the present invention.
  • the first control point may also be referred to as The second control point, the second control point may become the first control point or the like.
  • the first control point and the third control point are the same pixel point, that is, the number of selected control points is three, and among the three control points One control point is on the same horizontal line as one of the other two control points, and is located on the same vertical line as the other of the other two control points.
  • the first control point, the second control point, the third control point, and the fourth control point are vertices of the Affine block, and respectively, four vertices of an Affine block are respectively Marked as the top left corner, the bottom left corner, the top right corner, and the bottom right corner, then:
  • any three vertices located in two orthogonal directions may be selected to determine a motion vector difference of the Affine block. For example, an upper left corner vertex, a lower left corner vertex, and an upper right corner vertex may be selected, and the upper left corner may be selected. Vertex, upper right corner vertex and lower right corner vertex;
  • any two vertices located on the same horizontal line may be selected to determine a motion vector difference of the Affine block, for example, an upper left corner vertex and an upper right corner vertex may be selected, or a lower left corner vertex and a lower right corner vertex may be selected;
  • any two vertices located on the same vertical line may be selected to determine the motion vector difference of the Affine block, for example, the upper left corner vertex and the lower left corner vertex may be selected, or the upper right corner vertex and the lower right corner vertex may be selected.
  • the invention is not limited thereto.
  • the components in the two directions (horizontal direction, vertical direction, or become, x direction, y direction) of the motion vector of the first control point and the second control point may be
  • the difference of the components in any one direction is determined as the first component of the motion vector difference of the Affine block, and may be in any one of the components in the two directions of the motion vector of the third control point and the fourth control point.
  • the difference of the components is determined as the second component of the motion vector difference of the Affine block, and the manner of determining the motion vector difference is applicable to the foregoing schemes 1, 2, and 3; and may also be based on actual requirements for coding complexity and coding performance.
  • the value between the two differences of the components in the two directions of the motion vector is determined as the second component, which is not limited in the present invention.
  • the motion vector of each of the first control point to the fourth control point includes two components, that is, a horizontal component and a vertical component, and therefore, in the foregoing steps, according to the first control point located on the same horizontal line Determining the first component of the motion vector difference from the difference of the motion vector of the second control point, and determining the difference according to the difference between the motion vector of the third control point and the fourth control point on the same vertical line
  • the second component of the motion vector difference can be implemented in the following ways:
  • determining a second horizontal component difference and a second vertical component difference of the motion vector of the third control point and the fourth control point, the second horizontal component difference and the second vertical component difference The maximum value in the value is determined as the second component of the motion vector difference.
  • obtaining the motion vector difference value according to the affine model that is, determining the difference of the motion vector by determining the affine transformation parameter of the pixel point in the affine image block, It is noted that the pixels in the affine image block have the same affine transformation parameters;
  • determining a first horizontal component difference value and a first vertical component difference value of the motion vector of the first control point and the second control point specifically: according to the affine transformation parameter and the first Determining the first horizontal component difference value and the first vertical component difference value in a horizontal distance
  • determining a second horizontal component difference value of the motion vector of the third control point and the fourth control point determining a second vertical component difference value, specifically: determining the second horizontal component difference value and the second vertical component difference value according to the affine transformation parameter and the first vertical distance.
  • the affine transformation model may adopt a 6-parameter affine transformation model in the prior art, or a 4-parameter or 2-parameter affine transformation model, and a main application of a 6-parameter affine transformation model.
  • the 4-parameter affine transformation model is mainly applied to the scenarios of the two control points in the foregoing schemes 2 and 3.
  • the motion vector of the first control point, the motion vector of the second control point, the motion vector of the third control point, and the motion vector of the fourth control point may be determined. Thereby determining a motion vector difference of the affine image block;
  • the difference between the horizontal component of the motion vector of the first control point and the horizontal component of the motion vector of the second control point is determined as the first horizontal component difference; a difference between a vertical component of the motion vector of the first control point and a vertical component of the motion vector of the second control point is determined as the first vertical component difference value; a level of the motion vector of the third control point a difference between a component and a horizontal component of a motion vector of the fourth control point is determined as the second horizontal component difference; a vertical component of the motion vector of the third control point and a vertical motion vector of the fourth control point
  • the difference of the direct components is determined as the second vertical component difference.
  • the difference between the horizontal component of the motion vector of the first control point and the horizontal component of the motion vector of the second control point is determined as the first horizontal component difference;
  • the difference between the vertical component of the motion vector of the point and the vertical component of the motion vector of the second control point is determined as the first vertical component difference.
  • the difference between the horizontal component of the motion vector of the third control point and the horizontal component of the motion vector of the fourth control point is determined as the second horizontal component difference;
  • the difference between the vertical component of the motion vector of the point and the vertical component of the motion vector of the fourth control point is determined as the second vertical component difference.
  • the motion vector of the control point can be directly determined.
  • the first component and the second component of the motion vector difference of the Affine block can be directly obtained.
  • the first control point and the second control point are two adjacent pixel points
  • the third control point and the fourth control point are two adjacent pixel points.
  • the control point is not necessarily selected in the four corner points of the affine image block, also called the vertices, but may be set according to the codec end, or explicitly indicated in the code stream by signaling, or according to
  • the control point estimate of the surrounding affine image block is either a copy of the arbitrary position in the affine image block, in this case; determining the first horizontal and vertical component difference, and the second horizontal and vertical component difference The value is specifically:
  • the above is the three control points of the foregoing scheme 1 as an example.
  • the difference between the three control points in the scheme 1 and the scheme 1 is that only the scheme 1 is used.
  • the first component difference or the second component difference is used as the motion vector difference of the affine image of the two control points.
  • the encoding device may obtain motion vectors of all control points from the motion estimation search; motion vectors of all control points may be obtained from surrounding image blocks; all control may be calculated according to the affine transformation model The motion vector of the point; the motion vector of the partial control point can be obtained by motion estimation, and the motion vector of other control points can be obtained from the adjacent image block; the motion vector of the partial control point can be obtained by affine motion estimation, according to the affine transformation model The motion vectors of the other control points are calculated; the motion vectors of the partial control points can be obtained from the adjacent image blocks, and the motion vectors of the other control points are calculated according to the affine transformation model; however, the present invention is not limited thereto.
  • the first preset value may be determined as the motion vector precision of the affine image block; or the motion vector accuracy of the affine image block may be determined according to the characteristics of the adjacent image block of the affine image block.
  • the neighboring image block is an image block that is spatially and/or temporally adjacent to the affine image block.
  • S1450 specifically includes:
  • S1501 Perform equal-scale adjustment on the first horizontal distance according to the ratio of the motion vector precision to the first component of the motion vector difference to obtain a length of the affine motion compensation sub-image block in a horizontal direction, and determine the affine image block. Whether the length in the horizontal direction is an integral multiple of the length of the horizontal direction of the affine motion compensating sub-image block, and if not, adjusting the length of the horizontal direction of the affine motion compensating sub-image block to make the level of the affine image block The length of the direction is an integral multiple of the length of the adjusted horizontal direction of the affine motion compensation sub-image block.
  • the ratio of the motion vector precision to the first component of the motion vector difference is a ratio of the motion vector precision to the first component of the motion vector difference
  • the product of the ratio and the first horizontal distance is the affine motion compensation
  • the length of the horizontal direction of the sub-image block may also be referred to as the initial length in the horizontal direction; it can be understood that the initial length of the horizontal direction of the affine motion compensation sub-image block may be a non-integer in some cases, and is required at this time.
  • the initial length value is 8.35 (ie, the length of 8.35 unit pixels), and 8 is directly taken as the affine
  • the initial length value is 8.35 (ie, the length of 8.35 unit pixels)
  • 8 is directly taken as the affine
  • the adjustment method is a method of gradually increasing/decreasing the initial length of the horizontal direction or the initial length of the horizontal direction, that is, if it is determined that the length of the horizontal direction of the affine image block is not the affine motion compensation sub-image.
  • the length of the horizontal direction of the affine motion compensating sub-image block is increased/decreased by one or more unit length adjustments, and then the above scheme is cyclically executed until the affine image block
  • the length in the horizontal direction is an integral multiple of the adjusted length of the horizontal direction of the affine motion compensation sub-image block.
  • the unit length is usually one unit pixel, that is, the length of the horizontal direction of the affine motion compensation sub-image block is adjusted by one/minus one, and the affine may be said to be versatile without loss of versatility.
  • the length of the vertical direction of the motion compensation sub-image block is increased/decreased according to a fixed step size, which is an adjustment value, that is, the vertical direction of the affine motion compensation sub-image block in each cycle
  • the length is a basic unit or amplitude; the step is usually one unit pixel as described above, and may be other values, such as two pixel units.
  • the step/adjustment value used in the above adjustment may also compensate for the parity variation of the initial length in the horizontal direction of the affine motion compensation image block, for example, when the affine motion compensates the horizontal direction of the sub-image block.
  • the initial length is an odd number, and an odd step is selected.
  • an odd number of unit lengths such as a unit length
  • the even number is selected.
  • the step size for example, the step size of an even number of unit lengths.
  • the adjustment is increased or decreased may be selected according to a common agreement between the decoding end and the encoding end, or may be explicitly indicated in the code stream at the encoding end, the decoding end refers to the selection, or may be deduced by the neighboring block motion vector precision values. Or according to the ratio relationship between the affine image block and the length of the affine motion compensation sub-image block in the horizontal direction, for example, the ratio is less than the threshold, then the selection is decreased, otherwise the selection is increased.
  • the length of the horizontal direction of the affine image block is not an integer multiple of the length of the horizontal direction of the affine motion compensation sub-image block, and the affine motion compensated sub-image block is compensated for
  • the length in the horizontal direction is increased by an adjustment of a preset unit length, and then the above-described scheme is cyclically executed until the length of the horizontal direction of the affine image block is an integer of the adjusted length of the horizontal direction of the affine motion compensation sub-image block. Times.
  • the length of the horizontal direction of the affine motion compensating sub-image block may be adjusted toward a direction closest to the length of the horizontal direction of the affine image block, for example, the affine motion.
  • the length of the horizontal direction of the compensated sub-image block is 7, and the length of the horizontal direction of the affine image block is 16, and at this time, the length of the horizontal direction of the affine motion compensated sub-image block is increased to 8, thereby being divisible. 16;
  • the length of the affine motion compensating sub-image block in the horizontal direction is 5, and at this time, the length of the horizontal direction of the affine motion compensating sub-image block is reduced to 4, so that 16 can be divisible.
  • the affine motion compensator is 6 the length of the horizontal direction of the affine image block is 16, and the two adjacent values of the adjacent length 6 and divisible by 16 are 4 and 8, respectively, in this case, according to the codec end.
  • the demand selection is adjusted in a certain direction. For example, if a low delay is required, the adjustment in the direction of increasing may be selected at this time, and if the quality is required, the adjustment is made in the decreasing direction, and the present invention is not limited thereto.
  • the codec may be The same table is respectively established to allow the minimum integer divisor, for example, 2 N is the starting value, and the possible maximum length in the horizontal direction of the affine image block is divided into a plurality of intervals, and the span of the interval is 2 N+i . i ⁇ (0, (log 2 Wmax)-1), W max is the maximum possible length of the affine image block in the horizontal direction.
  • the upper and lower limit acquisition rules may be referred to the two ends of the codec, and may be explicitly indicated by the code stream, or the adjacent upper or lower limit value may be selected by rounding.
  • the final length in the horizontal direction of the affine motion compensation sub-image block can be determined by using a look-up table according to the initial length of the horizontal direction of the affine motion compensation sub-image block, so that the foregoing step S1501 can be replaced.
  • the step of adjusting the length of the affine motion compensated sub-image block in the horizontal direction reduces system complexity and computation time.
  • step S1501 in addition to determining that the length of the horizontal direction of the affine image block is an integer multiple of the length of the horizontal direction of the affine motion compensation sub-image block, It is necessary to determine whether the length of the horizontal direction of the affine motion compensating sub-image block is an integer multiple of a predetermined length S that is convenient for calculation, that is, whether the length of the horizontal direction of the affine motion compensating sub-image block is determined to satisfy the condition:
  • the length of the horizontal direction of the affine image block is an integral multiple of the length of the affine motion compensating sub-image block in the horizontal direction, and (2) the length of the affine motion compensating sub-image block in the horizontal direction is a predetermined length Integer multiple of S;
  • the length of the horizontal direction of the affine motion compensating sub-image block is adjusted so as to satisfy the above condition (1) and condition (2), that is, the length of the horizontal direction of the affine image block is the imitation
  • the motion compensation sub-image block is an integer multiple of the length of the adjusted horizontal direction
  • the length of the adjusted horizontal direction of the affine motion compensation sub-image block is an integer multiple of the preset length.
  • the length of the horizontal direction of the affine motion compensated sub-image block determined by the foregoing manner needs to be a limiting operation, that is, the M is located between the lower limit Tm and the upper limit W by a comparison manner, and the Tm is a preset value. , usually 4, W is the length of the affine image block in the horizontal direction.
  • S1503 Perform equal-scale adjustment of the first vertical distance according to the ratio of the motion vector precision to the second component of the motion vector difference to obtain a length of the affine motion compensation sub-image block in a vertical direction, and determine the affine image. Whether the length of the vertical direction of the block is an integral multiple of the vertical length of the affine motion compensating sub-image block, and if not, adjusting the length of the affine motion compensating sub-image block in the horizontal direction to make the affine The length of the vertical direction of the image block is an integral multiple of the length of the adjusted vertical direction of the affine motion compensated sub-image block.
  • the ratio of the motion vector precision to the second component of the motion vector difference is a ratio of the motion vector precision to the second component of the motion vector difference
  • the ratio of the ratio to the first vertical distance product is the affine motion compensation
  • the length of the vertical direction of the sub-image block may also be referred to as the initial length of the vertical direction; it can be understood that the initial length of the vertical direction of the affine motion compensated sub-image block may be a non-integer in some cases. In this case, the initial length needs to be rounded. To ensure the accuracy, it is usually rounded down, that is, the small part is directly discarded. For example, the initial length value is 8.35 (that is, the length of 8.35 unit pixels), and 8 is taken directly.
  • the rounding principle of rounding is also adopted, that is, the fractional part is less than 5, and is rounded down, and the fractional part is greater than 5, and then rounded up, for example, when calculating the obtained length is 8.86, 9 taking as its length, in order to ensure efficiency, minimum length should not be less than the initial predetermined value, for example, not less than 2 N or the like 2,4,8 preset
  • the preset value is typically set to a length of 4, not in a vertical direction should be greater than the affine-transformed image block.
  • the adjustment method is a method of gradually increasing/decreasing the initial length of the vertical direction or the initial length of the vertical direction, that is, if it is determined that the length of the vertical direction of the affine image block is not the affine motion.
  • the unit length is usually one unit pixel, that is, the length of the vertical direction of the affine motion compensation sub-image block is adjusted by one/minus one, and in order not to lose versatility, it can be said that the imitation is
  • the length of the vertical direction of the motion compensation sub-image block is increased/decreased according to a fixed step size, which is an adjustment value, that is, the vertical of the affine motion compensation sub-image block in each cycle
  • the length of the direction is a basic unit or amplitude; the step is usually one unit pixel as described above, and may be other values, such as two pixel units.
  • the step/adjustment value used in the above adjustment may also compensate for the parity variation of the initial length of the vertical direction of the sub-image block according to the affine motion, for example, when the affine motion compensates the sub-image block.
  • the initial length in the straight direction is an odd number
  • an odd step size is selected, for example, an odd number of unit lengths, such as a unit length, is adjusted in steps, when the initial length of the vertical direction of the affine motion compensating sub-image block is an even number, Then select an even step size, for example, an even number of steps of unit length.
  • the adjustment is increased or decreased may be selected according to a common agreement between the decoding end and the encoding end, or may be explicitly indicated by the encoding end in the code stream, the decoding end refers to the selection, or may be derived by the neighboring block motion vector precision values. Or according to the ratio relationship between the affine image block and the length of the affine motion compensation sub-image block in the vertical direction, for example, the ratio is less than the threshold, then the selection is decreased, otherwise the selection is increased.
  • the length of the vertical direction of the affine image block is not an integer multiple of the length of the vertical direction of the affine motion compensation sub-image block, and the affine motion compensation sub-image is The length of the vertical direction of the block is adjusted by adding a preset unit length, and then the above-described scheme is cyclically executed until the length of the vertical direction of the affine image block is the vertical direction adjustment of the affine motion compensation sub-image block. An integer multiple of the length after.
  • the length of the vertical direction of the affine motion compensating sub-image block may be adjusted toward a direction closest to the length of the vertical direction of the affine image block, for example, the imitation
  • the length of the vertical direction of the motion compensation sub-image block is 7, and the length of the vertical direction of the affine image block is 16, at which time the length of the vertical direction of the affine motion compensation sub-image block is increased by one. 8, so that it can be divided by 16; similarly, the length of the vertical direction of the affine motion compensating sub-image block is 5, and at this time, the length of the vertical direction of the affine motion compensating sub-image block is reduced to 4, Thus, 16 can be divisible.
  • the length of the vertical direction of the affine motion compensating sub-image block is equal to the distance between two adjacent values adjacent to and divisible from the length of the vertical direction of the affine image block, for example, the affine motion
  • the length of the vertical direction of the compensated sub-image block is 6, the length of the vertical direction of the affine image block is 16, and the two adjacent values of the adjacent length 6 and divisible by 16 are 4 and 8, respectively.
  • the selection is adjusted in a certain direction. For example, if a low delay is required, the adjustment may be selected in the increasing direction. If high quality is required, the adjustment is selected in the decreasing direction. No restrictions.
  • step S1503 when it is determined that the length of the vertical direction of the affine image block is not an integer multiple of the length of the vertical direction of the affine motion compensation sub-image block, in order to further simplify the algorithm,
  • the codec side respectively establishes the same table to allow the minimum integer divisor, for example, 2 N is the starting value, and divides the maximum possible length of the affine image block in the vertical direction into multiple intervals, and the span of the interval is 2 N +i , i ⁇ (0, (log 2 Wmax)-1), W max is the maximum possible length of the affine image block in the vertical direction.
  • the upper and lower limit acquisition rules may be referred to the two ends of the codec, and may be explicitly indicated by the code stream, or the adjacent upper or lower limit value may be selected by rounding.
  • the final length of the vertical direction of the affine motion compensation sub-image block can be determined by using a look-up table according to the initial length of the vertical direction of the affine motion compensation sub-image block, so that the foregoing steps can be replaced.
  • the step of adjusting the length of the affine motion compensating sub-image block in the vertical direction in S1503 reduces system complexity and computation time.
  • the length of the vertical direction of the affine image block is an integer of the length of the vertical direction of the affine motion compensated sub-image block.
  • the length of the vertical direction of the affine image block is an integral multiple of the length of the affine motion compensating sub-image block in the vertical direction, and (2) the length of the affine motion compensating sub-image block in the vertical direction Is an integer multiple of the predetermined length S;
  • adjusting the length of the affine motion compensating sub-image block in the vertical direction so as to satisfy the above condition (1) and condition (2) that is, the length of the affine image block in the vertical direction is
  • the length of the vertical direction of the affine motion compensation sub-image block determined by the foregoing manner needs to be a limiting operation, that is, the M is located between the lower limit Tm and the upper limit W by comparing, and the Tm is preset.
  • the value, usually 4 is the length of the affine image block in the vertical direction.
  • the encoding device determines the size of the affine motion compensating sub-image block by determining the motion vector difference of the affine image block, the motion vector precision, and the distance between the control points, and Further adjustment according to the size relationship between the affine image block size and the affine motion compensation sub-image block makes the size of the affine motion compensation sub-image block easier to implement while reducing complexity.
  • the invention can reduce the complexity of the coding end by 50%, the complexity of the decoding end by 70%, and maintain the performance of 90-95%, which can make the motion compensation prediction technology based on the Affine model can be effectively invested. Practical applications.
  • S1470 includes:
  • S1601 Determine a motion vector of each affine motion compensation sub-image block in the affine motion compensation sub-image block;
  • S1603 Determine, according to the motion vector of each affine motion compensation sub-image block, a motion compensation prediction signal of each affine motion compensation sub-image block;
  • S1605 encode each affine motion compensation sub-image block according to the motion compensation prediction signal of each affine motion compensation sub-image block.
  • each Affine-MC block may include a plurality of pixel points, and a motion vector of one pixel point needs to be selected from each Affine-MC as a motion vector of the Affine-MC block.
  • a motion vector of a pixel at a center position of the Affine-MC block may be selected as a motion vector of the Affine-MC block, and an average value of motion vectors of all pixels in the Affine-MC block may be selected.
  • the motion vector of the Affine-MC block the motion vector of the pixel located at the upper left corner of the Affine-MC block can be selected as the motion vector of the Affine-MC block, but the present invention is not limited thereto.
  • filtering a signal of a boundary pixel point of each affine motion compensation sub-image block optionally, filtering a signal of a boundary pixel point of each affine motion compensation sub-image block, where the boundary pixel point is a line located at a boundary of each affine motion compensation sub-image block Or multiple rows of pixels.
  • the signal of the boundary pixel includes a motion compensation prediction signal and/or a reconstruction signal, where the reconstruction signal is a sum of the motion compensation prediction signal and the reconstructed residual signal.
  • the reconstructed signal is typically obtained by adding a motion compensated prediction signal to the reconstructed residual signal.
  • the residual signal typically uses lossy coding, which results in distortion between the reconstructed residual signal and the original residual signal.
  • the direction of distortion of pixels at the boundary of adjacent Affine-MC blocks may be inconsistent. For example, the pixels on the right side of the first Affine-MC block become larger due to distortion, and the pixels on the left side of the adjacent Affine-MC block on the right side become smaller due to distortion. This can result in discontinuities in pixel values at the boundaries of the reconstructed pixels of the Affine-MC block, affecting subjective and objective effects. Therefore, the reconstructed signal needs to be filtered.
  • the filtering may be performed by a low-pass filter such that the pixel value of the boundary region changes more gently, for example, using a Gaussian filter, but the present invention is not limited thereto.
  • the overlapped block motion compensation (abbreviated as “OBMC” method may be used for filtering.
  • the pixel to be filtered uses the motion vector of its adjacent Affine-MC block to perform motion. Compensating the prediction, weighting and averaging the obtained motion compensation prediction signal and the motion compensation prediction signal obtained by using the motion vector of the pixel to be filtered to obtain a final motion compensation prediction signal.
  • the decoding device determines the size of the affine motion compensation sub-image block by determining the motion vector difference of the affine image block, the motion vector precision, and the distance between the control points, and according to the simulation
  • the size of the projected image block and the size relationship of the affine motion compensated sub-image block are further adjusted so that the size of the affine motion compensated sub-image block is more easily realized while reducing complexity.
  • the invention can reduce the complexity of the coding end by 50%, the complexity of the decoding end by 70%, and maintain the performance of 90-95%, which can make the motion compensation prediction technology based on the Affine model can be effectively invested. Practical applications.
  • a decoding apparatus 1700 for implementing the present invention will be described below with reference to FIG. 17, which includes:
  • a motion vector difference determining module 1710 configured to determine a motion vector difference of the affine image block
  • a motion vector accuracy determining module 1730 configured to determine a motion vector accuracy of the affine image block
  • the sub-image block size determining module 1750 is configured to determine the affine image block according to the motion vector difference, the motion vector precision, the distance between the control points in the affine image block, and the size of the affine image block.
  • the affine motion compensates the size of the sub-image block, the size including the length in the horizontal direction, and the length in the vertical direction such that the horizontal direction of the affine image block is the horizontal direction of the affine motion compensating sub-image block.
  • An integer multiple of the length, and the length of the affine image block in the vertical direction is an integer multiple of the length of the affine motion compensated sub-image block in the vertical direction, wherein the control point is used to determine the motion vector difference Pixels; and,
  • the decoding module 1770 is configured to perform decoding processing on the affine image block according to the size of the affine motion compensation sub-image block.
  • the decoding device determines a motion vector difference of the affine image block according to the determined control point, and determines a motion vector accuracy of the affine image block, according to the determined motion vector difference, the motion vector precision, and the control point Determining a size of the affine motion compensating sub-image block in the affine image block, the size of the affine image compensating sub-image block is a dividing size of the affine image block; Dividing the size, the affine image block is divided into a plurality of affine motion compensated sub-image blocks having the same size, and then the affine image block is decoded based on the affine motion compensated sub-image block.
  • Each module in the decoding device is a functional body that implements various execution steps included in the decoding method of the present invention, that is, has various steps in implementing the decoding method of the present invention, such as steps S710 to S740 and steps For the extension and deformation of the main body, please refer to the introduction of the decoding method in this article. For the sake of brevity, this article will not repeat them.
  • the encoding apparatus 1800 includes:
  • a motion vector difference determining module 1810 configured to determine a motion vector difference of the affine image block
  • a motion vector accuracy determining module 1830 configured to determine motion vector accuracy of the affine image block
  • the sub-image block size determining module 1850 is configured to determine the affine image block according to the motion vector difference, the motion vector precision, the distance between the control points in the affine image block, and the size of the affine image block.
  • the affine motion compensates the size of the sub-image block, the size including the length in the horizontal direction, and the length in the vertical direction such that the length of the affine image block in the horizontal direction is the imaginary motion compensating sub-image block An integer multiple of the length in the horizontal direction, and the length of the affine image block in the vertical direction is an integral multiple of the length of the affine motion compensating sub-image block in the vertical direction, wherein the control point is used to determine the motion Vector difference pixel points;
  • the encoding module 1870 is configured to perform encoding processing on the affine image block according to the size of the affine motion compensation sub-image block.
  • the encoding device determines a motion vector difference of the affine image block according to the determined control point, and determines a motion vector accuracy of the affine image block, according to the determined motion vector difference, the motion vector precision, and the control point Determining a size of the affine motion compensating sub-image block in the affine image block, the size of the affine image compensating sub-image block is a dividing size of the affine image block; Dividing the size, the affine image block is divided into a plurality of affine motion compensated sub-image blocks having the same size, and then the affine image block is encoded based on the affine motion compensated sub-image block.
  • Each module in the encoding device is a functional body for implementing various execution steps included in the decoding method of the present invention, that is, having various steps in the decoding method of the present invention, such as steps S1410 to S1470, and the steps For the extension and deformation of the main body, please refer to the introduction of the decoding method in this article. For the sake of brevity, this article will not repeat them.
  • an embodiment of the present invention further provides a decoding device 1900, which includes a processor 1910, a memory 1930, and a bus system 1950.
  • the processor and the memory are connected by a bus system for storing instructions for executing instructions stored in the memory.
  • the memory of the encoding device stores the program code, and the processor can invoke all of the steps in the decoding method 700 of the present invention and its extensions, i.e., all of the methods described in Figures 7 through 13, by calling program code stored in the memory.
  • the processor can invoke the program code stored in the memory to perform the operations in the decoding method of the present invention in its entirety:
  • the size includes a length in the horizontal direction and a length in the vertical direction such that the length of the horizontal direction of the affine image block is an integral multiple of the length of the horizontal direction of the affine motion compensating sub-image block, and the affine
  • the length of the vertical direction of the image block is an integer multiple of the length of the vertical direction of the affine motion compensating sub-image block, wherein the control point is a pixel point for determining the difference of the motion vector;
  • the affine image block is subjected to decoding processing according to the size of the affine motion compensated sub-picture block.
  • the affine image block is divided into a plurality of affine motion compensation sub-image blocks having the same size, thereby Reduce the complexity of decoding and improve decoding performance.
  • the processor 1910 may be a central processing unit (“CPU"), and the processor 1910 may also be other general-purpose processors, digital signal processors (DSPs). , an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, and the like.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 1930 can include read only memory and random access memory and provides instructions and data to the processor 1910.
  • a portion of the memory 32 may also include a non-volatile random access memory.
  • the memory 1930 can also store information of the device type.
  • the bus system 1950 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 1950 in the figure.
  • each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 1910 or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 1930, and the processor 1910 reads the information in the memory 1930 and performs the steps of the above method in combination with its hardware.
  • an embodiment of the present invention further provides an encoding device 2000, which includes a processor 2010, a memory 2030, and a bus system 2050.
  • the processor 2010 and the memory 2030 are connected by a bus system 2050 for storing instructions for executing instructions stored by the memory 2030.
  • the memory 2030 of the encoding device 2000 stores the program code, and the processor 2010 can call the program code stored in the memory 2030 to perform all the steps in the decoding method 1400 of the present invention and its extension, ie, from FIG. 14 to FIG. Reflect all method steps.
  • processor 2010 can invoke program code stored in memory 2030 for:
  • the size includes a length in the horizontal direction and a length in the vertical direction such that the length of the affine image block in the horizontal direction is an integral multiple of the length of the affine motion compensating sub-image block in the horizontal direction, and the imitation
  • the length of the shot image block in the vertical direction is an integer multiple of the length of the affine motion compensated sub-image block in the vertical direction, wherein the control point is a pixel point for determining the motion vector difference;
  • the affine image block is subjected to encoding processing according to the size of the affine motion compensation sub-image block.
  • the affine image block is divided into a plurality of affine motion compensation sub-image blocks having the same size, thereby Reduce the complexity of coding and improve coding performance.
  • the processor 2010 may be a central processing unit (“CPU"), and the processor 2010 may also be other general-purpose processors, digital signal processors (DSPs). , an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, and the like.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 2030 can include read only memory and random access memory and provides instructions and data to the processor 2010.
  • a portion of the memory 2030 may also include a non-volatile random access memory.
  • the memory 2030 can also store information of the device type.
  • the bus system 2050 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 2050 in the figure.
  • each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 2010 or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 2030, and the processor 2010 reads the information in the memory 2030 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

Landscapes

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

Abstract

本发明提供一种视频图像解码的方法,其根据运动矢量差异、运动矢量精度、仿射图像块中的控制点之间的距离以及仿射图像块的尺寸,确定仿射图像块内的仿射运动补偿子图像块的尺寸,其中,所述尺寸包括水平方向的长度,以及竖直方向的长度,以使仿射图像块的在水平/竖直方向的长度为仿射运动补偿子图像块的在水平/竖直方向的长度的整数倍,最后,根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行解码处理。该方法能够根据仿射图像块自身的属性自适应性的将其仿射运动补偿子图像块大小调整到最佳尺寸,即能保证解码的质量,同时能够降低解码的复杂度,有效提升解码效率。

Description

视频图像编码和解码的方法、装置及设备
本申请要求于2017年8月11日提交中国专利局、申请号为201710687117.5、申请名称为“视频图像编码和解码的方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及视频图像处理领域,尤其涉及视频图像编码和解码的方法、编码装置和解码装置、编码设备和解码设备。
背景技术
随着互联网科技的迅猛发展以及人们物质精神文化的日益丰富,在互联网中针对视频的应用需求尤其是针对高清视频的应用需求越来越多,而高清视频的数据量非常大,要想高清视频能在带宽有限的互联网中传输,必须首先解决的问题就是高清视频压缩编码问题。目前,国际上有两个国际组织专门进行视频编码标准的制定工作,即国际标准化组织(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”)标准。
当前广泛使用的视频编码标准H.264以及最新的视频编码标准HEVC,均以图像块为基本单元进行各种类型的编码操作,例如基于块的预测、变换、熵编码等等。图像块指一个二维采样点阵列,可以是正方形阵列,也可以是矩形阵列,例如一个4x4大小的图像块可看做4x4共16个采样点构成的方形采样点阵列,如图1所示,其中图像块可以记作B。图像块信号指图像块中采样点的采样值,可以表示为B(x,y),x,y=0...3,其中(x,y)表示图像块中每个采样点的坐标。类似的,图像也可以表示为一个二维采样 点阵列,采用与图像块类似的方法标记。此外,采样点还可以称为像素,在本发明文件中将不加区分的使用。
视频序列是由一帧一帧的图像排列组成,通常情况下,产生连续图像的时间间隔很短,图像之间的变化很小,导致连续图像之间的差值很少。因此,可以利用连续图像在时间上的相关性,只编码当前图像与参考图像之间的差值,参考图像通常为时间上邻近的已编码重建图像。从而减少待编码的信息量,达到信号压缩的效果。在视频编码技术中,这类方法称为帧间预测编码技术,该技术被当前视频编码标准广泛采用。图2表示帧间预测编码架构,输入待编码图像,通常为视频中每幅/每帧图像,被划分成不相互重叠的图像块,编码器通过运动估计获得图像块的运动矢量,编码器利用图像块的运动矢量通过运动补偿获得该图像块的运动补偿预测信号。接着使用图像块的原始信号减去运动补偿预测信号,得到预测残差信号。预测残差信号经过变换、量化和熵编码写入码流中。在该编码过程中,获得的图像块的运动补偿预测信号越准确,所得到的预测残差信号就会越小,所需要的编码比特数就越少,图像块的压缩率就越高。
上述运动估计是指使用当前图像块B在参考图像中搜索到一个同样大小且最匹配的图像块B',图像块B相对于B'在空间上的位置偏移称为图像块B的运动矢量。运动补偿是指根据图像块B的运动矢量,从参考图像中获得预测信号的过程。获得的信号称为运动补偿预测信号。
在解码端,对图像块的预测残差信号进行反量化、反变换得到重建残差信号,再根据图像块的运动矢量,通过运动补偿预测从参考图像获取运动补偿预测信号,将图像块的运动补偿预测信号与重建的残差信号相加即可得到图像块的重建信号。
图3表示图像块的划分以及图像块与运动矢量的关系,t时刻的图像A(t)被划分成不同大小且不相重叠的图像块,每个图像块内的箭头示意性的表示编码端所确定的运动矢量,长度和方向表示当前图像块运动的剧烈程度和方向。每个图像块的运动矢量将应用于该图像块中的所有采样点,即图像块中所有采样点将在指定参考图像中根据该运动矢量表示的位置偏移获取其预测信号。
基于块结构的运动补偿预测便于软硬件实现,复杂度低,在计算资源受限的情况下可以提供较好的压缩效率,但是同时也存在一些不足。例如,该方法中用一个运动矢量表示图像块内所有像素点的运动情况,当所有像素点的运动方向和大小都相同时,即平动运动,该方法可以很好表示;当图像块内像素点的运动方向或者大小有不同时,例如缩放和旋转运动,该方法就无法准确表示所有像素点的运动,从而不能得到准确的预测信号,降低压缩性能。
为了改善现有运动补偿预测技术的不足,一种基于线性变化的运动矢量场的运动补偿预测技术被提出来。运动矢量场是指图像块的运动矢量场,图像块被划分成更细致的子单元,子单元可以小到为一个像素点,每个子单元有一个运动矢量,图像块内所有子单元的运动矢量组成了图像块的运动矢量场。图像块的运动矢量场可以是线性变化的,也可以是非线性变化的。图像块的运动矢量场是线性变化的是指图像块内相邻子单元的运动矢量是均匀变化的。若图像块内相邻单元的运动矢量变化不均匀,则 图像块的运动矢量场为非线性变化的。本文主要强调基于线性变换的运动矢量场的运动补偿预测技术。在由Na Zhang;Xiaopeng Fan;Debin Zhao;Wen Gao,提出的名为"Motion vector derivation of deformable block,"Image Processing(ICIP),2012 19th IEEE International Conference on,vol.,no.,pp.1549,1552,Sept.30 2012-Oct.3 2012,文献中,提出使用图像块的四个顶点作为控制点,对四个控制点的运动矢量使用双线性插值的方法获得图像块内部每个4x4单元的的运动矢量。图像块四个顶点的运动矢量是根据周围图像块的运动矢量获得的,各个4x4单元的运动矢量组成了图像块的运动矢量场。再根据该运动矢量场,从参考图像中获得图像块的运动补偿预测信号。基于运动矢量场的运动补偿预测技术减小了具有独立运动矢量的单元的大小,可以更准确地表示非平动运动,例如旋转和缩放,可以获得更好的运动补偿预测信号。上述提到的运动矢量场是通过对控制点的运动矢量进行双线性插值得到的,运动矢量场是满足双线性模型的。所述双线性插值是数学上的插值方法,参照图4,具体插值方法介绍如下:
假设需要求解函数f在P=(x,y)的值,已知函数f在点Q 11=(x 1,y 1),Q 12=(x 1,y 2),Q 21=(x 2,y 1),及Q 22=(x 2,y 2)四个点的值。首先在x方向进行线性插值,得到,
Figure PCTCN2018099512-appb-000001
然后在y方向进行线性插值,得到,
Figure PCTCN2018099512-appb-000002
将公式(1)中的结果代入公式(2)中,即可得到P点的值。根据控制点的运动矢量,使用该插值方法,可以得到图像块内所有点的运动矢量。
该方法中控制点的运动矢量是从周围图像块的运动矢量中选取的,而选取的运动矢量可能不准确,若通过运动估计搜索获得控制点的运动矢量,则需要将控制点的运动矢量写入到码流中,此时就需要更高效的方法,例如用仿射变换模型来表示图像块的运动矢量场,从而提出了基于仿射变换的运动补偿预测技术。
仿射变换表示的是两个空间的映射关系,常见的仿射变换有旋转、缩放和平移。通过仿射变换模型获得的图像块的运动矢量场是线性变化的,且该运动矢量场满足仿射变换。常见的6参数的仿射变换模型可以表示上述三种运动。具体如公式(3)所示,其中(x,y)为像素点P在当前图像中的坐标,(x′,y′)为像素点P在参考图像中匹配的像素点P'的坐标,a,b,c,d,e,f为仿射变换的参数。若已知仿射参数,即可求得像素点(x,y)在参考图像中的位置(x′,y′),从而可以从参考图像中获得像素点的预测信号。
Figure PCTCN2018099512-appb-000003
一般仿射参数根据图像块中部分像素点的运动矢量计算得到,运动矢量可表示为公式(4)
Figure PCTCN2018099512-appb-000004
将公式(3)代入到(4)中可得,
Figure PCTCN2018099512-appb-000005
利用多组已知的运动矢量,例如3组已知的运动矢量,代入上述公式(5)中即可求得各个仿射变换参数的具体值,从而利用公式(3)及公式(4)便能求得图像块内所有点的运动矢量。在实践中,通常是通过运动估计先获得图像块角点(控制点)的运动矢量,再根据角点运动矢量求得仿射变换参数,从而求得图像块内所有像素点的运动矢量。角点的运动矢量如图5所示,(a)表示图像块X,图像块的宽度是w,高度是h,左上角点的坐标为(0,0),运动矢量为
Figure PCTCN2018099512-appb-000006
右上角点的坐标为(w,0),运动矢量为
Figure PCTCN2018099512-appb-000007
左下角点的坐标为(0,h),运动矢量为
Figure PCTCN2018099512-appb-000008
将上述三个运动矢量
Figure PCTCN2018099512-appb-000009
分别代入到公式5中即可得到如下的6参数仿射变换模型:
Figure PCTCN2018099512-appb-000010
图像块三个顶点的运动矢量可以不同,如图(b),图像块在参考图像中的映射关系如虚线所示。在求得图像块内所有点的运动矢量后,根据运动补偿预测获得图像块内所有点的运动补偿预测信号。
上述内容以6参数的仿射变换模型为例,但仿射变换不限于6参数模型,可以是4参数的仿射变换模型-参考公式(7)、(8),2参数的缩放模型-参考公式(9),等等。若图像块选用4参数的仿射变换模型来做运动补偿预测,那么仿射模型未知的参数有4个,使用两组运动矢量即可获得该模型的参数。两组运动矢量可以是图像块某两个角点的运动矢量,也可以是图像块内某两个点的运动矢量。
Figure PCTCN2018099512-appb-000011
Figure PCTCN2018099512-appb-000012
Figure PCTCN2018099512-appb-000013
将公式(3)代入到(7)中可得,
Figure PCTCN2018099512-appb-000014
左上角点的坐标为(0,0),运动矢量为
Figure PCTCN2018099512-appb-000015
右上角点的坐标为(w,0),运动矢量为
Figure PCTCN2018099512-appb-000016
代入到公式(10),则可以得到以左上角和右上角为控制点的运动模型公式:
Figure PCTCN2018099512-appb-000017
左上角点的坐标为(0,0),运动矢量为
Figure PCTCN2018099512-appb-000018
左下角点的坐标为(0,h),运动矢量为
Figure PCTCN2018099512-appb-000019
代入到公式(10),则可以得到以左上角和左下角为控制点的运动模型公式:
Figure PCTCN2018099512-appb-000020
相比于最新的视频编码标准HEVC,对于包含旋转、缩放运动的视频帧/图像序列,基于线性变化的运动矢量场的运动补偿预测技术可以显著提高编码性能,如上所述线性变化的运动矢量场包括使用仿射变换产生的运动矢量场,以及使用双线性模型产生的运动矢量场等。以基于仿射变换的运动补偿预测技术为例,在获得图像块的仿射变换参数后,要计算图像块内每个点的运动矢量,根据每个点的运动矢量做运动补偿预测,从而获取每个点的运动补偿预测信号。由于图像块内每个像素点的运动矢量都可能不同,需要根据运动矢量为每个像素点进行不同的操作。基于像素点的运动补偿预测复杂度很高,为了降低编解码的复杂度,相关技术尝试在图像块内再划分子图像块,求得每个子图像块的运动矢量,再获得每个子图像块的运动补偿预测信号。
但是,相关技术中的子图像块的大小是固定的,子图像块的尺寸过小会导致较高的编解码的复杂度,子图像块的尺寸过大会降低编解码性能,从而导致这种高效的编码方法在实践应用中面临极大的限制。
发明内容
本发明提供了一种视频图像解码、编码的方法、解码装置、编码装置、解码设备和编码设备,可以通过选取合适大小的子图像块,以使得整使图像块被划分成多个尺寸相同的子图像块进行处理,从而降低编解码的复杂度,提升编解码性能。
第一方面,提供了一种视频图像解码方法,其包括,确定仿射图像块的运动矢量差异;确定所述仿射图像块的运动矢量精度;根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行解码处理。
本发明第一方面提出的视频图像解码方法中,通过所确定的两个参数,即运动矢量差异、该运动矢量精度,结合该仿射图像块中的控制点之间的距离以及该仿射图像的尺寸,自适应地确定出仿射运动补偿子图像块尺寸,使得仿射图像块能够被划分为多个尺寸相同的仿射运动补偿子图像块,从而能够大幅度的降低解码端的复杂度,并提升解码的效率。
基于本发明的第一方面,确定并调整仿射运动补偿子图像块尺寸的过程具体可以是,根据该运动矢量精度与运动矢量差异的第一分量/第二分量的比例对该第一水平/ 竖直距离进行等比例调整得到该仿射运动补偿子图像块的水平/竖直方向的长度,确定该仿射图像块的水平/竖直方向的长度是否是该仿射运动补偿子图像块的水平/竖直方向的长度的整数倍,若否,则调整该仿射运动补偿子图像块的水平/竖直方向的长度以使该仿射图像块的水平/竖直方向的长度为该仿射运动补偿子图像块的调整后的水平/竖直方向的长度的整数倍。该具体实现方式中,通过该运动矢量精度与运动矢量差异的第一分量/第二分量的比例关系,来调整控制点之间的第一水平/竖直距离从而得到仿射运动补偿子图像块的水平/竖直方向的长度,从而使得仿射运动补偿子图像块的尺寸能够与仿射图像块的运动矢量的精度匹配,在保证解码质量的同时,降低了解码复杂度。
基于本发明的第一方面,调整该仿射运动补偿子图像块的水平/竖直方向的长度以使该仿射图像块的水平/竖直方向的长度为该仿射运动补偿子图像块的调整后的水平/竖直方向的长度的整数倍具体可以是通过则对该仿射运动补偿子图像块的水平/竖直的长度做增加/减少一个或者多个单位长度的调整,接着循环执行上述的方案直至该仿射图像块的水平/竖直方向的长度是该仿射运动补偿子图像块的水平/竖直方向的调整后的长度的整数倍。其中,上述单位长度通常是一个单位像素,即,对该仿射运动补偿子图像块的水平方向的长度做加一/减一的调整。此外,上述调整也可以是对该仿射运动补偿子图像块的水平/竖直方向的长度按照固定的步长做增加/减少的调整,所述的步长为调整值,即,每个循环内对仿射运动补偿子图像块的水平/竖直方向的长度进行调整的基本单位。该步长可以为任意值,通常为上述的一个单位像素,也可以是其他的值2.5个单位像素等。可选地,上述调整中所采用的步长/调整值也可以根据该仿射运动补偿子图像块的水平/竖直的初始长度(即未经过调整的长度)的奇偶性变化,例如,当仿射运动补偿子图像块的水平方向的初始长度为奇数,选择奇数步长,例如,以奇数个单位长度,如一个单位长度为步长进行调整,当仿射运动补偿子图像块的水平方向的初始长度为偶数时,则选择偶数步长,例如,偶数个单位长度的步长。该实施方式能够保证该仿射运动补偿子图像块的水平/竖直的长度能够快速的逼近整除所述仿射图像的水平/竖直的长度的值,从而进一步的降低复杂度。
为了提高效率,节省运算时间,在本发明第一方面提出的解码方法中,可以将该仿射运动补偿子图像块的水平/竖直方向的长度朝向最接近整除该仿射图像块的水平/竖直方向的长度的方向调整;若,该仿射运动补偿子图像块的水平/竖直方向的长度距离与邻近且可整除该仿射图像块的水平/竖直方向的长度的两个相邻的值的距离相等,可以根据编解码端的需求选择朝某一方向调整,例如,如果是要求低延时,此时可以选择朝增加的方向调整,如果要求高质量,则选择朝减小的方向调整。
当确定该仿射图像块的水平/竖直方向的长度不是该仿射运动补偿子图像块的水平/竖直方向的长度的整数倍时,为了更进一步的简化算法,可以在编解码端分别建立相同的表格,以允许的最小整除数,如,2 N为起始值,将仿射图像块水平/竖直方向的可能的最大长度划分为多个区间,区间的跨度为2 N+i,i∈(0,(log 2Wmax)-1),W max为仿射图像块水平/竖直方向的可能的最大长度。确定该仿射运动补偿子图像块的水平/竖直方向的长度所在的区间,以该仿射运动补偿子图像块的水平/竖直方向的长度所在的区间的下限值或者上限值为最终确定的所述仿射运动补偿子图像块的水平/竖直 方向的长度。其上下限值的获取规则可以参照编解码两端约定,可以通过码流明示,或者可以通过四舍五入的方式选择临近的区间上限值或者下限值。通过以上的表格,可以采用根据仿射运动补偿子图像块的水平/竖直方向的初始长度采用查表的方式来确定该仿射运动补偿子图像块的水平/竖直方向的最终长度,从而降低系统复杂度并节省及计时间。
可选地,为了进一步降低该方案的计算复杂度,在本发明第一方面提出的解码方法中,除了确定仿射图像块的水平/竖直方向的长度是该仿射运动补偿子图像块的水平/竖直方向的长度的整数倍,还需要确定该仿射运动补偿子图像块的水平/竖直方向的长度是否是便于计算的预定长度S的整数倍,即,确定该仿射运动补偿子图像块的水平/竖直方向的长度是否满足以下两个条件:
(1)仿射图像块的水平/竖直方向的长度是该仿射运动补偿子图像块的水平/竖直方向的长度的整数倍,且
(2)该仿射运动补偿子图像块的水平/竖直方向的长度是预定长度S的整数倍;
若不满足,则调整该仿射运动补偿子图像块的水平/竖直方向的长度以使其满足上述的条件(1)和条件(2),即,该仿射图像块的水平/竖直方向的长度为该仿射运动补偿子图像块的调整后的水平/竖直方向的长度的整数倍,且该仿射运动补偿子图像块的调整后的水平/竖直方向的长度是该预设长度的整数倍。预设长度S通常取4,也可以取8、16、32等数值,或者,S等于2 n,n为零或者正整数,需要说明的是S的取值不应大于仿射图像块自身的尺寸。本方案对于任意形状的仿射图像块均适用,若仿射图像块是采用四叉树(Qual Tree)规则划分模式下的情况下,或者仿射图像块的尺寸为2Nx2N,即正方形,由于上述判断条件(1)(2)中任一个条件的满足即可以同时满足另外一个条件,因此,仅需要保留一其中一个判定条件即可。上述条件(1)以及条件(2)是否满足的判断顺序以及依据判断结果对仿射运动补偿子图像块的水平/竖直方向的长度进行调整的顺序可以任意交换。
在本发明第一方面提出的解码方法中,为了避免出现该仿射运动补偿子图像块尺寸非法,即小于允许的最小尺寸,而大于仿射图像块自身的尺寸,可以选择对上述方式确定的该仿射运动补偿子图像块的水平/竖直方向的长度需要进行限幅操作,即通过比较的方式使的该仿射运动补偿子图像块的水平/竖直方向的长度位于下限Tm/Tn以及上限W/H之间,Tm/Tn为预设值,通常为4,W/H为仿射图像块的在水平/竖直方向的长度。
进一步的,发明第一方面提出的解码方法中适用于三控制点的仿射变换模型以及两控制点的仿射变换模型,在三控制点的仿射变换模型中,其需要独立获取该仿射运动补偿子图像块的竖直以及水平方向的长度,并对其进行独立的调整,对应的,在两控制点的仿射变换模型中,其仅需要其需要独立获取该仿射运动补偿子图像块的水平或竖直方向的长度,进而推到另外一个方向上的长度,并需要时对两个方向上的长度进行独立的调整。当仿射图像块的尺寸为2Nx2N的规则方形时,因为其水平方向和竖直方向的长度相同,则只需要对其水平或者竖直方向长度中的一个进行确定及调整即可。
第二方面,提供了一种视频图像编码方法,其主要包括:确定仿射图像块的运动 矢量差异;确定所述仿射图像块的运动矢量精度;根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行编码处理。
本发明第二方面提供的视频图像编码方法,通过所确定的两个参数,即,该运动矢量差异、该运动矢量精度,结合该仿射图像块中的控制点之间的距离以及该仿射图像的尺寸,自适应地确定出仿射运动补偿子图像块尺寸,使得仿射图像块能够被划分为多个尺寸相同的仿射运动补偿子图像块,从而能够大幅度的降低编码端的复杂度,并提升编码的效率。本发明第二方面的视频图像编码方法与本发明第一方面的视频图像解码方法除了最后一个步骤不同之外,其核心步骤,即确定仿射运动补偿子图像块尺寸以及调整仿射运动补偿子图像块尺寸的方法步骤完全相同,因此,本第一方面的视频图像解码方法中的方案可以完全适用于本发明第二方面的视频图像编码方法,具体请参照前述对第一方面的视频图像解码方法的介绍。
第三方面,提供了一种视频图像解码装置,其主要包括:运动矢量差异确定模块,用于确定仿射图像块的运动矢量差异;运动矢量精度确定模块,用于确定所述仿射图像块的运动矢量精度;子图像块尺寸确定模块,用于根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;解码模块,用于根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行解码处理。
本发明第三方面提供的一种视频图像解码装置与本发明第一方面提供的视频图像解码方法对应,具备实现发明第一方面提供的视频图像解码方法中的所有步骤的功能,且能够具有同样的技术效果,即大幅度的降低解码端的复杂度,并提升解码的效率。
第四方面,提供了一种视频图像编码装置,其主要包括:运动矢量差异确定模块,用于确定仿射图像块的运动矢量差异;运动矢量精度确定模块,用于确定所述仿射图像块的运动矢量精度;子图像块尺寸确定模块,用于根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;编码模块,用于根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行编码处理。
本发明第四方面提供的一种视频图像编码装置与本发明第二方面提供的视频图像编码方法对应,具备实现发明第二方面提供的视频图像编码方法中的所有步骤的功能,且能够具有同样的技术效果,即大幅度的降低编码端的复杂度,并提升编码的效率。
第五方面,提供了一种视频图像解码设备,其包括处理器以及非易失性存储器,所述处理器调用存储在所述存储器中的程序代码以实现本发明第一方面提供的所述的解码方法。
第六方面,提供了一种视频图像编码设备,其包括处理器以及非易失性存储器,所述处理器调用存储在所述存储器中的程序代码以实现第二方面提供的所述的编码方法。
于上述技术方案,本发明实施例的视频图像编码和解码的方法、编码装置和解码装置、编码设备和解码设备,通过所确定的两个参数,即,该运动矢量差异、该运动矢量精度,并结合该仿射图像块中的控制点之间的距离以及该仿射图像的尺寸,自适应地确定出仿射运动补偿子图像块尺寸,从而使得仿射图像块能够被划分为多个尺寸相同的仿射运动补偿子图像块,降低编解码的复杂度,提升编解码性能。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是为视频图像编码过程中的图像块示意图;
图2是为视频图像编码的基本流程示意图;
图3是为视频图像编码过程中图像块的划分以及图像块与运动矢量的关系示意图;
图4是采用双线性插值获取图像块的运动矢量场的示意图;
图5是采用仿射变换模型获取图像块的运动矢量场的示意图;
图6是实施本发明实施例提供的解码方法的视频解码器的框架示意图;
图7是根据本发明实施例的视频图像解码方法的示意性流程图;
图8是根据本发明实施例的仿射图像块及控制点的示意图;
图9是根据本发明实施例的仿射图像块及控制点的另一示意图;
图10是根据本发明实施例的仿射图像块中三个不重合像素点的示意图;
图11是根据本发明实施例的仿射图像块的再一示意图;
图12是根据本发明实施例的视频图像解码方法的另一示意性流程图;
图13是根据本发明实施例的视频图像解码方法的再一示意性流程图;
图14是根据本发明实施例的视频图像编码方法的示意性流程图;
图15是根据本发明实施例的视频图像编码方法的另一示意性流程图;
图16是根据本发明实施例的视频图像编码的方法的再一示意性流程图;
图17是根据本发明实施例的解码装置的示意性框图;
图18是根据本发明实施例的编码装置的示意性框图;
图19是根据本发明实施例的解码设备的示意性框图;
图20是根据本发明实施例的编码设备的示意性框图。
具体实施方式
本发明的目的在于能够保持仿射变换运动补偿预测性能的前提下,降低编解码复杂度,使得该方法可以有效的投入到实际应用中。本文中将独立具有仿射变换参数的图像块称为仿射图像块,即Affine块。把仿射图像块内部划分出来进行运动补偿预测的子图像块称为仿射运动补偿子图像(Affine Motion Compensation,简称为“Affine-MC”),记为Affine-MC块。本发明提出的技术方案是将Affine块根据编码/解码需求自适应的划分多个具有相同尺寸Affine-MC块,具体方法是根据Affine块的运动矢量精度,Affine块的运动矢量、以及Affine块的控制点之间的距离,自适应的将Affine块划分成满足要求的Affine-MC块。
以下以解码端为例,通过具体的实施例来说明本发明的方案。
解码端通常以解码器作为实施解码方法主体对已编码视频码流进行解码重建,解码器的基本逻辑结构如图6所示,视频解码器60包含熵解码单元650、预测处理单元652、逆量化单元654、逆变换处理单元656、重建单元658、滤波器单元659及解码图像缓冲器660。预测处理单元652包含运动补偿单元662及帧内预测处理单元664。熵解码单元650包含规则CABAC编解码引擎666及旁通编解码引擎668。在其它实例中,视频解码器60可包含更多、更少或不同的功能组件。
视频解码器60的基本工作流程为,在接收到已编码的视频码流(下文简称码流)之后,熵解码单元650解析所述码流以从所述码流中提取语法元素,其中,作为解析码流的一部分,熵解码单元650可解析码流中的经熵编码后的语法元素。预测处理单元652、逆量化单元654、逆变换处理单元656、重建单元658及滤波器单元659可根据从码流中提取的语法元素来解码视频数据,即产生解码后的视频数据。语法元素可包含经规则CABAC编解码二进制码字及经旁通编解码二进制码字。熵解码单元650可使用规则CABAC编解码引擎666来解码经规则CABAC编解码二进制码字,且可使用旁通编解码引擎668来解码经旁通编解码二进制码字。
预测处理单元652包括了运动补偿单元662以及帧内预测处理单元664。当待解码的图像块使用帧间预测编码,运动补偿单元662可根据待解码的图像块运动信息来确定一个或多个参考块,并根据参考块来产生待解码的图像块的预测性像素块。当待解码的图像块使用帧内预测编码,则由帧内预测处理单元664执行帧内预测以产生图像块的预测性像素块。帧内预测处理单元664可使用帧内预测模式以基于空间相邻图像块的像素产生待解码图像块的预测性像素块。
经过预测处理单元652所获取的预测性像素块与经过逆量化单元654以及逆变换处理单元656处理的待解码图像块的残差数据在重建单元658处重建,从而得到待解码的图像块的重建图像块,将由多个图像块构成的一帧图像在滤波器单元659内进行滤波之后存储在解码图像缓冲器660内从而完成对已编码视频码流的解码,存储在解码图像缓冲器660内的解码图像可以直接输出至显示设备进行显示,也可以用于作为后续码流的解码过程中的参考图像。
本发明的技术方案是应用于运动补偿单元662进行运动补偿预测解码过程中,示 例性的解码流程如图7所示。需要说明的是本发明中的解码方法和编码方法总体一致,解码方法是编码方法的逆过程,虽然下述以解码方法为例,但是该方法除了明确说明以外和编码方法基本相同。因此,在下述描述的解码过程中,出现编码相关的解释说明并不构成方案的冲突或者不一致。
图7示出了根据本发明实施例的视频图像编码的方法的示意性流程图,具体地,如图7所示,方法700包括:
S710,确定仿射图像块的运动矢量差异;
S720,确定该仿射图像块的运动矢量精度;
S730,根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;
S740,根据该仿射运动补偿子图像块的尺寸,对该述仿射图像块进行解码处理。
具体而言,解码/编码设备根据确定的控制点,确定仿射图像块的运动矢量差异,并确定该仿射图像块的运动矢量精度,根据确定的运动矢量差异、运动矢量精度和控制点之间的距离以及仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该仿射运动补偿子图像块的尺寸即为该仿射图像块的划分尺寸;基于该划分尺寸,所述仿射图像块被划分为多个具有相同尺寸的仿射运动补偿子图像块,然后基于该仿射运动补偿子图像块对所述仿射图像块进行解码。需要说明的是,通常情况下仿射图像块为规则的矩形或者正方形,而对应的仿射运动补偿子图像块也为规则的矩形或者正方形,因此,当确定了仿射运动补偿子图像在水平方向的长度以及竖直方向的长度之后,即能确定该仿射运动补偿子图像的整体尺寸。其中,水平方向以及竖直方向为本领域惯常采用的用于定位视频图像中的图像块/仿射图像块的位置的参考坐标系,其中水平方向通常代表规则的长方形视频图像的长边所在方向,而竖直方向通常代表规则的长方形视频图像的短边所在的方向,其中水平方向与竖直方向相互垂直;为了不失通用性,所述的水平方向可以用第一方向替代,而竖直方向可以用垂直于第一方向的第二方向替代,但是为了说明的简便起见,本文中采用水平方向以及竖直方向来描述。此外,本文中解码方法中所提到的“解码仿射图像块”指的是从码流中解析编码数据并以仿射图像块为基本单元对编码图像进行重建及恢复的过程,并不能因为使用“解码仿射图像块”而认为该仿射图像块已经重建完成。
运动补偿单元662通过运行本发明实施例的视频图像解码的方法,利用确定的仿射图像块的运动矢量差异、运动矢量精度和控制点之间的距离以及仿射图像块的尺寸,确定仿射运动补偿子图像块的尺寸,根据该仿射运动补偿子图像块的尺寸将该仿射图像块划分成多个大小一致的仿射运动补偿子图像之后进行解码处理,由此,在解码过程中能够根据上述参数的变化而自适应的选取合适大小的仿射运动补偿子图像块,降低解码的复杂度并提高了性能。
应理解,在本发明实施例中,该仿射图像(Affine)块为图像块内所有单元的运 动矢量符合相同的仿射模型,例如,同一个仿射模型,并可以用相同的参数,又或者是同一组参数来表示的图像块。其中单元是指一组像素,例如,可以是一个像素点,也可以是1×3,2×4等的块结构,本发明对此不作限定。此外,在本发明实施例中,可以选择任意不重合的像素点作为控制点来确定Affine块的运动矢量差异,本发明对此不作限定。
优选地,S710包括:
根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量;和/或
根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量;
其中,该第一控制点与该第二控制点之间具有第一水平距离,该第三控制点与该第四控制点之间具有第一竖直距离。需要说明的是,上述步骤S710中所包含的方案中的“和/或”具体表示了如下三种不同的技术方案:
方案1:基于三控制点的仿射图像块的运动矢量差异确定方法;其包括:
根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量,以及,根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量。
方案2:基于水平方向两控制点的仿射图像块的运动矢量差异确定方法;其包括:根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量。
方案3:基于竖直方向两控制点的仿射图像块的运动矢量差异确定方法:其包括:根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量。
应理解,在本发明实施例中,该运动矢量差异的第一分量指该运动矢量差异的水平分量,该运动矢量差异的第二分量指该运动矢量差异的竖直分量,在方案1中,该运动矢量差异的第一分量和该运动矢量差异的第二分量共同体现仿射图像块的运动矢量差异,而在方案2及方案3中,该运动矢量差异的第一分量及该运动矢量差异的第二分量分别独立的体现仿射图像块的运动矢量差异。换句话说,即,在方案1种,仿射图像块的运动矢量差异包括运动矢量差异的第一分量和该运动矢量差异的第二分量;在方案2中,仿射图像块的运动矢量差异包括运动矢量差异的第一分量;在方案3中,仿射图像块的运动矢量差异包括运动矢量差异的第二分量。还应理解,在本发明实施例中,第一、第二、第三和第四只是为了区分像素点,而不应该对本发明的保护范围构成任何限定,例如,第一控制点也可以称为第二控制点,第二控制点可以成为第一控制点等。
在本发明实施例中,可选地,该第一控制点和该第三控制点为同一个像素点,也就是说,选取的控制点的个数为3个,并且3个控制点中的一个控制点与其他2个控制点中的一个控制点位于同一水平线上,与其他2个控制点中的另一个控制点位于同一竖直线上。
在本发明实施例中,可选地,该第一控制点、该第二控制点、该第三控制点和该 第四控制点为该Affine块的顶点,假设一个Affine块的4个顶点分别标记为左上角顶点、左下角顶点、右上角顶点和右下角顶点,则:
在前述方案1中,可以选择位于两个正交方向上的任意三个顶点来确定该Affine块的运动矢量差异,例如,可以选择左上角顶点、左下角顶点和右上角顶点,可以选择左上角顶点、右上角顶点和右下角顶点;
在前述方案2中,可以选择位于同一水平线上的任意两个顶点来确定该Affine块的运动矢量差异,例如,可以选择左上角顶点和右上角顶点,或者选择左下角顶点和右下角顶点;
在前述方案3中,可以选择位于同一竖直线上的任意两个顶点来确定该Affine块的运动矢量差异,例如,可以选择左上角顶点和左下角顶点,或者选择右上角顶点和右下角顶点;本发明对此不作限定。
在本发明实施例中,可选地,可以将第一控制点与第二控制点的运动矢量的两个方向(水平方向、竖直方向,或者成为,x方向,y方向)上的分量中任意一个方向上的分量的差值确定为该Affine块的运动矢量差异的第一分量,可以将第三控制点与第四控制点的运动矢量的两个方向上的分量中任意一个方向上的分量的差值确定为该Affine块的运动矢量差异的第二分量,该运动矢量差异的确定方式适用于前述的方案1、2、3;还可以根据实际对编码复杂度和编码性能的要求,选择介于第一控制点与第二控制点的运动矢量的两个方向上的分量的两个差值之间的数值确定为该第一分量,选择介于第三控制点与第四控制点的运动矢量的两个方向上的分量的两个差值之间的数值确定为该第二分量,本发明对此不作限定。
通常,第一控制点至第四控制点中的每一个控制点的运动矢量均包含有两分量,即水平分量及竖直分量,因此,前述步骤中,根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量,以及,根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量,具体可以通过以下的方式来实现:
确定该第一控制点与该第二控制点的运动矢量的第一水平分量差值和第一竖直分量差值,将该第一水平分量差值和该第一竖直分量差值中的最大值确定为该运动矢量差异的第一分量;
相应的,确定该第三控制点与该第四控制点的运动矢量的第二水平分量差值和第二竖直分量差值,将该第二水平分量差值和该第二竖直分量差值中的最大值确定为该运动矢量差异的第二分量。
也就是说,如果用vx (x,y)和vy (x,y)表示位置为(x,y)的像素点的运动矢量的水平分量和竖直分量,则可以根据公式(13)和(14)确定Affine块的运动矢量差异:
Δmv hor=max(|vx (W,y)-vx (0,y)|,|vy (W,y)-vy (0,y)|)     (13)
Δmv ver=max(|vx (x,H)-vx (x,0)|,|vy (x,H)-vy (x,0)|)      (14)
其中,max表示取最大值,Δmv hor表示Affine块的运动矢量差异的水平分量,Δmv ver表示Affine块的运动矢量差异的竖直分量,W表示第一控制点与第二控制点的第一水平距离,H表示第三控制点与第四控制点的第一竖直距离。参考图8,公式(13)表示,运动矢量水平差值Δmv hor为在同一水平方向的两个控制点的运动矢量的各分量的最大 变化,即运动矢量差值的绝对值最大,例如可以选用顶点0和1或顶点2和3作为控制点来计算Δmv hor;公式(14)表示,运动矢量竖直差值Δmv ver为在同一竖直方向的两个控制点的运动矢量的各分量的最大变化,即运动矢量差值的绝对值最大,例如可以选用顶点0和2或顶点1和3作为控制点来计算Δmv ver。可以理解,上述公式(13)和(14)适用前述方案1、2、3中的任意一种方案,具体地:
在前述方案1中,基于三控制点确定仿射图像块的运动矢量差异,该运动矢量差异包括第一分量以及第二分量,因此,其采用公式(13)以及公式(14)的组合来获取仿射图像块的运动矢量差异;
在前述方案2中,基于水平方向两控制点确定仿射图像块的运动矢量差异,该运动矢量差异仅包括第一分量,因此,其采用公式(13)来获取仿射图像块的运动矢量差异。以图8为例,多数情况下,Affine块的顶点的运动矢量已知,在这种情况下,可直接根据Affine块顶点的运动矢量计算运动矢量差值。
若图8中Affine块顶点的运动矢量
Figure PCTCN2018099512-appb-000021
Figure PCTCN2018099512-appb-000022
已知,则有:
Δmv hor=max(|vx 1-vx 0|,|vy 1-vy 0|)        (15)
若图8中Affine块顶点的运动矢量
Figure PCTCN2018099512-appb-000023
Figure PCTCN2018099512-appb-000024
已知,则有:
Δmv hor=max(|vx 3-vx 2|,|vy 3-vy 2|)      (16)
也可以选择其他已知运动矢量的组合,本发明不做限制。
上述方案中使用的控制点的运动矢量可以根据仿射变换模型得到,例如,当采用4参数仿射变换模型,并以仿射图像块的左上角位置(0,0)和右上角位置(W,0)作为控制点,则模型公式为
Figure PCTCN2018099512-appb-000025
其中(vx 0,vy 0)和(vx 1,vy 1)分别为左上角和右上角控制点的运动矢量。将左下角和右下角控制点坐标(0,h)和(w,h)代入公式,则可以得到(vx 2,vy 2)和(vx 3,vy 3);
在前述方案3中,基于竖直方向两控制点确定仿射图像块的运动矢量差异,该运动矢量差异仅包括第二分量,因此,其采用公式(14)来获取仿射图像块的运动矢量差异。以图8为例,多数情况下,Affine块的顶点的运动矢量已知,在这种情况下,可直接根据Affine块顶点的运动矢量计算运动矢量差值。
若已知图8中Affine块顶点的运动矢量
Figure PCTCN2018099512-appb-000026
Figure PCTCN2018099512-appb-000027
则有:
Δmv ver=max(|vx 2-vx 0|,|vy 2-vy 0|)      (18)
若已知图8中Affine块顶点的运动矢量
Figure PCTCN2018099512-appb-000028
Figure PCTCN2018099512-appb-000029
则有:
Δmv ver=max(|vx 3-vx 1|,|vy 3-vy 1|)        (19)
也可以选择其他已知运动矢量的组合,本发明不做限制。
上述方案中使用的控制点的运动矢量可以根据仿射变换模型得到,例如,当采用4参数仿射变换模型,并以左上角位置(0,0)和左下角位置(0,H)作为控制点,则模型公式为
Figure PCTCN2018099512-appb-000030
其中(vx 0,vy 0)和(vx 2,vy 2)分别为左上角和左下角控制点的运动矢量。将右上角和 右下角控制点坐标(w,0)和(w,h)代入公式,则可以得到(vx 1,vy 1)和(vx 3,vy 3)。
在本发明实施例中,可选地,根据仿射模型来获得上述的运动矢量差值,即通过确定该仿射图像块内的像素点的仿射变换参数来获取运动矢量的差值,需要说明的是,该仿射图像块内的像素点具有相同的仿射变换参数;
相应地,前述步骤中,确定该第一控制点与该第二控制点的运动矢量的第一水平分量差值和第一竖直分量差值,具体为:根据该仿射变换参数和该第一水平距离,确定该第一水平分量差值和该第一竖直分量差值;前述步骤中,确定该第三控制点与该第四控制点的运动矢量的第二水平分量差值和第二竖直分量差值,具体为:根据该仿射变换参数和该第一竖直距离,确定该第二水平分量差值和该第二竖直分量差值。
应理解,前述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
在本发明实施例中,可选地,仿射变换模型可以采用现有技术中的6参数仿射变换模型,也可以采用4参数或2参数仿射变换模型,6参数仿射变换模型主要应用于前述方案1中的3控制点的场景中,4参数仿射变换模型主要应用于前述方案2及3中的两控制点的场景中。以下分别以6参数仿射变换模型以及4参数仿射变换模型为例来介绍根据仿射变换参数获取运动矢量的差值的过程。
在6参数仿射变换模型中,假设(x,y)为像素点P在当前图像中的坐标,(x′,y′)为像素点P在参考图像中匹配的像素点P'的坐标,a,b,c,d,e,f为仿射变换参数。若已知仿射变换参数,即可求得像素点(x,y)在参考图像中的位置(x′,y′),从而可以从参考图像中获得像素点的预测信号:
x′=ax+by+e            (21)
y′=cx+dy+f            (22)
通常情况下,仿射变换参数可以根据仿射图像块中部分像素点的运动矢量计算得到,运动矢量的水平分量和竖直分量可分别表示为公式(23)和(24):
vx=x-x'               (23)
vy=y-y'               (24)
将公式(21)带入公式(23)中,将公式(22)带入公式(24)中,得到坐标为(x,y)的像素点的运动矢量的水平分量和竖直分量分别为公式(25)和(26):
vx=(1-a)x-by-e        (25)
vy=(1-d)y-cx-f        (26)
将公式(25)带入公式(13)中,将公式(26)带入公式(14)中,公式(13)和(14)分别转变为公式(27)和(28):
Δmv hor=max(|(1-a)W|,|-cW|)             (27)
Δmv ver=max(|-bH|,|(1-d)H|)             (28)
通过确定仿射变换参数a、b、c和d,以及控制点之间的距离就可以确定Affine块的运动矢量差异的第一分量和第二分量。
在4参数仿射变换模型中,假设(x,y)为像素点P在当前图像中的坐标,(x′,y′)为像素点P在参考图像中匹配的像素点P'的坐标,a,b,e,f为仿射变换参数。若已知仿射变换参数,即可求得像素点(x,y)在参考图像中的位置(x′,y′),从而可以从参考图像中获得像素点的预测信号:
Figure PCTCN2018099512-appb-000031
Figure PCTCN2018099512-appb-000032
其中,公式(29)对应于前述方案2中,基于水平方向两控制点确定仿射图像块的运动矢量差异的场景中。公式(30)对应于前述方案3中,基于竖直方向两控制点确定仿射图像块的运动矢量差异的场景中。
通常情况下,仿射变换参数可以根据图像块中部分像素点的运动矢量计算得到,运动矢量的水平分量和竖直分量可参考前述公式(23)和(24)。将公式(29)及(30)分别带入公式(23)(24)中,得到坐标为(x,y)的像素点的运动矢量的水平分量和竖直分量分别为公式(31)和(32):
Figure PCTCN2018099512-appb-000033
Figure PCTCN2018099512-appb-000034
将公式(31)(32)带入公式(13)(14)中,公式(13)和(14)分别转变为公式(33)和(34):
Δmv hor=max(|(1-a)W|,|bW|)          (33)
Δmv ver=max(|bH|,|(1-a)H|)          (34)
通过确定仿射变换参数a和b,以及控制点之间的距离即可确定在前述的方2及方案3场景中Affine块的运动矢量差异的第一分量或者第二分量。
应理解,2参数仿射变换模型时,确定运动矢量差异的方法和采用6参数及4参数仿射变换模型时的确定方法本质上是相同的,为了简便,在此不再赘述。
在本发明实施例中,可选地,在解码过程中,仿射变换参数可以通过对各个参数进行迭代计算得到,比如将参数a加1,判断在该模型下运动补偿预测信号是否是最优。仿射变换参数也可以是根据邻近Affine块的仿射变换参数推导得到的。但本发明并不限于此。
在本发明实施例中,可选地,可以通过确定该第一控制点的运动矢量、该第二控制点的运动矢量、该第三控制点的运动矢量和该第四控制点的运动矢量,从而来确定仿射图像块的运动矢量差异;
相应地,在前述方案1的场景中,将该第一控制点的运动矢量的水平分量与该第二控制点的运动矢量的水平分量的差值确定为该第一水平分量差值;将该第一控制点的运动矢量的竖直分量和该第二控制点的运动矢量的竖直分量的差值,确定为该第一竖直分量差值;将该第三控制点的运动矢量的水平分量与该第四控制点的运动矢量的水平分量的差值确定为该第二水平分量差值;将该第三控制点的运动矢量的竖直分量和该第四控制点的运动矢量的竖直分量的差值,确定为该第二竖直分量差值。
在前述方案2的场景中,将该第一控制点的运动矢量的水平分量与该第二控制点的运动矢量的水平分量的差值确定为该第一水平分量差值;将该第一控制点的运动矢 量的竖直分量和该第二控制点的运动矢量的竖直分量的差值,确定为该第一竖直分量差值。
在前述方案3的场景中,将该第三控制点的运动矢量的水平分量与该第四控制点的运动矢量的水平分量的差值确定为该第二水平分量差值;将该第三控制点的运动矢量的竖直分量和该第四控制点的运动矢量的竖直分量的差值,确定为该第二竖直分量差值。
具体而言,可以直接确定出控制点的运动矢量,通过将运动矢量的各分量分别作差,就可以直接得到Affine块的运动矢量差异的第一分量和第二分量。
例如,图9是根据本发明实施例的仿射图像块及控制点的示意图。其中两个控制点A和B在同一水平线上,距离为w,两个控制点C和D在同一竖直线上,距离为h,如果已知控制点A、B、C和D点的运动矢量,则可以根据公式(11)和(12)确定Affine块的运动矢量差异的第一分量和第二分量:
Δmv hor=max(vx B-vx A,vy B-vy A)         (35)
Δmv ver=max(vx C-vx D,vy C-vy D)           (36)
在本发明实施例中,可选地,控制点A和C可以为同一个像素点。
在本发明实施例中,可选地,控制点A、B、C和D可以为Affine块的顶点,此时,控制点A和B的距离为Affine块的宽度W,控制点C和D的间距为Affine块的高度H。
在本发明实施例中,可选地,该第一控制点与该第二控制点为相邻的两个像素点,该第三控制点与该第四控制点为相邻的两个像素点,即控制点并不一定选在仿射图像块的四个角点,又叫顶点上,而是可以根据编解码端共同设置的,或者在码流中以信令的方式明示的,或者根据周边仿射图像块的控制点估计或者是复制得到的位于该仿射图像块内任意位置点,在此情况下;确定第一水平、竖直分量差值,以及第二水平、竖直分量差值具体为:
确定第一像素点的运动矢量、第二像素点的运动矢量和第三像素点的运动矢量,该第一像素点、该第二像素点和该第三像素点为互相不重合的像素点;确定该第一像素点与该第二像素点之间的第二水平距离和第二竖直距离;确定该第一像素点与该第三像素点之间的第三水平距离和第三竖直距离;根据该第一像素点的运动矢量、该第二像素点的运动矢量、该第三像素点的运动矢量、该第二水平距离、该第二竖直距离、该第三水平距离和该第三竖直距离,确定该第一水平分量差值、该第一竖直分量差值、该第二水平分量差值和该第二竖直分量差值。以上是以前述的方案1的三控制点为例,当采用前述方案2或方案3中的两控制点与方案1的三控制点的区别在于,仅取方案1中的第一分量差值或者第二分量差值作为二控制点仿射图像的运动矢量差异。
具体而言,假设A、B和C是图像块中任意互相不重合的三个像素点,三个像素点的位置如图10所示,三个点的运动矢量分别为(vx A,vy A)、(vx B,vy B)和(vx C,vy C)。点A与点B在水平方向的距离是w 1,竖直方向的距离是h 1,点A与点C在水平方向的距离是w 2,竖直方向的距离是h 2,点B与点C的在水平方向的距离为w 2-w 1,竖直方向的距离是h 1+h 2。假设在水平方向上相邻的两个像素点的运动矢量在水平方向的各分量的差异分别为Δmvx hor和Δmvy hor,在竖直方向上相邻的两个像素点的运动矢量在竖直方向的各分量的差异分别为Δmvx ver和Δmvy ver,由于图像块内运动矢量是线性变化的,则可 以通过确定A、B和C点的运动矢量确定Δmvx hor、Δmvy hor、Δmvx ver和Δmvy ver,从而可以确定图像块的相邻像素点的运动矢量差异。具体可以根据公式(37)~(40)确定:
vx B=vx A+w 1·Δmvx hor+h 1·Δmvx ver          (37)
vy B=vy A+w 1·Δmvy hor+h 1·Δmvy ver          (38)
vx C=vx A+w 2·Δmvx hor+h 2·Δmvx ver          (39)
vy C=vy A+w 2·Δmvy hor+h 2·Δmvy ver          (40)
还可以根据公式(37)和(38)以及公式(41)和(42)确定:
vx C=vx B+(w 2-w 1)·Δmvx hor+(h 2+h 1)·Δmvx ver         (41)
vy C=vy B+(w 2-w 1)·Δmvy hor+(h 2+h 1)·Δmvy ver         (42)
在本发明实施例中,可选地,解码设备可以从通过运动估计搜索得到所有控制点的运动矢量;可以从周围图像块获得所有控制点的运动矢量;可以根据仿射变换模型计算出所有控制点的运动矢量;可以通过运动估计搜索得到部分控制点的运动矢量,从邻近图像块获得其他控制点的运动矢量;可以通过仿射运动估计搜索得到部分控制点的运动矢量,根据仿射变换模型计算得到其他控制点的运动矢量;可以从邻近图像块获得部分控制点的运动矢量,根据仿射变换模型计算出其他控制点的运动矢量;但本发明并不限于此。
可选地,在S720中,可以将第一预设值确定为该仿射图像块的运动矢量精度;或根据该仿射图像块的邻近图像块的特性确定该仿射图像块的运动矢量精度,该邻近图像块为与该仿射图像块在空间上和/或时间上相邻的图像块。
具体而言,Affine块的运动矢量的值可以是整数,此时称运动矢量是整像素精度,即像素精度为1;运动矢量的值也可以是非整数的,此时称运动矢量是亚像素精度,包括1/2、1/4、1/8等精度。图11所示的是一个4×4的图像块,其中x表示的是整像素位置的像素,采集得到的图像只有整像素位置的像素。O表示的是1/2精度位置的像素,需要通过整像素位置的像素进行插值来得到。其他精度位置的像素值需要使用整像素精度像素或1/2精度像素进一步插值来获得。若当前像素点的运动矢量是整数,则指向参考图像中×所在的位置,若当前像素点的运动矢量是1/2精度,则指向参考图像中O所在的位置。
Affine块的运动矢量精度指Affine块内所有像素点的运动矢量的最高精度。Affine块的运动矢量精度可以是预先设定好的,例如整像素精度、1/2、1/4、1/8、1/16等精度。也可以是根据图Affine块邻近图像块的特性来确定,例如若周围的图像较为平滑,可以预测当前Affine块也较为平滑,则可以选用较高的运动矢量精度,例如1/8、1/16精度等,反之选用较低的运动矢量精度,例如整像素精度、1/2精度等。获得的精度用MvAc来表示。
可选地,如图12所示,S730具体包括:
S1201,根据该运动矢量精度与该运动矢量差异的第一分量的比例对该第一水平距离进行等比例调整得到该仿射运动补偿子图像块的水平方向的长度,确定该仿射图像块的水平方向的长度是否是该仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整该仿射运动补偿子图像块的水平方向的长度以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的调整后的水平方向的长度的整数倍。
具体地,该运动矢量精度与运动矢量差异的第一分量的比例为该运动矢量精度与运动矢量差异的第一分量的比值,该比值与该第一水平距离的乘积则为该仿射运动补偿子图像块的水平方向的长度,也可以称之为水平方向的初始长度;可以理解,该仿射运动补偿子图像块的水平方向的初始长度在某些情况下可能为非整数,此时需要对该初始长度取整,为保证精度,通常是向下取整,即,直接丢弃小部分,例如,初始长度值为8.35(即,8.35个单位像素的长度),且直接取8作为仿射运动补偿子图像块的水平方向的长度;当然,也可以采用四舍五入的取整原则,即小数部分小于5则向下取整,小数部分大于5,则向上取整,例如当计算得出的长度为8.86时,取9作为其长度,为了保证效率,初始长度的最小值应该不小于预设的值,例如不能小于2、4、8或者2 N等预设的值,该预设值通常设置为4,也不应大于仿射变换图像块的在水平方向的长度。该水平方向的初始长度或者水平方向的取整后的初始长度是否合适,取决于其是否能够将仿射图像块在水平方向的长度整除,若能整数,则说明仿射图像块在水平方向是否能够以该水平方向的初始长度或者水平方向取整后的初始长度为单位被划分成整数个子块。通常其调整方式是采用逐步递增/递减该水平方向的初始长度或者水平方向取整后的初始长度的方法,即,若确定该仿射图像块的水平方向的长度不是该仿射运动补偿子图像块的水平方向的长度的整数倍,则对该仿射运动补偿子图像块的水平方向的长度做增加/减少一个或者多个单位长度的调整,接着循环执行上述的方案直至该仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的调整后的长度的整数倍。其中,上述单位长度通常是一个单位像素,即,对该仿射运动补偿子图像块的水平方向的长度做加一/减一的调整,为不失通用性,也可以说是,对该仿射运动补偿子图像块的水平方向的长度按照固定的步长做增加/减少的调整,所述的步长为调整值,即,每个循环内对该仿射运动补偿子图像块的水平方向的长度进行调整的基本单位或者叫幅度;该步长通常为上述的一个单位像素,也可以是其他的值,如两个像素单位等。可选地,上述调整中所采用的步长/调整值也可以根据该仿射运动补偿子图像块的水平方向的初始长度的奇偶性变化,例如,当仿射运动补偿子图像块的水平方向的初始长度为奇数,选择奇数步长,例如,以奇数个单位长度,如一个单位长度为步长进行调整,当仿射运动补偿子图像块的水平方向的初始长度为偶数时,则选择偶数步长,例如,偶数个单位长度的步长。
此外,所述调整是增加还是减少可以根据解码端以及编码端共同约定来选择,也可以由编码端在码流中明示,解码端参照选择,也可以通过周边相邻的块运动矢量精度值来推导,或者根据仿射图像块与该仿射运动补偿子图像块的水平方向的长度之间的比值关系来确定,例如比值小于阈值则选择减少,否则选择增加。
为了简化算法,同时兼顾编解码效率,确定该仿射图像块的水平方向的长度不是该仿射运动补偿子图像块的水平方向的长度的整数倍时,则对该仿射运动补偿子图像块的水平方向的长度做增加一个预设单位长度的调整,接着循环执行上述的方案直至该仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的调整后的长度的整数倍。
此外,为了提高效率,节省运算时间,也可以将该仿射运动补偿子图像块的水平方向的长度朝向最接近整除该仿射图像块的水平方向的长度的值的方向调整,例如, 该仿射运动补偿子图像块的水平方向的长度为7,而仿射图像块的水平方向的长度为16,此时,对仿射运动补偿子图像块的水平方向的长度加1变成8,从而能整除16;同理,该仿射运动补偿子图像块的水平方向的长度为5,此时,对仿射运动补偿子图像块的水平方向的长度减1变成4,从而能整除16。若,该仿射运动补偿子图像块的水平方向的长度距离与邻近且可整除该仿射图像块的水平方向的长度的两个相邻的值的距离相等,例如,该仿射运动补偿子图像块的水平方向的长度为6,仿射图像块的水平方向的长度为16,邻近长度6且可整除16的两个相邻的值分别为4和8,此时,可以根据编解码端的需求选择朝某一方向调整,例如,如果是要求低延时,此时可以选择朝增加的方向调整,如果要求高质量,则选择朝减小的方向调整,对此,本发明不做限制。
此外,上述步骤S1201中的,当确定该仿射图像块的水平方向的长度不是该仿射运动补偿子图像块的水平方向的长度的整数倍时,为了更进一步的简化算法,可以在编解码端分别建立相同的表格,以允许的最小整除数,如,2 N为起始值,将仿射图像块水平方向的可能的最大长度划分为多个区间,区间的跨度为2 N+i,i∈(0,(log 2Wmax)-1),W max为仿射图像块水平方向的可能的最大长度。确定该仿射运动补偿子图像块的水平方向的长度所在的区间,以该仿射运动补偿子图像块的水平方向的长度所在的区间的下限值或者上限值为最终确定的所述仿射运动补偿子图像块的水平方向的长度。其上下限值的获取规则可以参照编解码两端约定,可以通过码流明示,或者可以通过四舍五入的方式选择临近的区间上限值或者下限值。通过以上的表格,可以采用根据仿射运动补偿子图像块的水平方向的初始长度采用查表的方式来确定该仿射运动补偿子图像块的水平方向的最终长度,从而可以替换前述步骤S1201中调整该仿射运动补偿子图像块的水平方向的长度的步骤,以降低系统复杂度并减少计算时间。
可选地,为了进一步降低该方案的计算复杂度,在步骤S1201中的,除了确定仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的长度的整数倍,还需要确定该仿射运动补偿子图像块的水平方向的长度是否是便于计算的预定长度S的整数倍,即,确定该仿射运动补偿子图像块的水平方向的长度是否满足条件:
(1)仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的长度的整数倍,且(2)该仿射运动补偿子图像块的水平方向的长度是预定长度S的整数倍;
若不满足,则调整该仿射运动补偿子图像块的水平方向的长度以使其满足上述的条件(1)和条件(2),即,该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,且该仿射运动补偿子图像块的调整后的水平方向的长度是该预设长度的整数倍。预设长度S通常取4,也可以取8、16、32等数值,或者说S=2 n,n为零或者正整数。本方案对于任意形状的仿射图像块均适用,若仿射图像块是采用四叉树(Qual Tree)的规则划分的情况下,由于上述判断条件(1)(2)中任一个条件的满足即可以满足另外一个条件,因此,仅需要保留一其中一个判定条件即可。上述条件(1)以及条件(2)是否满足的判断顺序以及依据判断结果对仿射运动补偿子图像块的水平方向的长度进行调整的顺序可以任意交换,为了区别, 可以将第一次调整叫做首次调整,而第二次调整(如果需要)叫做二次调整。
可选地,通过上述方式确定的该仿射运动补偿子图像块的水平方向的长度需要进行限幅操作,即通过比较的方式使的M位于下限Tm以及上限W之间,Tm为预设值,通常为4,W为仿射图像块的在水平方向的长度。
S1203,根据该运动矢量精度与该运动矢量差异的第二分量的比例对该第一竖直距离进行等比例调整得到该仿射运动补偿子图像块的竖直方向的长度,确定该仿射图像块的竖直方向的长度是否是该仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整该仿射运动补偿子图像块的竖直方向的长度以使该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
具体地,该运动矢量精度与运动矢量差异的第二分量的比例为该运动矢量精度与运动矢量差异的第二分量的比值,该比值与该第一竖直距离乘积则为该仿射运动补偿子图像块的竖直方向的长度,也可以称之为竖直方向的初始长度;可以理解,该仿射运动补偿子图像块的竖直方向的初始长度在某些情况下可能为非整数,此时需要对该初始长度取整,为保证精度,通常是向下取整,即,直接丢弃小部分,例如,初始长度值为8.35(即,8.35个单位像素的长度),且直接取8作为仿射运动补偿子图像块的竖直方向的长度;当然,也可以采用四舍五入的取整原则,即小数部分小于5则向下取整,小数部分大于5,则向上取整,例如当计算得出的长度为8.86时,取9作为其长度,为了保证效率,初始长度的最小值应该不小于预设的值,例如不能小于2、4、8或者2 N等预设的值,该预设值通常设置为4,也不应大于仿射变换图像块的在竖直方向的长度。该竖直方向的初始长度或者竖直方向的取整后的初始长度是否合适,取决于其是否能够将仿射图像块在竖直方向的长度整除,若能整数,则说明仿射图像块在竖直方向是否能够以该竖直方向的初始长度或者竖直方向取整后的初始长度为单位被划分成整数个子块。通常其调整方式是采用逐步递增/递减该竖直方向的初始长度或者竖直方向取整后的初始长度的方法,即,若确定该仿射图像块的竖直方向的长度不是该仿射运动补偿子图像块的竖直方向的长度的整数倍,则对该仿射运动补偿子图像块的竖直方向的长度做增加/减少一个或者多个单位长度的调整,接着循环执行上述的方案直至该仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的调整后的长度的整数倍。其中,上述单位长度通常是一个单位像素,即,对该仿射运动补偿子图像块的竖直方向的长度做加一/减一的调整。为了不失通用性,也可以说是对该仿射运动补偿子图像块的竖直方向的长度按照固定的步长做增加/减少的调整,所述的步长为调整值,即,每个循环内对仿射运动补偿子图像块的竖直方向的长度进行基本单位或者幅度;该步长通常为上述的一个单位像素,也可以是其他的值,如两个像素单位等。可选地,上述调整中所采用的步长/调整值也可以根据该仿射运动补偿子图像块的竖直方向的初始长度的奇偶性变化,例如,当仿射运动补偿子图像块的竖直方向的初始长度为奇数,选择奇数步长,例如,以奇数个单位长度,如一个单位长度为步长进行调整,当仿射运动补偿子图像块的竖直方向的初始长度为偶数时,则选择偶数步长,例如,偶数个单位长度的步长。
此外,所述调整是增加还是减少可以根据解码端以及编码端共同约定来选择,也可以由编码端在码流明示,解码端参照选择,也可以通过周边相邻的块运动矢量精度 值来推导,或者根据仿射图像块与该仿射运动补偿子图像块的竖直方向的长度之间的比值关系来确定,例如比值小于阈值则选择减少,否则选择增加。
为了简化算法,同时兼顾编解码效率,确定该仿射图像块的竖直方向的长度不是该仿射运动补偿子图像块的竖直方向的长度的整数倍,则对该仿射运动补偿子图像块的竖直方向的长度做增加一个预设单位长度的调整,接着循环执行上述的方案直至该仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的调整后的长度的整数倍。
此外,为了提高效率,节省运算时间,也可以将该仿射运动补偿子图像块的竖直方向的长度朝向最接近整除该仿射图像块的竖直方向的长度的方向调整,例如,该仿射运动补偿子图像块的竖直方向的长度为7,而仿射图像块的竖直方向的长度为16,此时,对仿射运动补偿子图像块的竖直方向的长度加1变成8,从而能整除16;同理,该仿射运动补偿子图像块的竖直方向的长度为5,此时,对仿射运动补偿子图像块的竖直方向的长度减1变成4,从而能整除16。若,该仿射运动补偿子图像块的竖直方向的长度距离与邻近且可整除该仿射图像块的竖直方向的长度的两个相邻的值的距离相等,例如,该仿射运动补偿子图像块的竖直方向的长度为6,仿射图像块的竖直方向的长度为16,邻近长度6且可整除16的两个相邻的值分别为4和8,此时,可以根据编解码端的需求选择朝某一方向调整,例如,如果是要求低延时,此时可以选择朝增加的方向调整,如果要求高质量,则选择朝减小的方向调整,对此,本发明不做限制。
此外,上述步骤S1203中的,当确定该仿射图像块的竖直方向的长度不是该仿射运动补偿子图像块的竖直方向的长度的整数倍时,为了更进一步的简化算法,可以在编解码端分别建立相同的表格,以允许的最小整除数,如,2 N为起始值,将仿射图像块竖直方向的可能的最大长度划分为多个区间,区间的跨度为2 N+i,i∈(0,(log 2Wmax)-1),W max为仿射图像块竖直方向的可能的最大长度。确定该仿射运动补偿子图像块的竖直方向的长度所在的区间,以该仿射运动补偿子图像块的竖直方向的长度所在的区间的下限值或者上限值为最终确定的所述仿射运动补偿子图像块的竖直方向的长度。其上下限值的获取规则可以参照编解码两端约定,可以通过码流明示,或者可以通过四舍五入的方式选择临近的区间上限值或者下限值。通过以上的表格,可以采用根据仿射运动补偿子图像块的竖直方向的初始长度采用查表的方式来确定该仿射运动补偿子图像块的竖直方向的最终长度,从而可以替换前述步骤S1203中调整该仿射运动补偿子图像块的竖直方向的长度的步骤降低系统复杂度以及计算时间。
可选地,为了进一步降低该方案的计算复杂度,在步骤S1203中的,除了确定,仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的长度的整数倍,还需要确定该仿射运动补偿子图像块的竖直方向的长度是否是便于计算的预定长度S的整数倍,即,确定该仿射运动补偿子图像块的竖直方向的长度是否满足条件:
(1)仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的长度的整数倍,且(2)该仿射运动补偿子图像块的竖直方向的长度是预定长度S的整数倍;
若不满足,则调整该仿射运动补偿子图像块的竖直方向的长度以使其满足上述的条件(1)和条件(2),即,该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,且该仿射运动补偿子图像块的调整后的竖直方向的长度是该预设长度的整数倍。预设长度S通常取4,也可以取8、16、32等数值,或者说S=2 n,n为零或者正整数。本方案对于任意形状的仿射图像块均适用,若仿射图像块是采用四叉树(Qual Tree)的规则划分的情况下,由于上述判断条件(1)(2)中任一个条件的满足即可以满足另外一个条件,因此,仅需要保留一其中一个判定条件即可。上述条件(1)以及条件(2)是否满足的判断顺序以及依据判断结果对仿射运动补偿子图像块的水平方向的长度进行调整的顺序可以任意交换,为了区别,可以将第一次调整叫做首次调整,而第二次调整(如果需要)叫做二次调整。
上述步骤S1201以及S1203适用于前述的方案1中三控制点场景中,在三控制点场景中,对于该仿射运动补偿子图像块在水平方向以及竖直方向的长度分别计算。而对于前述方案2以及方案3中的两控制点场景,可仅采用步骤S1201或者S1203来单独计算该仿射运动补偿子图像块在水平方向的长度或者该仿射运动补偿子图像块在竖直方向的长度,之后以该仿射运动补偿子图像块在水平/竖直方向的长度或者该仿射运动补偿子图像块在水平/竖直方向的调整后长度作为该仿射运动补偿子图像块在另一个方向,即竖直/水平方向的初始长度,并分别进行上述判断,即,
判断仿射图像块的竖直/水平方向的长度是否是该仿射运动补偿子图像块的竖直方向的长度的整数倍;
或者,
判断仿射图像块的竖直/水平方向的长度是否是该仿射运动补偿子图像块的竖直方向的长度的整数倍,以及确定该仿射运动补偿子图像块的竖直/水平方向的长度是否是预定长度S的整数倍。
在前述方案2及方案3的量控制点场景中,可以根据需求仅采用上述方案3中对于该仿射运动补偿子图像块在水平方的向长度的计算,或者对于该仿射运动补偿子图像块在竖直方向的长度的计算,并以所得到的仿射运动补偿子图像块的一个尺寸分量,即水平方向的长度或则竖直方向的长度为基础,来推导或计算另外一个尺寸分量。可以理解的是当仿射图像块的尺寸为2Nx2N的规则方形时,因为其水平方向和竖直方向的长度相同,则只需要对其水平或者竖直方向长度中的一个进行确定即可。
可选地,通过上述方式确定的该仿射运动补偿子图像块的竖直方向的长度需要进行限幅操作,即通过比较的方式使的M位于下限Tm以及上限W之间,Tm为预设值,通常为4,W为仿射图像块的在竖直方向的长度。
具体而言,通常获得的运动矢量差异Δmv hor和Δmv ver较小,表示每个像素点的运动矢量的精度过高,例如1/32,1/64等。过高的运动矢量精度对视频的压缩性能贡献不大,且会带来巨大的计算量。因此,根据之前获得的期望的运动矢量精度MvAc,来对Affine块进行划分,划分成多个Affine-MC块,保证每个Affine-MC块的运动矢量精度达到MvAc,其中,Δmv hor和Δmv ver的最小值不小于MvAc。
在本发明实施例中,可选地,假设第一控制点与第二控制点之间的水平距离为W,第三控制点与第四控制点之间的竖直距离为H,假设Affine-MC块的宽度为aMcW, 或记为M,高度为aMcH,或记为N;
在前述的方案1场景中,基于三控制点确定的仿射图像块的运动矢量差异,并获取仿射运动补偿子图像块的尺寸可以通过以下公式(43)来实现,即根据公式(43)确定M和N:
Figure PCTCN2018099512-appb-000035
Figure PCTCN2018099512-appb-000036
等同于:
Figure PCTCN2018099512-appb-000037
在前述的方案2场景中,基于水平方向的两控制点确定的仿射图像块的运动矢量差异,并获取仿射运动补偿子图像块的尺寸可以通过以下公式(46)来实现,即根据公式(46)确定M和N:
Figure PCTCN2018099512-appb-000038
等同于:
若Δmv hor≠0,
Figure PCTCN2018099512-appb-000039
若Δmv hor=0,M=N=W    (47)
在前述的方案3场景中,基于竖直方向的两控制点确定的仿射图像块的运动矢量差异,并获取仿射运动补偿子图像块的尺寸可以通过以下公式(48)来实现,即根据公式(48)确定M和N:
Figure PCTCN2018099512-appb-000040
等同于:
若Δmv ver≠0,
Figure PCTCN2018099512-appb-000041
若Δmv ver=0,M=N=H    (49)
根据公式(45)、(47)以及(49)计算得到M和N后,为了简化算法,需要进一步判断M,N是否便于运算,即,是否能够将宽度为W,高度为H的仿射图像块均匀划分为整数个仿射运动补偿子图像块,也即,判断W是否能被M整除,H是否能被N整除,如果不能整除,则对不能整除的值,即M和/或N进行调整,以使W能被M整除,H能被N整除,并且在限制范围Tm≤M≤W,Tn≤N≤H之内。
调整方法可以为:
1)当W不能被M整除时,逐步减小/增减M,直至W能被M整除;当H不能被N整除时,逐步减小/增加N,直至H能被N整除。在M=N的情况下,仅需要调整其中一个即可。
可选地,对M和N的上下限做一个限制,使得Tm≤M≤W,Tn≤N≤H,Tm和Tn一般设置为4。
2)通过查表的方式:在已构建好的二维表中,输入W和M,输出满足条件的M;输入H和N,输出满足条件的N。
可选地,根据公式(45)、(47)以及(49)计算得到M和N后,再进一步调整,使得W能被M整除,H能被N整除,并且M和N为S的倍数,并且在限制范围Tm≤M≤W, Tn≤N≤H之内。
调整方法可以为:
1)当W不能被M整除或者M不为S的倍数时,逐步减小M,直至W能被M整除并且为S的倍数;当H不能被N整除或者N不为S的倍数时,逐步减小N,直至H能被N整除并且为S的倍数。S通常设置为4。在M=N的情况下,仅需要调整其中一个即可。
可选地,对M和N的上下限做一个限制,使得Tm≤M≤W,Tn≤N≤H,Tm和Tn一般设置为4。
2)通过查表的方式:在已构建好的二维表中,输入W和M,输出满足条件的M,输入H和N,输出满足条件的N。
具体的上述方案可以通过以下表-1中实例性的算法代码来实现。
表-1
Figure PCTCN2018099512-appb-000042
Figure PCTCN2018099512-appb-000043
因此,本发明实施例的视频图像解码的方法,解码设备通过确定的仿射图像块的运动矢量差异、运动矢量精度和控制点之间的距离以及仿射图像块的尺寸,确定仿射运动补偿子图像块的尺寸,使得仿射图像块可被均匀的划分为多个尺寸相同仿射运动补偿子图像块,从而便于该方法的硬件/软件实现,同时降低复杂度。通过实验验证, 本发明可以使得编码端复杂度降低50%,解码端复杂度降低70%,同时保持了90~95%的性能,这可以使得基于Affine模型的运动补偿预测技术可以有效地投入到实际应用中。
可选地,如图13所示,S740包括:
S1301,确定该仿射运动补偿子图像块中每个仿射运动补偿子图像块的运动矢量;
S1303,根据该每个仿射运动补偿子图像块的运动矢量,确定该每个仿射运动补偿子图像块的运动补偿预测信号;
S1305,根据该每个仿射运动补偿子图像块的运动补偿预测信号对该每个仿射运动补偿子图像块进行解码。
应理解,在本发明实施例中,每个Affine-MC块可能包含多个像素点,需要从每个Affine-MC中选取一个像素点的运动矢量作为该Affine-MC块的运动矢量。
可选地,在S1301中,可以选取Affine-MC块的中心位置处的像素点的运动矢量作为该Affine-MC块的运动矢量,可以将Affine-MC块内所有像素点的运动矢量的平均值作为该Affine-MC块的运动矢量,可以选取位于Affine-MC块的左上角的像素点的运动矢量作为该Affine-MC块的运动矢量,但本发明并不限于此。
在本发明实施例中,可选地,对该每个仿射运动补偿子图像块的边界像素点的信号进行滤波,该边界像素点为位于每个仿射运动补偿子图像块的边界的一行或多行像素点。
在本发明实施例中,可选地,该边界像素点的信号包括运动补偿预测信号和/或重建信号,该重建信号为运动补偿预测信号与重建的残差信号之和。
具体而言,如图11所示,粗实线块表示Affine块,细实线块表示Affine-MC块,虚线框表示相邻的Affine-MC块的边界的像素,交叉点表示像素。其中,图11中虚线框的区域包含相邻Affine-MC块各自在边界的两行或者两列像素,也可以包含各自边界的一行或一列,三行或三列等。由于相邻的Affine-MC块的运动矢量可能不同,那么从参考图像中取得的预测信号在参考图像中不相邻,这会导致相邻Affine-MC块边界的预测信号之间的不连续,从而导致残差的不连续,影响残差的图像编码/解码性能,因此考虑对Affine-MC块边界处的运动补偿预测信号进行滤波。
重建信号一般是将运动补偿预测信号与重建的残差信号相加而得到。残差信号一般使用有损编码,这会导致重建的残差信号与原始的残差信号之间存在失真。相邻Affine-MC块的边界处的像素的失真方向可能不一致,例如第一个Affine-MC块右边的像素由于失真变大,右边相邻的Affine-MC块左边的像素由于失真变小,这会导致在Affine-MC块的重建像素的边界处像素值不连续,影响主观和客观的效果。因此需要对重建信号进行滤波。
在本发明实施例中,可选地,可以通过低通滤波器进行滤波,使得边界区域的像素值变化的更平缓,例如使用高斯滤波器进行滤波,但本发明并不限于此。
在本发明实施例中,可选地,可以采用重叠分块运动补偿(Overlapped block motion compensation,简称为“OBMC”方法进行滤波。对待滤波的像素使用其邻近的Affine-MC块的运动矢量做运动补偿预测,将获得的运动补偿预测信号与使用待滤波像素自己的运动矢量获得的运动补偿预测信号进行加权平均,得到最终的运动补偿预 测信号。
本发明实施例的视频图像解码的方法,解码设备通过确定的仿射图像块的运动矢量差异、运动矢量精度和控制点之间的距离,确定仿射运动补偿子图像块的尺寸,并根据仿射图像块尺寸与仿射运动补偿子图像块的尺寸关系来进一步调整使得仿射运动补偿子图像块的尺寸更便于实现,同时降低复杂度。通过实验验证,本发明可以使得编码端复杂度降低50%,解码端复杂度降低70%,同时保持了90~95%的性能,这可以使得基于Affine模型的运动补偿预测技术可以有效地投入到实际应用中。
可选地,可选地,本发明中解码方法也可以是:
解析码流,以获取仿射图像块的运动矢量差异以及该仿射图像块的运动矢量精度,其中,该仿射图像块内的像素点具有相同的仿射变换参数;
根据该运动矢量差异、该运动矢量精度和该仿射图像块中的控制点之间的距离,确定该仿射图像块中的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的在水平方向的长度为该仿射运动补偿子图像块的在水平方向的长度整数倍,且该仿射图像块在竖直方向的长度为该仿射运动补偿子图像块的在竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;
根据该仿射运动补偿子图像块的尺寸,对该仿射图像块进行解码处理。
或者;
解析码流,获取仿射图像块信息;
根据该仿射图像块信息确定该仿射图像块中的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,且该仿射图像块的在水平方向的长度为该仿射运动补偿子图像块的在水平方向的长度整数倍,且该仿射图像块在竖直方向的长度为该仿射运动补偿子图像块的在竖直方向的长度的整数倍;
根据该仿射运动补偿子图像块的尺寸,对该仿射图像块进行解码处理。
通过这种方式解码端可以无需重新计算,而直接用编码端传至解码端的参数来确定仿射运动补偿子图像块的尺寸,从而进一步降低计算的复杂度。
以上结合图1至图13详细描述了根据本发明实施例的视频图像解码的方法,前面已经说明本方案在解码端以及编码端的实现方式基本相同,为了更加清楚的说明这一点,下面将结合图14至图16描述根据本发明实施例的视频图像编码的方法。应注意,因为编码端的有关操作本质上与解码端的一致,为了避免重复,在此不再赘述各实现细节。
图14示出了根据本发明实施例的视频图像解码的方法的示意性流程图。
图14所示的方法可以由编码设备执行,例如编码器类似于解码器通常包括有预测处理单元、残余产生单元、变换处理单元、量化单元、逆量化单元、逆变换处理单元、重建单元、滤波器单元、解码图片缓冲器及熵编码单元。熵编码单元包含规则CABAC编解码引擎及旁通编解码引擎。预测处理单元包含帧间预测处理单元及帧内预测处理单元。帧间预测处理单元包含运动估计单元及运动补偿单元。在其它实例中,编码器可包含更多、更少或不同的功能组件。类似于解码器,本发明的编码方法主要应用在帧间预测处理单元进行帧间预测的过程中,编码器的各个功能单元的详细结构可以参 照现有技术如H.265标准中的规定及描述,本发明再次不展开描述,本发明仅通过以下实施例来说明本发明实施例的方法中如何实现自适应地确定仿射运动补偿子图像块的尺寸并进行编码的基本过程。
具体地,如图14所示,方法1400包括:
S1410,确定仿射图像块的运动矢量差异;
S1430,确定该仿射图像块的运动矢量精度;
S1450,根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的在水平方向的长度为该仿射运动补偿子图像块的在水平方向的长度整数倍,且该仿射图像块在竖直方向的长度为该仿射运动补偿子图像块的在竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;
S1470,根据该仿射运动补偿子图像块的尺寸,对该述仿射图像块进行编码处理。
具体而言,解码设备根据确定的控制点,确定仿射图像块的运动矢量差异,并确定该仿射图像块的运动矢量精度,根据确定的运动矢量差异、运动矢量精度和控制点之间的距离以及仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该仿射运动补偿子图像块的尺寸即为该仿射图像块的划分尺寸;基于该划分尺寸,所述仿射图像块被划分为多个具有相同尺寸的仿射运动补偿子图像块,然后基于该仿射运动补偿子图像块对所述仿射图像块进行编码。
因此,帧间预测处理单元通过运行本发明实施例的视频图像编码的方法,利用确定的仿射图像块的运动矢量差异、运动矢量精度和控制点之间的距离以及仿射图像块的尺寸,确定仿射运动补偿子图像块的尺寸,根据该仿射运动补偿子图像块的尺寸将该仿射图像块划分成多个大小一致的仿射运动补偿子图像之后进行编码处理,由此,在编码过程中能够根据上述参数的变化自适应的选取合适大小的仿射运动补偿子图像块,降低编码的复杂度并提高编码性能即压缩效率。
优选地,S1410包括:
根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量;和/或
根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量;
其中,该第一控制点与该第二控制点之间具有第一水平距离,该第三控制点与该第四控制点之间具有第一竖直距离。需要说明的是,上述步骤S1410中所包含的方案中的“和/或”具体表示了如下三种不同的技术方案:
方案1:基于三控制点的仿射图像块的运动矢量差异确定方法;其包括:
根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量,以及,根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量。
方案2:基于水平方向两控制点的仿射图像块的运动矢量差异确定方法;其包括:根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢 量差异的第一分量。
方案3:基于竖直方向两控制点的仿射图像块的运动矢量差异确定方法:其包括:根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量。
应理解,在本发明实施例中,该运动矢量差异的第一分量指该运动矢量差异的水平分量,该运动矢量差异的第二分量指该运动矢量差异的竖直分量,在方案1中,该运动矢量差异的第一分量和该运动矢量差异的第二分量共同体现仿射图像块的运动矢量差异,而在方案2及方案3中,该运动矢量差异的第一分量及该运动矢量差异的第二分量分别独立的体现仿射图像块的运动矢量差异。换句话说,即,在方案1种,仿射图像块的运动矢量差异包括运动矢量差异的第一分量和该运动矢量差异的第二分量;在方案2中,仿射图像块的运动矢量差异包括运动矢量差异的第一分量;在方案3中,仿射图像块的运动矢量差异包括运动矢量差异的第三分量。还应理解,在本发明实施例中,第一、第二、第三和第四只是为了区分像素点,而不应该对本发明的保护范围构成任何限定,例如,第一控制点也可以称为第二控制点,第二控制点可以成为第一控制点等。
在本发明实施例中,可选地,该第一控制点和该第三控制点为同一个像素点,也就是说,选取的控制点的个数为3个,并且3个控制点中的一个控制点与其他2个控制点中的一个控制点位于同一水平线上,与其他2个控制点中的另一个控制点位于同一竖直线上。
在本发明实施例中,可选地,该第一控制点、该第二控制点、该第三控制点和该第四控制点为该Affine块的顶点,假设一个Affine块的4个顶点分别标记为左上角顶点、左下角顶点、右上角顶点和右下角顶点,则:
在前述方案1中,可以选择位于两个正交方向上的任意三个顶点来确定该Affine块的运动矢量差异,例如,可以选择左上角顶点、左下角顶点和右上角顶点,可以选择左上角顶点、右上角顶点和右下角顶点;
在前述方案2中,可以选择位于同一水平线上的任意两个顶点来确定该Affine块的运动矢量差异,例如,可以选择左上角顶点和右上角顶点,或者选择左下角顶点和右下角顶点;
在前述方案3中,可以选择位于同一竖直线上的任意两个顶点来确定该Affine块的运动矢量差异,例如,可以选择左上角顶点和左下角顶点,或者选择右上角顶点和右下角顶点;本发明对此不作限定。
在本发明实施例中,可选地,可以将第一控制点与第二控制点的运动矢量的两个方向(水平方向、竖直方向,或者成为,x方向,y方向)上的分量中任意一个方向上的分量的差值确定为该Affine块的运动矢量差异的第一分量,可以将第三控制点与第四控制点的运动矢量的两个方向上的分量中任意一个方向上的分量的差值确定为该Affine块的运动矢量差异的第二分量,该运动矢量差异的确定方式适用于前述的方案1、2、3;还可以根据实际对编码复杂度和编码性能的要求,选择介于第一控制点与第二控制点的运动矢量的两个方向上的分量的两个差值之间的数值确定为该第一分量,选择介于第三控制点与第四控制点的运动矢量的两个方向上的分量的两个差值之间的 数值确定为该第二分量,本发明对此不作限定。
通常,第一控制点至第四控制点中的每一个控制点的运动矢量均包含有两分量,即水平分量及竖直分量,因此,前述步骤中,根据位于同一水平线上的第一控制点与第二控制点的运动矢量的差值,确定该运动矢量差异的第一分量,以及,根据位于同一竖直线上的第三控制点与第四控制点的运动矢量的差值,确定该运动矢量差异的第二分量,具体可以通过以下的方式来实现:
确定该第一控制点与该第二控制点的运动矢量的第一水平分量差值和第一竖直分量差值,将该第一水平分量差值和该第一竖直分量差值中的最大值确定为该运动矢量差异的第一分量;
相应的,确定该第三控制点与该第四控制点的运动矢量的第二水平分量差值和第二竖直分量差值,将该第二水平分量差值和该第二竖直分量差值中的最大值确定为该运动矢量差异的第二分量。
在本发明实施例中,可选地,根据仿射模型来获得上述的运动矢量差值,即通过确定该仿射图像块内的像素点的仿射变换参数来获取运动矢量的差值,需要说明的是,该仿射图像块内的像素点具有相同的仿射变换参数;
相应地,前述步骤中,确定该第一控制点与该第二控制点的运动矢量的第一水平分量差值和第一竖直分量差值,具体为:根据该仿射变换参数和该第一水平距离,确定该第一水平分量差值和该第一竖直分量差值;前述步骤中,确定该第三控制点与该第四控制点的运动矢量的第二水平分量差值和第二竖直分量差值,具体为:根据该仿射变换参数和该第一竖直距离,确定该第二水平分量差值和该第二竖直分量差值。
应理解,前述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
在本发明实施例中,可选地,仿射变换模型可以采用现有技术中的6参数仿射变换模型,也可以采用4参数或2参数仿射变换模型,6参数仿射变换模型主要应用于前述方案1中的3控制点的场景中,4参数仿射变换模型主要应用于前述方案2及3中的两控制点的场景中,具体内容请参照本文在介绍解码方法中的描述。
在本发明实施例中,可选地,可以通过确定该第一控制点的运动矢量、该第二控制点的运动矢量、该第三控制点的运动矢量和该第四控制点的运动矢量,从而来确定仿射图像块的运动矢量差异;
相应地,在前述方案1的场景中,将该第一控制点的运动矢量的水平分量与该第二控制点的运动矢量的水平分量的差值确定为该第一水平分量差值;将该第一控制点的运动矢量的竖直分量和该第二控制点的运动矢量的竖直分量的差值,确定为该第一竖直分量差值;将该第三控制点的运动矢量的水平分量与该第四控制点的运动矢量的水平分量的差值确定为该第二水平分量差值;将该第三控制点的运动矢量的竖直分量和该第四控制点的运动矢量的竖直分量的差值,确定为该第二竖直分量差值。
在前述方案2的场景中,将该第一控制点的运动矢量的水平分量与该第二控制点的运动矢量的水平分量的差值确定为该第一水平分量差值;将该第一控制点的运动矢量的竖直分量和该第二控制点的运动矢量的竖直分量的差值,确定为该第一竖直分量差值。
在前述方案3的场景中,将该第三控制点的运动矢量的水平分量与该第四控制点的运动矢量的水平分量的差值确定为该第二水平分量差值;将该第三控制点的运动矢量的竖直分量和该第四控制点的运动矢量的竖直分量的差值,确定为该第二竖直分量差值。
具体而言,可以直接确定出控制点的运动矢量,通过将运动矢量的各分量分别作差,就可以直接得到Affine块的运动矢量差异的第一分量和第二分量。
在本发明实施例中,可选地,该第一控制点与该第二控制点为相邻的两个像素点,该第三控制点与该第四控制点为相邻的两个像素点,即控制点并不一定选在仿射图像块的四个角点,又叫顶点上,而是可以根据编解码端共同设置的,或者在码流中以信令的方式明示的,或者根据周边仿射图像块的控制点估计或者是复制得到的位于该仿射图像块内任意位置点,在此情况下;确定第一水平、竖直分量差值,以及第二水平、竖直分量差值具体为:
确定第一像素点的运动矢量、第二像素点的运动矢量和第三像素点的运动矢量,该第一像素点、该第二像素点和该第三像素点为互相不重合的像素点;确定该第一像素点与该第二像素点之间的第二水平距离和第二竖直距离;确定该第一像素点与该第三像素点之间的第三水平距离和第三竖直距离;根据该第一像素点的运动矢量、该第二像素点的运动矢量、该第三像素点的运动矢量、该第二水平距离、该第二竖直距离、该第三水平距离和该第三竖直距离,确定该第一水平分量差值、该第一竖直分量差值、该第二水平分量差值和该第二竖直分量差值。以上是以前述的方案1的三控制点为例,根据前面的示例可以,当采用前述方案2或方案3中的两控制点与方案1的三控制点的区别在于,仅取方案1中的第一分量差值或者第二分量差值作为二控制点仿射图像的运动矢量差异。
在本发明实施例中,可选地,编码设备可以从通过运动估计搜索得到所有控制点的运动矢量;可以从周围图像块获得所有控制点的运动矢量;可以根据仿射变换模型计算出所有控制点的运动矢量;可以通过运动估计搜索得到部分控制点的运动矢量,从邻近图像块获得其他控制点的运动矢量;可以通过仿射运动估计搜索得到部分控制点的运动矢量,根据仿射变换模型计算得到其他控制点的运动矢量;可以从邻近图像块获得部分控制点的运动矢量,根据仿射变换模型计算出其他控制点的运动矢量;但本发明并不限于此。
可选地,在S1430中,可以将第一预设值确定为该仿射图像块的运动矢量精度;或根据该仿射图像块的邻近图像块的特性确定该仿射图像块的运动矢量精度,该邻近图像块为与该仿射图像块在空间上和/或时间上相邻的图像块。
可选地,如图15所示,S1450具体包括:
S1501,根据该运动矢量精度与该运动矢量差异的第一分量的比例对该第一水平距离进行等比例调整得到该仿射运动补偿子图像块的水平方向的长度,确定该仿射图像块的水平方向的长度是否是该仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整该仿射运动补偿子图像块的水平方向的长度以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的调整后的水平方向的长度的整数倍。
具体地,该运动矢量精度与运动矢量差异的第一分量的比例为该运动矢量精度与 运动矢量差异的第一分量的比值,该比值与该第一水平距离的乘积则为该仿射运动补偿子图像块的水平方向的长度,也可以称之为水平方向的初始长度;可以理解,该仿射运动补偿子图像块的水平方向的初始长度在某些情况下可能为非整数,此时需要对该初始长度取整,为保证精度,通常是向下取整,即,直接丢弃小部分,例如,初始长度值为8.35(即,8.35个单位像素的长度),且直接取8作为仿射运动补偿子图像块的水平方向的长度;当然,也可以采用四舍五入的取整原则,即小数部分小于5则向下取整,小数部分大于5,则向上取整,例如当计算得出的长度为8.86时,取9作为其长度,为了保证效率,初始长度的最小值应该不小于预设的值,例如不能小于2、4、8或者2 N等预设的值,该预设值通常设置为4,也不应大于仿射变换图像块的在水平方向的长度。该水平方向的初始长度或者水平方向的取整后的初始长度是否合适,取决于其是否能够将仿射图像块在水平方向的长度整除,若能整数,则说明仿射图像块在水平方向是否能够以该水平方向的初始长度或者水平方向取整后的初始长度为单位被划分成整数个子块。通常其调整方式是采用逐步递增/递减该水平方向的初始长度或者水平方向取整后的初始长度的方法,即,若确定该仿射图像块的水平方向的长度不是该仿射运动补偿子图像块的水平方向的长度的整数倍,则对该仿射运动补偿子图像块的水平方向的长度做增加/减少一个或者多个单位长度的调整,接着循环执行上述的方案直至该仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的调整后的长度的整数倍。其中,上述单位长度通常是一个单位像素,即,对该仿射运动补偿子图像块的水平方向的长度做加一/减一的调整,为了不失通用性,也可以说是对该仿射运动补偿子图像块的竖直方向的长度按照固定的步长做增加/减少的调整,所述的步长为调整值,即,每个循环内对仿射运动补偿子图像块的竖直方向的长度进行基本单位或者幅度;该步长通常为上述的一个单位像素,也可以是其他的值,如两个像素单位等。可选地,上述调整中所采用的步长/调整值也可以根据该仿射运动补偿子图像块的水平方向的初始长度的奇偶性变化,例如,当仿射运动补偿子图像块的水平方向的初始长度为奇数,选择奇数步长,例如,以奇数个单位长度,如一个单位长度为步长进行调整,当仿射运动补偿子图像块的水平方向的初始长度为偶数时,则选择偶数步长,例如,偶数个单位长度的步长。
此外,所述调整是增加还是减少可以根据解码端以及编码端共同约定来选择,也可以在编码端在码流明示,解码端参照选择,也可以通过周边相邻的块运动矢量精度值来推导,或者根据仿射图像块与该仿射运动补偿子图像块的水平方向的长度之间的比值关系来确定,例如比值小于阈值则选择减少,否则选择增加。
为了简化算法,同时兼顾编解码效率,确定该仿射图像块的水平方向的长度不是该仿射运动补偿子图像块的水平方向的长度的整数倍,则对该仿射运动补偿子图像块的水平方向的长度做增加一个预设单位长度的调整,接着循环执行上述的方案直至该仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的调整后的长度的整数倍。
此外,为了提高效率,节省运算时间,也可以将该仿射运动补偿子图像块的水平方向的长度朝向最接近整除该仿射图像块的水平方向的长度的方向调整,例如,该仿射运动补偿子图像块的水平方向的长度为7,而仿射图像块的水平方向的长度为16, 此时,对仿射运动补偿子图像块的水平方向的长度加1变成8,从而能整除16;同理,该仿射运动补偿子图像块的水平方向的长度为5,此时,对仿射运动补偿子图像块的水平方向的长度减1变成4,从而能整除16。若,该仿射运动补偿子图像块的水平方向的长度距离与邻近且可整除该仿射图像块的水平方向的长度的两个相邻的值的距离相等,例如,该仿射运动补偿子图像块的水平方向的长度为6,仿射图像块的水平方向的长度为16,邻近长度6且可整除16的两个相邻的值分别为4和8,此时,可以根据编解码端的需求选择朝某一方向调整,例如,如果是要求低延时,此时可以选择朝增加的方向调整,如果要求高质量,则选择朝减小的方向调整,对此,本发明不做限制。
此外,上述步骤S1201中的,当确定该仿射图像块的水平方向的长度不是该仿射运动补偿子图像块的水平方向的长度的整数倍时,为了更进一步的简化算法,可以在编解码端分别建立相同的表格,以允许的最小整除数,如,2 N为起始值,将仿射图像块水平方向的可能的最大长度划分为多个区间,区间的跨度为2 N+i,i∈(0,(log 2Wmax)-1),W max为仿射图像块水平方向的可能的最大长度。确定该仿射运动补偿子图像块的水平方向的长度所在的区间,以该仿射运动补偿子图像块的水平方向的长度所在的区间的下限值或者上限值为最终确定的所述仿射运动补偿子图像块的水平方向的长度。其上下限值的获取规则可以参照编解码两端约定,可以通过码流明示,或者可以通过四舍五入的方式选择临近的区间上限值或者下限值。通过以上的表格,可以采用根据仿射运动补偿子图像块的水平方向的初始长度采用查表的方式来确定该仿射运动补偿子图像块的水平方向的最终长度,从而可以替换前述步骤S1501中调整该仿射运动补偿子图像块的水平方向的长度的步骤降低系统复杂度以及计算时间。
可选地,为了进一步降低该方案的计算复杂度,在步骤S1501中的,除了确定仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的长度的整数倍,还需要确定该仿射运动补偿子图像块的水平方向的长度是否是便于计算的预定长度S的整数倍,即,确定该仿射运动补偿子图像块的水平方向的长度是否满足条件:
(1)仿射图像块的水平方向的长度是该仿射运动补偿子图像块的水平方向的长度的整数倍,且(2)该仿射运动补偿子图像块的水平方向的长度是预定长度S的整数倍;
若不满足,则调整该仿射运动补偿子图像块的水平方向的长度以使其满足上述的条件(1)和条件(2),即,该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,且该仿射运动补偿子图像块的调整后的水平方向的长度是该预设长度的整数倍。预设长度S通常取4,也可以取8、16、32等数值,或者说S=2 n,n为零或者正整数。本方案对于任意形状的仿射图像块均适用,若仿射图像块是采用四叉树(Qual Tree)的规则划分的情况下,由于上述判断条件(1)(2)中任一个条件的满足即可以满足另外一个条件,因此,仅需要保留一其中一个判定条件即可。
可选地,通过上述方式确定的该仿射运动补偿子图像块的水平方向的长度需要进行限幅操作,即通过比较的方式使的M位于下限Tm以及上限W之间,Tm为预设值, 通常为4,W为仿射图像块的在水平方向的长度。
S1503,根据该运动矢量精度与该运动矢量差异的第二分量的比例对该第一竖直距离进行等比例调整得到该仿射运动补偿子图像块的竖直方向的长度,确定该仿射图像块的竖直方向的长度是否是该仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整该仿射运动补偿子图像块的水平方向的长度以使该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
具体地,该运动矢量精度与运动矢量差异的第二分量的比例为该运动矢量精度与运动矢量差异的第二分量的比值,该比值与该第一竖直距离乘积则为该仿射运动补偿子图像块的竖直方向的长度,也可以称之为竖直方向的初始长度;可以理解,该仿射运动补偿子图像块的竖直方向的初始长度在某些情况下可能为非整数,此时需要对该初始长度取整,为保证精度,通常是向下取整,即,直接丢弃小部分,例如,初始长度值为8.35(即,8.35个单位像素的长度),且直接取8作为仿射运动补偿子图像块的竖直方向的长度;当然,也可以采用四舍五入的取整原则,即小数部分小于5则向下取整,小数部分大于5,则向上取整,例如当计算得出的长度为8.86时,取9作为其长度,为了保证效率,初始长度的最小值应该不小于预设的值,例如不能小于2、4、8或者2 N等预设的值,该预设值通常设置为4,也不应大于仿射变换图像块的在竖直方向的长度。该竖直方向的初始长度或者竖直方向的取整后的初始长度是否合适,取决于其是否能够将仿射图像块在竖直方向的长度整除,若能整数,则说明仿射图像块在竖直方向是否能够以该竖直方向的初始长度或者竖直方向取整后的初始长度为单位被划分成整数个子块。通常其调整方式是采用逐步递增/递减该竖直方向的初始长度或者竖直方向取整后的初始长度的方法,即,若确定该仿射图像块的竖直方向的长度不是该仿射运动补偿子图像块的竖直方向的长度的整数倍,则对该仿射运动补偿子图像块的竖直方向的长度做增加/减少一个或者多个单位长度的调整,接着循环执行上述的方案直至该仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的调整后的长度的整数倍。其中,上述单位长度通常是一个单位像素,即,对该仿射运动补偿子图像块的竖直方向的长度做加一/减一的调整,为了不失通用性,也可以说是对该仿射运动补偿子图像块的竖直方向的长度按照固定的步长做增加/减少的调整,所述的步长为调整值,即,每个循环内对仿射运动补偿子图像块的竖直方向的长度进行基本单位或者幅度;该步长通常为上述的一个单位像素,也可以是其他的值,如两个像素单位等。可选地,上述调整中所采用的步长/调整值也可以根据该仿射运动补偿子图像块的竖直方向的初始长度的奇偶性变化,例如,当仿射运动补偿子图像块的竖直方向的初始长度为奇数,选择奇数步长,例如,以奇数个单位长度,如一个单位长度为步长进行调整,当仿射运动补偿子图像块的竖直方向的初始长度为偶数时,则选择偶数步长,例如,偶数个单位长度的步长。
此外,所述调整是增加还是减少可以根据解码端以及编码端共同约定来选择,也可以由编码端在码流明示,解码端参照选择,也可以通过周边相邻的块运动矢量精度值来推导,或者根据仿射图像块与该仿射运动补偿子图像块的竖直方向的长度之间的比值关系来确定,例如比值小于阈值则选择减少,否则选择增加。
为了简化算法,同时兼顾编解码效率,确定该仿射图像块的竖直方向的长度不是 该仿射运动补偿子图像块的竖直方向的长度的整数倍,则对该仿射运动补偿子图像块的竖直方向的长度做增加一个预设单位长度的调整,接着循环执行上述的方案直至该仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的调整后的长度的整数倍。
此外,为了提高效率,节省运算时间,也可以将该仿射运动补偿子图像块的竖直方向的长度朝向最接近整除该仿射图像块的竖直方向的长度的方向调整,例如,该仿射运动补偿子图像块的竖直方向的长度为7,而仿射图像块的竖直方向的长度为16,此时,对仿射运动补偿子图像块的竖直方向的长度加1变成8,从而能整除16;同理,该仿射运动补偿子图像块的竖直方向的长度为5,此时,对仿射运动补偿子图像块的竖直方向的长度减1变成4,从而能整除16。若,该仿射运动补偿子图像块的竖直方向的长度距离与邻近且可整除该仿射图像块的竖直方向的长度的两个相邻的值的距离相等,例如,该仿射运动补偿子图像块的竖直方向的长度为6,仿射图像块的竖直方向的长度为16,邻近长度6且可整除16的两个相邻的值分别为4和8,此时,可以根据编解码端的需求选择朝某一方向调整,例如,如果是要求低延时,此时可以选择朝增加的方向调整,如果要求高质量,则选择朝减小的方向调整,对此,本发明不做限制。
此外,上述步骤S1503中的,当确定该仿射图像块的竖直方向的长度不是该仿射运动补偿子图像块的竖直方向的长度的整数倍时,为了更进一步的简化算法,可以在编解码端分别建立相同的表格,以允许的最小整除数,如,2 N为起始值,将仿射图像块竖直方向的可能的最大长度划分为多个区间,区间的跨度为2 N+i,i∈(0,(log 2Wmax)-1),W max为仿射图像块竖直方向的可能的最大长度。确定该仿射运动补偿子图像块的竖直方向的长度所在的区间,以该仿射运动补偿子图像块的竖直方向的长度所在的区间的下限值或者上限值为最终确定的所述仿射运动补偿子图像块的竖直方向的长度。其上下限值的获取规则可以参照编解码两端约定,可以通过码流明示,或者可以通过四舍五入的方式选择临近的区间上限值或者下限值。通过以上的表格,可以采用根据仿射运动补偿子图像块的竖直方向的初始长度采用查表的方式来确定该仿射运动补偿子图像块的竖直方向的最终长度,从而可以替换前述步骤S1503中调整该仿射运动补偿子图像块的竖直方向的长度的步骤降低系统复杂度以及计算时间。
可选地,为了进一步降低该方案的计算复杂度,在步骤S1503中的,除了确定,仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的长度的整数倍,还需要确定该仿射运动补偿子图像块的竖直方向的长度是否是便于计算的预定长度S的整数倍,即,确定该仿射运动补偿子图像块的竖直方向的长度是否满足条件:
(1)仿射图像块的竖直方向的长度是该仿射运动补偿子图像块的竖直方向的长度的整数倍,且(2)该仿射运动补偿子图像块的竖直方向的长度是预定长度S的整数倍;
若不满足,则调整该仿射运动补偿子图像块的竖直方向的长度以使其满足上述的条件(1)和条件(2),即,该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,且该仿射运动补偿子图像块的调整后的竖 直方向的长度是该预设长度的整数倍。预设长度S通常取4,也可以取8、16、32等数值,或者说S=2 n,n为零或者正整数。本方案对于任意形状的仿射图像块均适用,若仿射图像块是采用四叉树(Qual Tree)的规则划分的情况下,由于上述判断条件(1)(2)中任一个条件的满足即可以满足另外一个条件,因此,仅需要保留一其中一个判定条件即可。
可选地,通过上述方式确定的该仿射运动补偿子图像块的竖直方向的长度需要进行限幅操作,即通过比较的方式使的M位于下限Tm以及上限W之间,Tm为预设值,通常为4,W为仿射图像块的在竖直方向的长度。
上述确定以及调整仿射运动补偿子图像块的尺寸的具体实现方式请参照本文中对解码方法中的具体描述。
因此,本发明实施例的视频图像编码的方法,编码设备通过确定的仿射图像块的运动矢量差异、运动矢量精度和控制点之间的距离,确定仿射运动补偿子图像块的尺寸,并根据仿射图像块尺寸与仿射运动补偿子图像块的尺寸关系来进一步调整使得仿射运动补偿子图像块的尺寸更便于实现,同时降低复杂度。通过实验验证,本发明可以使得编码端复杂度降低50%,解码端复杂度降低70%,同时保持了90~95%的性能,这可以使得基于Affine模型的运动补偿预测技术可以有效地投入到实际应用中。
可选地,如图16所示,S1470包括:
S1601,确定该仿射运动补偿子图像块中每个仿射运动补偿子图像块的运动矢量;
S1603,根据该每个仿射运动补偿子图像块的运动矢量,确定该每个仿射运动补偿子图像块的运动补偿预测信号;
S1605,根据该每个仿射运动补偿子图像块的运动补偿预测信号对该每个仿射运动补偿子图像块进行编码。
应理解,在本发明实施例中,每个Affine-MC块可能包含多个像素点,需要从每个Affine-MC中选取一个像素点的运动矢量作为该Affine-MC块的运动矢量。
可选地,在S1601中,可以选取Affine-MC块的中心位置处的像素点的运动矢量作为该Affine-MC块的运动矢量,可以将Affine-MC块内所有像素点的运动矢量的平均值作为该Affine-MC块的运动矢量,可以选取位于Affine-MC块的左上角的像素点的运动矢量作为该Affine-MC块的运动矢量,但本发明并不限于此。
在本发明实施例中,可选地,对该每个仿射运动补偿子图像块的边界像素点的信号进行滤波,该边界像素点为位于每个仿射运动补偿子图像块的边界的一行或多行像素点。
在本发明实施例中,可选地,该边界像素点的信号包括运动补偿预测信号和/或重建信号,该重建信号为运动补偿预测信号与重建的残差信号之和。
重建信号一般是将运动补偿预测信号与重建的残差信号相加而得到。残差信号一般使用有损编码,这会导致重建的残差信号与原始的残差信号之间存在失真。相邻Affine-MC块的边界处的像素的失真方向可能不一致,例如第一个Affine-MC块右边的像素由于失真变大,右边相邻的Affine-MC块左边的像素由于失真变小,这会导致在Affine-MC块的重建像素的边界处像素值不连续,影响主观和客观的效果。因此需要对重建信号进行滤波。
在本发明实施例中,可选地,可以通过低通滤波器进行滤波,使得边界区域的像素值变化的更平缓,例如使用高斯滤波器进行滤波,但本发明并不限于此。
在本发明实施例中,可选地,可以采用重叠分块运动补偿(Overlapped block motion compensation,简称为“OBMC”方法进行滤波。对待滤波的像素使用其邻近的Affine-MC块的运动矢量做运动补偿预测,将获得的运动补偿预测信号与使用待滤波像素自己的运动矢量获得的运动补偿预测信号进行加权平均,得到最终的运动补偿预测信号。
本发明实施例的视频图像解码的方法,解码设备通过确定的仿射图像块的运动矢量差异、运动矢量精度和控制点之间的距离,确定仿射运动补偿子图像块的尺寸,并根据仿射图像块尺寸与仿射运动补偿子图像块的尺寸关系来进一步调整使得仿射运动补偿子图像块的尺寸更便于实现,同时降低复杂度。通过实验验证,本发明可以使得编码端复杂度降低50%,解码端复杂度降低70%,同时保持了90~95%的性能,这可以使得基于Affine模型的运动补偿预测技术可以有效地投入到实际应用中。
下面将结合图17介绍用于实施本发明的解码装置1700,该解码装置1700包括:
运动矢量差异确定模块1710,用于确定仿射图像块的运动矢量差异;
运动矢量精度确定模块1730,用于确定该仿射图像块的运动矢量精度;
子图像块尺寸确定模块1750,用于根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;以及,
解码模块1770,用于根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行解码处理。
具体而言,解码装置根据确定的控制点,确定仿射图像块的运动矢量差异,并确定该仿射图像块的运动矢量精度,根据确定的运动矢量差异、运动矢量精度、控制点之间的距离以及仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该仿射运动补偿子图像块的尺寸即为该仿射图像块的划分尺寸;基于该划分尺寸,所述仿射图像块被划分为多个具有相同尺寸的仿射运动补偿子图像块,然后基于该仿射运动补偿子图像块对所述仿射图像块进行解码。该解码装置中的各个模块为实现本发明解码方法中所包含的各种执行步骤的功能主体,即具备实现完整实现本发明解码方法中各个方法步骤,如S710至S740中的各个步骤以及这些步骤的扩展及变形的功能主体,具体请参见本文中对解码方法的介绍,为简洁起见,本文将不再赘述。
下面将结合图18详细描述本发明实施例的编码装置,该编码装置1800包括:
运动矢量差异确定模块1810,用于确定仿射图像块的运动矢量差异;
运动矢量精度确定模块1830,用于确定该仿射图像块的运动矢量精度;
子图像块尺寸确定模块1850,用于根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以 使该仿射图像块的在水平方向的长度为该仿射运动补偿子图像块的在水平方向的长度整数倍,且该仿射图像块在竖直方向的长度为该仿射运动补偿子图像块的在竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;
编码模块1870,用于根据该仿射运动补偿子图像块的尺寸,对该述仿射图像块进行编码处理。
具体而言,编码装置根据确定的控制点,确定仿射图像块的运动矢量差异,并确定该仿射图像块的运动矢量精度,根据确定的运动矢量差异、运动矢量精度、控制点之间的距离以及仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该仿射运动补偿子图像块的尺寸即为该仿射图像块的划分尺寸;基于该划分尺寸,所述仿射图像块被划分为多个具有相同尺寸的仿射运动补偿子图像块,然后基于该仿射运动补偿子图像块对所述仿射图像块进行编码。该编码装置中的各个模块为实现本发明解码方法中所包含的各种执行步骤的功能主体,即具备实现完整实现本发明解码方法中各个方法步骤,如S1410至S1470中的各个步骤以及这些步骤的扩展及变形的功能主体,具体请参见本文中对解码方法的介绍,为简洁起见,本文将不再赘述。
如图19所示,本发明实施例还提供了一种解码设备1900,包括处理器1910、存储器1930和总线系统1950。其中,处理器和存储器通过总线系统相连,该存储器用于存储指令,该处理器用于执行该存储器存储的指令。编码设备的存储器存储程序代码,且处理器可以调用存储器中存储的程序代码执行本发明解码方法700中的所有步骤以及其扩展,即,从图7至图13中所描述的所有方法。
例如,所述处理器可以调用存储器中存储的程序代码完整的执行本发明解码方法中的操作:
确定仿射图像块的运动矢量差异;
确定该仿射图像块的运动矢量精度;
根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的水平方向的长度为该仿射运动补偿子图像块的水平方向的长度的整数倍,且该仿射图像块的竖直方向的长度为该仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;以及
根据该仿射运动补偿子图像块的尺寸,对该述仿射图像块进行解码处理。
在该解码过程,由于能够选取合适大小的子图像块,并通过对子图像块的尺寸进行调整使得所述仿射图像块被划分为多个具有相同尺寸的仿射运动补偿子图像块,从而降低解码的复杂度,提高解码性能。
应理解,在本发明实施例中,该处理器1910可以是中央处理单元(Central Processing Unit,简称为“CPU”),该处理器1910还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
该存储器1930可以包括只读存储器和随机存取存储器,并向处理器1910提供指 令和数据。存储器32的一部分还可以包括非易失性随机存取存储器。例如,存储器1930还可以存储设备类型的信息。
该总线系统1950除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统1950。
在实现过程中,上述方法的各步骤可以通过处理器1910中的硬件的集成逻辑电路或者软件形式的指令完成。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1930,处理器1910读取存储器1930中的信息,结合其硬件完成上述方法的步骤。
如图20所示,本发明实施例还提供了一种编码设备2000,包括处理器2010、存储器2030和总线系统2050。其中,处理器2010和存储器2030通过总线系统2050相连,该存储器2030用于存储指令,该处理器2010用于执行该存储器2030存储的指令。编码设备2000的存储器2030存储程序代码,且处理器2010可以调用存储器2030中存储的程序代码执用于执行本发明解码方法1400中的所有步骤以及其扩展,即,从图14至图16中所反映的所有方法步骤。例如,处理器2010可以调用存储器2030中存储的程序代码执用于:
确定仿射图像块的运动矢量差异;
确定该仿射图像块的运动矢量精度;
根据该运动矢量差异、该运动矢量精度、该仿射图像块中的控制点之间的距离以及该仿射图像块的尺寸,确定该仿射图像块内的仿射运动补偿子图像块的尺寸,该尺寸包括水平方向的长度,以及竖直方向的长度,以使该仿射图像块的在水平方向的长度为该仿射运动补偿子图像块的在水平方向的长度整数倍,且该仿射图像块在竖直方向的长度为该仿射运动补偿子图像块的在竖直方向的长度的整数倍,其中,该控制点为用于确定该运动矢量差异的像素点;以及
根据该仿射运动补偿子图像块的尺寸,对该述仿射图像块进行编码处理。
在该编码过程,由于能够选取合适大小的子图像块,并通过对子图像块的尺寸进行调整使得所述仿射图像块被划分为多个具有相同尺寸的仿射运动补偿子图像块,从而降低编码的复杂度,提高编码性能。
应理解,在本发明实施例中,该处理器2010可以是中央处理单元(Central Processing Unit,简称为“CPU”),该处理器2010还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
该存储器2030可以包括只读存储器和随机存取存储器,并向处理器2010提供指令和数据。存储器2030的一部分还可以包括非易失性随机存取存储器。例如,存储器2030还可以存储设备类型的信息。
该总线系统2050除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统2050。
在实现过程中,上述方法的各步骤可以通过处理器2010中的硬件的集成逻辑电路或者软件形式的指令完成。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器2030,处理器2010读取存储器2030中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。

Claims (38)

  1. 一种视频图像解码的方法,其特征在于,包括:
    确定仿射图像块的运动矢量差异;
    确定所述仿射图像块的运动矢量精度;
    根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,所述尺寸包括水平方向的长度,以及竖直方向的长度,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,所述控制点为用于确定所述运动矢量差异的像素点;
    根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行解码处理。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,包括:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度及竖直方向的长度,其中,所述仿射运动补偿子图像块的水平方向和竖直方向的长度均为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍:
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度和水平方向的长度,其中,所述仿射运动补偿子图像块的竖直方向和水平方向的长度均为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向 的长度的整数倍;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,包括:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度,其中,所述仿射运动补偿子图像块的水平方向的长度为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度,其中,所述仿射运动补偿子图像块的竖直方向的长度为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  5. 根据权利要求2至4任意一项所述的方法,其特征在于,
    所述调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍包括:
    对所述仿射运动补偿子图像块的水平方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    所述调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍包括:
    对所述仿射运动补偿子图像块的竖直方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块 的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  6. 根据权利要求2至4任意一项所述的方法,其特征在于,
    所述调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍包括:
    对所述仿射图像块的水平方向的长度朝最接近整除所述仿射图像块的水平方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    所述调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍包括:
    对所述仿射图像块的竖直方向的长度朝最接近整除所述仿射图像块的竖直方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  7. 根据权利要求2至6任意一项所述的方法,其特征在于,所述方法还包括:
    确定所述仿射运动补偿子图像块的调整后的水平方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的水平方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的水平方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数;
    确定所述仿射运动补偿子图像块的调整后的竖直方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的竖直方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数。
  8. 根据权利要求1所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,包括:
    根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸在预设的尺寸表中通过查表确定所述仿射图像块内的所述仿射运动补偿子图像块的尺寸,所述预设的尺寸表存储有依据运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离及所述仿射图像块的尺寸预先确定的仿射运动补偿子图像块的尺寸,所述预先确定的仿射运动补偿子图像块的尺寸满足,所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向 的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍。
  9. 根据权利要求8所述的方法,其特征在于,其中,所述预先确定的仿射运动补偿子图像块的尺寸还满足,所述仿射运动补偿子图像块的水平方向的长度为预定长度S的整数倍,且所述仿射运动补偿子图像块的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数。
  10. 一种视频图像编码的方法,其特征在于,包括:
    确定仿射图像块的运动矢量差异;
    确定所述仿射图像块的运动矢量精度;
    根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,所述尺寸包括水平方向的长度,以及竖直方向的长度,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,所述控制点为用于确定所述运动矢量差异的像素点;
    根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行编码处理。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,包括:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度及竖直方向的长度,其中,所述仿射运动补偿子图像块的水平方向和竖直方向的长度均为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  12. 根据权利要求10所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍包括:
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距 离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度和水平方向的长度,其中,所述仿射运动补偿子图像块的竖直方向和水平方向的长度均为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍。
  13. 根据权利要求10所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,包括:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度,其中,所述仿射运动补偿子图像块的水平方向的长度为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度,其中,所述仿射运动补偿子图像块的竖直方向的长度为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  14. 根据权利要求11至13任意一项所述的方法,其特征在于,
    所述调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍包括:
    对所述仿射运动补偿子图像块的水平方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    所述调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖 直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍包括:
    对所述仿射运动补偿子图像块的竖直方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  15. 根据权利要求11至13任意一项所述的方法,其特征在于,
    所述调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍包括:
    对所述仿射图像块的水平方向的长度朝最接近整除所述仿射图像块的水平方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    所述调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍包括:
    对所述仿射图像块的竖直方向的长度朝最接近整除所述仿射图像块的竖直方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  16. 根据权利要求11至15任意一项所述的方法,其特征在于,所述方法还包括:
    确定所述仿射运动补偿子图像块的调整后的水平方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的水平方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的水平方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数;
    确定所述仿射运动补偿子图像块的调整后的竖直方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的竖直方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数。
  17. 根据权利要求10所述的方法,其特征在于,所述根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,包括:
    根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的 距离以及所述仿射图像块的尺寸在预设的尺寸表中通过查表确定所述仿射图像块内的所述仿射运动补偿子图像块的尺寸,所述预设的尺寸表存储有依据运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离及所述仿射图像块的尺寸预先确定的仿射运动补偿子图像块的尺寸,所述预先确定的仿射运动补偿子图像块的尺寸能够满足,所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍。
  18. 根据权利要求17所述的方法,其特征在于,其中,所述预先确定的仿射运动补偿子图像块的尺寸还满足,所述仿射运动补偿子图像块的水平方向的长度为预定长度S的整数倍,且所述仿射运动补偿子图像块的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数。
  19. 一种视频图像解码的装置,其特征在于,包括:
    运动矢量差异确定模块,用于确定仿射图像块的运动矢量差异;
    运动矢量精度确定模块,用于确定所述仿射图像块的运动矢量精度;
    子图像块尺寸确定模块,用于根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,所述尺寸包括水平方向的长度,以及竖直方向的长度,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,所述控制点为用于确定所述运动矢量差异的像素点;
    解码模块,用于根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行解码处理。
  20. 根据权利要求19所述的装置,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度及竖直方向的长度,其中,所述仿射运动补偿子图像块的水平方向和竖直方向的长度均为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  21. 根据权利要求19所述的装置,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度和水平方向的长度,其中,所述仿射运动补偿子图像块的竖直方向和水平方向的长度均为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍。
  22. 根据权利要求19所述的方法,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度,其中,所述仿射运动补偿子图像块的水平方向的长度为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度,其中,所述仿射运动补偿子图像块的竖直方向的长度为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  23. 根据权利要求20至22任意一项装置的装置,其特征在于,所述子图像尺寸确定模块进一步用于:
    对所述仿射运动补偿子图像块的水平方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    对所述仿射运动补偿子图像块的竖直方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  24. 根据权利要求20至22任意一项所述的装置,其特征在于,所述子图像尺寸确定模块进一步用于:
    对所述仿射图像块的水平方向的长度朝最接近整除所述仿射图像块的水平方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    所述调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍包括:
    对所述仿射图像块的竖直方向的长度朝最接近整除所述仿射图像块的竖直方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  25. 根据权利要求20至24任意一项所述的方法,其特征在于,所述子图像尺寸确定模块进一步用于:
    确定所述仿射运动补偿子图像块的调整后的水平方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的水平方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的水平方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数;
    确定所述仿射运动补偿子图像块的调整后的竖直方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的竖直方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数
  26. 根据权利要求19所述的装置,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸在预设的尺寸表中通过查表确定所述仿射图像块内的所述仿射运动补偿子图像块的尺寸,所述预设的尺寸表存储有依据运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离及所述仿射图像块的尺寸预先确定的仿射运动补偿子图像块的尺寸,所述预先确定的仿射运动补偿子图像块的尺寸能够满足,所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍。
  27. 根据权利要求26所述的装置,其特征在于,其中,所述预先确定的仿射运动补偿子图像块的尺寸还满足,所述仿射运动补偿子图像块的水平方向的长度为预定长度S的整数倍,且所述仿射运动补偿子图像块的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数。
  28. 一种视频图像编码装置,其特征在于,包括:
    运动矢量差异确定模块,用于确定仿射图像块的运动矢量差异;
    运动矢量精度确定模块,用于确定所述仿射图像块的运动矢量精度;
    子图像块尺寸确定模块,用于根据所述运动矢量差异、所述运动矢量精度、所述 仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸,确定所述仿射图像块内的仿射运动补偿子图像块的尺寸,所述尺寸包括水平方向的长度,以及竖直方向的长度,以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍,其中,所述控制点为用于确定所述运动矢量差异的像素点;
    编码模块,用于根据所述仿射运动补偿子图像块的尺寸,对所述仿射图像块进行编码处理。
  29. 根据权利要求28所述的装置,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度及竖直方向的长度,其中,所述仿射运动补偿子图像块的水平方向和竖直方向的长度均为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  30. 根据权利要求28所述的装置,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度和水平方向的长度,其中,所述仿射运动补偿子图像块的竖直方向和水平方向的长度均为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍。
  31. 根据权利要求28所述的方法,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量精度与所述运动矢量差异的第一分量的比例对所述第一水平距离进行等比例调整得到所述仿射运动补偿子图像块的水平方向的长度,其中,所述仿射运动补偿子图像块的水平方向的长度为整数;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的水平方向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的水平方向的长度以使所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方 向的长度的整数倍;
    根据所述运动矢量精度与所述运动矢量差异的第二分量的比例对所述第一竖直距离进行等比例调整得到所述仿射运动补偿子图像块的竖直方向的长度,其中,所述仿射运动补偿子图像块的竖直方向的长度为整数;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的竖直向的长度的整数倍,若否,则调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  32. 根据权利要求29至31任意一项装置的装置,其特征在于,所述子图像尺寸确定模块进一步用于:
    对所述仿射运动补偿子图像块的水平方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向的长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    对所述仿射运动补偿子图像块的竖直方向的长度做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  33. 根据权利要求29至31任意一项所述的装置,其特征在于,所述子图像尺寸确定模块进一步用于:
    对所述仿射图像块的水平方向的长度朝最接近整除所述仿射图像块的水平方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的水平方向长度是否是所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的调整后的水平方向的长度的整数倍;
    所述调整所述仿射运动补偿子图像块的竖直方向的长度以使所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍包括:
    对所述仿射图像块的竖直方向的长度朝最接近整除所述仿射图像块的竖直方向的长度的数值的方向做增加/减少一个或者多个单位长度的调整;
    确定所述仿射图像块的竖直方向的长度是否是所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍,若否,重复所述调整及确定步骤直至所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的调整后的竖直方向的长度的整数倍。
  34. 根据权利要求29至33任意一项所述的装置,其特征在于,所述子图像尺寸确定模块进一步用于:
    确定所述仿射运动补偿子图像块的调整后的水平方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的水平方向的长度做增加/减少一个 或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的水平方向的长度为预定长度S的整数倍;S等于2 n,n为零或者正整数;
    确定所述仿射运动补偿子图像块的调整后的竖直方向的长度是否为预定长度S的整数倍;
    若否,对所述仿射运动补偿子图像块的调整后的竖直方向的长度做增加/减少一个或者多个单位长度的二次调整,直至所述仿射运动补偿子图像块的二次调整后的竖直方向的长度为预定长度S的整数倍。
  35. 根据权利要求28所述的方法,其特征在于,所述子图像尺寸确定模块用于:
    根据所述运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离以及所述仿射图像块的尺寸在预设的尺寸表中通过查表确定所述仿射图像块内的所述仿射运动补偿子图像块的尺寸,所述预设的尺寸表存储有依据运动矢量差异、所述运动矢量精度、所述仿射图像块中的控制点之间的距离及所述仿射图像块的尺寸预先确定的仿射运动补偿子图像块的尺寸,所述预先确定的仿射运动补偿子图像块的尺寸能够满足,所述仿射图像块的水平方向的长度为所述仿射运动补偿子图像块的水平方向的长度的整数倍,且所述仿射图像块的竖直方向的长度为所述仿射运动补偿子图像块的竖直方向的长度的整数倍。
  36. 根据权利要求35所述的装置,其特征在于,其中,所述预先确定的仿射运动补偿子图像块的尺寸还满足,所述仿射运动补偿子图像块的水平方向的长度为预定长度S的整数倍,且所述仿射运动补偿子图像块的竖直方向的长度为预定长度S的整数倍,S等于2 n,n为零或者正整数。
  37. 一种解码设备,其包括处理器以及非易失性存储器,所述处理器调用存储在所述存储器中的程序代码以实现如权利要求1至9任意一项所述的解码方法。
  38. 一种编码设备,其包括处理器以及非易失性存储器,所述处理器调用存储在所述存储器中的程序代码以实现如权利要求9至18任意一项所述的编码方法。
PCT/CN2018/099512 2017-08-11 2018-08-09 视频图像编码和解码的方法、装置及设备 WO2019029590A1 (zh)

Priority Applications (14)

Application Number Priority Date Filing Date Title
KR1020207006267A KR102357575B1 (ko) 2017-08-11 2018-08-09 비디오 이미지 인코딩 및 디코딩 방법, 장치 및 디바이스
JP2020507658A JP2020529811A (ja) 2017-08-11 2018-08-09 ビデオ画像符号化および復号方法、装置、およびデバイス
AU2018315106A AU2018315106B2 (en) 2017-08-11 2018-08-09 Video image encoding and decoding method, apparatus, and device
CN201880052255.9A CN110999302A (zh) 2017-08-11 2018-08-09 视频图像编码和解码的方法、装置及设备
EP18843177.9A EP3664452A4 (en) 2017-08-11 2018-08-09 METHOD, DEVICE AND DEVICE FOR CODING AND DECODING VIDEO IMAGES
CN202010734355.9A CN111935482B (zh) 2017-08-11 2018-08-09 视频图像编码和解码的方法、装置及设备
SG11202001199QA SG11202001199QA (en) 2017-08-11 2018-08-09 Video image encoding and decoding method, apparatus, and device
RU2020110025A RU2771955C2 (ru) 2017-08-11 2018-08-09 Устройство, оборудование, способ кодирования и декодирования видеоизображений
BR112020002656-5A BR112020002656A2 (pt) 2017-08-11 2018-08-09 método, aparelho, e dispositivo de codificação e decodificação de imagem de vídeo
MX2020001646A MX2020001646A (es) 2017-08-11 2018-08-09 Método, aparato y dispositivo de codificación y decodificación de imagen de video.
CA3072712A CA3072712A1 (en) 2017-08-11 2018-08-09 Video image decoding and encoding based on motion compenstaion prediction
US16/786,660 US11039127B2 (en) 2017-08-11 2020-02-10 Video image encoding and decoding method, apparatus, and device
PH12020500307A PH12020500307A1 (en) 2017-08-11 2020-02-11 Video image encoding and decoding method, apparatus, and device
US17/234,976 US11496732B2 (en) 2017-08-11 2021-04-20 Video image encoding and decoding method, apparatus, and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710687117.5A CN109391814B (zh) 2017-08-11 2017-08-11 视频图像编码和解码的方法、装置及设备
CN201710687117.5 2017-08-11

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/786,660 Continuation US11039127B2 (en) 2017-08-11 2020-02-10 Video image encoding and decoding method, apparatus, and device

Publications (1)

Publication Number Publication Date
WO2019029590A1 true WO2019029590A1 (zh) 2019-02-14

Family

ID=65270850

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/099512 WO2019029590A1 (zh) 2017-08-11 2018-08-09 视频图像编码和解码的方法、装置及设备

Country Status (13)

Country Link
US (2) US11039127B2 (zh)
EP (1) EP3664452A4 (zh)
JP (1) JP2020529811A (zh)
KR (1) KR102357575B1 (zh)
CN (4) CN116708780A (zh)
AU (1) AU2018315106B2 (zh)
BR (1) BR112020002656A2 (zh)
CA (1) CA3072712A1 (zh)
MX (1) MX2020001646A (zh)
PH (1) PH12020500307A1 (zh)
SG (1) SG11202001199QA (zh)
TW (1) TWI692247B (zh)
WO (1) WO2019029590A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636301A (zh) * 2019-09-18 2019-12-31 浙江大华技术股份有限公司 仿射预测方法、计算机设备和存储装置

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111247806B (zh) * 2017-10-27 2023-11-14 松下电器(美国)知识产权公司 解码装置和解码方法
US10999596B2 (en) * 2018-06-19 2021-05-04 Qualcomm Incorporated Unification of affine motion field derivation and affine motion compensation
WO2019244051A1 (en) 2018-06-19 2019-12-26 Beijing Bytedance Network Technology Co., Ltd. Selected mvd precision without mvp truncation
EP3844955A1 (en) * 2018-08-29 2021-07-07 Vid Scale, Inc. Adaptive motion vector precision for affine motion model based video coding
CN110933427B (zh) * 2018-09-19 2023-05-12 北京字节跳动网络技术有限公司 仿射模式编码的模式相关自适应运动矢量分辨率
CN113170192B (zh) * 2018-11-15 2023-12-01 北京字节跳动网络技术有限公司 仿射的merge与mvd
US11102476B2 (en) * 2018-12-28 2021-08-24 Qualcomm Incorporated Subblock based affine motion model
EP3895429A4 (en) 2019-01-31 2022-08-10 Beijing Bytedance Network Technology Co., Ltd. CONTEXT FOR CODE AN ADAPTIVE MOTION VECTOR RESOLUTION IN AFFINE MODE
WO2020181507A1 (zh) * 2019-03-12 2020-09-17 北京大学 图像处理的方法与装置
CN111567044A (zh) * 2019-03-13 2020-08-21 北京大学 一种视频处理方法、装置、编码设备及解码设备
CN114222136A (zh) * 2019-06-25 2022-03-22 Oppo广东移动通信有限公司 运动补偿的处理方法、编码器、解码器以及存储介质
CN112204973A (zh) * 2019-09-24 2021-01-08 北京大学 视频编解码的方法与装置
CN112770113A (zh) * 2019-11-05 2021-05-07 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
US20240040141A1 (en) * 2022-07-18 2024-02-01 Tencent America LLC Method for affine motion refinement

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1325220A (zh) * 2000-05-24 2001-12-05 三星电子株式会社 运动向量编码方法
EP1274254A2 (en) * 1995-08-29 2003-01-08 Sharp Kabushiki Kaisha Video coding device and video decoding device with a motion compensated interframe prediction
CN1961582A (zh) * 2004-03-31 2007-05-09 三星电子株式会社 在多层结构中有效压缩运动向量的方法和装置
CN102611884A (zh) * 2011-01-19 2012-07-25 华为技术有限公司 图像编解码方法及编解码设备
CN104539966A (zh) * 2014-09-30 2015-04-22 华为技术有限公司 图像预测方法及相关装置
CN106303543A (zh) * 2015-05-15 2017-01-04 华为技术有限公司 视频图像编码和解码的方法、编码设备和解码设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100359115B1 (ko) 2000-05-24 2002-11-04 삼성전자 주식회사 영상 코딩 방법
KR100571920B1 (ko) * 2003-12-30 2006-04-17 삼성전자주식회사 움직임 모델을 이용한 매쉬 기반의 움직임 보상방법을제공하는 영상의 부호화 방법 및 그 부호화 장치
DE102009026983A1 (de) * 2009-06-16 2010-12-30 Trident Microsystems (Far East) Ltd. Bildverarbeitungsverfahren mit einer Bewegungsschätzung und Bildverarbeitungsanordnung
MX353107B (es) 2010-04-09 2017-12-19 Mitsubishi Electric Corp Dispositivo codificador de imagen en movimiento y dispositivo decodificador de imagen en movimiento.
US10560712B2 (en) * 2016-05-16 2020-02-11 Qualcomm Incorporated Affine motion prediction for video coding
US10448010B2 (en) * 2016-10-05 2019-10-15 Qualcomm Incorporated Motion vector prediction for affine motion models in video coding
US10701390B2 (en) * 2017-03-14 2020-06-30 Qualcomm Incorporated Affine motion information derivation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1274254A2 (en) * 1995-08-29 2003-01-08 Sharp Kabushiki Kaisha Video coding device and video decoding device with a motion compensated interframe prediction
CN1325220A (zh) * 2000-05-24 2001-12-05 三星电子株式会社 运动向量编码方法
CN1961582A (zh) * 2004-03-31 2007-05-09 三星电子株式会社 在多层结构中有效压缩运动向量的方法和装置
CN102611884A (zh) * 2011-01-19 2012-07-25 华为技术有限公司 图像编解码方法及编解码设备
CN104539966A (zh) * 2014-09-30 2015-04-22 华为技术有限公司 图像预测方法及相关装置
CN106303543A (zh) * 2015-05-15 2017-01-04 华为技术有限公司 视频图像编码和解码的方法、编码设备和解码设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NA ZHANGXIAOPENG FANDEBIN ZHAOWEN GAO: "Motion Vector Derivation of Deformable Block", IMAGE PROCESSING (ICIP), THE 2012 19TH IEEE INTERNATIONAL CONFERENCE ON, 30 September 2012 (2012-09-30), pages 1549 - 1552, XP032333479, DOI: 10.1109/ICIP.2012.6467168

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636301A (zh) * 2019-09-18 2019-12-31 浙江大华技术股份有限公司 仿射预测方法、计算机设备和存储装置
WO2021052478A1 (en) * 2019-09-18 2021-03-25 Zhejiang Dahua Technology Co., Ltd. Affine predication methodandcomputing device
CN110636301B (zh) * 2019-09-18 2021-08-03 浙江大华技术股份有限公司 仿射预测方法、计算机设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN111935482A (zh) 2020-11-13
CA3072712A1 (en) 2019-02-14
KR102357575B1 (ko) 2022-02-08
CN109391814B (zh) 2023-06-06
JP2020529811A (ja) 2020-10-08
EP3664452A1 (en) 2020-06-10
TW201919402A (zh) 2019-05-16
EP3664452A4 (en) 2020-06-10
US20200177877A1 (en) 2020-06-04
PH12020500307A1 (en) 2021-02-08
CN109391814A (zh) 2019-02-26
KR20200033331A (ko) 2020-03-27
US11039127B2 (en) 2021-06-15
SG11202001199QA (en) 2020-03-30
CN116708780A (zh) 2023-09-05
RU2020110025A (ru) 2021-09-14
CN110999302A (zh) 2020-04-10
US20210243432A1 (en) 2021-08-05
CN111935482B (zh) 2023-04-11
BR112020002656A2 (pt) 2020-08-18
US11496732B2 (en) 2022-11-08
MX2020001646A (es) 2020-08-03
TWI692247B (zh) 2020-04-21
AU2018315106A1 (en) 2020-03-12
RU2020110025A3 (zh) 2021-11-03
AU2018315106B2 (en) 2022-10-06

Similar Documents

Publication Publication Date Title
WO2019029590A1 (zh) 视频图像编码和解码的方法、装置及设备
US11368678B2 (en) Image prediction method and device
WO2016184261A1 (zh) 视频图像编码和解码的方法、编码设备和解码设备
TW201943272A (zh) 以角度模式延伸之位置相關框內預測組合
TW202038611A (zh) 用於視訊寫碼之三角運動資訊
WO2019184639A1 (zh) 一种双向帧间预测方法及装置
KR20200005648A (ko) 인트라 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
Youvalari et al. Efficient coding of 360-degree pseudo-cylindrical panoramic video for virtual reality applications
WO2017005141A1 (zh) 参考图像编码和解码的方法、编码设备和解码设备
TW202029774A (zh) 藉由轉換域濾波之量化假影抑制及信號恢復
TW202025727A (zh) 向量預測器清單之產生
TW202019173A (zh) 用於視訊寫碼中之適應性運動向量差解析度及增加的運動向量儲存精確度的運動向量捨位
JP2023552923A (ja) ビデオのトランスコード方法、装置、電子機器及び記憶媒体
CN113068026B (zh) 编码预测方法、装置及计算机存储介质
TW202002654A (zh) 具有群組分流位元子之係數寫碼
RU2771955C2 (ru) Устройство, оборудование, способ кодирования и декодирования видеоизображений
CN114424544A (zh) 允许基于矩阵的帧内预测块具有多个变换块
CN113395520A (zh) 解码预测方法、装置及计算机存储介质
US20230080180A1 (en) Coding a pixel string vector based on attribute information of the pixel string
WO2022110131A1 (zh) 帧间预测方法、装置、编码器、解码器和存储介质

Legal Events

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

Ref document number: 18843177

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020507658

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 3072712

Country of ref document: CA

NENP Non-entry into the national phase

Ref country code: DE

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112020002656

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 20207006267

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2018315106

Country of ref document: AU

Date of ref document: 20180809

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2018843177

Country of ref document: EP

Effective date: 20200302

ENP Entry into the national phase

Ref document number: 112020002656

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20200207