WO2021134631A1 - 视频处理的方法与装置 - Google Patents

视频处理的方法与装置 Download PDF

Info

Publication number
WO2021134631A1
WO2021134631A1 PCT/CN2019/130843 CN2019130843W WO2021134631A1 WO 2021134631 A1 WO2021134631 A1 WO 2021134631A1 CN 2019130843 W CN2019130843 W CN 2019130843W WO 2021134631 A1 WO2021134631 A1 WO 2021134631A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
image
blocks
motion vector
candidate motion
Prior art date
Application number
PCT/CN2019/130843
Other languages
English (en)
French (fr)
Inventor
王悦名
郑萧桢
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/130843 priority Critical patent/WO2021134631A1/zh
Priority to CN201980049277.4A priority patent/CN112514391A/zh
Publication of WO2021134631A1 publication Critical patent/WO2021134631A1/zh

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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding

Definitions

  • This application relates to the field of video coding, and more specifically, to a method and device for video processing.
  • Prediction is an important link in the video coding process.
  • the purpose of prediction is to obtain a block (which may be referred to as a reference block) that is closest to an image block, and then subtract the image block from its reference block to obtain the residual.
  • Prediction is divided into intra-frame prediction and inter-frame prediction.
  • Inter-frame prediction is to obtain the motion vector (MV) of the current image block, and then determine the position of the reference block in the reference frame according to the MV.
  • the High Efficiency Video Coding (HEVC) standard proposes two inter-frame prediction modes: Merge mode and Skip mode.
  • the Merge mode and the Skip mode the reference block of the image block is obtained according to the candidate motion vector of the image block, wherein data needs to be obtained from the reference frame according to the candidate motion vector to obtain the reference block of the current block.
  • the hardware encoder it is necessary to request data from the reference frame buffer (buffer).
  • the HEVC standard provides a flexible block division structure, in which one frame of image is divided into multiple sub-blocks. For example, a frame of image is first divided into multiple coding tree units (Coding Tree Unit, CTU), a CTU can be divided into one or more coding units (Coding Unit, CU), and a CU can be divided into one or more Prediction Unit (PU). Under the HEVC standard, for each PU, it is necessary to obtain data from the reference frame buffer according to its candidate motion vector. This leads to the need to request data from the reference frame buffer multiple times during the inter-coding process of a CTU, which will increase The difficulty of hardware design will also reduce the efficiency of inter-frame prediction.
  • CTU Coding Tree Unit
  • CU Coding Unit
  • PU Prediction Unit
  • This application provides a video processing method and device.
  • pre-accessing the data of M reference blocks from the reference frame buffer it is possible to obtain the Merge mode or Skip mode inter-frame prediction required from the pre-obtained M reference blocks. Multiple data, which can reduce the number of requests for data from the reference frame buffer.
  • a video processing method includes: obtaining data of M reference blocks from a reference frame buffer, where M is a positive integer; performing inter-frame prediction in Merge mode or Skip mode on N image blocks When determining whether there is a reference block for each of the N image blocks from the M reference blocks, N is a positive integer.
  • an encoding device in a second aspect, includes a processor and a memory, the memory is used to store instructions, the processor is used to execute the instructions stored in the memory, and the execution of the instructions stored in the memory causes the The processor performs the following operations: Obtain the data of M reference blocks from the reference frame buffer, where M is a positive integer; when performing inter-frame prediction in Merge mode or Skip mode on N image blocks, determine whether to determine whether from the M reference blocks There are reference blocks for each of the N image blocks, and N is a positive integer.
  • a chip in a third aspect, includes a processing module and a communication interface, the processing module is used to control the communication interface to communicate with the outside, and the processing module is used to implement the method provided in the first aspect.
  • a computer-readable storage medium is provided, and a computer program is stored thereon.
  • the computer program is executed by a computer, the computer realizes the method provided in the first aspect.
  • a computer program product containing instructions is provided, which when executed by a computer causes the computer to implement the method provided in the first aspect.
  • Figure 1 is a schematic diagram of the video encoding architecture.
  • Fig. 2 is a schematic diagram of the block division structure under the HEVC standard.
  • FIG. 3 is a schematic flowchart of a video processing method provided by an embodiment of the application.
  • FIG. 4 is another schematic flowchart of a video processing method provided by an embodiment of the application.
  • FIG. 5 is another schematic flowchart of a video processing method provided by an embodiment of this application.
  • Fig. 6 is a schematic block diagram of an encoding device provided by an embodiment of the application.
  • FIG. 1 The basic architecture of video coding is shown in Figure 1. First, a frame of image is divided into several image blocks, and then each image block is predicted, transformed, quantized and entropy coded.
  • Intra-frame prediction uses the encoded block on the current image frame to generate the reference block (or called the prediction block) of the current image block (hereinafter referred to as the current block), while the inter-frame prediction uses the reference frame (or called the reference image). Get the reference block of the current block. Then the current block is subtracted from the reference block to obtain residual data. Through the residual data and the transformation matrix, the time domain signal is transformed to the frequency domain to obtain the transformation coefficient. The transform coefficients are quantized to reduce the dynamic range of the transform coefficients to further compress the information.
  • the quantized transform coefficients one is to obtain an entropy-coded bitstream through entropy coding; the other is to add the reference block after inverse quantization and inverse transformation, and then perform in-loop filtering to obtain a reconstructed frame image, which can be determined based on the reconstructed frame image Better forecasting method.
  • inter prediction for the current block, search for the most similar block from the reference frame as the reference block of the current block, and then subtract the current block from the reference block to obtain the residual, which undergoes subsequent transformation, quantization and entropy
  • the encoding forms a bit stream.
  • the process of searching for the block most similar to the current block from the reference frame is called motion search.
  • the position offset of the current block relative to the reference block is called the motion vector (MV) of the current block. It can be understood that if the MV of the current block is obtained, the position of the reference block in the reference frame can be obtained, that is, the reference block of the current block can be obtained.
  • inter prediction modes In the High Efficiency Video Coding (HEVC) standard, three inter prediction modes are proposed: ordinary inter prediction (inter predict mode), merge mode (Merge mode) and skip mode (Skip mode). Among them, Merge mode and Skip mode belong to two special inter-frame prediction modes.
  • inter-frame prediction the purpose of inter-frame prediction is to obtain the MV of the current block, and then determine the position of the reference block in the reference image according to the MV.
  • the current block and neighboring blocks belong to the same object.
  • the lens moves the distance and direction they move are naturally similar or the same. Therefore, there is no need to go
  • the MV of the adjacent block can be used as the MV of the current block.
  • Merge mode and Skip mode are inter-frame prediction modes based on this idea.
  • a motion vector prediction (MVP) candidate list is obtained from its neighboring blocks (temporal neighboring blocks, and/or spatial neighboring blocks), and the best one is selected.
  • MVP is used as the MV of the current block, and then the position of the reference block in the reference frame is directly determined according to the MV, that is, the reference block is determined according to the MV.
  • the Merge mode can obtain up to 5 candidate motion vectors from adjacent blocks, and select one of them as the motion vector of the current block.
  • the MVP and MV are the same, that is, the Motion Vector Difference (MVD) is zero, and it can be considered that there is no MVD. Therefore, the encoding end only needs to encode the index of the MVP (ie MV) selected from the MVP candidate list in the MVP candidate list, and it is no longer necessary to encode the MVD.
  • the decoding end can construct the MVP candidate list according to a similar method, and then the MV of the current block can be obtained according to the index transmitted from the encoding end.
  • the encoding operation flow in Merge mode includes the following steps.
  • Step 1 Obtain a motion vector prediction (MVP) candidate list of the current block.
  • MVP motion vector prediction
  • Step 2 Select an optimal MVP from the MVP candidate list, and at the same time obtain the index of the MVP in the MVP candidate list.
  • Step 3 Use the MVP selected in step 2 as the motion vector (MV) of the current block.
  • Step 4 Determine the position of the reference block in the reference frame according to the MV of the current block, that is, obtain the reference block of the current block.
  • Step 5 Subtract the reference block from the current block to obtain residual data.
  • Step 6 Because MVP and MV are the same, there is no MVD, and only the residual data and the index of the MV (MVP) in the MVP candidate list are transmitted to the decoder.
  • step two includes the following sub-steps.
  • Sub-step (1) For each MVP in the MVP candidate list, treat it as an MV, and proceed as follows:
  • Sub-step (2) by comparing the coding cost of each MVP in the MVP candidate list, the optimal MVP is selected from the MVP candidate list.
  • step two the optimal MVP (that is, the MV of the current block) is obtained.
  • the Skip mode is similar to the Merge mode. It also obtains candidate motion vectors from adjacent blocks and selects one of them as the motion vector of the current block.
  • the Skip mode has two differences: one is that there are only image blocks divided according to a 2N ⁇ 2N division structure (for example, the image block divided in the upper left corner of (C) in Figure 2, see below in conjunction with Figure 2 Description) in order to use the Skip mode; second, in the Skip mode, the residual of the current block and the reference block is zero by default, that is, there is no need to encode the residuals, which greatly saves the code rate.
  • the reference block of the current block is the same as the reconstructed block.
  • the Skip mode can be regarded as a special case of the Merge mode, that is, the residual is 0 and there is no need to encode the residual.
  • Merge and Skip modes are inter-frame prediction modes. Therefore, in Merge and Skip modes, it is necessary to obtain data from the reference frame according to the candidate motion vector to obtain the reference block of the current block. In the hardware encoder, it is to buffer the reference frame (Buffer) Request data.
  • the new generation of video coding standard HEVC uses a hybrid coding architecture based on block division, as shown in Figure 2.
  • each CTU can be further divided into one or four coding units (Coding Unit, CU), and each CU can be further divided into smaller CUs.
  • each CU can be further divided into one, two or four prediction units (PU).
  • the size of the CTU can range from 16 ⁇ 16 to 64 ⁇ 64 (in pixels).
  • the prediction granularity is PU.
  • the prediction granularity is PU.
  • data needs to be obtained from the reference frame buffer according to the candidate motion vector. .
  • one image block can correspond to one candidate motion vector, or it can correspond to multiple candidate motion vectors.
  • HEVC provides a flexible block division structure.
  • a CTU can be divided into one or more CUs, and each CU can be further divided into one or more PUs. Therefore, in a CTU inter-frame coding process, it is necessary to request data from the reference frame buffer many times or even frequently, which will increase the time delay of inter-frame coding and also increase the difficulty of hardware design.
  • This application provides a video processing method and device.
  • By accessing data of M reference blocks from the reference frame buffer in advance it is possible to obtain multiple data required for inter-frame prediction from the M reference blocks obtained in advance, thereby Reduce the number of requests for data from the reference frame buffer.
  • the coding standards applicable to this application include but are not limited to the HEVC coding standard.
  • this application can be applied to various current and future-evolving codec standards.
  • FIG. 3 is a schematic flowchart of a video processing method provided by an embodiment of the application. The method includes the following steps.
  • the reference frame buffer means a buffer that stores data of the reference frame.
  • the reference frame represents an image frame that has been encoded.
  • M is a positive integer.
  • M is 1, or an integer greater than 1.
  • the M reference blocks may be located in one reference frame or in multiple reference frames.
  • S320 When performing inter-frame prediction in Merge mode or Skip mode on N image blocks, determine from the M reference blocks whether there is a reference block for each of the N image blocks.
  • N is a positive integer.
  • N is 1, or an integer greater than 1.
  • Each of the N image blocks may be the smallest image processing object in video coding.
  • each of the N image blocks may be called a prediction unit (PU).
  • PU prediction unit
  • each of the N image blocks may have other names correspondingly.
  • description will be made by taking each of the N image blocks as a PU as an example.
  • image block x Take one image block (denoted as image block x) among the N image blocks as an example.
  • the reference block of image block x is obtained from the M reference blocks, so that the reference block is used to perform Merge mode or Skip mode inter prediction on image block x .
  • the Merge mode or Skip mode inter prediction process of image block x is skipped.
  • performing Merge mode or Skip mode inter prediction on image block x includes: obtaining reference blocks of image block x from M reference blocks.
  • reference blocks of image block x in the M reference blocks which means that the data of the M reference blocks obtained in step S310 includes data of the reference block of image block x.
  • reference blocks of image block x in the M reference blocks which can also be understood as any reference block in the M reference blocks or a reference block of the image block x included in the multiple reference blocks.
  • Obtaining the reference block of the image block x from the M reference blocks means that the data of the reference block of the image block x is obtained from the data of the M reference blocks obtained in step S310, that is, the reference block of the image block x is obtained.
  • Step S310 is executed before step S320. Therefore, in step S320, it is determined from the pre-acquired M reference blocks whether there is a reference block for each of the N image blocks.
  • the data of M reference blocks are accessed from the reference frame buffer in advance, and then when the Merge mode or Skip mode inter prediction is performed on the N image blocks, it is determined whether there is any in the M reference blocks obtained in advance.
  • the reference block of each image block in the N image blocks where, in the case of yes, perform the inter prediction of the corresponding image block in Merge mode or Skip mode, and in the case of no, skip the Merge mode of the corresponding image block Or the inter-frame prediction process in Skip mode.
  • reducing the number of requests for data from the reference frame buffer can reduce the difficulty of hardware design, and can also improve the efficiency of inter-frame prediction.
  • N is greater than 1
  • the processing method for each of the N image blocks is similar.
  • one image block (denoted as the second image block) of the N image blocks will be used as an example for description. It should be noted that the solution described below taking the second image block as an example is also applicable to other image blocks in the N image blocks, or in other words, the second image is similar to each of the N image blocks. Block processing.
  • step S310 there may be multiple methods for obtaining data of M reference blocks from the reference frame buffer.
  • step S310 includes: obtaining M reference blocks from the reference frame buffer according to the S candidate motion vectors of the first image block, where the first image block and the N image blocks belong to the same image unit block.
  • M reference blocks are obtained from the reference frame buffer, which means that M positions are obtained by adding M motion vectors to the position of the first image block, and based on the M positions from the reference Read the data of M reference blocks in the frame buffer. For example, taking these M positions as the center, read the data of M reference blocks from the reference frame buffer.
  • S is a positive integer less than or equal to M. If S is equal to M, then these M motion vectors are S candidate motion vectors of the first image block. If S is less than M, zero motion vector or global motion vector can be used to supplement, that is, M motion vectors are obtained through S candidate motion vectors and (M-S) zero motion vectors or global motion vectors.
  • the size of the i-th reference block in M reference blocks is W i ⁇ H i , where W i represents the width, H i represents the height, and i is equal to 1, 2,...,M.
  • the i-th block is assumed that the reference point of left and upper boundary pixels in the horizontal and vertical coordinates of the image frame are X i and Y i, the i-th boundary and the right boundary of the pixel block in the reference image frame
  • the horizontal and vertical coordinates within are X i +W i -1 and Y i +H i -1, respectively.
  • the sizes of the M reference blocks may be the same or not completely the same.
  • the size of the M reference blocks may be related to the block division mode of the coding architecture.
  • the size of the M reference blocks may be predefined.
  • the first image block and the N image blocks belong to the same image unit block, which means that the first image block and the N image blocks belong to the same non-minimum image processing unit.
  • the image unit block represents a non-minimum image processing unit in the video coding architecture.
  • the image unit block can be a CTU or a CU. It should be understood that under other video coding standards, the image unit block may have other names.
  • the first image block may be an image block at the same division level as the N image blocks, or may be an image block with a division level higher than the N image blocks.
  • each of the N image blocks is a PU
  • the first image block may be a PU, or a CU or a CTU.
  • the foregoing N image blocks are N PUs
  • the CTU composed of the N PUs is the first image block, that is, the CTU includes N PUs.
  • the foregoing N image blocks are N CUs
  • the CTU formed by the N CUs is the first image block, that is, the CTU includes N CUs.
  • the reference blocks of the N image blocks fall into the M references obtained based on the candidate motion vectors of the first image block.
  • the probability of the block is relatively large, so that more data required for inter-frame prediction can be obtained from the M reference blocks obtained in advance, so that the number of accesses to the reference frame buffer can be reduced.
  • the first image block includes some or all of the N image blocks.
  • N image blocks are N PUs
  • the first image block is a CU or CTU that includes some or all of the N PUs.
  • the probability that the reference blocks of the N image blocks fall into the M reference blocks obtained through the candidate motion vectors of the first image block is further improved In this way, more data required for inter-frame prediction can be obtained from the M reference blocks obtained in advance, so that the number of accesses to the reference frame buffer can be effectively reduced.
  • the first image block is an image unit block including N image blocks.
  • N image blocks are N PUs in 1 CTU, and the first image block is the CTU; or, N image blocks are N PUs in 1 CU, and the first image block is The CU.
  • the probability that the reference blocks of the N image blocks fall into the M reference blocks obtained through the candidate motion vectors of the first image block is further improved, so that the Obtain more data required for inter-frame prediction from the M reference blocks, thereby effectively reducing the number of accesses to the reference frame buffer.
  • the inter-frame prediction process of the N image blocks can be obtained from M reference blocks obtained in advance, that is, in the inter-frame prediction process of N image blocks, the data only needs to be requested once from the reference frame buffer.
  • the first image block is a CTU
  • the N image blocks are the N PUs obtained by dividing the CTU.
  • the embodiment of the present application can be used in the Merge mode or Skip mode of all PUs in the CTU. During the encoding process, only one data access to the reference frame buffer is required, which effectively reduces the number of data accesses to the reference frame buffer compared to the prior art.
  • step S310 data of M reference blocks are obtained from the reference frame buffer according to the candidate motion vector of the first image block.
  • data of M reference blocks may also be obtained from the reference frame buffer according to other feasible manners.
  • the data of M reference blocks are obtained from the reference frame buffer according to the motion vectors of one or more PU/CUs in the CTU, and then the Merge mode or Skip mode inter prediction is performed on each PU/CU in the CTU.
  • the reference block of each PU/CU can be obtained from the M reference blocks obtained in advance, and there is no need to send the reference block obtaining request to the reference frame buffer multiple times for each PU/CU.
  • step S320 includes: performing Merge mode or Skip mode on the second image block among the N image blocks. During prediction, it is determined from the M reference blocks whether there is a reference block for the second image block.
  • the reference block of the second image block may be obtained through the candidate motion vector of the second image block.
  • step S320 can be completed in step two.
  • step 2 it is determined whether the reference block of the second image block is included in the M reference blocks.
  • the method of the embodiment shown in FIG. 3 may further include step S330 or step S340.
  • step S330 In a case where the result of the determination in step S320 is yes, that is, when there are reference blocks of the second image block in the M reference blocks, perform the Merge mode on the second image block according to the reference blocks of the second image block Or Inter prediction in Skip mode.
  • Performing the Merge mode or Skip mode inter-frame prediction on the second image block according to the reference block of the second image block includes: acquiring the reference block of the second image block from M reference blocks.
  • Obtaining the reference block of the second image block from the M reference blocks means that the data of the reference block of the second image block is obtained from the data of the M reference blocks obtained in advance.
  • step S320 and step S330 can be completed in step two.
  • step 2 it is determined whether the reference block of the second image block is included in the M reference blocks, and in the case of yes, Obtain the reference block of the second image block from the M reference blocks.
  • step S340 In the case that the result of the determination in step S320 is no, that is, when there is no reference block of the second image block in the M reference blocks, skip the Merge mode or Skip mode of the second image block. Forecasting process.
  • a candidate motion vector of the second image block if the reference block corresponding to the candidate motion vector is not in the M reference blocks, skip using the reference block corresponding to the candidate motion vector to perform the Merge mode on the second image block or The inter-frame prediction process in Skip mode.
  • the block performs the Merge mode or Skip mode inter prediction process, that is, skips the Merge mode or Skip mode inter prediction process of the second image block, that is, does not perform the Merge mode or Skip mode inter prediction process on the second image block Forecasting process.
  • step S320 includes: determining from the M reference blocks whether there is a reference block corresponding to the jth candidate motion vector of the second image block, where j is 1,...,P, P is the number of candidate motion vectors in the second image block.
  • P is a positive integer, and P can be 1, or an integer greater than 1.
  • step S330 includes: using the reference block corresponding to the jth candidate motion vector to compare the second The image block performs inter prediction in Merge mode or Skip mode.
  • Using the reference block corresponding to the jth candidate motion vector to perform Merge mode or Skip mode inter prediction on the second image block includes: obtaining the reference block corresponding to the jth candidate motion vector from the M reference blocks.
  • step S320 if it is determined in step S320 that there is no reference block corresponding to the j-th candidate motion vector in the M reference blocks, in the embodiments shown in FIG. 3 and FIG. 4, the use of the j-th candidate motion vector can be skipped.
  • the corresponding reference block performs the Merge mode or Skip mode inter prediction process on the second image block.
  • step S320 determines that the reference block corresponding to one candidate motion vector of the second image block is included in the M reference blocks. It should be understood that, as long as it is determined in step S320 that the reference block corresponding to one candidate motion vector of the second image block is included in the M reference blocks, the method of the embodiment shown in FIG. 3 includes step S330 shown in FIG. 4.
  • step S320 If it is determined in step S320 that the reference blocks corresponding to the P candidate motion vectors of the second image block are not included in the M reference blocks, the method of the embodiment shown in FIG. 3 includes step S340 shown in FIG. 4, and The step S330 shown in FIG. 4 is not included.
  • the P candidate motion vectors of the second image block involved in step S320 may be part or all of the motion vectors in the motion vector prediction (motion vector prediction, MVP) candidate list of the second image block. Whether the P candidate motion vectors are part of the motion vectors in the MVP candidate list of the second image block or all the motion vectors may be determined by actual requirements. In addition, in the case where the P candidate motion vectors are part of the motion vectors in the MVP candidate list of the second image block, the positions of the P candidate motion vectors in the MVP candidate list may also be determined by actual requirements.
  • step S320 includes: determining from the M reference blocks whether there is a reference block corresponding to the jth candidate motion vector of the second image block according to the following factors: the position of the second image block, the jth candidate motion vector , The location of M reference blocks.
  • the position of the second image block and the j-th candidate motion vector calculate the position of the second image block plus the j-th candidate motion vector (denoted as the predicted position), and then determine whether the predicted position is included in M In the position of the reference block, if yes, it can be considered that there is a reference block corresponding to the jth candidate motion vector of the second image block in the M reference blocks; if not, it can be considered that there is no second reference block in the M reference blocks.
  • the reference block corresponding to the jth candidate motion vector of the image block is a reference block corresponding to the jth candidate motion vector of the image block.
  • the expression “determine whether there is a reference block corresponding to the jth candidate motion vector of the second image block from M reference blocks” can be replaced with “determine whether the reference block corresponding to the jth candidate motion vector is included in M Reference block”.
  • the expression “the reference block corresponding to the jth candidate motion vector of the second image block exists in the M reference blocks” can be replaced with "the reference block corresponding to the jth candidate motion vector is included in the M reference blocks "Medium”, "there is no reference block corresponding to the jth candidate motion vector of the second image block in the M reference blocks” can be replaced with "the reference block corresponding to the jth candidate motion vector is not included in the M reference blocks” .
  • the position of the second image block can be expressed as (X PU , Y PU , X PU + W PU- 1, Y PU +H PU -1), these four values respectively represent the positions of the left boundary, the upper boundary, the right boundary, and the lower boundary of the second image block.
  • the coordinates of the pixels on the left and upper boundaries of the second image block can be expressed as (X PU , Y PU ), and the coordinates of the pixels on the right and lower boundaries on the second image can be expressed as (X PU +W PU -1, Y PU +H PU -1).
  • the horizontal component and vertical component of the j-th candidate motion vector are denoted as MVX PU and MVY PU respectively .
  • the predicted position of the second image block after adding the j-th candidate motion vector can be expressed as (X PU +MVX PU , Y PU +MVY PU , X PU +W PU +MVX PU -1, Y PU +H PU + MVY PU -1), these four values respectively represent the positions of the left, upper, right, and lower borders of the second image block plus the j-th candidate motion vector.
  • the jth candidate motion vector corresponds to The reference block is included in the M reference blocks, otherwise, it is considered that the reference block corresponding to the j-th candidate motion vector is not included in the M reference blocks.
  • the j-th candidate motion vector when the positions of the left, upper, right, and lower boundaries of the second image block after adding the j-th candidate motion vector are all located within the contraction positions of the M reference blocks, the j-th candidate motion vector can be considered
  • the corresponding reference block is included in the M reference blocks, otherwise, it is considered that the reference block corresponding to the j-th candidate motion vector is not included in the M reference blocks.
  • the shrinking positions of the M reference blocks indicate the positions after shrinking the M reference blocks based on the pixels required by the sub-pixel interpolation. For details, please refer to the description of the manner 2 to the manner 5 below.
  • step S320 includes: in the case where the horizontal component and the vertical component of the j-th candidate motion vector respectively point to whole pixels, if the position of the second image block after the displacement of the j-th candidate motion vector is located at M Within the position of any reference block in the reference block, it is determined that there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks.
  • step S310 includes: obtaining M reference blocks from the reference frame buffer according to the S candidate motion vectors of the first image block.
  • step S320 in the case where the horizontal component and the vertical component of the jth candidate motion vector of the second image block respectively point to integer pixels, if the jth candidate motion vector (MVX PU , MVY PU ) satisfies the conditions described below 1. It is determined that the reference block corresponding to the jth candidate motion vector is included in the M reference blocks.
  • step S320 it is determined from the M reference blocks whether there is a reference block corresponding to the jth candidate motion vector of the second image block except for the position of the second image block, the jth candidate motion vector.
  • a preset value may also be included, and the preset value is related to the minimum precision of the motion vector and/or the number of taps of the interpolation filter.
  • the minimum precision is 1/4
  • the tap is 7 taps or 8 taps
  • the preset value can be 3.25.
  • the value of the preset value may also change accordingly.
  • the preset value may have a corresponding value.
  • step S320 includes: when the horizontal component and/or the vertical component of the jth candidate motion vector of the second image block point to sub-pixels, comprehensively consider the position of the second image block and the jth candidate motion.
  • the vector, the positions of the M reference blocks, and the preset value, determine whether there is a reference block corresponding to the jth candidate motion vector of the second image block from the M reference blocks.
  • step S320 includes: in the case where the horizontal component of the jth candidate motion vector of the second image block points to sub-pixels and the vertical component points to the whole pixel, if the second image block is shifted by the jth candidate motion vector, The position of is located within the contraction position of the i-th reference block in the M reference blocks, and it is determined that there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks, i is 1,...,M, where the i-th The shrinking position of the reference block represents the position of the i-th reference block after passing through the left boundary and the right boundary respectively after shrinking inward by a preset value.
  • step S320 includes: in the case where the horizontal component of the jth candidate motion vector of the second image block points to the whole pixel and the vertical component points to the sub-pixel, if the second image block is shifting the jth candidate motion vector
  • the latter position is located in the contracted position of the i-th reference block in the M reference blocks, and it is determined that there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks, i is 1,...,M, where the i-th reference block
  • the contraction position of each reference block represents the position of the i-th reference block after the upper boundary and the lower boundary are respectively contracted inward by a preset value.
  • step S320 includes: when the horizontal component of the jth candidate motion vector of the second image block points to the sub-pixel and the vertical component points to the sub-pixel, if the second image block is shifting the jth candidate motion vector
  • the latter position is located in the contracted position of the i-th reference block in the M reference blocks, and it is determined that there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks, i is 1,...,M, where the i-th reference block
  • the contraction position of each reference block represents the position of the i-th reference block after the left boundary, the right boundary, the upper boundary and the lower boundary are respectively contracted inward by a preset value.
  • step S310 M reference blocks are obtained from the reference frame buffer according to the S candidate motion vectors of the first image block.
  • step S320 it is determined whether there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks in any of the following manners.
  • (X PU , Y PU ) represents the coordinates of the pixels located at the left and upper boundaries of the second image block, that is, the position coordinates of the upper left pixel in the second image block
  • W PU and HPU respectively represent the second image block wide and high
  • MVX PU MVY PU and each represent a vertical component and a horizontal component of the j-th candidate motion vectors
  • X i and Y i represent reference blocks M i-th reference block on the left border and the border pixels
  • the horizontal and vertical coordinates of, W i and H i respectively represent the width and height of the i-th reference block
  • the value of i ranges from 1 to M
  • a represents the preset value, which is the minimum precision of the motion vector It is related to the number of taps of the interpolation filter.
  • the value of a can be 3.25.
  • step S320 regardless of whether the horizontal component and the vertical component of the j-th candidate motion vector of the second image block point to sub-pixels or integer pixels, the position of the second image block and the j-th candidate motion vector are considered. , The positions of the M reference blocks, and the preset value to determine whether the reference block corresponding to the j-th candidate motion vector is included in the M reference blocks.
  • step S320 if the position of the second image block after the displacement of the j-th candidate motion vector is within the contraction position of the i-th reference block among the M reference blocks, it is determined that the j-th candidate motion vector corresponds to
  • the reference block of is contained in M reference blocks, where the shrinking position of the i-th reference block represents the position of the i-th reference block after the left boundary, the right boundary, the upper boundary and the lower boundary are respectively shrunk inward by the preset values,
  • the preset value is related to the minimum precision of the motion vector, i is 1,...,M.
  • step S310 M reference blocks are obtained from the reference frame buffer according to the S candidate motion vectors of the first image block.
  • step S320 it may be determined whether there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks through the following manner five.
  • a candidate motion vector (denoted as the j-th candidate motion vector) of an image block (denoted as the second image block) is taken as an example for description.
  • the second image block may be called PU, for example.
  • the inter-coding of the second image block includes the following steps.
  • Step S510 is the same as step S310 in the above embodiment. For details, please refer to the above description and will not be repeated here.
  • step S520 According to the position of the second image block, the jth candidate motion vector of the second image block, and the position of the i-th reference block in the M reference blocks, determine whether the reference block corresponding to the jth candidate motion vector is included in the Within i reference blocks, if yes, go to step S530, if not, go to step S540.
  • the value range of j is 1 to P
  • P represents the number of candidate motion vectors of the second image block.
  • the initial value of i is 1, and the value range of i is 1 to M.
  • S530 Perform inter-frame prediction in Merge mode or Skip mode on the second image block by using the reference block corresponding to the j-th candidate motion vector.
  • step S530 includes: obtaining a reference block corresponding to the j-th candidate motion vector from the data of the i-th reference block.
  • step S530 can be implemented by sub-step (1) in the encoding operation flow in the Merge mode or the Skip mode described above.
  • Step 1) in sub-step (1) is equivalent to obtaining the reference block corresponding to the j-th candidate motion vector from the i-th reference block.
  • step S550 Determine whether the value of i exceeds M, if yes, go to step S560, if not, go to step S520.
  • the processing shown in FIG. 5 can be performed for each candidate motion vector in the P candidate motion vectors. If the P candidate motion vectors of the second image block are processed as shown in FIG. 5, and one or more reference blocks corresponding to the candidate motion vectors are obtained from the M reference frames, the second image block can be used for the first
  • the two image blocks are subjected to an inter-frame prediction process in Merge mode or Skip mode. For the specific process, refer to the sub-steps in step 2 of the encoding operation flow in Merge mode or Skip mode described above for details.
  • the Merge mode or Skip mode can be performed on the image block based on these reference blocks.
  • the inter-frame prediction process of the mode is described in detail below.
  • the Merge mode or Skip mode inter prediction of this image block can be skipped process.
  • other methods can be used to perform inter-frame prediction or intra-frame prediction on this image block.
  • the second image block is taken as an example for description. It should be understood that, for each of the N image blocks, an operation similar to the processing of the second image block can be performed.
  • the reference block corresponding to each candidate motion vector is obtained from M reference blocks, and there is no need to request the reference frame buffer once for each motion vector of each image block Or multiple times of data, reducing the number of requests sent to the reference frame buffer, alleviating the management pressure on the reference frame buffer, reducing coding complexity, and improving coding efficiency.
  • Another embodiment of the present application also provides a video processing method.
  • the method includes the following steps (A) and (B).
  • M can be 1, or it can be an integer greater than 1.
  • the M reference blocks may be located in one reference frame or in multiple reference frames.
  • Step (A) is the same as step S310 in the above embodiment.
  • Step (A) is the same as step S310 in the above embodiment.
  • step (B) during the inter-frame prediction of N image blocks, the reference block of each image block of the N image blocks is obtained from the M reference blocks.
  • N is a positive integer, N can be 1, or an integer greater than 1.
  • Each of the N image blocks may be the smallest image processing object in video coding.
  • each of the N image blocks may be referred to as a prediction unit (PU).
  • PU prediction unit
  • each of the N image blocks may have other names correspondingly.
  • Step (A) is executed before step (B). Therefore, in step (B), it can be regarded as obtaining reference blocks of N image blocks from M reference blocks obtained in advance.
  • the technical solution of this embodiment can be applied to a scene where the inter-frame prediction mode is Merge mode or Skip mode.
  • step (B) the reference block of each of the N image blocks is obtained from M reference blocks, and for each of the N image blocks, according to the reference block of the image block, The image block performs inter-frame prediction in Merge mode or Skip mode.
  • the technical solution provided in this embodiment can also be applied to scenarios where the inter-frame prediction mode is a non-Merge mode and a non-Skip mode.
  • N is an integer greater than 1
  • N is an integer greater than 1
  • by obtaining reference blocks of multiple image blocks from M reference blocks obtained in advance it is not necessary for each image block to be uniformly predicted during the inter-prediction process of multiple image blocks.
  • Request data from the reference frame buffer one or more times, thereby reducing the number of requests for data from the reference frame buffer.
  • N is equal to 1
  • the inter prediction mode is Merge mode or Skip mode
  • multiple candidate motions of 1 image block are obtained from M reference blocks obtained in advance.
  • the reference block corresponding to the vector eliminates the need to request data from the reference frame buffer for each candidate motion vector of the image block, thereby reducing the number of requests for data from the reference frame buffer.
  • the reference blocks of the N image blocks are obtained from the M reference blocks obtained in advance. Therefore, there is no need for the inter prediction process of the N image blocks.
  • the reference frame buffer is requested one or more times for data, which reduces the number of requests sent to the reference frame buffer, relieves the management pressure on the reference frame buffer, reduces coding complexity, and can improve coding efficiency.
  • step (B) the reference block of each of the N image blocks can be obtained unconditionally from the M reference blocks; each image of the N image blocks can also be obtained conditionally from the M reference blocks The reference block of the block.
  • the data of M reference blocks is obtained from the reference frame buffer according to the candidate motion vector of the first image block, and the first image block includes N image blocks.
  • N image blocks are N PUs
  • the first image block is a CTU to which the N PUs belong. It is assumed that the data of these M reference blocks can be guaranteed to include reference blocks of N image blocks.
  • the reference block of each of the N image blocks can be obtained unconditionally from the M reference blocks. In other words, in step (B), it is possible to directly obtain the reference block of each image block of the N image blocks from the M reference blocks without performing the judgment action.
  • the M reference blocks obtained in step (A) contain reference blocks of N image blocks
  • the method for judging whether there is a reference block of the second image block in the M reference blocks is detailed in the relevant description in the above embodiment, here No longer.
  • the Merge mode or Skip mode inter prediction can be performed for each of the N image blocks, so that, in the N image blocks During the inter-frame prediction process in the Merge mode or Skip mode, there is no need to request one or more data from the reference frame buffer for the inter-frame prediction of each image block, which reduces the number of requests sent to the reference frame buffer and eases the need for reference
  • the management pressure of the frame buffer reduces the coding complexity, which can improve the coding efficiency.
  • the video encoding method provided in the embodiments of the present application may be executed by an encoder or a device with a video encoding function.
  • an embodiment of the present application also provides an encoding device.
  • the encoding device includes a processor 610 and a memory 620, the memory 620 is used to store instructions, the processor 610 is used to execute the instructions stored in the memory 620, and the execution of the instructions stored in the memory 620 makes the processor 610 The method used to perform the above method embodiment.
  • the processor 610 executes the instructions stored in the memory 620 to perform the following operations: obtain data of M reference blocks from the reference frame buffer, where M is a positive integer; perform inter-frame prediction in Merge mode or Skip mode on N image blocks When determining whether there is a reference block for each of the N image blocks from the M reference blocks, N is a positive integer.
  • the cache can reduce the number of requests for data from the reference frame cache, ease the management pressure on the reference frame cache, reduce coding complexity, and improve coding efficiency.
  • each of the N image blocks is a prediction unit (PU).
  • PU prediction unit
  • the first image block is any one of the following: coding tree unit (CTU), coding unit (CU), prediction unit (PU).
  • CTU coding tree unit
  • CU coding unit
  • PU prediction unit
  • obtaining data of M reference blocks from the reference frame buffer includes: obtaining M reference blocks from the reference frame buffer according to the S candidate motion vectors of the first image block, where S is a positive integer less than or equal to M , Where the first image block and the N image blocks belong to the same image unit block.
  • the first image block includes part or all of the N image blocks.
  • the first image block is an image unit block.
  • the N image blocks include the second image block; wherein, when the N image blocks are inter-predicted in Merge mode or Skip mode, it is determined from the M reference blocks whether each of the N image blocks exists.
  • the reference block of the image blocks includes: determining whether there is a reference block of the second image block from the M reference blocks.
  • the processor 610 is further configured to perform the following operations: when there are reference blocks of the second image block in the M reference blocks, perform Merge mode or Skip mode on the second image block according to the reference blocks of the second image block. Inter prediction.
  • the processor 610 is further configured to perform the following operation: in the case that there is no reference block of the second image block in the M reference blocks, skip the Merge mode or the Skip mode inter prediction of the second image block.
  • the candidate motion vector of the second image block includes multiple; wherein, determining whether there is a reference block corresponding to the second image block from the M reference blocks includes: determining whether there is a second image from the M reference blocks The reference block corresponding to the jth candidate motion vector of the block, where j is 1,...,P, and P is the number of multiple candidate motion vectors.
  • determining whether there is a reference block corresponding to the jth candidate motion vector of the second image block from the M reference blocks includes: determining whether there is the second image block from the M reference blocks according to the following factors Reference blocks corresponding to the j candidate motion vectors: the position of the second image block, the j-th candidate motion vector, and the positions of the M reference blocks.
  • determining whether there is a reference block corresponding to the j-th candidate motion vector of the second image block from the M reference blocks including: when the horizontal component and the vertical component of the j-th candidate motion vector respectively point to the whole pixel
  • the factors also include a preset value, the preset value and the minimum precision of the motion vector and/or the interpolation filter The number of taps is related.
  • determining whether there is a reference block corresponding to the jth candidate motion vector of the second image block from the M reference blocks includes: if the position of the second image block after the displacement of the jth candidate motion vector is located Within the contraction position of the i-th reference block in the M reference blocks, it is determined that there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks, and i is 1,...,M.
  • the contraction position of the i-th reference block means that the i-th reference block is contracted inward by the preset value after the left boundary and the right boundary. After the location.
  • the contraction position of the i-th reference block means that the i-th reference block passes through the upper boundary and the lower boundary and shrinks inward by a preset value. After the location.
  • the contraction position of the i-th reference block indicates that the i-th reference block passes through the left, right, upper, and lower boundaries, respectively Shrink the position after the preset value inward.
  • determining whether there is a reference block corresponding to the jth candidate motion vector of the second image block from the M reference blocks includes: if the position of the second image block after the displacement of the jth candidate motion vector is located Within the contracted position of the i-th reference block in the M reference blocks, it is determined that there is a reference block corresponding to the j-th candidate motion vector in the M reference blocks, where the contracted position of the i-th reference block represents the i-th reference block The position after the left boundary, right boundary, upper boundary and lower boundary are respectively contracted inward by the preset value.
  • the preset value is related to the minimum precision of the motion vector, i is 1,...,M.
  • performing Merge mode or Skip mode inter prediction on the second image block includes: there is a jth in the M reference blocks In the case of the reference block corresponding to the candidate motion vector, the reference block corresponding to the j-th candidate motion vector is used to perform Merge mode or Skip mode inter prediction on the second image block.
  • the processor 610 is further configured to perform the following operation: in the case that there is no reference block corresponding to the j-th candidate motion vector in the M reference blocks, skip using the reference block pair corresponding to the j-th candidate motion vector
  • the second image block performs an inter prediction process in Merge mode or Skip mode.
  • the encoding device further includes a communication interface 630 for transmitting signals with external devices.
  • the encoding device in this embodiment is an encoder
  • the communication interface 630 is used to receive image or video data to be processed from an external device.
  • the communication interface 630 is also used to send the encoded code stream to the decoding end.
  • the embodiment of the present invention also provides a computer storage medium on which a computer program is stored.
  • the computer program When the computer program is executed by a computer, the computer executes the method of the above method embodiment.
  • An embodiment of the present invention also provides a computer program product containing instructions, which is characterized in that, when the instructions are executed by a computer, the computer executes the method of the above method embodiment.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any other combination.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer program instructions When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • computer instructions may be transmitted from a website, computer, server, or data center through a cable (such as Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.

Landscapes

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

Abstract

提供一种视频处理的方法与装置,该方法包括:从参考帧缓存中获取M个参考块的数据,M为正整数;在对N个图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在N个图像块中每个图像块的参考块,N为正整数。通过预先从参考帧缓存访问M个参考块的数据,并在预先获取的M个参考块中确定是否存在N个图像块中每个图像块的参考块,可以实现从预先获取的M个参考块中获取Merge模式或Skip模式的帧间预测所需的多个数据,从而可以减少向参考帧缓存请求数据的次数。

Description

视频处理的方法与装置
版权申明
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。
技术领域
本申请涉及视频编码领域,并且更为具体地,涉及一种视频处理的方法与装置。
背景技术
为了减少视频存储和传输所占用的带宽,需要对视频数据进行编码处理。预测是视频编码流程中的重要环节,预测的目的在于,针对一个图像块,获取与其最相近的一个块(可以称为参考块),然后将该图像块与其参考块相减得到残差。预测分为帧内预测与帧间预测。帧间预测,就是要获得当前图像块的运动矢量(motion vector,MV),然后根据该MV确定参考块在参考帧中的位置。
高效视频编码(High Efficiency Video Coding,HEVC)标准提出两种帧间预测模式:Merge模式与Skip模式。在Merge模式与Skip模式中,根据图像块的候选运动矢量获取该图像块的参考块,其中,需要根据候选运动矢量从参考帧中获取数据来获取当前块的参考块。在硬件编码器中,就是要向参考帧缓存(buffer)请求数据。
HEVC标准提供了灵活的块划分结构,一帧图像划分为多个子块。例如,先将一帧图像划分为多个编码树单元(Coding Tree Unit,CTU),一个CTU可划分为一个或多个编码单元(Coding Unit,CU),一个CU又可划分为一个或多个预测单元(Prediction Unit,PU)。在HEVC标准下,针对每个PU,都需要根据其候选运动矢量从参考帧缓存中获取数据,这导致在一个CTU的帧间编码过程中,需要多次向参考帧缓存请求数据,这会增加硬件设计的难度,也会降低帧间预测的效率。
发明内容
本申请提供一种视频处理的方法与装置,通过预先从参考帧缓存访问M个参考块的数据,可以实现从预先获取的M个参考块中获取Merge模式或Skip模式的帧间预测所需的多个数据,从而可以减少向参考帧缓存请求数据的次数。
第一方面,提供一种视频处理的方法,该方法包括:从参考帧缓存中获取M个参考块的数据,M为正整数;在对N个图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在N个图像块中每个图像块的参考块,N为正整数。
第二方面,提供一种编码装置,该编码装置包括处理器与存储器,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,并且对该存储器中存储的指令的执行使得,该处理器执行如下操作:从参考帧缓存中获取M个参考块的数据,M为正整数;在对N个图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在N个图像块中每个图像块的参考块,N为正整数。
第三方面,提供一种芯片,该芯片包括处理模块与通信接口,该处理模块用于控制该通信接口与外部进行通信,该处理模块用于实现第一方面提供的方法。
第四方面,提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得所述计算机实现第一方面提供的方法。
第五方面,提供一种包含指令的计算机程序产品,该指令被计算机执行时使得该计算机实现第一方面提供的方法。
因此,在本申请中,通过预先从参考帧缓存访问M个参考块的数据,并在预先获取的M个参考块中确定是否存在N个图像块中每个图像块的参考块,可以实现从预先获取的M个参考块中获取Merge模式或Skip模式的帧间预测所需的多个数据,从而无需针对每个图像块的帧间预测均向参考帧缓存请求一次或多次数据,减少了向参考帧缓存发送请求的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度,从而可以提升编码效率。
附图说明
图1为视频编码的架构示意图。
图2为HEVC标准下的块划分结构的示意图。
图3为本申请实施例提供的视频处理的方法的示意性流程图。
图4为本申请实施例提供的视频处理的方法的另一示意性流程图。
图5为本申请实施例提供的视频处理的方法的又一示意性流程图。
图6为本申请实施例提供的编码装置的示意性框图。
具体实施方式
下面将结合附图,对本申请实施例中的技术方案进行描述。
为了便于理解本申请实施例,先描述本申请实施例涉及的相关概念。
1、视频编码基本架构
为了减少视频存储和传输所占用的带宽,需要对视频数据进行编码处理。视频编码的基本架构如图1所示。首先将一帧图像划分为若干的图像块,然后对每个图像块进行预测、变换、量化和熵编码。
其中,预测分为帧内预测和帧间预测。帧内预测使用当前图像帧上已编码的块来生成当前图像块(下文简称为当前块)的参考块(或称为预测块),而帧间预测使用参考帧(或称为参考图像)来获取当前块的参考块。然后将当前块与参考块相减得到残差数据。通过残差数据与变换矩阵,将时域信号变换到频域上,得到变换系数。对变换系数进行量化,来缩小变换系数的动态范围,以进一步压缩信息。对于量化后的变换系数,一是通过熵编码得到熵编码的比特流;二是经过反量化和反变换后与参考块相加,再进行环内滤波得到重建帧图像,可以基于重建帧图像确定较优的预测方式。
在帧间预测中,对于当前块,从参考帧中搜索与其最相似的一个块作为当前块的参考块,然后将当前块与参考块相减得到残差,残差经过后续变换、量化和熵编码形成比特流。从参考帧中搜索与当前块最相似的块的过程称为运动搜索。通过运动搜索得到当前块的参考块。当前块相对于参考块的位置偏移称为当前块的运动向量(motion vector,MV)。可以理解到,若获得当前块的MV,就可以获得参考块在参考帧中的位置,即获得当前块的参考块。
2、Merge模式与Skip模式的帧间预测
在高效视频编码(High Efficiency Video Coding,HEVC)标准中,提出三种帧间预测模式:普通帧间预测(inter predict mode)、合并模式(Merge mode)与跳过模式(Skip mode)。其中,Merge模式和Skip模式属于两种特殊的帧间预测模式。
从前文对帧间预测的描述可以理解到,帧间预测的目的,就是要得到当前块的MV,然后根据该MV确定参考块在参考图像中的位置。相邻图像块之间具有相似性,例如,当前块和临近块都属于同一个物体,在镜头移动的时候,它们移动的距离和方向自然是相似或相同的,因此,很多时候并不需要去计算当前块的MV,可以将相邻块的MV作为当前块的MV。Merge模式与Skip模式就是基于这种思路的帧间预测模式。
在Merge模式中,针对当前块,通过其相邻块(时域相邻块,和/或空域相邻块)得到一个运动矢量预测值(motion vector prediction,MVP)候选列表,从中选出最优的一个MVP作为当前块的MV,然后根据该MV直接确定参考块在参考帧中的位置,即根据该MV确定参考块。在HEVC标准中,Merge模式最多可从相邻块获取5个候选运动矢量,并从中选择出一个作为当前块的运动矢量。
在Merge模式中,MVP和MV相同,即运动矢量差(Motion Vector Difference,MVD)为零,可以视为不存在MVD。因此编码端编码的时候只需要编码从MVP候选列表中选出来的MVP(即MV)在MVP候选列表中的索引即可,不再需要编码MVD。解码端可以按照类似的方法构造MVP候选列表,然后依据编码端传输过来的索引就能得到当前块的MV了。也就是说,Merge模式的特点为:MV=MVP(MVD=0),在编码的码流中,不需要编码MVD。
作为示例而非限定,Merge模式下的编码操作流程包括如下步骤。
步骤一、获取当前块的运动矢量预测值(motion vector prediction,MVP)候选列表。
步骤二、从MVP候选列表中选出最优的一个MVP,同时得到该MVP在MVP候选列表中的索引。
步骤三、把步骤二中选出的MVP作为当前块的运动矢量(MV)。
步骤四、根据当前块的MV确定参考块在参考帧中的位置,即获取当前块的参考块。
步骤五、将参考块与当前块进行相减,得到残差数据。
步骤六、因为MVP和MV相同,因此没有MVD,只需将残差数据,以及MV(MVP)在MVP候选列表中的索引传输给解码器。
作为示例而非限定,步骤二包括如下子步骤。
子步骤(1)、对于MVP候选列表中的每个MVP,把它当作MV,进行如下处理:
1),根据该MV在参考帧中得到参考块;
2),根据该MV与该参考块,计算残差,并基于残差进行变换与量化,确定当前块基于该MV进行编码的编码代价。
子步骤(2)、通过比较MVP候选列表中各个MVP的编码代价,从MVP候选列表中选出最优的MVP。
应理解,经过步骤二之后,就得到了最优的MVP(即当前块的MV)。
Skip模式与Merge模式相似,也是从相邻块中获取候选运动矢量,并从中选择出一个作为当前块的运动矢量。
相对于Merge模式,Skip模式具有两点区别:一是,只有按照2N×2N的划分结构划分的图像块(例如,图2中(C)中左上角划分的图像块,请参见下文结合图2描述的内容)才能使用Skip模式;二是,在Skip模式下,当前块与参考块的残差默认是零,即不需要对残差进行编码,从而大幅节省码率。换句话说,在Skip模式中,当前块的参考块与重建块相同。或者说,Skip模式的一个特点为,重构值(rec)=预测值(pred)(残差值=0),即不需要编码残差。
例如,可以将Skip模式视为Merge模式的一种特殊情况,即残差为0,无需编码残差。
Merge和Skip模式属于帧间预测模式,因此,在Merge和Skip模式中,需要根据候选运动矢量从参考帧中获取数据来得到当前块的参考块,在硬件编码器中,就是要向参考帧缓存(Buffer)请求数据。
3、块划分
新一代视频编码标准HEVC采用的是基于块划分的混合编码架构,如图2所示。
如图2中的(A)所示,一个图像被划分为若干的子块,每个子块称为编码树单元(Coding Tree Unit,CTU)。如图2中的(B)所示,每个CTU可以进一步划分为一个或四个编码单元(Coding Unit,CU),每个CU又可以再进一步划分为更小的CU。如图2中(C)所示,每个CU可以再进一步划分为一个、两个或四个预测单元(Prediction Unit,PU)。在HEVC标准中,CTU的尺寸范围可以为:16×16到64×64(单位为像素)。
在HEVC采用的基于块划分的混合编码架构中,预测粒度是PU,例如,在Merge模式与Skip模式的帧间预测中,对于每个PU,均需要根据候选运动矢量从参考帧缓存中获取数据。
在现有的帧间编码方案中,对于每个图像块,需要根据其每个候选运动矢量从参考帧缓存中请求数据以获取该图像块的参考块。
首先,一个图像块可以对应一个候选运动矢量,也可以对应多个候选运动矢量。其次,HEVC提供了灵活的块划分结构,一个CTU可划分为一个或多个的CU,每个CU还能进一步划分为一个或多个PU。因此,在一个CTU的帧间编码过程中,需要多次甚至频繁地向参考帧缓存请求数据,这会增加帧间编码的时延,也会增加硬件设计的难度。
本申请提供一种视频处理的方法与装置,通过预先从参考帧缓存访问M个参考块的数据,可以实现从预先获取的M个参考块中获取帧间预测所需的多个数据,从而可以减少向参考帧缓存请求数据的次数。
本申请适用于的编码标准包括但不限于HEVC编码标准。例如,本申请可以适用于当前的以及未来演进的各种编解码标准。
图3为本申请实施例提供的视频处理的方法的示意性流程图。该方法包括如下步骤。
S310,从参考帧缓存中获取M个参考块的数据。
参考帧缓存表示存储参考帧的数据的缓存(buffer)。参考帧表示已经完成编码的图像帧。
其中,M为正整数。例如,M为1,或者为大于1的整数。在M为大于1的整数的情况下,M个参考块可以位于一个参考帧中,也可以位于多个参考帧中。
S320,在对N个图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在N个图像块中每个图像块的参考块。
其中,N为正整数。例如,N为1,或者为大于1的整数。
N个图像块中的每个图像块可以为视频编码中最小的图像处理对象。例如,在HEVC标准中,N个图像块中的每个图像块可以称为预测单元(Prediction Unit,PU)。再例如,在其它视频编码标准中,N个图像块中的每个图像块可以相应具有其它名称。下文一些实施例中,会以N个图像块中的每个图像块为PU为例进行描述。
以N个图像块中的一个图像块(记为图像块x)为例。在M个参考块中存在图像块x的参考块的情况下,从M个参考块中获取图像块x的参考块,从而利用该参考块对图像块x进行Merge模式或Skip模式的帧间预测。在M个参考块中不存在图像块x的参考块的情况下,跳过图像块x的Merge模式或Skip模式的帧间预测过程。
其中,在M个参考块中存在图像块x的参考块的情况下,对图像块x进行Merge模式或Skip模式的帧间预测,包括:从M个参考块中获取图像块x的参考块。
M个参考块中存在图像块x的参考块,表示,步骤S310中获取的M个参考块的数据中包含图像块x的参考块的数据。M个参考块中存在图像块x的参考块,还可以理解为,M个参考块中任一个参考块或者多个参考块中包含图像块x的参考块。
从M个参考块中获取图像块x的参考块,表示,从步骤S310中获取的M个参考块的数据中获取图像块x的参考块的数据,即获取图像块x的参考块。
M个参考块中不存在图像块x的参考块,表示,步骤S310中获取的M个参考块的数据中不包含图像块x的参考块的数据。M个参考块中不存在图像块x的参考块,还可以理解为,M个参考块中任一个参考块中均不包含图像块x的参考块。
步骤S310在步骤S320之前执行。因此,在步骤S320中,是从预先获取的M个参考块中确定是否存在N个图像块中每个图像块的参考块。
从前文针对Merge模式或Skip模式的描述可知,在一种实现方式中,在Merge模式或Skip模式的帧间预测中,针对每个候选运动矢量需要向参考帧缓存请求数据,针对每个PU需要向参考帧缓存请求数据。
而在本申请中,预先从参考帧缓存访问M个参考块的数据,然后在对N个图像块进行Merge模式或Skip模式的帧间预测时,在预先获取的M个参考块中确定是否存在N个图像块中每个图像块的参考块,其中,在是的情况下,对相应图像块进行Merge模式或Skip模式的帧间预测,在否的情况下,跳过相应图像块的Merge模式或Skip模式的帧间预测过程。
应理解,通过预先从参考帧缓存访问M个参考块的数据,以及在预先获取的M个参考块中确定是否存在N个图像块中每个图像块的参考块,可 以使得从预先获取的M个参考块中获取Merge模式或Skip模式的帧间预测所需的多个数据。因此,无需针对每个图像块均向参考帧缓存请求一次或多次数据,减少了向参考帧缓存发送请求的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度,从而可以提升编码效率。
因此,在本申请中,通过预先从参考帧缓存访问M个参考块的数据,可以实现从预先获取的M个参考块中获取Merge模式或Skip模式的帧间预测所需的多个数据,从而可以避免每处理一个候选运动矢量需要访问一次参考帧缓存、每处理一个图像块(例如,PU)需要访问一次或多次参考帧缓存,相对于现有技术,可以减少向参考帧缓存请求数据的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度,从而可以提升编码效率。
应理解,减少向参考帧缓存请求数据的次数,可以降低硬件的设计难度,还可以提高帧间预测的效率。
在N大于1的情况下,在本申请中,对N个图像块中每个图像块的处理方式是类似的。为了便于理解与描述,下文一些实施例中会以N个图像块中的一个图像块(记为第二图像块)为例进行的描述。需要说明的是,下文中以第二图像块为例描述的方案也适用于N个图像块中的其它图像块,或者说,对N个图像块中的每个图像块都进行类似第二图像块的处理。
在步骤S310中,从参考帧缓存中获取M个参考块的数据的方法可以有多种。
可选地,步骤S310中包括:根据第一图像块的S个候选运动矢量从参考帧缓存中获取M个参考块,其中,第一图像块与N个图像块属于同一个图像单元块。
根据第一图像块的S个候选运动矢量从参考帧缓存中获取M个参考块,表示,以第一图像块的位置分别加上M个运动矢量后得到M个位置,基于M个位置从参考帧缓存中读取M个参考块的数据。例如,以这M个位置为中心,从参考帧缓存中读取M个参考块的数据。
其中,S为小于或等于M的正整数。若S等于M,则这M个运动矢量就是第一图像块的S个候选运动矢量。若S小于M,可以使用零运动矢量或全局运动矢量补充,即通过S个候选运动矢量与(M-S)个零运动矢量或全局运动矢量,获得M个运动矢量。
作为示例,假设M个参考块中第i个参考块的大小为W i×H i,其中, W i表示宽度,H i表示高度,i等于1,2…,M。假设第i个参考块的左边界和上边界的像素点在图像帧内的水平和垂直坐标分别是X i和Y i,则第i个参考块的右边界和下边界的像素点在图像帧内的水平和垂直坐标分别是X i+W i-1和Y i+H i-1。
需要说明的是,本申请对M个参考块的大小不作限定。例如,M个参考块的大小可以相同,也可以不完全相同。再例如,M个参考块的大小可以与编码架构的块划分方式有关。或者,M个参考块的大小可以预定义。
第一图像块与N个图像块属于同一个图像单元块,表示,第一图像块与N个图像块属于同一个非最小的图像处理单元。换言之,该图像单元块表示视频编码架构中非最小的图像处理单元。例如,在HEVC标准下,该图像单元块可以是CTU,也可以是CU。应理解,在其它视频编码标准下,该图像单元块可以具有其它名称。
第一图像块可以是与N个图像块相同划分层级下的图像块,也可以是划分层级高于N个图像块的划分层级的图像块。
例如,在HEVC标准下,N个图像块中每个图像块为PU,第一图像块可以是PU,也可以是CU或CTU。在一种示例中,上述N个图像块为N个PU,该N个PU组成的CTU即为第一图像块,也即是说,该CTU包括N个PU。在另一种示例中,上述N个图像块为N个CU,该N个CU组成的CTU即为第一图像块,也即是说,该CTU包括N个CU。
应理解,因为第一图像块与要进行帧间预测的N个图像块属于同一个图像单元块,所以N个图像块的参考块落入基于第一图像块的候选运动矢量获取的M个参考块的概率较大,可以使得从预先获取的M个参考块中获取较多的帧间预测所需的数据,从而可以减小对参考帧缓存的访问次数。
可选地,在通过第一图像块的候选运动矢量从参考帧缓存中获取M个参考块的数据的实施例中,第一图像块包括N个图像块中的部分或全部图像块。
例如,在HEVC标准中,N个图像块为N个PU,第一图像块为包含该N个PU中的部分PU或全部PU的CU或CTU。
应理解,当第一图像块包含N个图像块中的部分或全部图像块,N个图像块的参考块落入通过第一图像块的候选运动矢量获取的M个参考块中的概率进一步提高,从而可以从预先获取的M个参考块中获取更多的帧间预 测所需的数据,从而可以有效减小对参考帧缓存的访问次数。
可选地,在通过第一图像块的候选运动矢量从参考帧缓存中获取M个参考块的数据的实施例中,第一图像块为包含N个图像块的图像单元块。
例如,在HEVC标准中,N个图像块为1个CTU中的N个PU,第一图像块为该CTU;或者,N个图像块为1个CU中的N个PU,第一图像块为该CU。
应理解,当第一图像块包含N个图像块,N个图像块的参考块落入通过第一图像块的候选运动矢量获取的M个参考块中的概率更进一步提高,从而可以从预先获取的M个参考块中获取更多的帧间预测所需的数据,从而可以有效减小对参考帧缓存的访问次数。
例如,在通过第一图像块的候选运动矢量从参考帧缓存中获取M个参考块的数据、且第一图像块包含N个图像块的实施例中,在N个图像块的帧间预测过程中,所需的参考数据均可以从预先获取的M个参考块中获取,也就是说,在N个图像块的帧间预测过程中,仅需向参考帧缓存请求一次数据。
作为示例,在HEVC标准中,第一图像块为CTU,N个图像块为该CTU中划分得到的N个PU,本申请实施例可以在该CTU内所有PU的Merge模式或Skip模式的帧间编码过程中,仅需向参考帧缓存访问一次数据,相比于现有技术,有效减小了向参考帧缓存访问数据的次数。
上文描述了,在步骤S310中根据第一图像块的候选运动矢量从参考帧缓存中获取M个参考块的数据。可选地,在步骤S310中,也可以根据其它可行的方式从参考帧缓存中获取M个参考块的数据。例如,根据CTU内的一个或多个PU/CU的运动矢量从参考帧缓存中获取M个参考块的数据,后续在对该CTU内的各个PU/CU进行Merge模式或Skip模式的帧间预测时,从预先获取的M个参考块中获取各个PU/CU的参考块即可,无需针对每个PU/CU分多次向参考帧缓存发送参考块获取请求。
下文中,以N个图像块中的第二图像块为例进行描述,如图4所示,步骤S320包括:在对N个图像块中的第二图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在第二图像块的参考块。
其中,第二图像块的参考块可以通过第二图像块的候选运动矢量获取。
例如,在前文描述的Merge模式或Skip模式下的编码操作流程的示例 中,步骤S320可以在步骤二内完成。换句话说,在前文描述的Merge模式或Skip模式下的编码操作流程的示例中,在步骤二中,判断第二图像块的参考块是否包含于M个参考块中。
可选地,如图4所示,图3所示实施例的方法还可以包括步骤S330或步骤S340。
S330,在步骤S320中的判断结果为是的情况下,即在M个参考块中存在第二图像块的参考块的情况下,根据第二图像块的参考块对第二图像块进行Merge模式或Skip模式的帧间预测。
根据第二图像块的参考块对第二图像块进行Merge模式或Skip模式的帧间预测,包括:从M个参考块中获取第二图像块的参考块。
从M个参考块中获取第二图像块的参考块,表示,从预先获取的M个参考块的数据中获取第二图像块的参考块的数据。
关于对图像块进行Merge模式或Skip模式的帧间预测的过程,参见上文描述的Merge模式或Skip模式下的编码操作流程,这里不再赘述。
例如,在前文描述的Merge模式或Skip模式下的编码操作流程的示例中,步骤S320与步骤S330均可以在步骤二内完成。换句话说,在前文描述的Merge模式或Skip模式下的编码操作流程的示例中,在步骤二中,判断第二图像块的参考块是否包含于M个参考块中,在是的情况下,从M个参考块中获取第二图像块的参考块。
S340,在步骤S320中的判断结果为否的情况下,即在M个参考块中不存在第二图像块的参考块的情况下,跳过第二图像块的Merge模式或Skip模式的帧间预测过程。
例如,对于第二图像块的一个候选运动矢量,如果该候选运动矢量对应的参考块不在M个参考块中,则跳过采用该候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测过程。
再例如,对于第二图像块的所有候选运动矢量,如果该所有的候选运动矢量对应的参考块均不在M个参考块中,则跳过采用每个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测过程,即跳过第二图像块的Merge模式或Skip模式的帧间预测过程,也就是说,不对第二图像块进行Merge模式或Skip模式的帧间预测过程。
在不对第二图像块进行Merge模式或Skip模式的帧间预测过程的情形 下,例如,可以采用其他方式对这个图像块进行帧间预测或者帧内预测。
可选地,在图4所示实施例中,步骤S320包括:从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块,j为1,…,P,P为第二图像块具有的候选运动矢量的个数。P为正整数,P可以为1,或者为大于1的整数。
例如,若在步骤S320中,确定M个参考块中存在第二图像块的第j个候选运动矢量对应的参考块,则步骤S330包括:采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测。
采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测,包括:从M个参考块中获取第j个候选运动矢量对应的参考块。
作为示例,将第j个候选运动矢量作为第二图像块的MV,进行前文描述的Merge模式或Skip模式下的编码操作流程中步骤二中的子步骤(1)与子步骤(2)。
又例如,若在步骤S320中,确定M个参考块中不存在第j个候选运动矢量对应的参考块,在图3与图4所示实施例中,可以跳过采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测过程。
应理解,只要在步骤S320中确定了第二图像块的一个候选运动矢量对应的参考块包含于M个参考块中,则图3所示实施例的方法包括图4中所示的步骤S330。
若在步骤S320中确定第二图像块的P个候选运动矢量对应的参考块均不包含于M个参考块中,则图3所示实施例的方法包括图4中所示的步骤S340,而不包括图4中所示的步骤S330。
步骤S320中涉及的第二图像块的P个候选运动矢量,可以是第二图像块的运动矢量预测值(motion vector prediction,MVP)候选列表中的部分或全部运动矢量。P个候选运动矢量是第二图像块的MVP候选列表中的部分运动矢量还是全部运动矢量,可以由实际需求决定。此外,在P个候选运动矢量是第二图像块的MVP候选列表中的部分运动矢量的情况下,P个候选运动矢量在MVP候选列表中的位置也可以由实际需求确定。
下文将描述确定M个参考块中是否存在第j个候选运动矢量对应的参考 块的方法。
可选地,步骤S320包括:根据下列因素,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块:第二图像块的位置,第j个候选运动矢量,M个参考块的位置。
例如,根据第二图像块的位置与第j个候选运动矢量,计算第二图像块加上第j个候选运动矢量后的位置(记为预测位置),然后判断该预测位置是否包含于M个参考块的位置内,若是,则可以视为M个参考块中存在第二图像块的第j个候选运动矢量对应的参考块,若否,则可以视为M个参考块中不存在第二图像块的第j个候选运动矢量对应的参考块。
本文中的表述“从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块”可以替换为“判断第j个候选运动矢量对应的参考块是否包含于M个参考块中”。相应地,本文中的表述“M个参考块中存在第二图像块的第j个候选运动矢量对应的参考块”可以替换为“第j个候选运动矢量对应的参考块包含于M个参考块中”,“M个参考块中不存在第二图像块的第j个候选运动矢量对应的参考块”可以替换为“第j个候选运动矢量对应的参考块不包含于M个参考块中”。
作为示例。以第二图像块为PU为例,假设第二图像块的宽与高分别表示为W PU与H PU,第二图像块的位置可以表示为(X PU,Y PU,X PU+W PU-1,Y PU+H PU-1),这四个值分别表示第二图像块的左边界、上边界、右边界、下边界的位置。可以理解到,第二图像块上位于左边界与上边界的像素的坐标可以表示为(X PU,Y PU),第二图像上位于右边界与下边界的像素的坐标可以表示为(X PU+W PU-1,Y PU+H PU-1)。假设,第j个候选运动矢量的水平分量与垂直分量分别表示为MVX PU与MVY PU。则第二图像块加上第j个候选运动矢量后的预测位置可以表示为(X PU+MVX PU,Y PU+MVY PU,X PU+W PU+MVX PU-1,Y PU+H PU+MVY PU-1),这四个值分别表示第二图像块加上第j个候选运动矢量后的左、上、右、下边界的位置。
例如,在第二图像块加上第j个候选运动矢量后的左、上、右、下边界的位置均位于M个参考块的位置内的情况下,可以认为第j个候选运动矢量对应的参考块包含于M个参考块中,否则,则认为第j个候选运动矢量对应的参考块不包含于M个参考块中。
再例如,在第二图像块加上第j个候选运动矢量后的左、上、右、下边 界的位置均位于M个参考块的收缩位置内的情况下,可以认为第j个候选运动矢量对应的参考块包含于M个参考块中,否则,则认为第j个候选运动矢量对应的参考块不包含于M个参考块中。其中,M个参考块的收缩位置表示基于分像素插值需要的像素对M个参考块进行收缩后的位置,详见下文关于方式二至方式五的描述。
可选地,步骤S320包括:在第j个候选运动矢量的水平分量与垂直分量分别指向整像素的情况下,若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中任一个参考块的位置内,确定M个参考块中存在第j个候选运动矢量对应的参考块。
作为示例,以M个参考块的数据通过第一图像块的候选运动矢量获得的为例。例如,步骤S310包括:根据第一图像块的S个候选运动矢量从参考帧缓存中获取M个参考块。在步骤S320中,在第二图像块的第j个候选运动矢量的水平分量与垂直分量分别指向整像素的情况下,若第j个候选运动矢量(MVX PU,MVY PU)满足下文描述的条件一,确定第j个候选运动矢量对应的参考块包含于M个参考块内。
可选地,在步骤S320中,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块的因素除了第二图像块的位置、第j个候选运动矢量、M个参考块的位置之外,还可以包括预设值,该预设值与运动矢量的最小精度和/或插值滤波器的抽头数量相关。
例如,在HEVC标准下,最小精度是1/4,抽头是7抽头或8抽头,该预设值可以为3.25。再例如,在其他标准下,当运动矢量的最小精度发生改变,或者插值滤波器的抽头数量发生改变的情况下,该预设值的取值也可以相应发生变化。再例如,在其它视频编码标准下,该预设值可以具有相应的取值。
可选地,步骤S320包括:在第二图像块的第j个候选运动矢量的水平分量,和/或垂直分量指向分像素的情况下,综合考虑第二图像块的位置、第j个候选运动矢量、M个参考块的位置、以及该预设值,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块。
例如,步骤S320包括:在第二图像块的第j个候选运动矢量的水平分量指向分像素、垂直分量指向整像素的情况下,若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中的第i个参考块的收缩位置 内,确定M个参考块中存在第j个候选运动矢量对应的参考块,i为1,…,M,其中,第i个参考块的收缩位置表示第i个参考块经过左边界与右边界分别向里收缩预设值之后的位置。
又例如,步骤S320包括:在第二图像块的第j个候选运动矢量的水平分量指向整像素、垂直分量指向分像素的情况下,若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中的第i个参考块的收缩位置内,确定M个参考块中存在第j个候选运动矢量对应的参考块,i为1,…,M,其中,第i个参考块的收缩位置表示第i个参考块经过上边界与下边界分别向里收缩预设值之后的位置。
再例如,步骤S320包括:在第二图像块的第j个候选运动矢量的水平分量指向分像素、垂直分量指向分像素的情况下,若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中的第i个参考块的收缩位置内,确定M个参考块中存在第j个候选运动矢量对应的参考块,i为1,…,M,其中,第i个参考块的收缩位置表示第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩预设值之后的位置。
作为示例,在步骤S310中,根据第一图像块的S个候选运动矢量从参考帧缓存中获取M个参考块。在步骤S320中,通过如下方式中的任一种方式确定M个参考块中是否存在第j个候选运动矢量对应的参考块。
方式一。在第j个候选运动矢量的水平分量与垂直分量分别指向整像素的情况下,若第j个候选运动矢量(MVX PU,MVY PU)满足下列条件一,确定第j个候选运动矢量对应的参考块包含于M个参考块内。
方式二。在第j个候选运动矢量的水平分量指向分像素、垂直分量指向整像素的情况下,若第j个候选运动矢量(MVX PU,MVY PU)满足下列条件二,确定第j个候选运动矢量对应的参考块包含于M个参考块内。
方式三。在第j个候选运动矢量的水平分量指向整像素、垂直分量指向分像素的情况下,若第j个候选运动矢量(MVX PU,MVY PU)满足下列条件三,判断第j个候选运动矢量对应的参考块包含于M个参考块内。
方式四。在第j个候选运动矢量的水平分量与垂直分量分别指向分像素的情况下,若第j个候选运动矢量(MVX PU,MVY PU)满足下列条件四,确定第j个候选运动矢量对应的参考块包含于M个参考块内。
条件一:
X PU+MVX PU≥X i
Y PU+MVY PU≥Y i
X PU+W PU+MVX PU-1≤X i+W i-1
Y PU+H PU+MVY PU-1≤Y i+H i-1
条件二:
X PU+MVX PU≥X i+a
Y PU+MVY PU≥Y i
X PU+W PU+MVX PU-1≤X i+W i-1-a
Y PU+H PU+MVY PU-1≤Y i+H i-1
条件三:
X PU+MVX PU≥X i
Y PU+MVY PU≥Y i+a
X PU+W PU+MVX PU-1≤X i+W i-1
Y PU+H PU+MVY PU-1≤Y i+H i-1-a
条件四:
X PU+MVX PU≥X i+a
Y PU+MVY PU≥Y i+a
X PU+W PU+MVX PU-1≤X i+W i-1-a
Y PU+H PU+MVY PU-1≤Y i+H i-1-a
其中,(X PU,Y PU)表示第二图像块中位于左边界与上边界的像素的坐标,即第二图像块中左上角像素的位置坐标,W PU与H PU分别表示第二图像块的宽与高,MVX PU与MVY PU分别表示第j个候选运动矢量的水平分量与垂直分量,X i与Y i分别表示M个参考块中第i个参考块左边界与上边界的像素点的水平坐标与垂直坐标,W i与H i分别表示第i个参考块的宽与高,i的取值范围为1~M,a表示预设值,该预设值与运动矢量的最小精度和/或插值滤波器的抽头数量相关。例如,在HEVC标准下,a的取值可以为3.25。
可选地,在步骤S320中,无论第二图像块的第j个候选运动矢量的水平分量与垂直分量是否指向分像素或整像素,均考虑第二图像块的位置、第j个候选运动矢量、M个参考块的位置、以及该预设值,判断第j个候选运动矢量对应的参考块是否包含于M个参考块中。
例如,在步骤S320中,若第二图像块在进行第j个候选运动矢量的位 移后的位置位于M个参考块中的第i个参考块的收缩位置内,确定第j个候选运动矢量对应的参考块包含于M个参考块内,其中,第i个参考块的收缩位置表示第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩预设值之后的位置,预设值与运动矢量的最小精度相关,i为1,…,M。
作为示例,在步骤S310中,根据第一图像块的S个候选运动矢量从参考帧缓存中获取M个参考块。在步骤S320中,可以通过如下方式五确定M个参考块中是否存在第j个候选运动矢量对应的参考块。
方式五。若第j个候选运动矢量(MVX PU,MVY PU)满足上述条件四,确定第j个候选运动矢量对应的参考块包含于M个参考块内。
为了更好地理解本申请提供的技术方案,下文结合图5给出一个示例。
在图5中,以一个图像块(记为第二图像块)的一个候选运动矢量(记为第j个候选运动矢量)为例进行描述。该第二图像块例如可以称为PU。
如图5所示,对第二图像块的帧间编码包括如下步骤。
S510,从参考帧缓存中获取M个参考块的数据。
步骤S510与上文实施例中的步骤S310相同,详见上文描述,这里不再赘述。
S520,根据第二图像块的位置、第二图像块的第j个候选运动矢量、M个参考块中第i个参考块的位置,判断第j个候选运动矢量对应的参考块是否包含于第i个参考块内,若是,转到步骤S530,若否,转到步骤S540。其中,j的取值范围为1~P,P表示第二图像块具有的候选运动矢量的数量。i的初始值为1,i的取值范围为1~M。
判断第j个候选运动矢量对应的参考块是否包含于第i个参考块的方法参见上文实施例中的相关描述,这里不再赘述。
S530,采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测。
应理解,在步骤S530中,包括:从第i个参考块的数据中获取第j个候选运动矢量对应的参考块。
例如,步骤S530可以通过上文描述的Merge模式或Skip模式下的编码操作流程中的子步骤(1)实现。子步骤(1)中的第1)步,相当于,从第i个参考块中获取第j个候选运动矢量对应的参考块。
S540,将i的取值加1。
S550,判断i的取值是否超过M,若是,转到步骤S560,若否,转到步骤S520。
S560,跳过采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测过程。
假设第二图像块具有P个候选运动矢量参与Merge模式或Skip模式的帧间预测,则针对P个候选运动矢量中的每个候选运动矢量均可以进行图5所示的处理过程。若对第二图像块的P个候选运动矢量进行图5所示的处理之后,从M个参考帧中获取了一个或多个候选运动矢量对应的参考块,则可以分别基于这些参考块对第二图像块进行Merge模式或Skip模式的帧间预测过程。具体过程,详见上文描述的Merge模式或Skip模式下的编码操作流程中的步骤二中的子步骤。
还应理解,如需要对多个图像块进行帧间预测,则对每个图像块进行图5所示的处理。
假设对于某个图像块,经过图5的处理后,从M个参考帧中获取了一个或多个候选运动矢量对应的参考块,则可以分别基于这些参考块对该图像块进行Merge模式或Skip模式的帧间预测过程。
假设对于某个图像块,经过图5的处理后,没有从M个参考帧中获取到任一个候选运动矢量对应的参考块,则可以跳过这个图像块的Merge模式或Skip模式的帧间预测过程。例如,可以采用其他方式对这个图像块进行帧间预测或者帧内预测。
上文实施例中以第二图像块为例进行了描述。应理解,对N个图像块中的每个图像块均可进行类似第二图像块的处理的操作。
针对第二图像块的多个候选运动矢量,均是从M个参考块中获取每个候选运动矢量对应的参考块,,无需针对每个图像块的每个运动矢量均向参考帧缓存请求一次或多次数据,减少了向参考帧缓存发送请求的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度,从而可以提升编码效率。
本申请另一实施例还提供一种视频处理的方法。该方法包括如下步骤(A)与步骤(B)。
步骤(A),从参考帧缓存中获取M个参考块的数据,M为正整数。
M可以为1,也可以为大于1的整数。在M为大于1的整数的情况下,M个参考块可以位于一个参考帧中,也可以位于多个参考帧中。
步骤(A)与上文实施例中的步骤S310相同,相关描述,详见上文,这里不再赘述。
步骤(B),在N个图像块的帧间预测时,从M个参考块中获取N个图像块中每个图像块的参考块。N为正整数,N可以为1,也可以为大于1的整数。
N个图像块中的每个图像块可以为视频编码中最小的图像处理对象。例如,在HEVC标准中,N个图像块中的每个图像块可以称为预测单元(PU)。再例如,在其它视频编码标准中,N个图像块中的每个图像块可以相应具有其它名称。
步骤(A)在步骤(B)之前执行。因此,在步骤(B)中,可以视为,是从预先获取的M个参考块中获取N个图像块的参考块。
本实施例的技术方案可以应用于帧间预测模式为Merge模式或Skip模式的场景。
例如,在步骤(B)中,从M个参考块中获取N个图像块中每个图像块的参考块,对于N个图像块中的每个图像块,根据该图像块的参考块,对该图像块进行Merge模式或Skip模式的帧间预测。
可选地,本实施例提供的技术方案也可以应用于帧间预测模式为非Merge模式以及非Skip模式的场景。
在N为大于1的整数的情形下,通过从预先获取的M个参考块中获取多个图像块的参考块,使得在多个图像块的帧间预测过程中,无需针对每个图像块均向参考帧缓存请求一次或多次数据,从而可以减少向参考帧缓存请求数据的次数。
在N等于1的情形下,在本实施例应用于帧间预测模式为Merge模式或Skip模式的场景的情况下,通过从预先获取的M个参考块中获取1个图像块的多个候选运动矢量对应的参考块,使得无需针对该图像块的每个候选运动矢量需向参考帧缓存请求数据,从而可以减少向参考帧缓存请求数据的次数。
在本实施例中,在N个图像块的帧间预测中,通过从预先获取的M个参考块中获取N个图像块的参考块,因而在N个图像块的帧间预测过程中,无需针对每个图像块均向参考帧缓存请求一次或多次数据,减少了向参考帧缓存发送请求的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度, 从而可以提升编码效率。
因此,在本实施例提供的方案中,通过预先从参考帧缓存访问M个参考块的数据,然后从预先访问的M个参考块的数据中获取帧间预测所需的多个数据,从而可以减少向参考帧缓存请求数据的次数,进而可以降低硬件的设计难度,还可以提高帧间预测的效率。
在步骤(B)中,可以无条件地从M个参考块中获取N个图像块中每个图像块的参考块;也可以有条件地从M个参考块中获取N个图像块中每个图像块的参考块。
无条件地从M个参考块中获取N个图像块中每个图像块的参考块,表示,可以直接在预先获取的M个参考块的数据中,获取N个图像块中每个图像块的参考块。
例如,在步骤(A)中,根据第一图像块的候选运动矢量从参考帧缓存中获取M个参考块的数据,该第一图像块包括N个图像块。例如,N个图像块为N个PU,第一图像块为包含N个PU所属的CTU。假设,可以保证这M个参考块的数据包含N个图像块的参考块。这种情形下,在步骤(B)中,可以无条件地从M个参考块中获取N个图像块中每个图像块的参考块。换言之,在步骤(B)中,可以无需执行判断动作,直接从M个参考块中获取N个图像块中每个图像块的参考块。
有条件地从M个参考块中获取N个图像块中每个图像块的参考块,表示,在保证N个图像块的参考块包含于M个参考块的条件下,从M个参考块中获取N个图像块中每个图像块的参考块。
例如,在不能保证步骤(A)中获取的M个参考块包含N个图像块的参考块的情形下,可以在确定M个参考块中存在N个图像块的参考块的前提下,从M个参考块中获取N个图像块的参考块。
以N个图像块中的一个图像块(记为第二图像块)为例,判断M个参考块中是否存在第二图像块的参考块的方法详见上文实施例中的相关描述,这里不再赘述。
应理解,在N个图像块的Merge模式或Skip模式的帧间预测过程中,通过预先从参考帧缓存中获取M个参考块的数据,在M个参考块中存在N个图像块的参考块的前提下从M个参考块中获取N个图像块的参考块,从而可以对于N个图像块中的每个图像块进行Merge模式或Skip模式的帧间 预测,这样使得,在N个图像块的Merge模式或Skip模式的帧间预测过程中,无需针对每个图像块的帧间预测均向参考帧缓存请求一次或多次数据,减少了向参考帧缓存发送请求的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度,从而可以提升编码效率。
本申请实施例提供的视频编码的方法可以由编码器或具有视频编码功能的装置执行。
上文描述了本申请的方法实施例,下文将描述本申请的装置实施例。应理解,装置实施例的描述与方法实施例的描述相互对应,因此,未详细描述的内容可以参见前面方法实施例,为了简洁,这里不再赘述。
如图6所示,本申请实施例还提供一种编码装置。该编码装置包括处理器610与存储器620,该存储器620用于存储指令,该处理器610用于执行该存储器620存储的指令,并且对该存储器620中存储的指令的执行使得,该处理器610用于执行上文方法实施例的方法。
该处理器610通过执行存储器620存储的指令,执行如下操作:从参考帧缓存中获取M个参考块的数据,M为正整数;在对N个图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在N个图像块中每个图像块的参考块,N为正整数。
在本实施例中,通过预先从参考帧缓存访问M个参考块的数据,并在预先获取的M个参考块中确定是否存在N个图像块中每个图像块的参考块,可以实现从预先获取的M个参考块中获取Merge模式或Skip模式的帧间预测所需的多个数据,从而可以避免每处理一个候选运动矢量需要访问一次参考帧缓存、每处理一个图像块需要访问一次参考帧缓存,相对于现有技术,可以减少向参考帧缓存请求数据的次数,缓解了对参考帧缓存的管理压力,降低了编码复杂度,从而可以提升编码效率。
可选地,N个图像块中每个图像块为预测单元(PU)。
可选地,第一图像块为下列中任一种:编码树单元(CTU)、编码单元(CU)、预测单元(PU)。
可选地,从参考帧缓存中获取M个参考块的数据,包括:根据第一图像块的S个候选运动矢量从参考帧缓存中获取M个参考块,S为小于或等于M的正整数,其中,第一图像块与N个图像块属于同一个图像单元块。
可选地,第一图像块包括N个图像块中的部分或全部图像块。
可选地,第一图像块为图像单元块。
可选地,N个图像块中包括第二图像块;其中,在对N个图像块进行Merge模式或Skip模式的帧间预测时,从M个参考块中确定是否存在N个图像块中每个图像块的参考块,包括:从M个参考块中确定是否存在第二图像块的参考块。其中,处理器610还用于执行如下操作:在M个参考块中存在第二图像块的参考块的情况下,根据第二图像块的参考块对第二图像块进行Merge模式或Skip模式的帧间预测。
可选地,处理器610还用于执行如下操作:在M个参考块中不存在第二图像块的参考块的情况下,跳过第二图像块的Merge模式或Skip模式的帧间预测。
可选地,第二图像块的候选运动矢量包括多个;其中,从M个参考块中确定是否存在第二图像块对应的参考块,包括:从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块,j为1,…,P,P为多个候选运动矢量的个数。
可选地,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块,包括:根据下列因素,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块:第二图像块的位置、第j个候选运动矢量、M个参考块的位置。
可选地,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块,包括:在第j个候选运动矢量的水平分量与垂直分量分别指向整像素的情况下,若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中任一个参考块的位置内,确定M个参考块中存在第j个候选运动矢量对应的参考块。
可选地,在第j个候选运动矢量的水平分量,和/或垂直分量指向分像素的情况下,因素还包括预设值,预设值与运动矢量的最小精度和/或插值滤波器的抽头数量相关。
可选地,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块,包括:若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中的第i个参考块的收缩位置内,确定M个参考块中存在第j个候选运动矢量对应的参考块,i为1,…,M。
在第j个候选运动矢量的水平分量指向分像素、垂直分量指向整像素的 情况下,第i个参考块的收缩位置表示第i个参考块经过左边界与右边界分别向里收缩预设值之后的位置。
在第j个候选运动矢量的水平分量指向整像素、垂直分量指向分像素的情况下,第i个参考块的收缩位置表示第i个参考块经过上边界与下边界分别向里收缩预设值之后的位置。
在第j个候选运动矢量的水平分量指向分像素、垂直分量指向分像素的情况下,第i个参考块的收缩位置表示第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩预设值之后的位置。
可选地,从M个参考块中确定是否存在第二图像块的第j个候选运动矢量对应的参考块,包括:若第二图像块在进行第j个候选运动矢量的位移后的位置位于M个参考块中的第i个参考块的收缩位置内,确定M个参考块中存在第j个候选运动矢量对应的参考块,其中,第i个参考块的收缩位置表示第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩预设值之后的位置,预设值与运动矢量的最小精度相关,i为1,…,M。
可选地,在M个参考块中存在第二图像块的参考块的情况下,对第二图像块进行Merge模式或Skip模式的帧间预测,包括:在M个参考块中存在第j个候选运动矢量对应的参考块的情况下,采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测。
可选地,处理器610还用于执行如下操作:在M个参考块中不存在第j个候选运动矢量对应的参考块的情况下,跳过采用第j个候选运动矢量对应的参考块对第二图像块进行Merge模式或Skip模式的帧间预测过程。
可选地,如图6所示,该编码装置还包括通信接口630,用于与外部器件传输信号。
可选地,本实施例的编码装置为编码器,通信接口630用于从外部器件接收待处理的图像或视频数据。或者,通信接口630还用于向解码端发送编码的码流。
本发明实施例还提供一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得,该计算机执行上文方法实施例的方法。
本发明实施例还提供一种包含指令的计算机程序产品,其特征在于,该指令被计算机执行时使得计算机执行上文方法实施例的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其他任 意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本发明实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单 元中。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (34)

  1. 一种视频处理的方法,其特征在于,包括:
    从参考帧缓存中获取M个参考块的数据,M为正整数;
    在对N个图像块进行Merge模式或Skip模式的帧间预测时,从所述M个参考块中确定是否存在所述N个图像块中每个图像块的参考块,N为正整数。
  2. 根据权利要求1所述的方法,其特征在于,所述从参考帧缓存中获取M个参考块的数据,包括:
    根据第一图像块的S个候选运动矢量从所述参考帧缓存中获取所述M个参考块,所述S为小于或等于所述M的正整数,其中,所述第一图像块与所述N个图像块属于同一个图像单元块。
  3. 根据权利要求2所述的方法,其特征在于,所述第一图像块包括所述N个图像块中的部分或全部图像块。
  4. 根据权利要求3所述的方法,其特征在于,所述第一图像块为所述图像单元块。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述N个图像块中包括第二图像块;
    其中,所述在对N个图像块进行Merge模式或Skip模式的帧间预测时,从所述M个参考块中确定是否存在所述N个图像块中每个图像块的参考块,包括:
    从所述M个参考块中确定是否存在所述第二图像块的参考块;
    其中,所述方法还包括:
    在所述M个参考块中存在所述第二图像块的参考块的情况下,对所述第二图像块进行Merge模式或Skip模式的帧间预测。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    在所述M个参考块中不存在所述第二图像块的参考块的情况下,跳过所述第二图像块的Merge模式或Skip模式的帧间预测。
  7. 根据权利要求5所述的方法,其特征在于,所述第二图像块的候选运动矢量包括多个;
    其中,所述从所述M个参考块中确定是否存在所述第二图像块对应的参考块,包括:
    从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,j为1,…,P,所述P为所述多个候选运动矢量的个数。
  8. 根据权利要求7所述的方法,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    根据下列因素,从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块:
    所述第二图像块的位置、所述第j个候选运动矢量、所述M个参考块的位置。
  9. 根据权利要求7或8所述的方法,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    在所述第j个候选运动矢量的水平分量与垂直分量分别指向整像素的情况下,若所述第二图像块在进行所述第j个候选运动矢量的位移后的位置位于所述M个参考块中任一个参考块的位置内,确定所述M个参考块中存在所述第j个候选运动矢量对应的参考块。
  10. 根据权利要求8所述的方法,其特征在于,在所述第j个候选运动矢量的水平分量,和/或垂直分量指向分像素的情况下,所述因素还包括预设值,所述预设值与运动矢量的最小精度和/或插值滤波器的抽头数量相关。
  11. 根据权利要求10所述的方法,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    若所述第二图像块在进行所述第j个候选运动矢量的位移后的位置位于所述M个参考块中的第i个参考块的收缩位置内,确定所述M个参考块中存在所述第j个候选运动矢量对应的参考块,i为1,…,M,其中,
    在所述第j个候选运动矢量的水平分量指向分像素、垂直分量指向整像素的情况下,所述第i个参考块的收缩位置表示所述第i个参考块经过左边界与右边界分别向里收缩所述预设值之后的位置,
    在所述第j个候选运动矢量的水平分量指向整像素、垂直分量指向分像素的情况下,所述第i个参考块的收缩位置表示所述第i个参考块经过上边界与下边界分别向里收缩所述预设值之后的位置,
    在所述第j个候选运动矢量的水平分量指向分像素、垂直分量指向分像 素的情况下,所述第i个参考块的收缩位置表示所述第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩所述预设值之后的位置。
  12. 根据权利要求7或8所述的方法,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    若所述第二图像块在进行所述第j个候选运动矢量的位移后的位置位于所述M个参考块中的第i个参考块的收缩位置内,确定所述M个参考块中存在所述第j个候选运动矢量对应的参考块,其中,
    所述第i个参考块的收缩位置表示所述第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩预设值之后的位置,所述预设值与运动矢量的最小精度相关,所述i为1,…,M。
  13. 根据权利要求7至12中任一项所述的方法,其特征在于,所述在所述M个参考块中存在所述第二图像块的参考块的情况下,对所述第二图像块进行Merge模式或Skip模式的帧间预测,包括:
    在所述M个参考块中存在所述第j个候选运动矢量对应的参考块的情况下,采用所述第j个候选运动矢量对应的参考块对所述第二图像块进行Merge模式或Skip模式的帧间预测。
  14. 根据权利要求7至12中任一项所述的方法,其特征在于,所述方法还包括:
    在所述M个参考块中不存在所述第j个候选运动矢量对应的参考块的情况下,跳过采用所述第j个候选运动矢量对应的参考块对所述第二图像块进行Merge模式或Skip模式的帧间预测过程。
  15. 根据权利要求1至14中任一项所述的方法,其特征在于,所述N个图像块中每个图像块为预测单元PU。
  16. 根据权利要求2至4中任一项所述的方法,其特征在于,所述第一图像块为下列中任一种:编码树单元CTU、编码单元CU、预测单元PU。
  17. 一种编码装置,其特征在于,包括:
    存储器,用于存储指令;
    处理器,用于执行所述存储器存储的指令,执行如下操作:
    从参考帧缓存中获取M个参考块的数据,M为正整数;
    在对N个图像块进行Merge模式或Skip模式的帧间预测时,从所述M 个参考块中确定是否存在所述N个图像块中每个图像块的参考块,N为正整数。
  18. 根据权利要求17所述的编码装置,其特征在于,所述从参考帧缓存中获取M个参考块的数据,包括:
    根据第一图像块的S个候选运动矢量从所述参考帧缓存中获取所述M个参考块,所述S为小于或等于所述M的正整数,其中,所述第一图像块与所述N个图像块属于同一个图像单元块。
  19. 根据权利要求18所述的编码装置,其特征在于,所述第一图像块包括所述N个图像块中的部分或全部图像块。
  20. 根据权利要求19所述的编码装置,其特征在于,所述第一图像块为所述图像单元块。
  21. 根据权利要求17至20中任一项所述的编码装置,其特征在于,所述N个图像块中包括第二图像块;
    其中,所述在对N个图像块进行Merge模式或Skip模式的帧间预测时,从所述M个参考块中确定是否存在所述N个图像块中每个图像块的参考块,包括:
    从所述M个参考块中确定是否存在所述第二图像块的参考块;
    其中,所述处理器还用于执行如下操作:
    在所述M个参考块中存在所述第二图像块的参考块的情况下,对所述第二图像块进行Merge模式或Skip模式的帧间预测。
  22. 根据权利要求21所述的编码装置,其特征在于,所述处理器还用于执行如下操作:
    在所述M个参考块中不存在所述第二图像块的参考块的情况下,跳过所述第二图像块的Merge模式或Skip模式的帧间预测。
  23. 根据权利要求21所述的编码装置,其特征在于,所述第二图像块的候选运动矢量包括多个;
    其中,所述从所述M个参考块中确定是否存在所述第二图像块对应的参考块,包括:
    从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,j为1,…,P,所述P为所述多个候选运动矢量的个数。
  24. 根据权利要求23所述的编码装置,其特征在于,所述从所述M个 参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    根据下列因素,从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块:
    所述第二图像块的位置、所述第j个候选运动矢量、所述M个参考块的位置。
  25. 根据权利要求23或24所述的编码装置,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    在所述第j个候选运动矢量的水平分量与垂直分量分别指向整像素的情况下,若所述第二图像块在进行所述第j个候选运动矢量的位移后的位置位于所述M个参考块中任一个参考块的位置内,确定所述M个参考块中存在所述第j个候选运动矢量对应的参考块。
  26. 根据权利要求24所述的编码装置,其特征在于,在所述第j个候选运动矢量的水平分量,和/或垂直分量指向分像素的情况下,所述因素还包括预设值,所述预设值与运动矢量的最小精度和/或插值滤波器的抽头数量相关。
  27. 根据权利要求26所述的编码装置,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    若所述第二图像块在进行所述第j个候选运动矢量的位移后的位置位于所述M个参考块中的第i个参考块的收缩位置内,确定所述M个参考块中存在所述第j个候选运动矢量对应的参考块,i为1,…,M,其中,
    在所述第j个候选运动矢量的水平分量指向分像素、垂直分量指向整像素的情况下,所述第i个参考块的收缩位置表示所述第i个参考块经过左边界与右边界分别向里收缩所述预设值之后的位置,
    在所述第j个候选运动矢量的水平分量指向整像素、垂直分量指向分像素的情况下,所述第i个参考块的收缩位置表示所述第i个参考块经过上边界与下边界分别向里收缩所述预设值之后的位置,
    在所述第j个候选运动矢量的水平分量指向分像素、垂直分量指向分像素的情况下,所述第i个参考块的收缩位置表示所述第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩所述预设值之后的位置。
  28. 根据权利要求23或24所述的编码装置,其特征在于,所述从所述M个参考块中确定是否存在所述第二图像块的第j个候选运动矢量对应的参考块,包括:
    若所述第二图像块在进行所述第j个候选运动矢量的位移后的位置位于所述M个参考块中的第i个参考块的收缩位置内,确定所述M个参考块中存在所述第j个候选运动矢量对应的参考块,其中,
    所述第i个参考块的收缩位置表示所述第i个参考块经过左边界、右边界、上边界与下边界分别向里收缩预设值之后的位置,所述预设值与运动矢量的最小精度相关,所述i为1,…,M。
  29. 根据权利要求23至28中任一项所述的编码装置,其特征在于,所述在所述M个参考块中存在所述第二图像块的参考块的情况下,对所述第二图像块进行Merge模式或Skip模式的帧间预测,包括:
    在所述M个参考块中存在所述第j个候选运动矢量对应的参考块的情况下,采用所述第j个候选运动矢量对应的参考块对所述第二图像块进行Merge模式或Skip模式的帧间预测。
  30. 根据权利要求23至28中任一项所述的编码装置,其特征在于,所述处理器还用于执行如下操作:
    在所述M个参考块中不存在所述第j个候选运动矢量对应的参考块的情况下,跳过采用所述第j个候选运动矢量对应的参考块对所述第二图像块进行Merge模式或Skip模式的帧间预测过程。
  31. 根据权利要求17至30中任一项所述的编码装置,其特征在于,所述N个图像块中每个图像块为预测单元PU。
  32. 根据权利要求18至20中任一项所述的编码装置,其特征在于,所述第一图像块为下列中任一种:编码树单元CTU、编码单元CU、预测单元PU。
  33. 一种计算机存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被计算机执行时使得,所述计算机执行如权利要求1至16任一项所述的方法。
  34. 一种包含指令的计算机程序产品,其特征在于,所述指令被计算机执行时使得所述计算机执行如权利要求1至16任一项所述的方法。
PCT/CN2019/130843 2019-12-31 2019-12-31 视频处理的方法与装置 WO2021134631A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/130843 WO2021134631A1 (zh) 2019-12-31 2019-12-31 视频处理的方法与装置
CN201980049277.4A CN112514391A (zh) 2019-12-31 2019-12-31 视频处理的方法与装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/130843 WO2021134631A1 (zh) 2019-12-31 2019-12-31 视频处理的方法与装置

Publications (1)

Publication Number Publication Date
WO2021134631A1 true WO2021134631A1 (zh) 2021-07-08

Family

ID=74924081

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/130843 WO2021134631A1 (zh) 2019-12-31 2019-12-31 视频处理的方法与装置

Country Status (2)

Country Link
CN (1) CN112514391A (zh)
WO (1) WO2021134631A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533366A (zh) * 2012-07-03 2014-01-22 展讯通信(上海)有限公司 用于视频运动补偿的缓存方法与装置
CN107087171A (zh) * 2017-05-26 2017-08-22 中国科学技术大学 Hevc整像素运动估计方法及装置
CN108024116A (zh) * 2016-10-28 2018-05-11 腾讯科技(深圳)有限公司 一种数据缓存方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10735762B2 (en) * 2014-12-26 2020-08-04 Sony Corporation Image processing apparatus and image processing method
US10390028B2 (en) * 2015-06-03 2019-08-20 Mediatek Inc. Methods for palette coding of image and video data
CN110198440B (zh) * 2018-03-29 2022-11-18 腾讯科技(深圳)有限公司 编码预测信息的确定及视频编码的方法、装置及可读介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533366A (zh) * 2012-07-03 2014-01-22 展讯通信(上海)有限公司 用于视频运动补偿的缓存方法与装置
CN108024116A (zh) * 2016-10-28 2018-05-11 腾讯科技(深圳)有限公司 一种数据缓存方法及装置
CN107087171A (zh) * 2017-05-26 2017-08-22 中国科学技术大学 Hevc整像素运动估计方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JINSEON YOUN ; JUNRIM CHOI ; SEUNG-SOO HAN: "Parallel Integer Motion Estimation Method by Using Reference Blocks Shared for HD Video Encoding", ELECTRONIC COMPUTER TECHNOLOGY, 2009 INTERNATIONAL CONFERENCE ON, 20 February 2009 (2009-02-20), pages 577 - 581, XP031434090, ISBN: 978-0-7695-3559-3 *

Also Published As

Publication number Publication date
CN112514391A (zh) 2021-03-16

Similar Documents

Publication Publication Date Title
TWI705703B (zh) 於視訊寫碼中針對子區塊推導運動資訊
TWI688262B (zh) 用於視訊寫碼之重疊運動補償
JP2019505144A (ja) ビデオコーディングのためのフィルタのための幾何学的変換
US20210337232A1 (en) Video processing method and device
JP7148612B2 (ja) ビデオデータインター予測の方法、装置、ビデオエンコーダ、ビデオデコーダ及びプログラム
WO2020006969A1 (zh) 运动矢量预测方法以及相关装置
JP7143435B2 (ja) 双方向インター予測の方法および装置
WO2020042604A1 (zh) 视频编码器、视频解码器及相应方法
BR112021002335A2 (pt) método de decodificação de imagem com base na predição de movimento afim e dispositivo usando lista de candidatos à fusão afins no sistema de codificação de imagem
CN114827623A (zh) 用于视频编解码的边界扩展
WO2020181504A1 (zh) 视频编码的方法与装置,以及视频解码的方法与装置
CN112740663B (zh) 图像预测方法、装置以及相应的编码器和解码器
CN110876058B (zh) 一种历史候选列表更新方法与装置
WO2021134631A1 (zh) 视频处理的方法与装置
WO2022022299A1 (zh) 视频编解码中的运动信息列表构建方法、装置及设备
TWI841033B (zh) 視頻數據的幀間預測方法和裝置
WO2024104503A1 (zh) 图像编解码
WO2024092425A1 (zh) 视频编解码方法、装置、设备、及存储介质
CN110677645B (zh) 一种图像预测方法及装置
WO2020181507A1 (zh) 图像处理的方法与装置
WO2022037458A1 (zh) 视频编解码中的运动信息列表构建方法、装置及设备
WO2020140216A1 (zh) 视频处理方法和装置
US20210185323A1 (en) Inter prediction method and apparatus, video encoder, and video decoder
WO2023034640A1 (en) Candidate derivation for affine merge mode in video coding
CN117981315A (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: 19958619

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19958619

Country of ref document: EP

Kind code of ref document: A1