WO2019010634A1 - 一种基于模板匹配的解码方法及装置 - Google Patents

一种基于模板匹配的解码方法及装置 Download PDF

Info

Publication number
WO2019010634A1
WO2019010634A1 PCT/CN2017/092514 CN2017092514W WO2019010634A1 WO 2019010634 A1 WO2019010634 A1 WO 2019010634A1 CN 2017092514 W CN2017092514 W CN 2017092514W WO 2019010634 A1 WO2019010634 A1 WO 2019010634A1
Authority
WO
WIPO (PCT)
Prior art keywords
image block
motion information
current image
template
distortion
Prior art date
Application number
PCT/CN2017/092514
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 CN201780092906.2A priority Critical patent/CN110832859B/zh
Priority to PCT/CN2017/092514 priority patent/WO2019010634A1/zh
Priority to EP17917349.7A priority patent/EP3644608A4/en
Publication of WO2019010634A1 publication Critical patent/WO2019010634A1/zh
Priority to US16/738,996 priority patent/US20200145653A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures

Definitions

  • the present invention relates to the field of video image technology, and in particular, to a decoding method and apparatus based on template matching, and a coding method and apparatus based on template matching.
  • Video coding technology greatly improves the speed and quality of video transmission.
  • Video coding technology is digital television, digital live broadcast system, wireless broadcast system, personal digital assistant (PDA), laptop or desktop computer, tablet computer, e-book reader, digital camera, digital recording device, digital media player Key technologies for applications such as video game devices, video game consoles, cellular or satellite radio phones, video conferencing devices, video streaming devices, etc.
  • PDA personal digital assistant
  • laptop or desktop computer laptop or desktop computer
  • tablet computer tablet computer
  • e-book reader digital camera
  • digital recording device digital media player Key technologies for applications such as video game devices, video game consoles, cellular or satellite radio phones, video conferencing devices, video streaming devices, etc.
  • Video encoding techniques can be, for example, MPEG-2, MPEG-4, ITU-TH.263 , ITU-TH.264/MPEG-4 Part 10 Advanced Video Codec (AVC), ITU-TH.265 High Efficiency Video Codec (HEVC), and standards defined by the H.266 standard and extensions to the above standards Those video coding techniques described.
  • AVC Advanced Video Codec
  • HEVC High Efficiency Video Codec
  • Inter-Template Matching is an important inter-frame prediction technique in the field of video coding. Since this technology does not need to transmit additional motion information (including motion vectors, reference frame indexes, etc., it generally includes two for bidirectional prediction). Group motion information), which brings greater coding performance to the encoder, is a widely studied prediction technique.
  • a motion information list is first established (for two-way prediction, two motion information lists are established), and the motion information in the motion information list is used as initial motion information of the current block, and respectively in the list.
  • the motion information is used as the candidate motion information of the current image block, and the template distortion of the current image block corresponding to the candidate motion information is calculated, and then the candidate motion information with the smallest template distortion is selected as the initial motion information of the current image block, and then according to the initial motion information.
  • Performing a refined search of the motion vector the process comprising: searching and matching the template of the current image block with a template of the surrounding image block of the image block in the reference frame pointed to by the initial motion information, wherein the surrounding image block can be The image blocks in the reference frame pointed to by the initial motion information intersect, are adjacent or not adjacent, and find an image block with the smallest template distortion of the current image block, and the motion vector between the image block and the current image block is the current The motion vector of the image block.
  • template distortion refers to the template distortion of the current image block and the template distortion of the weighted template, which is a weighted sum of templates of two image blocks obtained from two motion information lists.
  • the template distortion is a template distortion of a template of a current image block and a template of an image block obtained from a motion information list.
  • the template distortion obtained by the refined search according to the bidirectional prediction and the two motion information lists corresponding to the bidirectional prediction are respectively refined to obtain template distortion, and then the three template distortions are compared, thereby It is determined whether bidirectional prediction is performed for encoding and decoding or according to one of two motion information lists.
  • the template distortion when determining the prediction direction, the template distortion sometimes cannot accurately reflect the true distortion of the current image block, and since the steps performed by the encoding end and the decoding end are the same, the computational complexity is performed for the decoding end. Higher.
  • the embodiment of the invention provides a decoding method and device, and an encoding method and device, which can provide The decoding accuracy reduces the computational complexity of the decoder.
  • the concept of a frame refers to a complete image, which can be played by a frame-by-frame image in a certain order and frame rate.
  • the frame rate reaches a certain speed, the interval between the two frames is less than the resolution limit of the human eye, and a short visual pause occurs, so that it appears to be dynamically appearing on the screen.
  • the basis for the compression of video files is the compression encoding of single-frame digital images. There are many repeated representations in the digitized images, which are called redundant information.
  • the purpose of video compression coding (or video coding) is to use various technical methods to remove redundant information in the video sequence to achieve the effect of reducing storage space and saving transmission bandwidth.
  • video compression coding may mainly include intra prediction, inter prediction, transform quantization, entropy coding, and deblocking filtering.
  • intra prediction inter prediction
  • transform quantization entropy coding
  • deblocking filtering deblocking filtering
  • predictive coding that is, using the data information of the previously encoded frame to predict the frame to be currently encoded.
  • a predicted value is obtained by prediction, and the predicted value is not completely equivalent to the actual value, and there is a certain residual value. If the prediction is more suitable, the closer the predicted value is to the actual value, the smaller the residual value, so that the residual value can be encoded to greatly reduce the amount of data, and the residual value plus the predicted value is used when decoding at the decoding end.
  • Reconstructing the initial image is the basic idea of predictive coding. Predictive coding is divided into two basic types: intra prediction and inter prediction.
  • a first aspect of the present invention provides a decoding method based on template matching, including:
  • the value of the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the first motion information list of the current image block and the second motion information list of the current image block, according to Determining, by the first motion information list, first motion information, where a first template distortion between a reference image block corresponding to the first motion information and the current image block is less than or equal to that in the first motion information list a reference image block corresponding to the motion information and a template distortion of the current image block; determining second motion information according to the second motion information list, the reference image block corresponding to the second motion information and the current image block The second template distortion between the two is less than or equal to the reference image block corresponding to the motion information in the second motion information list and the template distortion of the current image block;
  • the computational complexity of decoding can be reduced by adding an identifier to the code stream.
  • the method may further include: determining the first motion information list and the second motion information list.
  • the method may further include: the value identified in the prediction direction indicates that the encoded data of the current image block is compared to the current image according to a first motion information list of a current image block and a second motion information list of a current image block.
  • the first motion information list and the second motion information list are determined.
  • the template distortion between the reference image block and the current image block indicates a difference between the template of the reference image block and the template of the current image block for estimating a difference between the reference image block and the current image block.
  • the method further includes:
  • the value identified in the prediction direction indicates that the encoded data of the current image block is according to the current image block.
  • the reconstructed image block of the current image block is obtained according to the first motion information list and the encoded data of the current image block;
  • the prediction direction identifier indicates that the coded data of the current image block is unidirectionally predicted according to the second motion information list of the current image block
  • the second motion The information list and the encoded data of the current image block obtain a reconstructed image block of the current image block.
  • the method may further include: determining the first motion information list.
  • the method may further include: when the value of the prediction direction identifier indicates that the coded data of the current image block is unidirectionally predicted according to the first motion information list of the current image block, Determining the first list of motion information.
  • the method may further include: determining the second motion information list.
  • the method may further include: when the value of the prediction direction identifier indicates that the encoded data of the current image block is unidirectionally predicted according to the second motion information list of the current image block, Determining the second list of motion information.
  • the method further includes:
  • the value identified in the prediction direction indicates that the encoded data of the current image block is unidirectional to the current image block according to the first motion information list of the current image block or the second motion information list of the current image block.
  • This embodiment reduces the number of bits occupied by the identification compared to the first embodiment, which reduces the computational complexity of decoding compared to the prior art.
  • the method may further include: determining the first motion information list and the second motion information list.
  • the method may further include: the value identified in the prediction direction indicates that the encoded data of the current image block is based on the first motion information list of the current image block or the second motion information list of the current image block.
  • the current image block is obtained by unidirectional prediction, the first motion information list and the second motion information list are determined.
  • the method further includes:
  • the template distortion threshold is obtained according to the first template distortion and the second template distortion.
  • the method may further include: determining a first motion information list of the current image block and a second motion information list of the current image block.
  • the method may further include: when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is less than or equal to the second template distortion, obtaining the current image according to the first motion information and the encoded data of the current image block. The reconstructed image block of the block.
  • the method may further include: when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is greater than the second template distortion, obtaining the current image block according to the second motion information and the encoded data of the current image block. Rebuild the image block.
  • a second aspect of the present invention provides an encoding method, including:
  • the block performs bidirectional prediction to obtain bidirectional code stream data of the current image block, the bidirectional code stream data includes code stream data encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates the current image block.
  • the encoded data is obtained by bidirectionally predicting the current image block according to the first motion information list and the second motion information list.
  • the method may further include: determining a first motion information list of the current image block and the current image A list of second motion information for the block.
  • the method further includes:
  • the first motion information performs unidirectional prediction on the current image block, thereby obtaining first code stream data of the current image block, where the first code stream data includes code stream data that is encoded in a prediction direction identifier,
  • the value of the prediction direction identifier indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list;
  • the bidirectional rate distortion cost is greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first rate distortion cost is greater than the second rate distortion cost
  • the second motion information performs unidirectional prediction on the current image block, thereby obtaining second code stream data of the current image block, where the second code stream data includes code stream data that is encoded in the prediction direction identifier,
  • the value of the prediction direction identifier indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the second motion information list.
  • the second possible implementation manner of the second aspect only when the reference structure of the frame where the current image block is located is a non-low delay reference structure, Determining, according to the first motion information and the second motion information, a bidirectional rate distortion cost of the bidirectional prediction corresponding to the bidirectional motion information, a first rate distortion cost of the unidirectional prediction corresponding to the first motion information, and the second motion The second rate distortion penalty of the unidirectional prediction corresponding to the information.
  • the method further includes:
  • the bidirectional rate distortion cost is greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first template distortion is less than or equal to the second template distortion, according to the Performing unidirectional prediction on the current image block by a motion information, thereby obtaining first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes code stream data encoded in a prediction direction identifier
  • the value of the prediction direction identifier indicates that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list or the second motion information list;
  • the bidirectional rate distortion cost is greater than a minimum of the first rate distortion cost and the second rate distortion cost
  • the first template distortion is greater than the second template distortion
  • the second motion information performs unidirectional prediction on the current image block, thereby obtaining second unidirectional code stream data of the current image block, where the second unidirectional code stream data includes code stream data encoded in the prediction direction identifier.
  • the value of the prediction direction identifier indicates that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list or the second motion information list.
  • the method further includes:
  • the first template is lost according to the first template True and the second template distortion, determining bidirectional template distortion for bidirectional prediction of the current image block;
  • the current image block is bidirectionally predicted according to the first motion information and the second motion information, thereby obtaining encoded data of the current image block.
  • the template distortion threshold is obtained according to the first template distortion and the second template distortion.
  • the method may further include: when the reference structure of the frame where the current image block is located is a low-latency reference structure, and when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is less than or equal to the first When the two templates are distorted, the current image block is encoded according to the first motion information, thereby obtaining encoded data of the current image block.
  • the method may further include: when the reference structure of the frame where the current image block is located is a low-latency reference structure, and when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is greater than the second template When the distortion is performed, the current image block is encoded according to the second motion information, thereby obtaining the encoded data of the current image block.
  • the determining, according to the first motion information list, the first motion information includes: The motion information corresponding to the smallest template distortion of the template image of the current image block and the first initial motion information corresponding to the first initial motion information Performing a motion search on a region where the reference image block is located to obtain the first motion information;
  • determining, according to the second motion information list, determining the second motion information comprises: minimizing a template image block corresponding to the motion information in the second motion information list and a template distortion of the current image block
  • the template distortion corresponds to the motion information as the second initial motion information; the motion search is performed in the region where the reference image block corresponding to the second initial motion information is located, and the second motion information is obtained.
  • a third aspect of the present invention provides a decoding apparatus, the apparatus comprising:
  • An obtaining unit configured to acquire a prediction direction identifier and encoded data of a current image block
  • a reconstruction unit wherein the value of the identifier in the prediction direction indicates that the encoded data of the current image block is bidirectional to the current image block according to the first motion information list of the current image block and the second motion information list of the current image block.
  • the reconstruction unit may be further configured to: determine a first motion information list of the current image block and a second motion information list of the current image block.
  • the reconstruction unit may be further configured to: the value identified in the prediction direction indicates that the encoded data of the current image block is compared to the current motion information list of the current image block and the second motion information list of the current image block.
  • the first motion information list of the current image block and the second motion information list of the current image block are determined.
  • the reconstruction unit is further configured to:
  • the value of the prediction direction indicates that the encoded data of the current image block is unidirectionally predicted according to the first motion information list of the current image block, according to the first motion information column. And the encoded data of the current image block to obtain a reconstructed image block of the current image block;
  • the reconstructing unit is further configured to: the value indicated by the prediction direction indicates that the encoded data of the current image block is unidirectionally predicted according to the second motion information list of the current image block. And reconstructing an image block of the current image block according to the second motion information list and the encoded data of the current image block.
  • the reconstruction unit may be further configured to: determine the first motion information list.
  • the reconstruction unit may be further configured to: when the value of the prediction direction indicates that the encoded data of the current image block is unidirectionally predicted according to the first motion information list of the current image block, Determining the first motion information list.
  • the reconstruction unit may be further configured to: determine the second motion information list.
  • the reconstruction unit may be further configured to: when the value of the prediction direction indicates that the encoded data of the current image block is unidirectionally predicted according to the second motion information list of the current image block, Determining the second list of motion information.
  • the reconstruction unit is further configured to:
  • the value identified in the prediction direction indicates that the encoded data of the current image block is unidirectional to the current image block according to the first motion information list of the current image block or the second motion information list of the current image block.
  • the reconstruction unit may be further configured to: determine a first motion information list of the current image block and a second motion information list of the current image block.
  • the reconstruction unit may be further configured to: the value identified in the prediction direction indicates that the encoded data of the current image block is according to the first motion information list of the current image block or the second motion information list of the current image block. And determining, by the unidirectional prediction of the current image block, a first motion information list of the current image block and a second motion information list of the current image block.
  • the acquiring unit is configured to:
  • the prediction direction identifier is acquired only when the reference structure of the frame in which the current image block is located is a non-low delay reference structure.
  • the reconstruction unit is further configured to:
  • the reference structure of the frame in which the current image block is located is a low-latency reference structure, determining, according to the first motion information list of the current image block, the first motion information, the reference image block corresponding to the first motion information Place
  • the first template distortion between the current image blocks is less than or equal to a reference image block corresponding to the motion information in the first motion information list and a template distortion of the current image block;
  • the template distortion threshold is obtained according to the first template distortion and the second template distortion.
  • the reconstruction unit may be further configured to: determine a first motion information list of the current image block and a second motion information list of the current image block.
  • the reconstruction unit may be further configured to: when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is less than or equal to the second template distortion, obtain the current according to the first motion information and the encoded data of the current image block. A reconstructed image block of an image block.
  • the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • a fourth aspect of the present invention provides an encoding apparatus, the apparatus comprising:
  • a matching unit configured to determine first motion information according to the first motion information list of the current image block, where a first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or a reference image block corresponding to the motion information in the first motion information list and a template distortion of the current image block; determining second motion information according to the second motion information list of the current image block, The second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to the reference image block corresponding to the motion information in the second motion information list and the template distortion of the current image block ;
  • a determining unit configured to determine, according to the first motion information and the second motion information, a bidirectional rate distortion cost of the bidirectional prediction corresponding to the bidirectional motion information, and a first rate distortion of the unidirectional prediction corresponding to the first motion information a cost and a second rate distortion cost of the unidirectional prediction corresponding to the second motion information, the two-way motion information including the first motion information and the second motion information;
  • a prediction unit configured to: according to the first motion information and the second motion information, when the bidirectional rate distortion cost is less than or equal to a minimum of the first rate distortion cost and the second rate distortion cost Performing bidirectional prediction on the current image block to obtain bidirectional code stream data of the current image block, where the bidirectional code stream data includes code stream data that is encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates The encoded data of the current image block is obtained by bidirectionally predicting the current image block according to the first motion information list and the second motion information list.
  • the determining unit may be further configured to: determine a first motion information list of the current image block and a second motion information list of the current image block.
  • the predicting unit is further configured to:
  • the minimum of the two-way rate distortion cost is greater than the first rate distortion cost and the second rate distortion cost a value, and the first rate distortion cost is less than or equal to the second rate distortion cost, performing unidirectional prediction on the current image block according to the first motion information, thereby obtaining a first of the current image block Code stream data, the first code stream data includes code stream data encoded in a prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first motion information list.
  • the current image block is obtained by unidirectional prediction;
  • the bidirectional rate distortion cost is greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first rate distortion cost is greater than the second rate distortion cost
  • the second motion information performs unidirectional prediction on the current image block, thereby obtaining second code stream data of the current image block, where the second code stream data includes code stream data that is encoded in the prediction direction identifier,
  • the value of the prediction direction identifier indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the second motion information list.
  • the determining unit is configured to:
  • the predicting unit is further configured to:
  • the bidirectional rate distortion cost is greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first template distortion is less than or equal to the second template distortion, according to the Performing unidirectional prediction on the current image block by a motion information, thereby obtaining first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes code stream data encoded in a prediction direction identifier
  • the value of the prediction direction identifier indicates that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list or the second motion information list;
  • the bidirectional rate distortion cost is greater than a minimum of the first rate distortion cost and the second rate distortion cost
  • the first template distortion is greater than the second template distortion
  • the second motion information performs unidirectional prediction on the current image block, thereby obtaining second unidirectional code stream data of the current image block, where the second unidirectional code stream data includes code stream data encoded in the prediction direction identifier.
  • the value of the prediction direction identifier indicates that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list or the second motion information list.
  • the prediction unit is further configured to:
  • the reference structure of the frame where the current image block is located is a low-latency reference structure, determining bidirectional template distortion for bidirectional prediction of the current image block according to the first template distortion and the second template distortion;
  • the current image block is bidirectionally predicted according to the first motion information and the second motion information, thereby obtaining encoded data of the current image block.
  • the template distortion threshold is obtained according to the first template distortion and the second template distortion.
  • the prediction unit may be further configured to: when the reference structure of the frame where the current image block is located is a low-latency reference structure, and when the bidirectional template distortion is greater than a template distortion threshold, and the distortion in the first template is small When or equal to the second template distortion, the current image block is encoded according to the first motion information, thereby obtaining encoded data of the current image block.
  • the prediction unit may be further configured to: when the reference structure of the frame where the current image block is located is a low-latency reference structure, and when the bidirectional template distortion is greater than a template distortion threshold, and the distortion in the first template is greater than When the second template is distorted, the current image block is encoded according to the second motion information, thereby obtaining encoded data of the current image block.
  • the matching unit is configured to: respectively: the motion information in the first motion information list is corresponding to The motion information corresponding to the smallest template distortion of the template image of the current image block is used as the first initial motion information; the motion search is performed in the region where the reference image block corresponding to the first initial motion information is located, The first motion information;
  • a fifth aspect of the present invention provides a template matching based decoding apparatus, including: a memory and a processor;
  • the memory is for storing a set of executable code
  • the processor is configured to execute executable code stored in the memory to perform the first aspect, or any one of the first to fourth embodiments of the first aspect.
  • a sixth aspect of the present invention provides an apparatus for encoding based on template matching, comprising: a memory and a processor;
  • the memory is for storing a set of executable code
  • the processor is configured to execute executable code stored in the memory to perform the second aspect, or any one of the first to fifth embodiments of the second aspect.
  • a seventh aspect of the present invention provides a storage medium storing executable code, the executable code being executable to perform the first aspect, or the first to fourth aspects of the first aspect Any of the embodiments.
  • An eighth aspect of the present invention provides a storage medium storing executable code, the executable code being executable to perform the second aspect, or the first to fifth aspects of the second aspect Any of the embodiments.
  • a ninth aspect of the invention provides a computer program that can perform the first aspect, or any one of the first to fourth embodiments of the first aspect.
  • a tenth aspect of the invention provides a computer program that can perform the second aspect, or any one of the first to fifth embodiments of the second aspect.
  • the eleventh aspect of the present invention provides a decoding method based on template matching, which is characterized in that:
  • the value identified in the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list, and the current image block is Performing template matching in the reference image in the first reference image list, thereby obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining second motion information And according to the first motion information, the second motion information, and the encoded data of the current image block, A reconstructed image block of the current image block is obtained.
  • the computational complexity of decoding can be reduced by adding an identifier to the code stream.
  • the method further includes:
  • the current image block is in the first Performing template matching in a reference image in a reference image list, thereby obtaining first motion information, and obtaining a reconstructed image block of the current image block according to the first motion information and the encoded data of the current image block;
  • the current image block is in the Template matching is performed in the reference image in the second reference image list, thereby obtaining second motion information, and the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • the method further includes: the value identified in the prediction direction indicates that the encoded data of the current image block is according to the first reference image list.
  • the current image block is template-matched in the reference image in the first reference image list, Obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining second motion information;
  • the reconstructed image block of the current image block is obtained according to the first motion information and the encoded data of the current image block; or the first template is distorted in the first template
  • the second template distortion satisfies the second unidirectional template distortion condition
  • the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • the first unidirectional template distortion condition includes that the first template distortion is less than or equal to the second template distortion
  • the second unidirectional template distortion condition includes the first template distortion being greater than the second template distortion
  • the reference structure of the frame where the current image block is located is a non-low delay reference structure.
  • the method further includes: when the reference structure of the frame where the current image block is located is a low-latency reference structure, The current image block performs template matching in the reference image in the first reference image list, thereby obtaining first motion information, a template of the reference image block corresponding to the first motion information, and a reference corresponding to the first motion information. And a first template distortion between the image block and the current image block, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining second motion information and the second motion information a template of the corresponding reference image block and a second template distortion between the reference image block corresponding to the second motion information and the current image block;
  • a template corresponding to the reference image block corresponding to the first motion information and a reference image corresponding to the second motion information a template of the block, determining bidirectional template distortion for bidirectional prediction of the current image block;
  • the bidirectional template distortion condition includes that the bidirectional template distortion is less than or equal to a template distortion threshold, and the template distortion threshold may be according to the The first template distortion and the second template distortion are obtained.
  • a twelfth aspect of the present invention provides a coding method based on template matching, including:
  • Bidirectional prediction is performed to obtain bidirectional code stream data of the current image block, the bidirectional code stream data includes code stream data encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates an encoding of the current image block.
  • Data is obtained bidirectionally based on the first reference image list and the second reference image list, the bidirectional code stream data including encoded data of the current image block.
  • the method further includes:
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost satisfy a unidirectional rate distortion condition, performing unidirectional prediction on the current image block according to the first motion information, thereby obtaining first code stream data of the current image block, where the first code stream data includes Entering the code stream data of the prediction direction, the value of the prediction direction identifier indicating that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first reference image list, the first code stream data Include encoded data of the current image block;
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost
  • the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second code stream data of the current image block, where the second code stream data includes
  • the code stream data is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates that the current image block is obtained by unidirectionally predicting the current image block according to the second reference image list, and the second code stream is obtained.
  • the data includes encoded data of the current image block.
  • the second possible implementation manner of the twelfth aspect only when the reference structure of the frame in which the current image block is located is a non-low delay reference structure Determining, according to the first motion information and the second motion information, the bidirectional rate distortion cost, the first rate distortion cost, And the second rate distortion penalty.
  • This embodiment clarifies an implementation scenario in which, using the implementation provided in the twelfth aspect, the decoding efficiency can be increased and the computational complexity of decoding can be reduced.
  • the method further includes:
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first template distortion and the second template distortion satisfy the first order
  • the current image block is unidirectionally predicted according to the first motion information, thereby obtaining first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes
  • the code stream data is encoded in the prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is performed on the current image block according to the first reference image list or the second reference image list.
  • Unidirectional prediction, the first unidirectional code stream data includes encoded data of the current image block;
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first template distortion and the second template distortion satisfy
  • the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second unidirectional code stream data of the current image block, and the second unidirectional code stream
  • the data includes code stream data that is encoded into the prediction direction identifier, and the value of the prediction direction identifier indicates that the encoded data of the current image block is compared to the current image according to the first reference image list or the second reference image list.
  • the block is obtained by unidirectional prediction, and the second unidirectional code stream data includes encoded data of the current image block.
  • this embodiment reduces the number of bits, and improves the coding efficiency compared to the prior art. By programming the identifier in the code stream, the computational complexity of decoding is reduced.
  • the method further includes:
  • the present invention provides a decoding apparatus based on template matching, the apparatus comprising:
  • An acquiring unit configured to acquire a prediction direction identifier of a current image block and encoded data of the current image block
  • a reconstruction unit configured to: when the value of the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list, Performing template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, and performing template matching on the current image block in the reference image in the second reference image list, thereby Obtaining second motion information; obtaining, according to the first motion information, the second motion information, and the encoded data of the current image block, a reconstructed image block of the current image block.
  • the reconstruction unit is further configured to:
  • the current image block is in the first One Performing template matching in the reference image in the reference image list, thereby obtaining first motion information, and obtaining a reconstructed image block of the current image block according to the first motion information and the encoded data of the current image block;
  • the current image block is in the Template matching is performed in the reference image in the second reference image list, thereby obtaining second motion information, and the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • the reconstruction unit is further configured to:
  • the value identified in the prediction direction indicates that the encoded data of the current image block is unidirectional to the current image block according to a reference image in the first reference image list or a reference image in the second reference image list.
  • the current image block is template-matched in the reference image in the first reference image list, thereby obtaining first motion information, and the current image block is performed in the reference image in the second reference image list. Template matching, thereby obtaining second motion information;
  • the reconstructed image block of the current image block is obtained according to the first motion information and the encoded data of the current image block; or the first template is distorted in the first template
  • the second template distortion satisfies the second unidirectional template distortion condition
  • the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • the first one-way template distortion condition includes that the first template distortion is less than or equal to the second template distortion
  • the second unidirectional template distortion condition includes the first template distortion being greater than the second template distortion
  • the acquiring unit is configured to: only the reference structure of the frame where the current image block is located is non- The low-latency reference structure acquires the prediction direction identifier.
  • the reconstruction unit is further configured to: when the reference structure of the frame where the current image block is located is a low-latency reference structure And performing template matching on the current image block in the reference image in the first reference image list, thereby obtaining the first motion information, the template of the reference image block corresponding to the first motion information, and the first motion information corresponding to First template distortion between the reference image block and the current image block, template matching the current image block in the reference image in the second reference image list, thereby obtaining second motion information, the second a template of the reference image block corresponding to the motion information and a second template distortion between the reference image block corresponding to the second motion information and the current image block;
  • the bidirectional template distortion condition includes the bidirectional template distortion being less than or equal to a template distortion threshold, and the template distortion threshold may be Obtained according to the first template distortion and the second template distortion.
  • a fourteenth aspect of the present invention provides an apparatus for encoding based on template matching, comprising:
  • a matching unit configured to perform template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, and using the current image block in the reference image in the second reference image list Perform template matching to obtain second motion information
  • a determining unit configured to determine, according to the first motion information and the second motion information, a bidirectional rate distortion cost of the bidirectional prediction corresponding to the bidirectional motion information, and a first rate distortion of the unidirectional prediction corresponding to the first motion information a cost and a second rate distortion cost of the unidirectional prediction corresponding to the second motion information, the two-way motion information including the first motion information and the second motion information;
  • a prediction unit when the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost satisfy a bidirectional rate distortion condition, according to the first motion information and the second motion information
  • the current image block is bidirectionally predicted to obtain bidirectional code stream data of the current image block
  • the bidirectional code stream data includes code stream data encoded in a prediction direction identifier
  • the value of the prediction direction identifier indicates the current image
  • the encoded data of the block is obtained by bidirectional prediction according to the first reference image list and the second reference image list, and the bidirectional code stream data includes encoded data of the current image block.
  • the predicting unit is further configured to:
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost satisfy a unidirectional rate distortion condition, performing unidirectional prediction on the current image block according to the first motion information, thereby obtaining first code stream data of the current image block, where the first code stream data includes Entering the code stream data of the prediction direction, the value of the prediction direction identifier indicating that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first reference image list, the first code stream data Include encoded data of the current image block;
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost
  • the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second code stream data of the current image block, where the second code stream data includes
  • the code stream data is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates that the current image block is obtained by unidirectionally predicting the current image block according to the second reference image list, and the second code stream is obtained.
  • the data includes encoded data of the current image block.
  • the determining unit is configured to: only the reference structure of the frame where the current image block is located is In the non-low delay reference structure, the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost are determined according to the first motion information and the second motion information.
  • the predicting unit is further configured to:
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first template distortion and the second template distortion satisfy the first order
  • the current image block is unidirectionally predicted according to the first motion information, thereby obtaining first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes Code stream data encoded in the prediction direction identifier, the value of the prediction direction identifier indicating that the encoded data of the current image block is according to the first reference image
  • the list or the second reference image list is obtained by unidirectionally predicting the current image block, and the first unidirectional code stream data includes encoded data of the current image block;
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first template distortion and the second template distortion satisfy
  • the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second unidirectional code stream data of the current image block, and the second unidirectional code stream
  • the data includes code stream data that is encoded into the prediction direction identifier, and the value of the prediction direction identifier indicates that the encoded data of the current image block is compared to the current image according to the first reference image list or the second reference image list.
  • the block is obtained by unidirectional prediction, and the second unidirectional code stream data includes encoded data of the current image block.
  • the determining unit is further configured to:
  • the predicting unit is further configured to: according to the first motion information and the second, when the bidirectional template distortion, the first template distortion, and the second template distortion satisfy a bidirectional template distortion condition
  • the motion information performs bidirectional prediction on the current image block, thereby obtaining encoded data of the current image block.
  • a fifteenth aspect of the present invention provides a decoding apparatus, including: a memory and a processor;
  • the memory is for storing a set of executable code
  • the processor is configured to execute the executable code stored in the memory to perform the eleventh aspect, or any one of the first to sixth embodiments of the eleventh aspect.
  • a sixteenth aspect of the present invention provides an encoding apparatus comprising: a memory and a processor;
  • the memory is for storing a set of executable code
  • the processor is configured to execute the executable code stored in the memory to perform the twelfth aspect, or any one of the first to fourth embodiments of the twelfth aspect.
  • a seventeenth aspect of the present invention provides a storage medium storing executable code, the executable code being executable to perform an eleventh aspect, or the first embodiment of the eleventh aspect Up to any of the sixth embodiments.
  • An eighteenth aspect of the invention provides a storage medium storing executable code, the executable code being executable to perform the twelfth aspect, or the first embodiment of the twelfth aspect Up to any of the fourth embodiments.
  • a nineteenth aspect of the present invention provides a computer program which can execute the eleventh aspect, or any one of the first to sixth embodiments of the eleventh aspect.
  • a twentieth aspect of the invention provides a computer program which can perform the twelfth aspect or any one of the first to fourth embodiments of the twelfth aspect.
  • FIG. 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present invention
  • FIG. 2 is a schematic block diagram of a video encoder according to an embodiment of the present invention.
  • FIG. 3 is a schematic block diagram of a video decoder according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart diagram of an encoding method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of an “L” type template in a template matching technology according to an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart diagram of a decoding method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic flowchart diagram of an encoding method according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic flowchart diagram of an encoding method according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic flowchart diagram of an encoding method according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic flowchart diagram of an encoding method according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic flowchart diagram of a decoding method according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic flowchart diagram of a decoding method according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic flowchart diagram of a decoding method according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic flowchart diagram of a decoding method according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic block diagram of an encoding apparatus according to an embodiment of the present invention.
  • FIG. 16 is a schematic block diagram of a decoding apparatus according to an embodiment of the present invention.
  • FIG. 17 is a schematic block diagram of an encoding apparatus according to an embodiment of the present invention.
  • FIG. 18 is a schematic block diagram of a decoding apparatus according to an embodiment of the present invention.
  • FIG. 19 is a schematic structural diagram of hardware of a computer device according to an embodiment of the present invention.
  • FIG. 20 is a schematic structural diagram of hardware of a computer device according to an embodiment of the present invention.
  • FIG. 1 is a schematic block diagram of a video codec system 10 according to an embodiment of the present invention.
  • video codec system 10 includes source device 12 and destination device 14 (or referred to as a decoding device).
  • Source device 12 produces encoded video encoded data.
  • source device 12 may be referred to as a video encoding device or a video encoding device.
  • Destination device 14 may decode the encoded video encoded data produced by source device 12.
  • destination device 14 may be referred to as a video decoding device or a video decoding device.
  • Source device 12 and destination device 14 may be examples of video codec devices or video codec devices.
  • Source device 12 and destination device 14 may include a wide range of devices including desktop computers, mobile computing devices, notebook (eg, laptop) computers, tablet computers, set top boxes, smart phones, etc., televisions, cameras, display devices , digital media player, video game console, on-board computer, or the like.
  • Destination device 14 may receive the encoded video encoded data from source device 12 via channel 16.
  • Channel 16 may include one or more media and/or devices capable of moving video encoded data from source device 12 to destination device 14.
  • channel 16 may include one or more communication media that enable source device 12 to transmit encoded video encoded data directly to destination device 14 in real time.
  • source device 12 may modulate the encoded video encoded data according to a communication standard (eg, a wireless communication protocol) and may encode the modulated video.
  • the data is transmitted to the destination device 14.
  • the one or more communication media may include wireless and/or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines.
  • RF radio frequency
  • the one or more communication media may form part of a packet-based network (eg, a local area network, a wide area network, or a global network (eg, the Internet)).
  • the one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from source device 12 to destination device 14.
  • channel 16 can include a storage medium that stores encoded video encoded data generated by source device 12.
  • destination device 14 can access the storage medium via disk access or card access.
  • the storage medium may include a variety of locally accessible data storage media, such as Blu-ray Disc, DVD, CD-ROM, flash memory, or other suitable digital storage medium for storing encoded video encoded data.
  • channel 16 can include a file server or another intermediate storage device that stores encoded video encoded data generated by source device 12.
  • destination device 14 may access the encoded video encoded data stored at a file server or other intermediate storage device via streaming or download.
  • the file server may be a server capable of storing the encoded video encoded data and transmitting the encoded video encoded data to the destination device 14.
  • the instance file server includes a web server (eg, for a website), a file transfer protocol (FTP) server, a network attached storage (NAS) device, and a local disk drive.
  • FTP file transfer protocol
  • NAS network attached storage
  • Destination device 14 can access the encoded video encoded data via a standard data connection (e.g., an Internet connection).
  • a standard data connection e.g., an Internet connection.
  • An instance type of data connection includes a wireless channel (eg, a Wi-Fi connection), a wired connection (eg, DSL, cable modem, etc.), or both, suitable for accessing encoded video encoded data stored on a file server The combination.
  • the transmission of the encoded video encoded data from the file server may be streaming, downloading, or a combination of both.
  • the technology of the embodiment of the present invention is not limited to a wireless application scenario.
  • the technology may be applied to video codec supporting multiple multimedia applications such as aerial television broadcasting, cable television transmission, satellite television transmission, and streaming. Transmission of video transmissions (e.g., via the Internet), encoding of video encoded data stored on a data storage medium, decoding of video encoded data stored on a data storage medium, or other application.
  • video codec system 10 may be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and/or video telephony.
  • source device 12 may include video source 18, video encoder 20, and output interface 22.
  • output interface 22 can include a modulator/demodulator (modem) and/or a transmitter.
  • Video source 18 may include a video capture device (eg, a video camera), a video archive containing previously acquired video data, a video input interface to receive video data from a video content provider, and/or a computer for generating video data.
  • Video encoder 20 may encode video data from video source 18.
  • source device 12 transmits the encoded video encoded data directly to destination device 14 via output interface 22.
  • the encoded video encoded data may also be stored on a storage medium or file server for later access by the destination device 14 for decoding and/or playback.
  • destination device 14 includes an input interface 28, a video decoder 30, and a display device 32.
  • input interface 28 includes a receiver and/or a modem.
  • Input interface 28 can receive the encoded video encoded data via channel 16.
  • Display device 32 may be integral with destination device 14 or may be external to destination device 14. In general, display device 32 displays the decoded video encoded data.
  • Display device 32 can include a variety of display devices, For example, liquid crystal displays (LCDs), plasma displays, organic light emitting diode (OLED) displays, or other types of display devices.
  • LCDs liquid crystal displays
  • OLED organic light emitting diode
  • Video encoder 20 and video decoder 30 may operate in accordance with video compression standards (eg, the High Efficiency Video Codec H.265 standard) or the next generation video codec compression standard (H.266) currently under development, and may Follow the HEVC test model or the H.266 test model (JEM).
  • video compression standards eg, the High Efficiency Video Codec H.265 standard
  • H.266 next generation video codec compression standard
  • JEM H.266 test model
  • video encoder 20 and video decoder 30 may operate in accordance with other proprietary or industry standards including ITU-TH.261, ISO/IEC MPEG-1 Visual, ITU-TH.262, or ISO/IEC MPEG-2 Visual, ITU. -TH.263, ISO/IECMPEG-4 Visual, ITU-TH.264 (also known as ISO/IEC MPEG-4 AVC), including scalable video codec (SVC) and multiview video codec (MVC) extensions.
  • SVC scalable video codec
  • MVC multiview video codec
  • FIG. 1 is merely an example and the techniques of the present invention are applicable to video codec applications (eg, single-sided video encoding or video decoding) that do not necessarily include any data communication between the encoding device and the decoding device.
  • data is retrieved from a local memory, streamed via a network, or manipulated in a similar manner.
  • the encoding device may encode the video data and store the video encoded data to a memory, and/or the decoding device may retrieve the encoded data from the memory and decode the encoded data.
  • encoding and decoding are performed by a plurality of devices that only encode data to and/or retrieve encoded data from memory without communicating with each other.
  • Video encoder 20 and video decoder 30 may each be implemented as any of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable Gate array (FPGA), discrete logic, hardware, or any combination thereof.
  • Video encoder 20 and video decoder 30 may also be implemented in part or in whole in software, and source device 12 and destination device 14 may store instructions of the software in a suitable non-transitory computer readable storage medium, and may use one Or a plurality of processors execute instructions in hardware to perform the methods provided by embodiments of the present invention. Any of the foregoing (including hardware, software, a combination of hardware and software, etc.) can be considered as one or more processors.
  • Video encoder 20 or video decoder 30 may be included in one or more encoders or decoders, and video encoder 20 or video decoder 30 may be integrated into a combined encoder/decoder (codec) in other devices. Part of (CODEC)).
  • the video encoder 20 encodes video data.
  • Video data may include one or more image frames.
  • Video encoder 20 may generate code stream data that contains encoded data and associated data for the image frames in the form of a bitstream.
  • the associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures (eg, identification information).
  • SPS sequence parameter set
  • PPS picture parameter set
  • An SPS can contain parameters that are applied to one or more sequences.
  • a PPS can contain parameters that are applied to one or more pictures.
  • a grammatical structure refers to a collection of one or more syntax elements arranged in a specified order in a code stream.
  • video encoder 20 may partition the picture into a coding tree block (CTB).
  • CTB coding tree block
  • a CTB may be referred to as a "tree block,” a "maximum coding unit” (LCU), or a "coding tree unit.”
  • the CTB is not limited to a specific size and may include one or more coding units (CUs), and the division manner of the CU may be based on a quadtree plus a binary tree structure (QTBT structure).
  • Each CTB can be associated with a block of pixels of equal size within the picture. Each pixel can correspond to one luminance (luminance or luma) sample and two chrominance or chroma samples.
  • each CTB can be associated with one luma sample block and two chroma sample blocks.
  • the CTB of a picture can be divided into one or more stripes.
  • each stripe contains an integer number of CTBs.
  • video encoder 20 may generate coding information for each strip of the picture, ie, the coding station Describe the CTB within the strip.
  • video encoder 20 may recursively perform quadtree partitioning, binary tree partitioning, or quadtree plus binary tree partitioning on the pixel blocks associated with the CTB to partition the block of pixels into decreasing blocks of pixels. The smaller block of pixels can be associated with a CU.
  • An image block in an embodiment of the present invention may be a CU, a CU associated image block, or other image block.
  • the image blocks included in the HEVC include a coding block CU, a prediction block PU, and a transform block TU.
  • the JEM model further improves the coding structure of the video image. Specifically, it is called “quadruple tree combination”.
  • the block coding structure of the Binary Tree (QTBT) is introduced.
  • the QTBT structure rejects the concepts of CU, PU, TU, etc. in HEVC, and supports more flexible CU partitioning shapes.
  • One CU can be square or rectangular.
  • a CTU first performs quadtree partitioning, and the leaf nodes of the quadtree further perform binary tree partitioning.
  • the leaf nodes of the binary tree are called CUs, and the CUs of the JEM cannot be further divided during the prediction and transformation process, that is, the CUs, PUs, and TUs of the JEM have the same block size.
  • the maximum size of the CTU is 256 ⁇ 256 luma pixels.
  • the image block of the present invention may include, but is not limited to, any of the above image blocks.
  • H.265 JCT-VC developed the H.265 (HEVC) standard.
  • HEVC standardization is based on an evolution model of a video decoding device called the HEVC Test Model (HM).
  • HM HEVC Test Model
  • the latest standard documentation for H.265 is available at http://www.itu.int/rec/T-REC-H.265.
  • the latest version of the standard document is H.265 (12/16), which is the full text of the standard document.
  • the manner of reference is incorporated herein.
  • the HM assumes that the video decoding device has several additional capabilities with respect to existing algorithms of ITU-TH.264/AVC. For example, H.264 provides nine intra-prediction coding modes, while HM provides up to 35 intra-prediction coding modes.
  • JVET is committed to the development of the H.266 standard.
  • the H.266 standardization process is based on an evolution model of a video decoding device called the H.266 test model.
  • the algorithm description of H.266 is available from http://phenix.int-evry.fr/jvet, and the latest algorithm description is included in JVET-F1001-v2, which is incorporated herein by reference in its entirety.
  • the reference software for the JEM test model is available from https://jvet.hhi.fraunhofer.de/svn/svn_HMJEMSoftware/, which is also incorporated herein by reference in its entirety.
  • FIG. 2 is a schematic block diagram of a video encoder 20 in the embodiment of the present application.
  • Video encoder 20 may perform intra-coding and inter-coding of image blocks of a video frame.
  • Intra coding relies on spatial prediction to reduce or remove spatial redundancy of video within a given video frame or image.
  • Inter-coding relies on temporal prediction to reduce or remove temporal redundancy of adjacent frames of a video sequence or video within an image.
  • the intra mode may refer to any of a number of space based compression modes.
  • An inter mode eg, unidirectional prediction (P mode) or bidirectional prediction (B mode), etc.
  • P mode unidirectional prediction
  • B mode bidirectional prediction
  • video encoder 20 includes a partitioning unit 35, a prediction unit 41, a reference image memory 64, a summer 50, a transform processing unit 52, a quantization unit 54, and an entropy encoding unit 56.
  • the prediction unit 41 includes a motion estimation unit 42, a motion compensation unit 44, and an intra prediction module 46.
  • video encoder 20 also includes inverse quantization unit 58, inverse transform unit 60, and summer 62.
  • a deblocking filter (not shown in Figure 2) may also be included to filter the block boundaries to remove blockiness artifacts from the reconstructed video. The deblocking filter will typically filter the output of summer 62 as needed. In addition to the deblocking filter, an additional loop filter (in-loop or post-loop) can also be used.
  • video encoder 20 receives video data, and segmentation unit 35 segments the data into video blocks.
  • This partitioning may also include partitioning into strips, image blocks, or other larger units, and, for example, video block partitioning based on the quadtree structure of the LCU and CU.
  • Video encoder 20 exemplarily illustrates the components of a video block encoded within a video strip to be encoded. In general, a stripe may be partitioned into multiple video blocks (and possibly into a collection of video blocks called image blocks).
  • Prediction unit 41 may select one of a plurality of possible coding modes of the current video block, such as multiple intra-frames, based on the coding quality and cost calculation results (eg, rate-distortion cost (or rate distortion cost), RDcost). One of one or more inter-coding modes in the encoding mode. Prediction unit 41 may provide the resulting intra-coded or inter-coded block (or referred to as a predicted image block) to summer 50 to generate residual block data and to derive the resulting intra-coded or inter-coded prediction. The image block is provided to summer 62 to reconstruct the reconstructed block for use as a block in the reference image.
  • a predicted image block or referred to as a predicted image block
  • Motion estimation unit 42 and motion compensation unit 44 within prediction unit 41 perform a current video block (or referred to as a current image block) relative to one or more blocks (which may be referred to as reference image blocks) in one or more reference images. Inter-frame predictive coding to provide temporal compression.
  • Motion estimation unit 42 may be configured to determine an inter-prediction mode of a video strip or a current image block or a region in which the current image block is located, according to a predetermined pattern of the video sequence. The predetermined mode can specify a video strip in the sequence as a P strip, a B strip, or a GPB strip.
  • Motion estimation unit 42 and motion compensation unit 44 may be highly integrated, but are separately illustrated for conceptual purposes.
  • a motion vector may indicate a displacement of an image block (or referred to as a video block) within a current video frame or image relative to a reference image block within a reference image.
  • the reference image block is a block that is found to closely match the current image block based on the pixel difference, and the pixel difference can be determined by absolute difference sum (SAD), squared difference sum (SSD), or other difference metric.
  • video encoder 20 may calculate a value of a sub-integer pixel location of a reference image stored in reference image memory 64. For example, video encoder 20 may interpolate values of a quarter pixel position, an eighth pixel position, or other fractional pixel position of a reference image. Accordingly, motion estimation unit 42 may perform a motion search with respect to the full pixel position and the fractional pixel position and output a motion vector having fractional pixel precision.
  • the motion estimation unit 42 calculates the motion vector of the inter-predicted current image block by comparing the position of the current image block with the position of the reference image block.
  • the reference images may be selected from a first reference image list (List 0) or a second reference image list (List 1), each of which corresponds to one or more reference images stored in the reference image memory 64.
  • Motion estimation unit 42 transmits the computed motion vector to entropy encoding unit 56 and motion compensation unit 44.
  • Motion compensation performed by motion compensation unit 44 may involve extracting or determining reference image blocks based on motion vectors determined by motion estimation, possibly performing interpolation to sub-pixel precision. After acquiring the motion vector of the current image block, motion compensation unit 44 may locate the reference image block to which the motion vector is directed in one of the one or two reference image lists.
  • the video encoder 20 forms a residual image block (or a residual video block) by subtracting the pixel value of the reference image block from the pixel value of the current image block being coded (which may also be referred to as the current video block), thereby obtaining the pixel difference value.
  • the pixel difference values form data for the residual image block and may include both luminance and chrominance difference components.
  • Summer 50 represents one or more components that perform this subtraction.
  • Motion compensation unit 44 may also generate syntax elements (such as provided by embodiments of the present invention) associated with the current image block and/or video strip for use by video decoder 30 to decode and obtain reconstructed blocks of the current image block or A reconstructed block of image blocks of a video strip.
  • syntax elements such as provided by embodiments of the present invention
  • the image blocks may be associated with two reference image lists called "List 0" and "List 1".
  • the B strip is included
  • the image may be associated with a list combination of a combination of list 0 and list 1.
  • motion estimation unit 42 may perform unidirectional prediction or bi-directional prediction for the image blocks, wherein, in some possible implementations, bi-directional prediction For prediction based on the images of the reference image lists of List 0 and List 1, respectively, in other possible embodiments, the bidirectional prediction is based on the reconstructed of the current frame (the frame in which the current image block is located) in the display order, respectively. Predictions for future frames and reconstructed past frames.
  • the motion estimation unit 42 may search for the reference image block of the current image block in the reference image of list 0 or list 1.
  • Motion estimation unit 42 may then generate a reference index indicating a reference image containing the reference image block in list 0 or list 1 and a motion vector indicating a spatial displacement between the current image block and the reference image block.
  • the motion estimation unit 42 may output a reference index, a prediction direction identifier, and a motion vector as motion information of the current image block.
  • the prediction direction indicator may indicate that the reference index indicates the reference image in list 0 or list 1.
  • Motion compensation unit 44 may be based on a predicted image block (or referred to as a predictive image block) of the current image block of the reference image block indicated by the motion information of the current image block.
  • the motion estimation unit 42 may search for a reference image block of the current image block in the reference image (the reference image may also be referred to as a reference frame) in the list 0 and may also be in the list Searching for another reference image block of the current image block in the reference image in 1.
  • Motion estimation unit 42 may then generate a reference index indicating the reference image containing the reference image block in list 0 and list 1 and a motion vector indicating the spatial displacement between the reference image block and the current image block.
  • the motion estimation unit 42 may output a reference index and a motion vector of the current image block as motion information of the current image block.
  • Motion compensation unit 44 may determine a predicted image block of the current image block based on the reference image block indicated by the motion information of the current image block.
  • motion estimation unit 42 does not output a complete set of motion information for the current image block to entropy encoding module 56. Rather, the motion estimation unit 42 may notify the motion information of the current image block with reference to the motion information of the other image block. For example, motion estimation unit 42 may determine that the motion information of the current image block is sufficiently similar to the motion information of the adjacent image block. In this embodiment, motion estimation unit 42 may indicate an indication value in a syntax structure associated with the current image block, the indication value indicating to video decoder 30 that the current image block has the same motion information as the adjacent image block. Or have motion information that can be derived from adjacent image blocks.
  • motion estimation unit 42 may identify candidate predicted motion vectors and motion vector differences (MVDs) associated with neighboring image blocks in a syntax structure associated with the current image block.
  • the MVD indicates the difference between the motion vector of the current image block and the indicated candidate predicted motion vector associated with the adjacent image block.
  • Video decoder 30 may use the candidate predicted motion vector and MVD to determine the motion vector of the current image block.
  • prediction module 41 may generate a list of candidate predicted motion vectors for the current image block.
  • One or more of the candidate predicted motion vector lists may include one or more candidate predicted motion vectors and one or more additional candidate predicted motion vectors derived from the candidate predicted motion vectors.
  • the intra prediction unit 46 within the prediction unit 41 may perform on the current image block based on the same image as the current image block or one or more adjacent image blocks (which may be in the strip) adjacent to the current image block. Intra prediction coding to provide spatial compression. Thus, instead of inter prediction (as described above) performed by motion estimation unit 42 and motion compensation unit 44, intra prediction unit 46 may intra-predict the current image block. In particular, intra prediction unit 46 may determine an intra prediction mode to encode the current image block. In some possible implementations, intra prediction unit 46 may encode the current image using various intra prediction modes, for example, during separate encoding traversal. The block, and intra prediction unit 46 (or in some possible implementations, mode selection unit 40) may select the appropriate intra prediction mode to use from the tested mode.
  • the video encoder 20 forms a residual image block by subtracting the predicted image block from the current image block.
  • the residual video data in the residual image block may be included in one or more TUs and applied to transform processing unit 52 (which may also be the residual image block applied directly to transform processing unit 52).
  • Transform processing unit 52 transforms the residual video data into residual transform coefficients using, for example, a discrete cosine transform (DCT) or a conceptually similar transform (eg, a discrete sinusoidal transform DST).
  • Transform processing unit 52 may convert the residual video data from the pixel domain to a transform domain (eg, a frequency domain).
  • Transform processing unit 52 may send the resulting transform coefficients to quantization unit 54.
  • Quantization unit 54 quantizes the transform coefficients to further reduce the code rate. The quantization process can reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting the quantization parameters. In some possible implementations, quantization unit 54 may then perform a scan of the matrix containing the quantized transform coefficients. Alternatively, entropy encoding unit 56 may perform a scan.
  • entropy encoding unit 56 may entropy encode the quantized transform coefficients. For example, entropy encoding unit 56 may perform context adaptive variable length decoding (CAVLC), context adaptive binary arithmetic decoding (CABAC), syntax based context adaptive binary arithmetic decoding (SBAC), probability interval partition entropy (PIPE) decoding or another entropy coding method or technique. Entropy encoding unit 56 may also entropy encode the motion vector of the current video strip (or the motion vector of the current image block) and other syntax elements. After entropy encoding by entropy encoding unit 56, the codeable code stream is transmitted to video decoder 30 or archive for later transmission or retrieved by video decoder 30 for retrieval.
  • CAVLC context adaptive variable length decoding
  • CABAC context adaptive binary arithmetic decoding
  • SBAC syntax based context adaptive binary arithmetic decoding
  • PIPE probability interval partition entropy
  • Entropy encoding unit 56 may encode information indicative of the selected intra prediction mode.
  • Video encoder 20 may include encoding of various blocks in transmitted code stream configuration data including a plurality of intra prediction mode index tables and a plurality of modified intra prediction mode index tables (also referred to as codeword mapping tables) A definition of the context and an indication of the MPM, the intra prediction mode index table, and the modified intra prediction mode index table for each of the contexts.
  • the inverse quantization unit 58 and the inverse transform unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual image block in the pixel domain to obtain a reference image block serving as a reference image.
  • Motion compensation unit 44 may reconstruct the reference image block by adding the residual image block to the predicted image block of one of the reference images within one of the reference image lists. Motion compensation unit 44 may also apply one or more interpolation filters to the reconstructed residual image block to calculate sub-integer pixel values for motion estimation.
  • the summer 62 adds the residual image block to the predicted image block of the motion compensated reference image block generated by the motion compensation unit 44 to produce a reference image block for storage in the reference image memory 64.
  • the reference image block may be used by the motion estimation unit 42 and the motion compensation unit 44 as a reference image block to inter-predict subsequent video frames or blocks in the image.
  • FIG. 3 is a schematic block diagram of a video decoder 30 in an embodiment of the present invention.
  • video decoder 30 includes an entropy encoding unit 80, a prediction unit 81, an inverse quantization unit 86, an inverse transform unit 88, a summer 90, and a reference image memory 92.
  • the prediction unit 81 includes a motion compensation unit 82 and an intra prediction unit 84.
  • video decoder 30 may perform the decoding process from the encoding process described by video encoder 20 of FIG. The decoding process of video decoder 30 may be reciprocal to the encoding process of the video encoder.
  • video decoder 30 receives from video encoder 20 an encoded video code stream representing an image block (or encoded image block) of the encoded video strip and associated syntax elements.
  • Entropy encoding unit 80 of video decoder 30 entropy decodes the code stream to produce quantized coefficients, motion vectors, and other syntax elements.
  • the entropy encoding unit 80 forwards the motion vectors and other syntax elements to the prediction unit 81.
  • Video decoder 30 can be at the video strip level and / Or a syntax element is received at the image block level.
  • the prediction data for the current image block or the image block of the current video slice may be generated based on the signaled intra prediction mode and data from previously decoded blocks of the current frame or image.
  • the motion compensation unit 82 of the prediction unit 81 is based on the slave entropy encoding unit 80 when the video image has been decoded into an inter-frame decoded (eg, B, P, or GPB) strip or the current image block is an image block for inter-frame decoding.
  • the received motion vector and other syntax elements produce a predicted image block of the current image block.
  • the predicted image block can be determined from one of the one or two reference image lists.
  • Video decoder 30 may construct a reference image list (List 0 and/or List 1) using default construction techniques based on reference images stored in reference image memory 92.
  • the motion compensation unit 82 determines the current image block or the image block of the current video strip by parsing the motion vector and other syntax elements (the current image block is the image block of the current video strip when the current image block is in the strip) The information is predicted, and the predicted information is used to decode the obtained predicted image block of the current image block.
  • motion compensation unit 82 uses some of the received syntax elements to determine a prediction mode (eg, intra prediction or inter prediction) to use to decode the current image block, inter prediction stripe type (eg, B stripe) , P strip or GPB strip) (or the type of frame in which the current image block is located), construction information of one or more of the reference image lists of the strip (or one of the reference image lists of the current image block) Construction information of one or more of the frames), the motion vector of each inter-coded video block of the stripe (or the motion vector of the current image block), the inter-predicted state of each inter-frame decoded image block of the stripe ( Either the inter-predicted state of the inter-coded picture block and other information used to decode the video block in the current video slice (or decode the current picture block).
  • a prediction mode eg, intra prediction or inter prediction
  • inter prediction stripe type eg, B stripe
  • P strip or GPB strip or the type of frame in which the current image block is located
  • Motion compensation unit 82 may also perform interpolation based on the interpolation filter. Motion compensation unit 82 may use the interpolation filters as used by video encoder 20 during encoding of the current image block to calculate interpolated values for sub-integer pixels of the reference block. In this application, motion compensation unit 82 may determine an interpolation filter used by video encoder 20 from the received syntax elements and use an interpolation filter to obtain a predicted image block of the current image block.
  • motion compensation unit 82 may generate a candidate predicted motion vector list for the current image block.
  • the code stream may include data identifying the location of the selected candidate predicted motion vector in the candidate predicted motion vector list of the current image block.
  • motion compensation unit 82 may generate a predicted image block for the current image block based on one or more reference blocks indicated by the motion information of the current image block.
  • the reference image block of the current image block may be in an image frame at a different time than the current image block.
  • Motion compensation unit 82 may determine motion information for the current image block based on the selected motion information from the candidate predicted motion vector list for the current image block.
  • Inverse quantization unit 86 inverse quantizes (eg, dequantizes) the quantized transform coefficients provided in the codestream and decoded by entropy encoding unit 80.
  • the inverse quantization process may include determining the degree of quantization using quantization parameters calculated by video encoder 20 for image blocks or image blocks in the video strip, and likewise determining the degree of inverse quantization that should be applied.
  • Inverse transform unit 88 applies an inverse transform (e.g., inverse DCT, inverse integer transform, or conceptually similar inverse transform process) to the transform coefficients to produce residual image blocks in the pixel domain.
  • the video decoder 30 seeks by using the residual image block from the inverse transform unit 88 and the corresponding predicted image block generated by the motion compensation unit 82. And to form a decoded video block (ie, a reconstructed image block of the current image block).
  • Sumifier 90 represents one or more components that perform this summation operation.
  • a deblocking filter can also be applied to filter the decoded blocks to remove blockiness artifacts as needed.
  • Other loop filters (either in the decoding loop or after the decoding loop) can also be used to smooth pixel transitions or otherwise improve video quality.
  • the decoded video block in a given frame or image is then stored in a reference image memory 92, which stores a reference image for subsequent motion compensation.
  • the reference image memory 92 also stores decoded video for later presentation on a display device such as display device 32 of FIG.
  • the techniques of some embodiments of the present invention illustratively relate to inter-coding and inter-coding. It should be understood that the techniques of some embodiments of the present invention may be performed by any of the video encoders and video decoders described in the embodiments of the present invention, the video encoder and video decoder comprising, for example, as described in relation to FIG. 3 shows and describes video encoder 20 and video decoder 30. That is, in one possible implementation, the prediction unit 41 described with respect to FIG. 2 may perform the specific techniques described below when performing inter prediction during encoding of the current image block. In another possible implementation, the prediction unit 81 described with respect to FIG. 3 may perform the specific techniques described below when performing inter prediction during decoding of the current image block. Thus, references to a generic "video encoder" or "video decoder” may include video encoder 20, video decoder 30, or another video encoding or encoding unit.
  • FIG. 4 is a schematic flowchart diagram of a coding method based on template matching according to an embodiment of the present invention.
  • the method may be performed by the source device 12, or may be performed by the video encoder 20, or may be performed by the prediction unit 41.
  • the method can include:
  • the method may further include: determining a first motion information list of the current image block and a second motion information list of the current image block.
  • the motion information may include a motion vector and a reference index.
  • the determining the motion information list of the current image block may be determined according to the frame of the current image block or the reference image list of the region (eg, the slice). Specifically, determining the first motion information list may be according to the first reference image list (for example, , list0) to determine, determine the first list of motion information. Determining the second motion information list may be determined according to the second reference image list (eg, list1).
  • the frame in which the current image block is located may be a frame for bidirectional prediction
  • the two motion information lists may be a candidate motion information list of a merge mode or a motion information list of an Advanced Motion Vector Prediction (AMVP) mode.
  • AMVP Advanced Motion Vector Prediction
  • the above two motion information lists may be established based on motion information of the encoded image blocks around the current image block.
  • any motion information in the first motion information list includes a motion vector and a reference index
  • the reference index is used to indicate that the reference frame (or referred to as a reference image) is in the first reference frame list (or is referred to as a first reference image list or Forward reference image list, location in List0).
  • the motion information in the second motion information list includes a motion vector and a reference index
  • the reference index is used to indicate that the reference frame is in the second reference frame list (or referred to as a second reference image list or a backward reference image list, List1) s position.
  • the reference image block corresponding to any motion information in the first motion information list is a reconstructed image block (for Reconstruct the resulting image block).
  • the reference image block corresponding to any motion information in the second motion information list is a reconstructed image block (for the reconstructed image block).
  • the first template distortion and the template of the reference image block corresponding to the first motion information are also determined.
  • the first template missing between the reference image block corresponding to the first motion information and the current image block is a difference between a template of the reference image block corresponding to the first motion information and a template of the current image block.
  • the first motion information may be the first motion information of the current image block.
  • the determining, according to the first motion information list, the first motion information may include: a template that minimizes a template image block corresponding to the motion information in the first motion information list and a template distortion of the current image block.
  • the motion information corresponding to the distortion is used as the first initial motion information; the motion search is performed in an area where the reference image block corresponding to the first initial motion information is located, and the first motion information is obtained.
  • the template distortion can be calculated by the following formula:
  • P is the template of the current image block
  • Q is the template of the reference image block pointed to by any motion information in the motion information list
  • (x, y) is the motion of any motion information in the motion information list between P and Q.
  • the vector, M, N is the length and width of the current image block and the reference image block
  • SAD is the template distortion, or is called SAD of Sum of Absolute Difference.
  • the template distortion can be expressed by the mean square error sum (SSD), in addition to the absolute error sum.
  • SSD mean square error sum
  • the above template may use an "L" type template.
  • the left adjacent block and the upper adjacent block of the current image block constitute an "L” type template. Since the spatial position of the template and the current current image block are in close proximity, the motion information of the two should remain substantially the same. Therefore, the motion information of the template can be used as the motion information of the current image block.
  • the left neighboring block and the upper neighboring block of the current image block are reconstructed and are available at both the encoding end and the decoding end.
  • the size of the area where the reference image block is located and the positional relationship with the reference image block may be preset.
  • the pixels in the area where the reference image block is located are reconstructed.
  • performing a motion search in an area where the reference image block corresponding to the first initial motion information is located, and obtaining the first motion information may include:
  • the interval between the at least two templates may be an integer pixel value or a non-integer pixel value, such as but not limited to a half pixel, a quarter pixel, an eighth pixel or Three-thirds of a pixel.
  • S402. Determine, according to the second motion information list of the current image block, second motion information, where a second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to The reference image block corresponding to the motion information in the second motion information list and the template of the current image block are distorted.
  • the second motion information may be second motion information of the current image block.
  • the determining, according to the second motion information list, the second motion information may include: a template that is the smallest one of the reference image block corresponding to the motion information in the second motion information list and the template distortion of the current image block.
  • the motion information corresponding to the distortion is used as the second initial motion information; the motion search is performed in the region where the reference image block corresponding to the second initial motion information is located, and the second motion information is obtained.
  • the process of S402 can refer to the process of S401, and details are not described herein again.
  • S403. Determine, according to the first motion information and the second motion information, a bidirectional rate distortion cost of the bidirectional prediction corresponding to the bidirectional motion information, a first rate distortion cost of the unidirectional prediction corresponding to the first motion information, and a second rate distortion cost of the unidirectional prediction corresponding to the second motion information, the bidirectional motion information including the first motion information and the second motion information.
  • MC Motion compensation
  • T transform
  • Q quantization
  • entropy coding on the current image block according to the first motion information (or referred to as forward motion information) to obtain a first rate.
  • the distortion cost (or the rate distortion cost of the forward prediction), the motion compensation, transform, quantization, and entropy coding of the current image block according to the second backward motion information (or referred to as backward motion information), to obtain the second rate
  • RDCost0 represents a first rate distortion cost
  • D0 represents a current picture block that is encoded with first motion information (which may include motion compensation, and includes at least one of transform, quantization, and entropy coding)
  • R0 represents a current image block.
  • the number of bits consumed by encoding the first motion information (which may include motion compensation, and including at least one of transform, quantization, and entropy coding), ⁇ is a multiplier, which may be determined by the encoding side.
  • RDCost1 represents a second rate distortion cost
  • D1 represents a current picture block that is encoded with second motion information (which may include motion compensation, and includes at least one of transform, quantization, and entropy coding)
  • R1 represents a current image block.
  • the number of bits consumed by encoding (which may include motion compensation, and including at least one of transform, quantization, and entropy coding) with the second motion information, ⁇ being a multiplier, may be determined by the encoding end.
  • RDCostBi represents a bidirectional rate distortion cost
  • DBi represents a distortion of the current image block encoded by the first motion information and the second motion information (which may include motion compensation, and includes at least one of transform, quantization, and entropy coding)
  • RBi Representing the number of bits consumed by the current image block encoded with the first motion information and the second motion information (which may include motion compensation, and including at least one of transform, quantization, and entropy coding)
  • being a multiplier, which may be determined by the encoding end .
  • the bidirectional rate distortion of the bidirectional prediction corresponding to the bidirectional motion information is determined according to the first motion information and the second motion information only when the reference structure of the frame in which the current image block is located is a non-low delay reference structure.
  • a cost, a first rate distortion cost of the unidirectional prediction corresponding to the first motion information, and a second rate distortion cost of the unidirectional prediction corresponding to the second motion information are determined according to the first motion information and the second motion information only when the reference structure of the frame in which the current image block is located is a non-low delay reference structure.
  • a cost, a first rate distortion cost of the unidirectional prediction corresponding to the first motion information, and a second rate distortion cost of the unidirectional prediction corresponding to the second motion information For the contents of the non-low delay reference structure (Non-LowDelay configuration) and the low delay reference structure (LowDelay configuration), refer to HM. 7.0, H.265 and H.266 related content, wherein the non-low latency reference structure can be
  • the method may further include: when the reference structure of the frame in which the current image block is located is a non-low latency reference structure, and the bidirectional rate distortion cost is greater than the first rate distortion cost and the second rate a minimum value in the distortion cost, and when the first rate distortion cost is less than or equal to the second rate distortion cost, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining the current First code stream data of the image block, the first code stream data includes code stream data encoded in a prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first motion
  • the information list is obtained by unidirectionally predicting the current image block.
  • the first code stream data may further include coded data of the current image block.
  • the method may further include: when the reference structure of the frame in which the current image block is located is a non-low latency reference structure, and the bidirectional rate distortion cost is greater than the first rate distortion cost and the second rate a minimum value in the distortion cost, and when the first rate distortion cost is greater than the second rate distortion cost, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining the current image block.
  • the second code stream data, the second code stream data includes code stream data encoded in the prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the second motion information list. Unidirectional prediction is performed on the current image block.
  • the second code stream data may further include encoded data of the current image block.
  • the method may further include: when the reference structure of the frame in which the current image block is located is a non-low delay reference structure, and the bidirectional rate distortion cost is greater than the first rate distortion cost And a minimum value of the second rate distortion cost, and when the first template distortion is less than or equal to the second template distortion, the current image block is unidirectionally predicted according to the first motion information, thereby Obtaining first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes code stream data that is encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates the current image block.
  • the encoded data is obtained by unidirectionally predicting the current image block according to the first motion information list or the second motion information list.
  • the first unidirectional code stream data may further include encoded data of the current image block.
  • the method may further include: when the reference structure of the frame in which the current image block is located is a non-low delay reference structure, and the bidirectional rate distortion cost is greater than the first rate distortion cost And a minimum value of the second rate distortion cost, and when the first template distortion is greater than the second template distortion, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining a
  • the second unidirectional code stream data of the current image block includes code stream data that is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates the coded data of the current image block. And performing unidirectional prediction on the current image block according to the first motion information list or the second motion information list.
  • the second unidirectional code stream data may further include encoded data of the current image block.
  • the method may further include: determining, when the reference structure of the frame where the current image block is located is a low-latency reference structure, determining, according to the first template distortion and the second template distortion, the current image block Bidirectional template distortion of bidirectional prediction; when the bidirectional template distortion is less than or equal to a template distortion threshold, bidirectionally predicting the current image block according to the first motion information and the second motion information, thereby obtaining the current Encoded data of the image block, the template distortion threshold being obtained according to the first template distortion and the second template distortion.
  • the template distortion threshold may be a minimum of the first template distortion and the second template distortion.
  • Template distortion The threshold may also be a value obtained by multiplying a minimum of the first template distortion and the second template distortion by a predetermined coefficient, which may be any real number greater than or equal to 1 and less than or equal to 3, such as 2 or 1.25.
  • the method may further include: when the reference structure of the frame where the current image block is located is a low-latency reference structure, and when the bidirectional template distortion is greater than a template distortion threshold, and at the first When the template distortion is less than or equal to the second template distortion, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining encoded data of the current image block. Or, when the reference structure of the frame where the current image block is located is a low-latency reference structure, and when the bidirectional template distortion is greater than a template distortion threshold, and when the first template distortion is greater than the second template distortion, according to the second The motion information performs unidirectional prediction on the current image block, thereby obtaining encoded data of the current image block.
  • determining the bidirectional template distortion for bidirectional prediction of the current image block according to the first template distortion and the second template distortion may include:
  • the second motion information calculates a template distortion between the template of the current image block and the template of the reference image block corresponding to the adjusted second motion information, that is, the bidirectional template distortion.
  • a template of the reference image block and performing a motion search according to a new template of the current image block in a region where the reference image block corresponding to the first motion information is located or a region where the reference image corresponding to the first initial motion information is located, and the adjusted image is obtained.
  • the first motion information calculates a template distortion between the new template of the current image block and the template of the reference image block corresponding to the adjusted first motion information, that is, the bidirectional template distortion.
  • determining the bidirectional template distortion for bidirectional prediction of the current image block according to the first template distortion and the second template distortion may also include:
  • the sum of the first template distortion and the second template distortion is distorted as a bidirectional template.
  • the product of the sum of the first template distortion and the second template distortion and another preset coefficient is used as a bidirectional template distortion.
  • the other coefficient may be any real number greater than or equal to 1 and less than or equal to 3, such as 2 or 1.25.
  • the bidirectional template distortion can also be obtained by:
  • the value of the bidirectional template distortion may be an absolute error sum of the template of the current image block and the bidirectional template
  • the bidirectional template is a template of the reference image block corresponding to the first motion information and a reference image block corresponding to the second motion information.
  • the template weighted sum for example, the bidirectional template may be half of the sum of the template of the reference image block corresponding to the first motion information and the template of the reference image block corresponding to the second motion information.
  • the value of the bidirectional template distortion may be a value of a product of a current image block and an absolute error of the bidirectional template and a product of another predetermined coefficient, and the other coefficient may be any greater than or equal to 1 and less than or equal to 3.
  • Real numbers such as 2 or 1.25.
  • determining a reference structure of a frame in which the current image block is located is a low latency reference
  • the structure or the process of the non-low-latency reference structure may be specifically as follows: if the reference frame (or referred to as a reference image) in the reference list of the current frame (that is, the frame of the current image block) is numbered (Picture of Count, POC) Both are smaller than the current frame number, and the reference structure of the frame where the current image block is located is a low-latency structure. Otherwise, the reference structure of the frame where the current image block is located is a non-low-latency reference structure.
  • POC_list0 may be used to indicate the number of reference frames in the first reference frame list (eg, List0)
  • POC_list1 represents the number of reference frames in the second reference frame list (List1)
  • POC_cur represents the number of the current frame.
  • POC_cur>POC_list0 POC_cur>POC_list1 are all valid.
  • the specific process can also refer to the description in JEM 5.0.1.
  • the current image block is bidirectionally predicted to obtain bidirectional code stream data of the current image block, the bidirectional code stream data includes code stream data encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates the current image
  • the encoded data of the block is obtained by bidirectionally predicting the current image block according to the first motion information list and the second motion information list.
  • the bidirectional code stream data may further include encoded data of the current image block.
  • the encoded data of the current image block may be bi-directionally predicted for the current image block (eg, based on motion compensation of two reference picture image lists), and further subjected to at least one of transform, quantization, and entropy coding to obtain data.
  • the encoded data obtained by bidirectional prediction in the following is similar to this content, and will not be described later.
  • the bidirectional prediction of the current image block according to the first motion information and the second motion information may include:
  • the reference image block corresponding to the first motion information and the reference image block corresponding to the second motion information are used as reference image blocks of the current image block, and the predicted image block of the current image block is obtained, and the current image block may be further encoded.
  • the predicted image block of the current image block performs at least one of transform, quantization, and entropy encoding to obtain bidirectional code stream data of the current image block.
  • the content of the subsequent one-way prediction is similar to this, and will not be described again.
  • bidirectional prediction of the current image block according to the first motion information and the second motion information may be replaced by the following scheme:
  • second motion information performing bidirectional prediction on the current image block according to the first motion information and the adjusted second motion information.
  • the first motion information is bidirectionally predicted according to the adjusted first motion information and the second motion information.
  • the method may further include: the bidirectional rate distortion cost is greater than the And a minimum of the first rate distortion cost and the second rate distortion cost, and when the first template distortion is less than or equal to the second template distortion, performing the current image block according to the first motion information Unidirectional prediction, thereby obtaining first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes code stream data that is encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates The encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list or the second motion information list.
  • the first unidirectional code stream data may further include encoded data of the current image block.
  • the encoded data of the current image block may be one-way prediction (for example, motion compensation) on the current image block, and further obtain data by at least one of transform, quantization, and entropy coding.
  • the encoded data obtained by unidirectional prediction in the following is similar to this content, and will not be described later.
  • the method may further include: at the bidirectional rate distortion cost being greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first template distortion is greater than
  • the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second unidirectional code stream data of the current image block, and the second unidirectional code stream
  • the data includes encoded into the prediction direction identification code stream data, and the value of the prediction direction identifier indicates that the encoded data of the current image block is compared to the current image block according to the first motion information list or the second motion information list. Make a one-way prediction.
  • the second unidirectional code stream data may further include encoded data of the current image block.
  • the method may further include: at the bidirectional rate distortion cost being greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first rate distortion cost When the second rate distortion cost is less than or equal to, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining first code stream data of the current image block, where the first code stream
  • the data includes code stream data that is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list.
  • the first code stream data may further include coded data of the current image block.
  • the method may further include: at the bidirectional rate distortion cost being greater than a minimum of the first rate distortion cost and the second rate distortion cost, and the first rate distortion cost
  • the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second code stream data of the current image block, where the second code stream data includes And predicting a direction identifier, where the value of the prediction direction identifier indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the second motion information list.
  • the second code stream data may further include encoded data of the current image block.
  • the scheme for predicting the value of the direction identifier may adopt the following coding scheme:
  • the bidirectional prediction indicates that the encoded data of the current image block is bidirectionally predicted according to the first motion information list of the current image block and the second motion information list of the current image block, and the forward prediction representation is performed.
  • the encoded data indicating the current image block is obtained by unidirectionally predicting a current image block according to a first motion information list of the current image block, and the backward prediction is performed by using the encoded data of the current image block according to the
  • the second motion information list of the current image block is obtained by unidirectional prediction of the current image block.
  • the value of the prediction direction identifier may be a bidirectional prediction value, for example, 2, and as the binarized value, the bidirectional prediction value may be '1'.
  • the value of the prediction direction identifier when forward prediction, may be a first unidirectional prediction value, for example, 0, and as a binarized value, the first unidirectional prediction value may be '00'.
  • the value of the prediction direction identifier may be a second unidirectional prediction value, for example, 1 as a binarized value, and the second unidirectional prediction value may be '01'.
  • the scheme for predicting the value of the direction identifier may also adopt another coding scheme as follows:
  • the non-bidirectional prediction indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list of the current image block or the second motion information list of the current image block.
  • the value of the prediction direction identifier when bidirectionally predicted, may be a bidirectional prediction value, for example, 0, and as a binarized value, the bidirectional prediction value may be '0'.
  • the value of the prediction direction identifier may be a non-bidirectional prediction value, for example, 1, and as a binarized value, the non-bidirectional prediction value may be '1'.
  • FIG. 6 is a schematic flowchart of a method for decoding based on template matching according to an embodiment of the present invention.
  • the method may be performed by the destination device 14, or may be performed by the video decoder 30, or may be performed by the prediction unit 81.
  • the method can include:
  • the prediction direction identifier may be a prediction direction identifier of the current image block, or may be a prediction direction identifier of a region where the current image block is located, or may be a prediction direction identifier of a frame where the current image block is located.
  • the prediction direction identifier is obtained only when a reference structure of a frame in which the current image block is located is a non-low delay reference structure (Non-LowDelay).
  • the method may further include: when the reference structure of the frame where the current image block is located is a non-low latency reference structure, and the value identified in the prediction direction indicates that the encoded data of the current image block is according to the current image block.
  • the motion information list performs bidirectional prediction on the current image block, the reconstructed image block of the current image block is obtained according to the first motion information list and the encoded data of the current image block.
  • obtaining the reconstructed image block of the current image block according to the first motion information list and the encoded data of the current image block may include: determining, according to the first motion information list, a motion information, a first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to a reference image block and a corresponding image corresponding to the motion information in the first motion information list Decoding the template of the current image block; obtaining the current image block according to the first motion information and the encoded data of the current image block Rebuild the image block.
  • the method may further include: when the reference structure of the frame where the current image block is located is a non-low latency reference structure, and the value identified in the prediction direction indicates that the encoded data of the current image block is according to the current image block.
  • the two motion information lists are bidirectionally predicted, the reconstructed image block of the current image block is obtained according to the second motion information list and the encoded data of the current image block.
  • obtaining the reconstructed image block of the current image block according to the second motion information list and the encoded data of the current image block may include: determining, according to the second motion information list, The second motion information, the first template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to the reference image block and the corresponding motion information in the second motion information list. Decoding the template of the current image block; and obtaining a reconstructed image block of the current image block according to the second motion information and the encoded data of the current image block.
  • the method may further include: when the reference structure of the frame where the current image block is located is a non-low latency reference structure, and the value identified in the prediction direction indicates that the encoded data of the current image block is according to the current
  • the first motion information list of the image block or the second motion information list of the current image block is unidirectionally predicted, the first motion information is determined according to the first motion information list, The first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to the reference image block corresponding to the motion information in the first motion information list and the template of the current image block Decoding; determining, according to the second motion information list, second motion information, where a second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to the second motion information
  • the reference image block corresponding to the motion information in the list is distorted with the template of the current image block; the distortion in the first template is less than When the second template is distorted, the reconstructed image block of the current image
  • the method may further include: according to the first motion information and the current image, when the bidirectional template distortion is greater than a template distortion threshold and the first template distortion is less than or equal to the second template distortion The encoded data of the block results in a reconstructed image block of the current image block.
  • the method may further include: when the bidirectional template distortion is greater than a template distortion threshold and the first template distortion is greater than the second template distortion, according to the second motion information and the current image block Encoding the data to obtain a reconstructed image block of the current image block.
  • the method may further include: when the reference structure of the frame where the current image block is located is a low delay (LowDelay) reference structure, determining the first motion information according to the first motion information list of the current image block, where The first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to the reference image block corresponding to the motion information in the first motion information list and the current image block.
  • LowDelay low delay
  • a template distortion determining, according to the second motion information list of the current image block, the second motion information, where the second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to Determining a reference image block corresponding to the motion information in the second motion information list and a template distortion of the current image block; determining, according to the first template distortion and the second template distortion, bidirectional to the current image block a predicted bidirectional template distortion; when the bidirectional template distortion is less than or equal to a template distortion threshold, according to the first motion information, The second motion information and the encoded data of the current image block to obtain the current image The reconstructed image block of the block, the template distortion threshold is obtained according to the first template distortion and the second template distortion.
  • the method may further include: according to the first motion information and the current image, when the bidirectional template distortion is greater than a template distortion threshold and the first template distortion is less than or equal to the second template distortion The encoded data of the block results in a reconstructed image block of the current image block.
  • the method may further include: when the bidirectional template distortion is greater than a template distortion threshold and the first template distortion is greater than the second template distortion, according to the second motion information and the current image block Encoding the data to obtain a reconstructed image block of the current image block.
  • the process of determining whether the reference structure of the frame in which the current image block is located is a low-latency reference structure or a non-low-latency reference structure may be specifically referred to the corresponding embodiment in FIG. Narration.
  • the value identified in the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the first motion information list of the current image block and the second motion information list of the current image block. Determining, according to the first motion information list, first motion information, where a first template distortion between a reference image block corresponding to the first motion information and the current image block is less than or equal to the first motion information list The reference image block corresponding to each of the motion information in the motion information is distorted with the template of the current image block.
  • the method may further include: determining a first motion information list of the current image block and a second motion information list of the current image block.
  • S603. Determine second motion information according to the second motion information list, where a second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to the second motion information.
  • the reference image block corresponding to the motion information in the list is distorted from the template of the current image block.
  • the obtaining the reconstructed image block of the current image block according to the first motion information, the second motion information, and the encoded data of the current image block may include:
  • the image block adds the predicted image block of the current image block and the residual image block to obtain a reconstructed image block of the current image block.
  • the method may further include: when the value of the prediction direction identifier indicates that the coded data of the current image block is bidirectionally predicted according to the first motion information list of the current image block, according to The first motion information list and the encoded data of the current image block obtain a reconstructed image block of the current image block.
  • the obtaining the reconstructed image block of the current image block according to the first motion information list and the encoded data of the current image block may include: determining, according to the first motion information list, first motion information, The first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to the reference image block corresponding to the motion information in the first motion information list and the template of the current image block Distortion; obtaining the location according to the first motion information and the encoded data of the current image block A reconstructed image block of the current image block.
  • the method may further include: when the value of the prediction direction identifier indicates that the coded data of the current image block is bidirectionally predicted according to the second motion information list of the current image block, according to The second motion information list and the encoded data of the current image block obtain a reconstructed image block of the current image block.
  • the method may further include: the value identified in the prediction direction indicates that the encoded data of the current image block is based on the first motion information list of the current image block or the current image block.
  • the second motion information list is unidirectionally predicted, the first motion information is determined according to the first motion information list, and the reference image block corresponding to the first motion information and the current image block
  • the first template distortion between the first template distortion is less than or equal to the reference image block corresponding to the motion information in the first motion information list and the template distortion of the current image block; determining the second motion according to the second motion information list Information, the second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to the reference image block corresponding to the motion information in the second motion information list, and the current a template distortion of the image block; according to the first template distortion when the first template distortion is less than or equal to the second template distortion Dynamic information and encoded data of the current image block to obtain a reconstructed image block of the current image block; or,
  • FIG. 7 is a schematic flowchart diagram of a coding method based on template matching according to an embodiment of the present invention.
  • the method may be performed by the source device 12, or may be performed by the video encoder 20, or may be performed by the prediction unit 41.
  • the method can include:
  • the method may further include: determining the first reference image list and the second reference image list.
  • the first reference image list and the second reference image list may be a reference image list of a frame in which the current image block is located, or may be a reference image list of a region in which the current image block is located, or may be a current image.
  • the first motion information is the first motion information of the current image block.
  • performing template matching in the reference image in the first reference image list refers to performing template matching on the template of the current image block in the reference image in the first reference image list.
  • And performing template matching on the current image block in the reference image in the first reference image list, so that obtaining the first motion information may include: determining, according to the first reference image list, first initial motion information of the current image block; And performing template matching on the reference image block around the reference image block corresponding to the first initial motion information in the region where the reference image block corresponding to the first initial motion information is located, according to the first initial motion information and the current image block,
  • the motion information with the smallest template distortion is used as the first motion information.
  • the template distortion here The minimum may refer to the minimum template distortion in the template distortion including the template distortion corresponding to the first initial motion information.
  • the determining, according to the first reference image list, the first initial motion information of the current image block may include: determining, according to the first reference image list, a first motion information list of the current image block, where the first motion information list is The motion information corresponding to each of the reference image blocks corresponding to the motion information and the template distortion of the template distortion of the current image block is used as the first initial motion information.
  • the template distortion corresponding to the first motion information is less than or equal to the template distortion corresponding to the first initial motion information.
  • the process of using the motion information with the minimum template distortion as the first motion information may also be referred to as: performing motion search in the region where the reference image block corresponding to the first initial motion information is located, and obtaining the first motion information, the process Can include:
  • the traversing all of the templates having the same size and shape as the template of the current image block calculating template distortion between the templates of the at least two templates and the current image block.
  • the motion information between the template that minimizes the template distortion and the template of the current image block is used as the first motion information.
  • the traversal order of the at least two templates may be traversed in a preset order.
  • the distance between adjacent ones of the at least two templates may be a preset length, such as an integer pixel or a non-integral pixel.
  • determining, according to the first reference image list, the first initial motion information of the current image block may include: determining, according to the first reference image list, a first motion information list of the current image block, the first motion The motion information corresponding to the template distortion in which the template distortion is the smallest in the information list is used as the first initial motion information.
  • the second reference image list, the second motion information, and the template matching of the current image block in the reference image in the second reference image list, thereby obtaining the operation of the second motion information and the first reference image The list, the first motion information, and the template matching of the current image block in the reference image in the first reference image list, so that the content of the operation of obtaining the first motion information is similar, and details are not described herein again.
  • determining the bidirectional rate distortion according to the first motion information and the second motion information only when a reference structure of a frame in which the current image block is located is a non-low delay reference structure The cost, the first rate distortion penalty, and the second rate distortion cost.
  • the method may further include: a reference structure of a frame in which the current image block is located is a non-low latency reference structure, and the bidirectional rate distortion cost, the first rate distortion cost, and The second rate distortion penalty does not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost satisfy a first unidirectional rate distortion condition, according to the first motion information pair Performing unidirectional prediction on the current image block to obtain first code stream data of the current image block, where the first code stream data includes code stream data that is encoded in a prediction direction identifier, and the value of the prediction direction identifier
  • the encoded data indicating the current image block is obtained by unidirectionally predicting the current image block according to the first reference image list, and the first code stream data packet is obtained.
  • the encoded data of the current image block is included.
  • the first unidirectional rate distortion condition may include the first rate distortion cost being less than or equal to the second rate distortion cost.
  • the method may further include: a reference structure of a frame in which the current image block is located is a non-low latency reference structure, and the bidirectional rate distortion cost, the first rate distortion cost, and The second rate distortion cost does not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost satisfy a second unidirectional rate distortion condition, according to the second motion information pair
  • the current image block performs unidirectional prediction to obtain second code stream data of the current image block, where the second code stream data includes code stream data that is encoded in the prediction direction identifier, and the value of the prediction direction identifier Representing that the current image block is obtained by unidirectionally predicting the current image block according to the second reference image list, and the second code stream data includes encoded data of the current image block.
  • the second unidirectional rate distortion condition may include the first rate distortion cost being greater than the second rate distortion cost.
  • the first rate distortion cost and the second rate distortion cost satisfying the second unidirectional rate distortion condition may be that the first rate distortion cost and the second rate distortion cost do not satisfy the first unidirectional rate distortion condition.
  • the method may further include: a reference structure of a frame in which the current image block is located is a non-low latency reference structure, and the bidirectional rate distortion cost, the first rate distortion cost, and The second rate distortion penalty does not satisfy the bidirectional rate distortion condition, and when the first template distortion and the second template distortion satisfy a first one-way template distortion condition, the The current image block performs unidirectional prediction to obtain first unidirectional code stream data of the current image block, and the first unidirectional code stream data includes code stream data that is encoded into the prediction direction identifier, and the prediction direction identifier
  • the value of the data of the current image block is obtained by performing unidirectional prediction on the current image block according to the first reference image list or the second reference image list, where the first unidirectional code stream data includes The encoded data of the current image block.
  • the first unidirectional template distortion condition may include the first template distortion being less than or equal to the second template distortion.
  • the method may further include: a reference structure of a frame in which the current image block is located is a non-low latency reference structure, and the bidirectional rate distortion cost, the first rate distortion cost, and The second rate distortion cost does not satisfy the bidirectional rate distortion condition, and when the first template distortion and the second template distortion satisfy a second one-way template distortion condition, the The current image block performs unidirectional prediction to obtain second unidirectional code stream data of the current image block, and the second unidirectional code stream data includes code stream data that is encoded into the prediction direction identifier, and the prediction direction identifier
  • the value of the data of the current image block is obtained by unidirectionally predicting the current image block according to the first reference image list or the second reference image list, where the second unidirectional code stream data includes The encoded data of the current image block.
  • the second unidirectional template distortion condition may include the first template distortion being greater than the second template distortion.
  • satisfying the second one-way template distortion condition may be that the first one-way template distortion condition is not satisfied.
  • the method may further include: when the reference structure of the frame in which the current image block is located is a low-latency reference structure, the template and the second reference image block corresponding to the first motion information a template of the reference image block corresponding to the motion information, determining bidirectional template distortion for bidirectional prediction of the current image block; satisfying the bidirectional template distortion condition in the bidirectional template distortion, the first template distortion, and the second template distortion And performing bidirectional prediction on the current image block according to the first motion information and the second motion information, thereby obtaining encoded data of the current image block.
  • the method may further include: losing in the two-way template True, the first template distortion and the second template distortion do not satisfy the bidirectional template distortion condition, and when the first template distortion and the second template distortion satisfy a first one-way template distortion condition, The first motion information performs unidirectional prediction on the current image block, thereby obtaining encoded data of the current image block; or, in the bidirectional template distortion, the first template distortion, and the second template distortion When the two-way template distortion condition is satisfied, and the first template distortion is that the second template distortion satisfies the second one-way template distortion condition, the current image block is unidirectionally predicted according to the second motion information, thereby The encoded data of the current image block is obtained.
  • the template of the reference image block corresponding to the first motion information and the first template distortion are determined. While determining the second motion information, the template of the reference image block corresponding to the second motion information and the second template distortion are determined.
  • the value of the bidirectional template distortion may be an absolute error sum of the template of the current image block and the bidirectional template
  • the bidirectional template is a template of the reference image block corresponding to the first motion information and a reference image block corresponding to the second motion information.
  • the template weighted sum for example, the bidirectional template may be half of the sum of the template of the reference image block corresponding to the first motion information and the template of the reference image block corresponding to the second motion information.
  • the acquisition manner of the bidirectional template distortion in the embodiment may also be the acquisition manner of the bidirectional template distortion in the embodiment of FIG. 4 .
  • the bidirectional template distortion condition may include that the bidirectional template distortion is less than or equal to a template distortion threshold, and the template distortion threshold may be obtained according to the first template distortion and the second template distortion.
  • the template distortion threshold may be a minimum of the first template distortion and the second template distortion.
  • the template distortion threshold may also be a value obtained by multiplying a minimum of the first template distortion and the second template distortion by a preset coefficient, which may be any real number greater than or equal to 1 and less than or equal to 3, such as 2 or 1.25. . S703.
  • the image block performs bidirectional prediction to obtain bidirectional code stream data of the current image block, the bidirectional code stream data includes code stream data encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates the current image block.
  • the encoded data is obtained by bidirectional prediction according to the first reference image list and the second reference image list, and the bidirectional code stream data includes encoded data of the current image block.
  • the prediction in this embodiment may be referred to as motion compensation or motion compensation prediction.
  • the unidirectional prediction may be referred to as unidirectional motion compensation or unidirectional motion compensation prediction
  • the bidirectional prediction may be referred to as bidirectional motion compensation prediction or bidirectional motion compensation. .
  • the bidirectional rate distortion condition may include the bidirectional rate distortion cost being less than or equal to a minimum of the first rate distortion cost and the second rate distortion cost.
  • the method may further include: the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost not satisfying the bidirectional rate distortion condition, and the When the first rate distortion condition and the second rate distortion cost satisfy the first unidirectional rate distortion condition, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining the first image block.
  • Code stream data the first code stream data includes code stream data encoded in a prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is compared to the current image according to a first reference image list.
  • the block is obtained by unidirectional prediction,
  • the first code stream data includes encoded data of the current image block.
  • the method may further include: the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost not satisfying the bidirectional rate distortion condition, and the When the rate distortion cost and the second rate distortion cost satisfy the second unidirectional rate distortion condition, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining the second image block.
  • Code stream data the second code stream data includes code stream data encoded in a prediction direction, and the value of the prediction direction identifier indicates that the current image block is paired with the current image block according to the second reference image list Obtaining unidirectional prediction, the second code stream data includes encoded data of the current image block.
  • the method may further include: the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost not satisfying the bidirectional rate distortion condition, and the When a template distortion and the second template distortion satisfy a first one-way template distortion condition, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining a first one-way of the current image block.
  • Code stream data, the first unidirectional code stream data includes code stream data encoded in a prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first reference image list or
  • the second reference image list is obtained by unidirectionally predicting the current image block, and the first unidirectional code stream data includes encoded data of the current image block.
  • the method may further include: the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost not satisfying the bidirectional rate distortion condition, and the When a template distortion and the second template distortion satisfy a second one-way template distortion condition, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining a second one-way of the current image block.
  • Code stream data, the second unidirectional code stream data includes code stream data encoded in a prediction direction, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first reference image list or The second reference image list is obtained by unidirectionally predicting the current image block, and the second unidirectional code stream data includes encoded data of the current image block.
  • the scheme for predicting the value of the direction identifier may adopt the following coding scheme:
  • the bidirectional prediction indicates that the encoded data of the current image block is bidirectionally predicted according to the first reference image list and the second reference image list, and the forward prediction representation represents an encoding of the current image block.
  • the data is obtained by performing unidirectional prediction on the current image block according to the first reference image list, and the backward prediction is performed by performing unidirectional prediction on the current image block according to the second reference image list.
  • the value of the prediction direction identifier may be a bidirectional prediction value, for example, 2, and as the binarized value, the bidirectional prediction value may be '1'.
  • the value of the prediction direction identifier when forward prediction, may be a first unidirectional prediction value, for example, 0, and as a binarized value, the first unidirectional prediction value may be '00'.
  • the value of the prediction direction identifier may be a second one-way prediction value,
  • the second unidirectional prediction value may be '01'.
  • the scheme for predicting the value of the direction identifier may also adopt another coding scheme as follows:
  • the non-bidirectional prediction indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the first reference image list or the second reference image list.
  • the value of the prediction direction identifier when bidirectionally predicted, may be a bidirectional prediction value, for example, 0, and as a binarized value, the bidirectional prediction value may be '0'.
  • the value of the prediction direction identifier may be a non-bidirectional prediction value, for example, 1, and as a binarized value, the non-bidirectional prediction value may be '1'.
  • FIG. 8 is a schematic flowchart diagram of a coding method based on template matching according to an embodiment of the present invention.
  • the method may be performed by the source device 12, or may be performed by the video encoder 20, or may be performed by the prediction unit 41.
  • the method can include:
  • S803. Determine whether the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost satisfy a bidirectional rate distortion condition. When satisfied, S804 is performed, and when not satisfied, S805 is performed.
  • S805. Determine whether the first rate distortion cost and the second rate distortion cost satisfy the first unidirectional rate distortion condition. When satisfied, S806 is performed, and when not satisfied, S807 is performed.
  • S807 Perform unidirectional prediction on the current image block according to the second motion information, to obtain second code stream data of the current image block, where the second code stream data includes a code that is encoded into a prediction direction identifier.
  • the value of the prediction direction identifier indicates that the current image block is obtained by unidirectionally predicting the current image block according to the second reference image list, and the second code stream data includes the current image block. Encoded data. End the process.
  • FIG. 9 is a schematic flowchart diagram of a coding method based on template matching according to an embodiment of the present invention.
  • the method may be performed by the source device 12, or may be performed by the video encoder 20, or may be performed by the prediction unit 41.
  • the method can include:
  • S901 Perform template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, and performing template matching on the current image block in the reference image in the second reference image list. , thereby obtaining second motion information.
  • S902 Determine whether the reference structure of the frame where the current image block is located is a non-low delay reference structure or a bit low delay reference structure.
  • S903 When the reference structure of the frame where the current image block is located is a non-low delay reference structure, perform S903, where When the reference structure of the frame in which the current image block is located is a low-latency reference structure, S909 is performed.
  • S904 Determine whether the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost satisfy a bidirectional rate distortion condition. When satisfied, S905 is performed, and when not satisfied, S906 is performed.
  • S905 Perform bidirectional prediction on the current image block according to the first motion information and the second motion information, to obtain bidirectional code stream data of the current image block, where the bidirectional code stream data includes a predicted prediction.
  • Direction coded code stream data the value of the prediction direction identifier indicating that the coded data of the current image block is bidirectionally predicted according to the first reference image list and the second reference image list, the bidirectional code stream data
  • the encoded data of the current image block is included. End the process.
  • S906. Determine whether the first rate distortion cost and the second rate distortion cost satisfy the first unidirectional rate distortion condition. When satisfied, execute S907, and if not, perform S908.
  • S907 Perform unidirectional prediction on the current image block according to the first motion information, to obtain first code stream data of the current image block, where the first code stream data includes a code that is encoded into a prediction direction identifier.
  • the value of the prediction direction identifier indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to a first reference image list, and the first code stream data includes the current image block. Encoded data. End the process.
  • S909 Determine a bidirectional template distortion for bidirectional prediction of the current image block according to the template of the reference image block corresponding to the first motion information and the template of the reference image block corresponding to the second motion information.
  • S912. Determine whether the first template distortion and the second template distortion satisfy the first one-way template distortion condition. When yes, execute S913. If not, perform S914.
  • FIG. 9 is a schematic flowchart diagram of a coding method based on template matching according to an embodiment of the present invention.
  • the method may be performed by the source device 12, or may be performed by the video encoder 20, or may be performed by the prediction unit 41.
  • the method can include:
  • S1001 Perform template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, and performing template matching on the current image block in the reference image in the second reference image list. , thereby obtaining second motion information.
  • S1002 determining whether the reference structure of the frame where the current image block is located is a non-low delay reference structure or a bit low delay reference structure. When the reference structure of the frame where the current image block is located is a non-low delay reference structure, executing S1003, When the reference structure of the frame where the current image block is located is a low-latency reference structure, S1009 is performed.
  • S1004 Determine whether the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost satisfy a bidirectional rate distortion condition. When satisfied, S1005 is performed, and when not satisfied, S1006 is performed.
  • S1005 Perform bidirectional prediction on the current image block according to the first motion information and the second motion information, to obtain bidirectional code stream data of the current image block, where the bidirectional code stream data includes being encoded into a prediction.
  • Direction coded code stream data the value of the prediction direction identifier indicating that the coded data of the current image block is bidirectionally predicted according to the first reference image list and the second reference image list, the bidirectional code stream data
  • the encoded data of the current image block is included. End the process.
  • S1006. Determine whether the first template distortion and the second template distortion satisfy the first one-way template distortion condition. When satisfied, execute S1007. If not, perform S1008.
  • S1007 Perform unidirectional prediction on the current image block according to the first motion information, to obtain first unidirectional code stream data of the current image block, where the first unidirectional code stream data includes a predicted prediction.
  • Direction coded code stream data wherein the value of the prediction direction identifier indicates that the coded data of the current image block is unidirectionally predicted according to the first reference image list or the second reference image list.
  • the first unidirectional code stream data includes encoded data of the current image block. End the process.
  • S1008 Perform unidirectional prediction on the current image block according to the second motion information, to obtain second unidirectional code stream data of the current image block, where the second unidirectional code stream data includes a predicted prediction.
  • Direction coded code stream data wherein the value of the prediction direction identifier indicates that the coded data of the current image block is unidirectionally predicted according to the first reference image list or the second reference image list.
  • the second unidirectional code stream data includes encoded data of the current image block. End the process.
  • S1009 Determine bidirectional template distortion for bidirectional prediction of the current image block according to the template of the reference image block corresponding to the first motion information and the template of the reference image block corresponding to the second motion information.
  • S1010 Determine whether the bidirectional template distortion, the first template distortion, and the second template distortion satisfy a bidirectional template distortion condition, and execute S1011 when satisfied, and execute S1012 when not satisfied.
  • S1011 Perform bidirectional prediction on the current image block according to the first motion information and the second motion information, to obtain encoded data of the current image block. End the process.
  • S1012 Determine whether the first template distortion and the second template distortion satisfy the first one-way template distortion condition. When satisfied, S1013 is performed, and when not satisfied, S1014 is performed.
  • S1013 Perform unidirectional prediction on the current image block according to the first motion information, thereby obtaining encoded data of the current image block. End the process.
  • S1014 Perform unidirectional prediction on the current image block according to the second motion information, to obtain encoded data of the current image block. End the process.
  • FIG. 11 is a schematic flowchart diagram of a decoding method according to an embodiment of the present invention.
  • the method may be performed by the destination device 14, or may be performed by the video decoder 30, or may be performed by the prediction unit 81.
  • the method can include:
  • S1101 Acquire a prediction direction identifier of a current image block and encoded data of the current image block.
  • the prediction direction identifier is acquired only when a reference structure of a frame in which the current image block is located is a non-low delay reference structure.
  • the obtaining the prediction direction identifier of the current image block and the encoded data of the current image block may include: acquiring code stream data of the current image block, parsing the code stream data, and acquiring the prediction direction identifier of the current image block and the current image.
  • the value of the prediction direction identifier may be directly written to the code stream data, or may be encoded (for example, entropy encoded) and then written into the code stream data.
  • the method may further include: when the reference structure of the frame in which the current image block is located is a low-latency reference structure, the current image block is in a reference image in the first reference image list Performing template matching, thereby obtaining first motion information, a template of a reference image block corresponding to the first motion information, and a first template distortion between the reference image block corresponding to the first motion information and the current image block, Performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining the second motion letter a template of the reference image block corresponding to the second motion information and a second template distortion between the reference image block corresponding to the second motion information and the current image block; corresponding to the first motion information Determining bidirectional template distortion for bidirectional prediction of the current image block by using a template of the reference image block and a template of the reference image block corresponding to the second motion information; the bidirectional template distortion, the first template distortion, and the first When the two template distortions satisfy the bidirectional template distortion condition, the re
  • the method may further include: the bidirectional template distortion, the first template distortion, and the second template distortion do not satisfy the bidirectional template distortion condition, and the first template distortion and the second template When the distortion satisfies the first unidirectional template distortion condition, the reconstructed image block of the current image block is obtained according to the first motion information and the encoded data of the current image block; or, in the bidirectional template distortion, the The first template distortion and the second template distortion do not satisfy the bidirectional template distortion condition, and the first template distortion when the second template distortion satisfies the second one-way template distortion condition, according to the second motion information And the encoded data of the current image block, to obtain a reconstructed image block of the current image block.
  • the bidirectional template distortion condition may include that the bidirectional template distortion is less than or equal to a template distortion threshold, and the template distortion threshold may be obtained according to the first template distortion and the second template distortion.
  • the template distortion threshold may be a minimum of the first template distortion and the second template distortion.
  • the template distortion threshold may also be a value obtained by multiplying a minimum of the first template distortion and the second template distortion by a preset coefficient, which may be any real number greater than or equal to 1 and less than or equal to 3, such as 2 or 1.25. .
  • the first unidirectional template distortion condition may include the first template distortion being less than or equal to the second template distortion.
  • the second unidirectional template distortion condition may include the first template distortion being greater than the second template distortion.
  • satisfying the second one-way template distortion condition may be that the first one-way template distortion condition is not satisfied.
  • the value identified in the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list, and the current image is obtained.
  • Blocking performing template matching in the reference image in the first reference image list, thereby obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining the second Motion information; obtaining a reconstructed image block of the current image block according to the first motion information, the second motion information, and the encoded data of the current image block.
  • the template matching is performed on the current image block in the reference image in the first reference image list, thereby obtaining the first motion information
  • the current image block is templated in the reference image in the second reference image list.
  • the second motion information refer to the descriptions in FIG. 1 to FIG. 10 above, and details are not described herein again.
  • the motion information, the second motion information, and the encoded data of the current image block are used to obtain an implementation of the reconstructed image block of the current image block.
  • FIG. 1 to FIG. 10 refer to the descriptions in FIG. 1 to FIG. 10 above, and details are not described herein again.
  • the method may further include:
  • the value identified in the prediction direction indicates that the current image block is unidirectionally predicted according to the reference image in the first reference image list according to the encoded data of the current image block, and is currently
  • the image block performs template matching in the reference image in the first reference image list, thereby obtaining first motion information, and obtaining the current image block according to the first motion information and the encoded data of the current image block. Rebuild the image block.
  • the method may further include:
  • the value identified in the prediction direction indicates that the current image block is unidirectionally predicted according to the reference image in the second reference image list according to the encoded data of the current image block, and the current image block is obtained. Performing template matching in the reference image in the second reference image list, thereby obtaining second motion information, and obtaining a reconstructed image of the current image block according to the second motion information and the encoded data of the current image block Piece.
  • the method may further include:
  • the value identified in the prediction direction indicates that the current image block is compared to the current image according to the reference image in the first reference image list or the reference image in the second reference image list according to the encoded data of the current image block.
  • the current image block is template-matched in the reference image in the first reference image list, thereby obtaining first motion information, and the current image block is in the second reference image list.
  • Performing template matching in the reference image to obtain second motion information a first template distortion between the reference image block corresponding to the first motion information and the current image block and a reference image corresponding to the second motion information
  • the second template distortion between the block and the current image block satisfies the first unidirectional template distortion condition
  • the reconstructed image of the current image block is obtained according to the first motion information and the encoded data of the current image block.
  • FIG. 12 is a schematic flowchart diagram of a decoding method according to an embodiment of the present invention.
  • the method may be performed by the destination device 14, or may be performed by the video decoder 30, or may be performed by the prediction unit 81.
  • the method can include:
  • S1201 Acquire a prediction direction identifier of a current image block and encoded data of the current image block.
  • the value identified in the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list, and the current image is obtained.
  • Blocking performing template matching in the reference image in the first reference image list, thereby obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining the second Motion information; obtaining a reconstructed image block of the current image block according to the first motion information, the second motion information, and the encoded data of the current image block. End the process.
  • the value identified in the prediction direction indicates that the coded data of the current image block is unidirectionally predicted according to the reference image in the first reference image list, and the current image block is in the Template matching is performed in the reference image in the first reference image list, thereby obtaining first motion information, and the reconstructed image block of the current image block is obtained according to the first motion information and the encoded data of the current image block. End the process.
  • the value identified in the prediction direction indicates that the coded data of the current image block is unidirectionally predicted according to the reference image in the second reference image list, and the current image block is in the Template matching is performed in the reference image in the second reference image list, thereby obtaining second motion information, and the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block. End the process.
  • FIG. 13 is a schematic flowchart diagram of a decoding method according to an embodiment of the present invention.
  • the method may be performed by the destination device 14, or may be performed by the video decoder 30, or may be performed by the prediction unit 81.
  • the method can include:
  • S1302 determining whether the reference structure of the frame where the current image block is located is a non-low delay reference structure or a bit low delay reference structure, and when the reference structure of the frame where the current image block is located is a non-low delay reference structure, executing S1303, When the reference structure of the frame in which the current image block is located is a low-latency reference structure, S1307 is performed.
  • the value identified in the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list, and the current image is obtained.
  • Blocking performing template matching in the reference image in the first reference image list, thereby obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining the second Motion information; obtaining a reconstructed image block of the current image block according to the first motion information, the second motion information, and the encoded data of the current image block. End the process.
  • the value identified in the prediction direction indicates that the coded data of the current image block is unidirectionally predicted according to the reference image in the first reference image list, and the current image block is in the Template matching is performed in the reference image in the first reference image list, thereby obtaining first motion information, and the reconstructed image block of the current image block is obtained according to the first motion information and the encoded data of the current image block. End the process.
  • the value identified in the prediction direction indicates that the coded data of the current image block is unidirectionally predicted according to the reference image in the second reference image list, and the current image block is in the Template matching is performed in the reference image in the second reference image list, thereby obtaining second motion information, and the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block. End the process.
  • S1307 Perform template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, a template of the reference image block corresponding to the first motion information, and the first motion information. Correlating a first template between the corresponding reference image block and the current image block, and performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining second motion information, the first a template of a reference image block corresponding to the second motion information and a reference image block corresponding to the second motion information and the current map Determining a second template between the blocks; determining a bidirectional template for bidirectional prediction of the current image block according to the template of the reference image block corresponding to the first motion information and the template of the reference image block corresponding to the second motion information distortion.
  • S1308 Determine whether the bidirectional template distortion, the first template distortion, and the second template distortion satisfy a bidirectional template distortion condition. When satisfied, S1309 is performed, and when not satisfied, S1310 is performed.
  • S1310 Determine whether the first template distortion and the second template distortion satisfy the first one-way template distortion condition. When satisfied, S1311 is performed, and when not satisfied, S1012 is performed.
  • S1312 Obtain a reconstructed image block of the current image block according to the second motion information and the encoded data of the current image block. End the process.
  • FIG. 14 is a schematic flowchart diagram of a decoding method according to an embodiment of the present invention.
  • the method may be performed by the destination device 14, or may be performed by the video decoder 30, or may be performed by the prediction unit 81.
  • the method can include:
  • S1402 determining whether the reference structure of the frame where the current image block is located is a non-low delay reference structure or a bit low delay reference structure. When the reference structure of the frame where the current image block is located is a non-low delay reference structure, executing S1403, When the reference structure of the frame where the current image block is located is a low-latency reference structure, S1409 is performed.
  • the value identified in the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list, and the current image is obtained.
  • Blocking performing template matching in the reference image in the first reference image list, thereby obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining the second Motion information; obtaining a reconstructed image block of the current image block according to the first motion information, the second motion information, and the encoded data of the current image block. End the process.
  • the value identified in the prediction direction indicates that the encoded data of the current image block is performed on the current image block according to a reference image in the first reference image list or a reference image in the second reference image list.
  • the current image block is template-matched in the reference image in the first reference image list, thereby obtaining the first motion information, and the reference image of the current image block in the second reference image list. Template matching is performed to obtain second motion information.
  • S1406 Determine a first template distortion corresponding to the first motion information and a first template distortion between the current image block and a second image between the reference image block corresponding to the second motion information and the current image block. Whether the template distortion satisfies the first one-way template distortion condition, when satisfied, S1407 is executed, and when not satisfied, S1408 is executed.
  • S1410 Determine whether the bidirectional template distortion, the first template distortion, and the second template distortion satisfy a bidirectional template distortion condition. When satisfied, S1411 is performed, and when not satisfied, S1412 is performed.
  • S1412 It is determined whether the first template distortion and the second template distortion satisfy the first one-way template distortion condition. When satisfied, S1413 is performed, and when not satisfied, S1414 is performed.
  • an embodiment of the present invention provides an encoding apparatus 1500, where the apparatus includes a matching unit 1501, a determining unit 1502, and a prediction unit 1503, where
  • the matching unit 1501 is configured to determine, according to the first motion information list of the current image block, the first motion information, where the first template distortion between the reference image block corresponding to the first motion information and the current image block is smaller than Or equal to a reference image block corresponding to the motion information in the first motion information list and a template distortion of the current image block; determining second motion information according to the second motion information list of the current image block, The second template distortion between the reference image block corresponding to the second motion information and the current image block is less than or equal to the reference image block corresponding to the motion information in the second motion information list and the template of the current image block distortion.
  • the matching unit 1501 may be configured to: move the reference image block corresponding to the motion information in the first motion information list to the minimum template distortion of the template distortion of the current image block.
  • the information is used as the first initial motion information; performing a motion search in an area where the reference image block corresponding to the first initial motion information is located, to obtain the first motion information;
  • a determining unit 1502 configured to determine bidirectional motion according to the first motion information and the second motion information a bidirectional rate distortion cost of the bidirectional prediction corresponding to the information, a first rate distortion cost of the unidirectional prediction corresponding to the first motion information, and a second rate distortion cost of the unidirectional prediction corresponding to the second motion information, the bidirectional
  • the motion information includes the first motion information and the second motion information.
  • the determining unit 1502 can be used to:
  • a prediction unit 1503 configured to: according to the first motion information and the second motion, when the bidirectional rate distortion cost is less than or equal to a minimum of the first rate distortion cost and the second rate distortion cost
  • the information is bidirectionally predicted by the current image block to obtain bidirectional code stream data of the current image block, where the bidirectional code stream data includes code stream data that is encoded in a prediction direction identifier, and the value of the prediction direction identifier is represented by
  • the encoded data of the current image block is obtained by bidirectionally predicting the current image block according to the first motion information list and the second motion information list.
  • the prediction unit 1503 can also be used to:
  • the first motion information performs unidirectional prediction on the current image block, thereby obtaining first code stream data of the current image block, where the first code stream data includes code stream data that is encoded in a prediction direction identifier,
  • the value of the prediction direction identifier indicates that the encoded data of the current image block is obtained by unidirectionally predicting the current image block according to the first motion information list.
  • the prediction unit 1503 may be further configured to: at the minimum value of the two-rate rate distortion cost being greater than the first rate distortion cost and the second rate distortion cost, and When the first rate distortion cost is greater than the second rate distortion cost, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second code stream data of the current image block,
  • the second code stream data includes code stream data that is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates that the coded data of the current image block is unidirectional to the current image block according to the second motion information list. Forecasted.
  • the prediction unit 1503 is further configured to: at the minimum value of the two-rate rate distortion cost being greater than the first rate distortion cost and the second rate distortion cost, and the When a template distortion is less than or equal to the second template distortion, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining first unidirectional code stream data of the current image block,
  • the first unidirectional code stream data includes code stream data that is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first motion information list or the second motion information.
  • the list is obtained by unidirectionally predicting the current image block.
  • the prediction unit 1503 may be further configured to: at the minimum value of the two-rate rate distortion cost being greater than the first rate distortion cost and the second rate distortion cost, and When the first template distortion is greater than the second template distortion, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second unidirectional code stream data of the current image block,
  • the second unidirectional code stream data includes code stream data that is coded into the prediction direction identifier, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first motion information list or the second motion information. List makes a single for the current image block Obtained from the forecast.
  • the prediction unit 1503 may be further configured to: when the reference structure of the frame where the current image block is located is a low-latency reference structure, according to the first template distortion and the second template Distortion, determining bidirectional template distortion for bidirectional prediction of the current image block; and when the bidirectional template distortion is less than or equal to a template distortion threshold, the current image is compared according to the first motion information and the second motion information The block performs bidirectional prediction to obtain encoded data of the current image block, and the template distortion threshold is obtained according to the first template distortion and the second template distortion.
  • the prediction unit 1503 is further configured to: when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is less than or equal to the second template distortion, the current image block is compared according to the first motion information. Bidirectional prediction is performed to obtain encoded data of the current image block.
  • the prediction unit 1503 is further configured to: perform bidirectional prediction on the current image block according to the second motion information when the bidirectional template distortion is greater than a template distortion threshold, and the first template distortion is greater than the second template distortion Thereby obtaining encoded data of the current image block.
  • an embodiment of the present invention provides a decoding apparatus 1600, where the apparatus includes an obtaining unit 1601 and a reconstruction unit 1602, where
  • the obtaining unit 1601 is configured to acquire the prediction direction identifier and the encoded data of the current image block.
  • the obtaining unit 1601 may be configured to: obtain the prediction direction identifier only when the reference structure of the frame where the current image block is located is a non-low delay reference structure.
  • the reconstruction unit 1602 is configured to: at the value indicated by the prediction direction, the encoded data of the current image block is performed on the current image block according to the first motion information list of the current image block and the second motion information list of the current image block.
  • the bidirectional prediction is obtained, determining, according to the first motion information list, the first motion information, where the first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to the first a reference image block corresponding to the motion information in a motion information list and a template distortion of the current image block; determining, according to the second motion information list, second motion information, the reference image block corresponding to the second motion information The second template distortion between the current image block is less than or equal to the reference image block corresponding to the motion information in the second motion information list and the template distortion of the current image block; according to the first motion information And the second motion information and the encoded data of the current image block to obtain a reconstructed image block of the current image block .
  • the reconstruction unit 1602 can also be used to:
  • the value of the prediction direction indicates that the encoded data of the current image block is unidirectionally predicted according to the first motion information list of the current image block, according to the first motion information list. And the encoded data of the current image block to obtain a reconstructed image block of the current image block;
  • the reconstruction unit 1602 may be further configured to: the value indicated by the prediction direction indicates that the encoded data of the current image block is unidirectionally predicted according to the second motion information list of the current image block. And reconstructing an image block of the current image block according to the second motion information list and the encoded data of the current image block.
  • the reconstruction unit 1602 can also be configured to: the value identified in the prediction direction When the encoded data of the current image block is unidirectionally predicted according to the first motion information list of the current image block or the second motion information list of the current image block, according to the a motion information list, the first motion information is determined, and the first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to the motion information in the first motion information list.
  • Corresponding reference image block and template splicing of the current image block determining, according to the second motion information list, second motion information, between the reference image block corresponding to the second motion information and the current image block
  • the second template distortion is less than or equal to a reference image block corresponding to the motion information in the second motion information list and a template distortion of the current image block
  • the first template distortion is less than or equal to the second template distortion
  • the first template is greater than a second template distortion of said distortion, based on the second motion information and encoded data of said current image block to obtain a reconstructed image block of the current image block.
  • the reconstruction unit 1602 may be further configured to determine, according to the first motion information list of the current image block, when the reference structure of the frame where the current image block is located is a low-latency reference structure a motion information, a first template distortion between the reference image block corresponding to the first motion information and the current image block is less than or equal to a reference image block and a corresponding image corresponding to the motion information in the first motion information list a template distortion of the current image block; determining second motion information according to the second motion information list of the current image block, the second template between the reference image block corresponding to the second motion information and the current image block The distortion is less than or equal to a reference image block corresponding to the motion information in the second motion information list and a template distortion of the current image block; determining, according to the first template distortion and the second template distortion, Two-way template distortion for bidirectional prediction of a current image block; when the bidirectional template distortion is less than or equal to a template distortion threshold, Deriving the first motion information list, the second motion
  • the reconstruction unit 1602 may be further configured to: when the first template distortion is less than or equal to the second template distortion, obtain the current image block according to the first motion information list and the encoded data of the current image block. Rebuild the image block.
  • the reconstruction unit 1602 may be further configured to: when the first template distortion is greater than the second template distortion, obtain a reconstructed image of the current image block according to the second motion information list and the encoded data of the current image block. Piece.
  • an embodiment of the present invention provides an encoding apparatus 1700, where the apparatus includes a matching unit 1701, a determining unit 1702, and a prediction unit 1703, where
  • the matching unit 1701 is configured to perform template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, and using a reference image of the current image block in the second reference image list Template matching is performed to obtain second motion information.
  • a determining unit 1702 configured to determine, according to the first motion information and the second motion information, a bidirectional rate distortion cost of the bidirectional prediction corresponding to the bidirectional motion information, and a first rate of the unidirectional prediction corresponding to the first motion information a distortion cost and a second rate distortion penalty of the unidirectional prediction corresponding to the second motion information, the bidirectional motion information including the first motion information and the second motion information.
  • the prediction unit 1703 according to the first motion information and the second motion information, when the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost satisfy a bidirectional rate distortion condition
  • the current image block is bidirectionally predicted to obtain bidirectional code stream data of the current image block
  • the bidirectional code stream data includes code stream data that is encoded in a prediction direction identifier
  • the value of the prediction direction identifier indicates the current
  • the encoded data of the image block is obtained bidirectionally predicted according to the first reference image list and the second reference image list, the bidirectional code stream data including encoded data of the current image block.
  • the prediction unit 1703 is further configured to:
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost satisfy a unidirectional rate distortion condition, performing unidirectional prediction on the current image block according to the first motion information, thereby obtaining first code stream data of the current image block, where the first code stream data includes Entering the code stream data of the prediction direction, the value of the prediction direction identifier indicating that the coded data of the current image block is obtained by unidirectionally predicting the current image block according to the first reference image list, the first code stream data Include encoded data of the current image block;
  • the prediction unit 1703 is further configured to:
  • the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, and the first rate distortion cost and the second rate distortion cost satisfy
  • the unidirectional rate distortion condition is performed, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining second code stream data of the current image block, where the second code stream data includes Entering the code stream data of the prediction direction, the value of the prediction direction identifier indicates that the current image block is obtained by unidirectionally predicting the current image block according to the second reference image list, and the second code stream data includes The encoded data of the current image block.
  • the determining unit 1702 may be configured to: according to the first motion information and the second, only when a reference structure of a frame in which the current image block is located is a non-low delay reference structure
  • the motion information determines the two-way rate distortion cost, the first rate distortion cost, and the second rate distortion cost.
  • the prediction unit 1703 is further configured to: when the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, And when the first template distortion and the second template distortion satisfy the first unidirectional template distortion condition, the current image block is unidirectionally predicted according to the first motion information, thereby obtaining the current image block.
  • the first unidirectional code stream data includes code stream data that is encoded in a prediction direction identifier, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first
  • the reference image list or the second reference image list is obtained by unidirectionally predicting the current image block, where the first unidirectional code stream data includes encoded data of the current image block;
  • the prediction unit 1703 is further configured to: when the bidirectional rate distortion cost, the first rate distortion cost, and the second rate distortion cost do not satisfy the bidirectional rate distortion condition, And when the first template distortion and the second template distortion satisfy the second unidirectional template distortion condition, the current image block is unidirectionally predicted according to the second motion information, thereby obtaining the current image block.
  • the second unidirectional code stream data, the second unidirectional code stream data includes code stream data that is encoded in the prediction direction identifier, and the value of the prediction direction identifier indicates that the coded data of the current image block is according to the first
  • the reference image list or the second reference image list is obtained by unidirectionally predicting the current image block, and the second unidirectional code stream data includes encoded data of the current image block.
  • the determining unit 1702 can also be used to:
  • the prediction unit 1703 is further configured to: when the bidirectional template distortion, the first template distortion, and the second template distortion satisfy a bidirectional template distortion condition And performing bidirectional prediction on the current image block according to the first motion information and the second motion information, thereby obtaining encoded data of the current image block.
  • the prediction unit 1703 is further configured to: when the first template distortion and the second template distortion satisfy the first one-way template distortion condition, perform one-way on the current image block according to the first motion information. Predicting, thereby obtaining encoded data of the current image block.
  • the prediction unit 1703 is further configured to: when the first template distortion and the second template distortion satisfy a second one-way template distortion condition, perform one-way on the current image block according to the second motion information. Predicting, thereby obtaining encoded data of the current image block.
  • an embodiment of the present invention provides a decoding apparatus 1800, where the apparatus includes an obtaining unit 1801 and a reconstruction unit 1802, where
  • An obtaining unit 1801 configured to acquire a prediction direction identifier of a current image block and encoded data of the current image block;
  • the reconstruction unit 1802 when the value indicated by the prediction direction indicates that the encoded data of the current image block is bidirectionally predicted according to the reference image in the first reference image list and the second reference image list. And performing template matching on the current image block in the reference image in the first reference image list, thereby obtaining first motion information, and performing template matching on the current image block in the reference image in the second reference image list, Obtaining second motion information; obtaining a reconstructed image block of the current image block according to the first motion information, the second motion information, and the encoded data of the current image block.
  • the reconstruction unit 1802 can also be used to:
  • the current image block is in the first Performing template matching in a reference image in a reference image list, thereby obtaining first motion information, and obtaining a reconstructed image block of the current image block according to the first motion information and the encoded data of the current image block;
  • the reconstruction unit 1802 can also be used to:
  • the current image block is in the first Template matching is performed in the reference image in the second reference image list, thereby obtaining second motion information, and the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • the reconstruction unit 1802 can also be used to:
  • the value identified in the prediction direction indicates that the encoded data of the current image block is unidirectional to the current image block according to a reference image in the first reference image list or a reference image in the second reference image list.
  • the prediction is obtained, the current image block is template-matched in the reference image in the first reference image list, Obtaining first motion information, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining second motion information;
  • the reconstructed image block of the current image block is obtained according to the first motion information and the encoded data of the current image block; or the first template is distorted in the first template
  • the second template distortion satisfies the second unidirectional template distortion condition
  • the reconstructed image block of the current image block is obtained according to the second motion information and the encoded data of the current image block.
  • the first unidirectional template distortion condition may include that the first template distortion is less than or equal to the second template distortion.
  • the second unidirectional template distortion condition may include the first template distortion being greater than the second template distortion.
  • the acquiring unit 1801 is configured to: when the reference structure of the frame where the current image block is located is a non-low delay reference structure, obtain the predicted direction identifier.
  • the reconstructing unit 1802 may be further configured to: when the reference structure of the frame where the current image block is located is a low-latency reference structure, the current image block is in the first reference image list. Performing template matching in the reference image, thereby obtaining first motion information, a template of the reference image block corresponding to the first motion information, and a reference image block corresponding to the first motion information and the current image block a template distortion, performing template matching on the current image block in the reference image in the second reference image list, thereby obtaining second motion information, a template of the reference image block corresponding to the second motion information, and the second a second template distortion between the reference image block corresponding to the motion information and the current image block;
  • the reconstruction unit 1802 may be further configured to: according to the first motion information and the encoded data of the current image block, when the first template distortion and the second template distortion satisfy a first one-way template distortion condition Obtaining a reconstructed image block of the current image block.
  • the reconstruction unit 1802 may be further configured to: according to the second motion information and the encoded data of the current image block, when the first template is distorted, the second template distortion satisfies a second unidirectional template distortion condition, A reconstructed image block of the current image block is obtained.
  • the bidirectional template distortion condition may include that the bidirectional template distortion is less than or equal to a template distortion threshold, and the template distortion threshold may be obtained according to the first template distortion and the second template distortion.
  • FIG. 19 is a schematic diagram showing the hardware structure of a computer device 1900 according to an embodiment of the present invention.
  • computer device 1900 can be implemented as an implementation of encoding device 1500 or 1700, which includes processor 1902, memory 1904, input/output interface 1906, communication interface 1908, and bus 1910. Among them, processing The 1902, the memory 1904, the input/output interface 1906, and the communication interface 1908 implement a communication connection with each other through the bus 1910.
  • computer device 1900 may be a management device in a computer device or carrier network or a NodeB (base station), RNC (radio network controller), gateway, etc. device.
  • NodeB base station
  • RNC radio network controller
  • the processor 1902 can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • Processor 1902 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 1902 or an instruction in a form of software.
  • the processor 1902 described above may be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or discrete hardware. Component.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present invention may be implemented or carried out.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in memory 1904, and processor 1902 reads the information in memory 1904 and, in conjunction with its hardware, performs the steps of the above method.
  • the memory 1904 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • Memory 1904 can store operating systems as well as other applications.
  • ROM read only memory
  • RAM random access memory
  • the program code of the technical solution is stored in the memory 1904, and the processor 1902 performs an operation required to be performed by the unit included in the encoding device 1500 or 1700, or performs an encoding method provided by the embodiment of the method of the present invention.
  • the input/output interface 1906 is for receiving input data and information, and outputting data such as operation results.
  • Communication interface 1908 implements communication between computer device 1900 and other devices or communication networks using transceivers such as, but not limited to, transceivers.
  • Bus 1910 can include a path for communicating information between various components of computer device 1900, such as processor 1902, memory 1904, input/output interface 1906, and communication interface 1908.
  • Computer device 1900 shown in FIG. 19 only shows the processor 1902, the memory 1904, the input/output interface 1906, the communication interface 1908, and the bus 1910, those skilled in the art will understand in the specific implementation process.
  • Computer device 1900 also includes other devices necessary to achieve normal operation, such as a display screen.
  • computer device 1900 may also include hardware devices that implement other additional functions, depending on the particular needs.
  • computer device 1900 may also only include the components necessary to implement embodiments of the present invention, and does not necessarily include all of the devices shown in FIG.
  • FIG. 20 is a schematic diagram showing the hardware structure of a computer device 2000 according to an embodiment of the present invention.
  • computer device 2000 can be implemented as an implementation of decoding device 1600 or 1800, which includes computer device 2000.
  • the processor 2002, the memory 2004, the input/output interface 2006, and the communication interface 2008 implement a communication connection with each other through the bus 2010.
  • the computer device 2000 may be a management device in a computer device or an operator network or a device such as a NodeB (base station), an RNC (Radio Network Controller), a gateway, or the like.
  • NodeB base station
  • RNC Radio Network Controller
  • the processor 2002 can be a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs.
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • Processor 2002 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 2002 or an instruction in a form of software.
  • the processor 2002 described above may be a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or discrete hardware. Component.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present invention may be implemented or carried out.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 2004, and the processor 2002 reads the information in the memory 2004 and performs the steps of the above method in combination with its hardware.
  • the memory 2004 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 2004 can store operating systems as well as other applications.
  • ROM read only memory
  • RAM random access memory
  • the program code of the technical solution is stored in the memory 2004, and the processor 2002 performs an operation required to perform a unit included in the decoding device 1600 or 1800, or performs a decoding method provided by an embodiment of the method of the present invention.
  • the input/output interface 2006 is for receiving input data and information, and outputting data such as operation results.
  • Communication interface 2008 enables communication between computer device 2000 and other devices or communication networks using transceivers such as, but not limited to, transceivers.
  • Bus 2010 may include a path for communicating information between various components of computer device 2000, such as processor 2002, memory 2004, input/output interface 2006, and communication interface 2008.
  • Computer device 2000 shown in FIG. 20 only shows the processor 2002, the memory 2004, the input/output interface 2006, the communication interface 2008, and the bus 2010, those skilled in the art will understand in the specific implementation process.
  • Computer device 2000 also includes other devices necessary to achieve normal operation, such as a display screen.
  • computer device 2000 may also include hardware devices that implement other additional functions, depending on the particular needs.
  • computer device 2000 may also only include the components necessary to implement embodiments of the present invention, and does not necessarily include all of the devices shown in FIG.
  • the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted as one or more instructions or code via a computer-readable medium and executed by a hardware-based processing unit.
  • the computer readable medium can comprise a computer readable storage medium (which corresponds to a tangible medium such as a data storage medium) or a communication medium comprising, for example, any medium that facilitates transfer of the computer program from one place to another in accordance with a communication protocol. .
  • computer readable media generally may correspond to (1) a non-transitory tangible computer readable storage medium, or (2) a communication medium such as a signal or carrier wave.
  • Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for use in carrying out the techniques described herein.
  • the computer program product can comprise a computer readable medium.
  • certain computer-readable storage media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, flash memory, or may be used to store instructions or data structures. Any other medium in the form of the desired program code and accessible by the computer. Also, any connection is properly termed a computer-readable medium. For example, if you use coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technology (eg, infrared, radio, and microwave) to send commands from a website, server, or other remote source, coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies (eg, infrared, radio, and microwave) are included in the definition of the media.
  • coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technology eg, infrared, radio, and microwave
  • a magnetic disk and an optical disk include a compact disk (CD), a laser disk, an optical disk, a digital video disk (DVD), a flexible disk, and a Blu-ray disk, wherein the disk usually reproduces data magnetically, and the disk passes the laser Optically copy data. Combinations of the above should also be included within the scope of computer readable media.
  • processors such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable logic arrays
  • processors may refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein.
  • the functionality described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated in a combined codec.
  • the techniques can be fully implemented in one or more circuits or logic elements.
  • the techniques of the present invention can be broadly implemented by a variety of devices or devices, including a wireless handset, an integrated circuit (IC), or a collection of ICs (eg, a chipset).
  • IC integrated circuit
  • Various components, modules or units are described in this disclosure to emphasize functional aspects of the apparatus configured to perform the disclosed techniques, but are not necessarily required to be implemented by different hardware units. Rather, as described above, various units may be combined in a codec hardware unit or combined with suitable software and/or by a collection of interoperable hardware units (including one or more processors as described above). Or firmware to provide.
  • system and “network” are used interchangeably herein. It should be understood that in this article The term “and/or” is merely an association describing the associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, A and B exist simultaneously, and B exists separately. three situations. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
  • B corresponding to A means that B is associated with A, and B can be determined from A.
  • determining B from A does not mean that B is only determined based on A, and that B can also be determined based on A and/or other information.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

Landscapes

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

Abstract

本发明公开了一种基于模板匹配的解码方法,其特征在于,包括:获取预测方向标识和当前图像块的编码数据;在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表;根据所述第一运动信息列表,确定第一运动信息;根据所述第二运动信息列表,确定第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。使用本发明提供的方案,可以提高解码的性能并降低解码的计算复杂度。

Description

一种基于模板匹配的解码方法及装置 技术领域
本发明涉及视频图像技术领域,尤其涉及一种基于模板匹配的解码方法及装置,以及一种基于模板匹配的编码方法及装置。
背景技术
据统计,视频是目前互联网上数据量最大的媒体。视频编码技术极大的提升了视频传输的速度和质量。视频编码技术是数字电视、数字直播系统、无线广播系统、个人数字助理(PDA)、膝上型或桌上型计算机、平板计算机、电子书阅读器、数码相机、数字记录装置、数字媒体播放器、视频游戏装置、视频游戏控制台、蜂窝式或卫星无线电电话、视频会议装置、视频流装置等应用的关键技术,视频编码技术可以为例如由MPEG-2、MPEG-4、ITU-TH.263、ITU-TH.264/MPEG-4第10部分高级视频编解码(AVC)、ITU-TH.265高效率视频编解码(HEVC)以及H.266标准定义的标准和上述标准的扩展部分中所描述的那些视频编码技术。
帧间模板匹配(Template Match,TM)是视频编码领域中的一个重要的帧间预测技术,由于该技术不需要传输额外的运动信息(包括运动矢量、参考帧索引等,对于双向预测一般包括两组运动信息),给编码器带来较大的编码性能,是一个广泛被研究的预测技术。在一种模板匹配技术中,首先建立一个运动信息列表(对于双向预测,是建立两个运动信息列表),将该运动信息列表中的运动信息作为当前块的初始运动信息,并分别把列表中的运动信息作为当前图像块的候选运动信息,计算候选运动信息对应的当前图像块的模板失真,然后选择模板失真最小的候选运动信息作为当前图像块的起始运动信息,然后根据起始运动信息进行运动矢量的精细化搜索,该过程包括:用当前图像块的模板与在起始运动信息所指向的参考帧中的图像块的周围图像块的模板进行搜索匹配,其中,周围图像块可以与起始运动信息所指向的参考帧中的图像块相交、相邻或者不相邻,找到与当前图像块的模板失真最小的图像块,该图像块与当前图像块之间的运动矢量即为当前图像块的运动矢量。在双向预测中,模板失真指的是当前图像块的模板与加权和模板的模板失真,该加权和模板为根据两个运动信息列表得到的两个图像块的模板的加权和。在单向预测中,模板失真是当前图像块的模板与根据运动信息列表得到的图像块的模板的模板失真。
在一些帧间预测技术中,会依据双向预测进行精细化搜索得到的模板失真以及双向预测对应的两个运动信息列表各自进行精细化搜索得到模板失真,然后将上述三个模板失真进行比较,从而确定执行双向预测进行编解码还是根据两个运动信息列表的其中一个进行编解码。然而在该帧间预测技术中,在确定预测方向时,模板失真有时不能准确的反映当前图像块的真实失真,并且由于编码端和解码端执行的步骤相同,对于解码端而言,计算复杂度较高。
发明内容
本发明实施例提供了一种解码方法及装置,以及一种编码方法及装置,可以提供 解码准确性的同时降低解码端的计算复杂度。
上述目标和其它目标将通过独立权利要求中的特征来达成。进一步的实现方式在从属权利要求、说明书和附图中体现。
一、视频编解码技术介绍
在视频编解码领域中,帧的概念是指一副完整的图像,由一帧一帧的图像按照一定的次序和帧速率组成视频格式后即可播放。当帧速率达到一定的速度后,两帧之间的间隔时间小于人眼的分辨极限,会出现短暂的视觉停留,方才能看似动态的出现在屏幕上。视频文件能够实现压缩的基础是单帧数字图像的压缩编码,数字化后的图像中存在很多的重复表示信息,称之为冗余信息。视频压缩编码(或者称为视频编码)的目的就是使用各种技术方法将视频序列中的冗余信息去除掉,以达到减小存储空间和节省传输带宽的效果。
就目前的技术发展现状而言,视频压缩编码主要可以包括帧内预测、帧间预测、变换量化、熵编码以及消块滤波处理等。在国际通用范围内,存在的视频压缩编码标准的压缩编码方式主要有四种:色度抽样、预测编码、变换编码和量化编码。
其中,预测编码:即利用之前已编码帧的数据信息来预测当前将要编码的帧。通过预测得到一个预测值,该预测值不完全等同与实际值,之间存在着一定的残差值。如果预测越适合,则预测值就会越接近实际值,残差值就越小,这样对残差值进行编码就能大大减小数据量,在解码端解码时运用残差值加上预测值重建出初始图像,这就是预测编码的基本思想方法。预测编码分为帧内预测和帧间预测两种基本类型。
本发明第一方面提供了一种基于模板匹配的解码方法,包括:
获取预测方向标识和当前图像块的编码数据;
在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。通过在码流中增加标识可以减低解码的计算复杂度。
其中,该方法还可以包括:确定所述第一运动信息列表和所述第二运动信息列表。或者,该方法还可以包括:在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,确定所述第一运动信息列表和所述第二运动信息列表。
其中,参考图像块和当前图像块之间的模板失真指示的是参考图像块的模板和当前图像块的模板之间的差异,以用于估计参考图像块与当前图像块之间的差异。
结合第一方面,在第一方面第一种可能的实施方式中,该方法还包括:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的 第一运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
或者,在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,该方法还可以包括:确定所述第一运动信息列表。或者,该方法还可以包括:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对所述当前图像块进行单向预测得到时,确定所述第一运动信息列表。
其中,该方法还可以包括:确定所述第二运动信息列表。或者,该方法还可以包括:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,确定所述第二运动信息列表。
结合第一方面,在第一方面第二种可能的实施方式中,该方法还包括:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。该实施方式相比于第一种实施方式减少了标识所占的比特数,相比于现有技术降低了解码的计算复杂度。
其中,该方法还可以包括:确定所述第一运动信息列表和所述第二运动信息列表。或者,该方法还可以包括:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,确定所述第一运动信息列表和所述第二运动信息列表。
结合第一方面或第一方面的以上任一种实施方式,在第一方面第三种可能的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。该实施方式明确了实施场景,在该实施场景下,使用第一方面提供的实施方式,可以增加解码效率并降低解码的计算复杂度。
结合第一方面第三种实施方式,在第一方面第四种可能的实施方式中,该方法还包括:
在所述当前图像块所在帧的参考结构为低延时参考结构时,
根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块的当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
其中,该方法还可以包括:确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
其中,该方法还可以包括:在所述双向模板失真大于模板失真阈值时,并且第一模板失真小于或者等于第二模板失真时,根据第一运动信息和当前图像块的编码数据,得到当前图像块的重建图像块。
其中,该方法还可以包括:在所述双向模板失真大于模板失真阈值时,并且第一模板失真大于第二模板失真时,根据第二运动信息和当前图像块的编码数据,得到当前图像块的重建图像块。
本发明第二方面提供了一种编码方法,包括:
根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
在所述双向率失真代价小于或者等于所述第一率失真代价和所述第二率失真代价中的最小值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表和所述第二运动信息列表对所述当前图像块进行双向预测得到。通过比较率失真代价来确定预测方向,比通过比较模板失真来确定预测方向更优,因此通过第二方面的方法,提升了编码效率。通过在码流中编入标识可以降低解码的计算复杂度,同样的,可以提升解码的效率。
其中,该方法还可以包括:确定当前图像块的第一运动信息列表和所述当前图像 块的第二运动信息列表。
结合第二方面,在第二方面第一种可能的实施方式中,该方法还包括:
在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到;
或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。
结合第二方面或第二方面第一种实施方式,在第二方面第二种可能的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价。该实施方式明确了实施场景,在该实施场景下,使用第二方面提供的实施方式,可以增加解码效率并降低解码的计算复杂度。
结合第二方面第二种实施方式,在第二方面第三种可能的实施方式中,该方法还包括:
在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到;
或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。该实施方式相比于第一种实施方式,降低了比特数,相比于现有技术提升了编码效率,通过在码流中编入标识,降低了解码的计算复杂度。
结合第二方面第二种实施方式或第二方面第三种实施方式,在第二方面第四种可能的实施方式中,该方法还包括:
在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一模板失 真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,并且在所述双向模板失真大于模板失真阈值时,并且在第一模板失真小于或者等于第二模板失真时,根据第一运动信息对当前图像块进行编码,从而得到当前图像块的编码数据。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,并且在所述双向模板失真大于模板失真阈值时,并且在第一模板失真大于第二模板失真时,根据第二运动信息对当前图像块进行编码,从而得到当前图像块的编码数据。
结合第二方面或第二方面的以上任一种实施方式,在第二方面第五种可能的实施方式中,所述根据所述第一运动信息列表,确定第一运动信息包括:将所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第一初始运动信息;在所述第一初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第一运动信息;
相应的,所述根据所述第二运动信息列表,确定第二运动信息包括:将所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第二初始运动信息;在所述第二初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第二运动信息。
本发明第三方面提供了一种解码装置,所述装置包括:
获取单元,用于获取预测方向标识和当前图像块的编码数据;
重建单元,用于在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,重建单元还可以用于:确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。或者,重建单元还可以用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
结合第三方面,在第三方面第一种可能的实施方式中,所述重建单元还用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列 表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
或者,所述重建单元还用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,重建单元还可以用于:确定所述第一运动信息列表。或者,重建单元还可以用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对所述当前图像块进行单向预测得到时,确定所述第一运动信息列表。
其中,重建单元还可以用于:确定所述第二运动信息列表。或者,重建单元还可以用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,确定所述第二运动信息列表。
结合第三方面,在第三方面第二种可能的实施方式中所述重建单元还用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。其中,重建单元还可以用于:确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。或者,重建单元还可以用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
结合第三方面或第三方面的以上任一种实施方式,在第三方面第三种可能的实施方式中,所述获取单元用于:
仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
结合第三方面第三种实施方式,在第三方面第四种可能的实施方式中,
所述重建单元还用于:
在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所 述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
其中,重建单元还可以用于:确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
其中,重建单元还可以用于:在所述双向模板失真大于模板失真阈值时,并且第一模板失真小于或者等于第二模板失真时,根据第一运动信息和当前图像块的编码数据,得到当前图像块的重建图像块。
或者,在所述双向模板失真大于模板失真阈值时,并且第一模板失真大于第二模板失真时,根据第二运动信息和当前图像块的编码数据,得到当前图像块的重建图像块。
本发明第四方面提供了一种编码装置,所述装置包括:
匹配单元,用于根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
确定单元,用于根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
预测单元,用于在所述双向率失真代价小于或者等于所述第一率失真代价和所述第二率失真代价中的最小值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表和所述第二运动信息列表对所述当前图像块进行双向预测得到。
其中,确定单元还可以用于:确定当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
结合第四方面,在第四方面第一种可能的实施方式中,所述预测单元还用于:
在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小 值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到;
或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。
结合第四方面或第四方面第一种实施方式,在第四方面第二种可能的实施方式中,所述确定单元用于:
仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
结合第四方面第二种实施方式,在第四方面第三种可能的实施方式中,所述预测单元还用于:
在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到;
或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。
结合第四方面第二种实施方式或第四方面第三种实施方式,在第四方面第四种可能的实施方式中,所述预测单元还用于:
在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
其中,所述预测单元还可以用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,并且在所述双向模板失真大于模板失真阈值时,并且在第一模板失真小 于或者等于第二模板失真时,根据第一运动信息对当前图像块进行编码,从而得到当前图像块的编码数据。
其中,所述预测单元还可以用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,并且在所述双向模板失真大于模板失真阈值时,并且在第一模板失真大于第二模板失真时,根据第二运动信息对当前图像块进行编码,从而得到当前图像块的编码数据。
结合第四方面或第四方面的以上任一种实施方式,在第四方面第五种可能的实施方式中,所述匹配单元用于:将所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第一初始运动信息;在所述第一初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第一运动信息;
将所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第二初始运动信息;在所述第二初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第二运动信息。
本发明的第五方面提供了一种基于模板匹配的解码装置,包括:存储器和处理器;
所述存储器用于存储一组可执行代码;
所述处理器用于执行所述存储器中存储的可执行代码以执行第一方面,或者第一方面的第一种实施方式至第四种实施方式中的任意一种。
本发明的第六方面提供了一种基于模板匹配的编码装置,包括:存储器和处理器;
所述存储器用于存储一组可执行代码;
所述处理器用于执行所述存储器中存储的可执行代码以执行第二方面,或者第二方面的第一种实施方式至第五种实施方式中的任意一种。
本发明的第七方面提供了一种存储介质,所述存储介质存储有可执行代码,所述可执行代码被执行时可执行第一方面,或者第一方面的第一种实施方式至第四种实施方式中的任意一种。
本发明的第八方面提供了一种存储介质,所述存储介质存储有可执行代码,所述可执行代码被执行时可执行第二方面,或者第二方面的第一种实施方式至第五种实施方式中的任意一种。
本发明的第九方面提供了一种计算机程序,所述计算机程序可执行第一方面,或者第一方面的第一种实施方式至第四种实施方式中的任意一种。
本发明的第十方面提供了一种计算机程序,所述计算机程序可执行第二方面,或者第二方面的第一种实施方式至第五种实施方式中的任意一种。
本发明第十一方面提供了一种基于模板匹配的解码方法,其特征在于,包括:
获取当前图像块的预测方向标识和所述当前图像块的编码数据;
在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据, 得到所述当前图像块的重建图像块。通过在码流中增加标识可以减低解码的计算复杂度。
结合第十一方面,在第十一方面第一种可能的实施方式中,该方法还包括:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
或者,在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
结合第十一方面,在第十一方面第二种可能的实施方式中,该方法还包括:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
在所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。该实施方式相比于第一种实施方式减少了标识所占的比特数,相比于现有技术降低了解码的计算复杂度。
结合十一方面第二种实施方式,在第十一方面第三种可能的实施方式中,所述第一单向模板失真条件包括所述第一模板失真小于或者等于所述第二模板失真,所述第二单向模板失真条件包括所述第一模板失真大于所述第二模板失真。
结合第十一方面以及以上第十一方面任一种实施方式,在第十一方面第四种可能的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。该实施方式明确了实施场景,在该实施场景下,使用第十一方面提供的实施方式,可以增加解码效率并降低解码的计算复杂度。
结合十一方面第四种实施方式,在第十一方面第五种可能的实施方式中,所述方法还包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;
根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像 块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
结合十一方面第五种实施方式,在第十一方面第六种可能的实施方式中,所述双向模板失真条件包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可以根据所述第一模板失真和所述第二模板失真得到。
本发明第十二方面提供了一种基于模板匹配的编码方法,包括:
将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价满足双向率失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。通过比较率失真代价来确定预测方向,比通过比较模板失真来确定预测方向更优,因此通过第二方面的方法,提升了编码效率。通过在码流中编入标识可以降低解码的计算复杂度,同样的,可以提升解码的效率。
结合第十二方面,在第十二方面第一种可能的实施方式中,所述方法还包括:
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据;
或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
结合第十二方面或第十二方面第一种实施方式,在第十二方面第二种可能的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以 及所述第二率失真代价。该实施方式明确了实施场景,在该实施场景下,使用第十二方面提供的实施方式,可以增加解码效率并降低解码的计算复杂度。
结合十二方面第二种实施方式,在第十二方面第三种可能的实施方式中,所述方法还包括:
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据;
或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。该实施方式相比于第一种实施方式,降低了比特数,相比于现有技术提升了编码效率,通过在码流中编入标识,降低了解码的计算复杂度。
结合十二方面第二种实施方式或第十二方面第三种实施方式,在第十二方面第四种可能的实施方式中,所述方法还包括:
在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。
本发明是第十三方面提供了一种基于模板匹配的解码装置,所述装置包括:
获取单元,用于获取当前图像块的预测方向标识和所述当前图像块的编码数据;
重建单元,用于在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
结合第十三方面,在第十三方面第一种可能的实施方式中,所述重建单元还用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一 参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
或者,在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
结合第十三方面,在第十三方面第二种可能的实施方式中,所述重建单元还用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
在所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
结合十三方面第二种实施方式,在第十三方面第三种可能的实施方式中,所述第一单向模板失真条件包括所述第一模板失真小于或者等于所述第二模板失真,所述第二单向模板失真条件包括所述第一模板失真大于所述第二模板失真。
结合第十三方面以及以上第十三方面任一种实施方式,在第十三方面第四种可能的实施方式中,获取单元用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
结合十三方面第四种实施方式,在第十三方面第五种可能的实施方式中,所述重建单元还用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;
根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
结合十三方面第五种实施方式,在第十三方面第六种可能的实施方式中,所述双向模板失真条件包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可 以根据所述第一模板失真和所述第二模板失真得到。
本发明第十四方面提供了一种基于模板匹配的编码装置,其特征在于,包括:
匹配单元,用于将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
确定单元,用于根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
预测单元,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价满足双向率失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。
结合第十四方面,在第十四方面第一种可能的实施方式中,所述预测单元还用于:
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据;
或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
结合第十四方面或第十四方面第一种实施方式,在第十四方面第二种可能的实施方式中,所述确定单元用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
结合十四方面第二种实施方式,在第十四方面第三种可能的实施方式中,所述预测单元还用于:
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像 列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据;
或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。
结合十四方面第二种实施方式或第十四方面第三种实施方式,在第十四方面第四种可能的实施方式中,所述确定单元还用于:
在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
相应的,所述预测单元还用于:在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。
本发明的第十五方面提供了一种解码装置,包括:存储器和处理器;
所述存储器用于存储一组可执行代码;
所述处理器用于执行所述存储器中存储的可执行代码以执行第十一方面,或者第十一方面的第一种实施方式至第六种实施方式中的任意一种。
本发明的第十六方面提供了一种编码装置,包括:存储器和处理器;
所述存储器用于存储一组可执行代码;
所述处理器用于执行所述存储器中存储的可执行代码以执行第十二方面,或者第十二方面的第一种实施方式至第四种实施方式中的任意一种。
本发明的第十七方面提供了一种存储介质,所述存储介质存储有可执行代码,所述可执行代码被执行时可执行第十一方面,或者第十一方面的第一种实施方式至第六种实施方式中的任意一种。
本发明的第十八方面提供了一种存储介质,所述存储介质存储有可执行代码,所述可执行代码被执行时可执行第十二方面,或者第十二方面的第一种实施方式至第四种实施方式中的任意一种。
本发明的第十九方面提供了一种计算机程序,所述计算机程序可执行第十一方面,或者第十一方面的第一种实施方式至第六种实施方式中的任意一种。
本发明的第二十方面提供了一种计算机程序,所述计算机程序可执行第十二方面,或者第十二方面的第一种实施方式至第四种实施方式中的任意一种。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种视频编码及解码系统的示意性框图;
图2为本发明实施例提供的一种视频编码器的示意性框图;
图3为本发明实施例提供的一种视频解码器的示意性框图;
图4为本发明实施例提供的一种编码方法的流程示意图;
图5为本发明实施例提供的一种模板匹配技术中“L”型模板示意图;
图6为本发明实施例提供的一种解码方法的流程示意图;
图7为本发明实施例提供的一种编码方法的流程示意图;
图8为本发明实施例提供的一种编码方法的流程示意图;
图9为本发明实施例提供的一种编码方法的流程示意图;
图10为本发明实施例提供的一种编码方法的流程示意图;
图11为本发明实施例提供的一种解码方法的流程示意图;
图12为本发明实施例提供的一种解码方法的流程示意图;
图13为本发明实施例提供的一种解码方法的流程示意图;
图14为本发明实施例提供的一种解码方法的流程示意图;
图15为本发明实施例提供的一种编码装置的示意性框图;
图16为本发明实施例提供的一种解码装置的示意性框图;
图17为本发明实施例提供的一种编码装置的示意性框图;
图18为本发明实施例提供的一种解码装置的示意性框图;
图19本发明实施例提供的一种计算机设备的硬件结构示意图;
图20本发明实施例提供的一种计算机设备的硬件结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
图1是根据本发明实施例提供的一种视频编解码系统10的示意性框图。如图1所示,视频编解码系统10包含源装置12及目的地装置14(或者称为解码装置)。源装置12产生编码后的视频编码数据。因此,源装置12可被称作视频编码装置或视频编码设备。目的地装置14可解码由源装置12产生的编码后的视频编码数据。因此,目的地装置14可被称作视频解码装置或视频解码设备。源装置12及目的地装置14可为视频编解码装置或视频编解码设备的实例。源装置12及目的地装置14可包括广泛范围的装置,包含台式计算机、移动计算装置、笔记本(例如,膝上型)计算机、平板计算机、机顶盒、智能电话等手持机、电视、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机,或其类似者。
目的地装置14可经由信道16接收来自源装置12的编码后的视频编码数据。信道16可包括能够将视频编码数据从源装置12移动到目的地装置14的一个或多个媒体及/或装置。在一个实例中,信道16可包括使源装置12能够实时地将编码后的视频编码数据直接发射到目的地装置14的一个或多个通信媒体。在此实例中,源装置12可根据通信标准(例如,无线通信协议)来调制编码后的视频编码数据,且可将调制后的视频编码 数据发射到目的地装置14。所述一个或多个通信媒体可包含无线及/或有线通信媒体,例如射频(RF)频谱或一根或多根物理传输线。所述一个或多个通信媒体可形成基于包的网络(例如,局域网、广域网或全球网络(例如,因特网))的部分。所述一个或多个通信媒体可包含路由器、交换器、基站,或促进从源装置12到目的地装置14的通信的其它设备。
在另一实例中,信道16可包含存储由源装置12产生的编码后的视频编码数据的存储媒体。在此实例中,目的地装置14可经由磁盘存取或卡存取来存取存储媒体。存储媒体可包含多种本地存取式数据存储媒体,例如蓝光光盘、DVD、CD-ROM、快闪存储器,或用于存储经编码视频编码数据的其它合适数字存储媒体。
在另一实例中,信道16可包含文件服务器或存储由源装置12产生的编码后的视频编码数据的另一中间存储装置。在此实例中,目的地装置14可经由流式传输或下载来存取存储于文件服务器或其它中间存储装置处的编码后的视频编码数据。文件服务器可以是能够存储编码后的视频编码数据且将所述编码后的视频编码数据发射到目的地装置14的服务器。实例文件服务器包含web服务器(例如,用于网站)、文件传送协议(FTP)服务器、网络附加存储(NAS)装置,及本地磁盘驱动器。
目的地装置14可经由标准数据连接(例如,因特网连接)来存取编码后的视频编码数据。数据连接的实例类型包含适合于存取存储于文件服务器上的编码后的视频编码数据的无线信道(例如,Wi-Fi连接)、有线连接(例如,DSL、缆线调制解调器等),或两者的组合。编码后的视频编码数据从文件服务器的发射可为流式传输、下载传输或两者的组合。
本发明实施例的技术不限于无线应用场景,示例性的,可将所述技术应用于支持以下应用等多种多媒体应用的视频编解码:空中电视广播、有线电视发射、卫星电视发射、流式传输视频发射(例如,经由因特网)、存储于数据存储媒体上的视频编码数据的编码、存储于数据存储媒体上的视频编码数据的解码,或其它应用。在一些实例中,视频编解码系统10可经配置以支持单向或双向视频发射,以支持例如视频流式传输、视频播放、视频广播及/或视频电话等应用。
在图1的实例中,源装置12可以包含视频源18、视频编码器20及输出接口22。在一些实例中,输出接口22可包含调制器/解调器(调制解调器)及/或发射器。视频源18可包含视频获取装置(例如,视频相机)、含有先前获取的视频数据的视频存档、用以从视频内容提供者接收视频数据的视频输入接口,和/或用于产生视频数据的计算机图形系统,或上述视频数据源的组合。
视频编码器20可编码来自视频源18的视频数据。在一些实例中,源装置12经由输出接口22将编码后的视频编码数据直接发射到目的地装置14。编码后的视频编码数据还可存储于存储媒体或文件服务器上以供目的地装置14稍后存取以用于解码和/或播放。
在图1的实例中,目的地装置14包含输入接口28、视频解码器30及显示装置32。在一些实例中,输入接口28包含接收器及/或调制解调器。输入接口28可经由信道16接收编码后的视频编码数据。显示装置32可与目的地装置14整合或可在目的地装置14外部。一般来说,显示装置32显示解码后的视频编码数据。显示装置32可包括多种显示装置, 例如液晶显示器(LCD)、等离子体显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。
视频编码器20及视频解码器30可根据视频压缩标准(例如,高效率视频编解码H.265标准)或者目前在开发中的下一代视频编解码压缩标准(H.266)而操作,且可遵照HEVC测试模型或者H.266测试模型(JEM)。H.265标准和H/266标准的全部内容以引用的方式并入本文中。
或者,视频编码器20及视频解码器30可根据其它专属或行业标准而操作,所述标准包含ITU-TH.261、ISO/IECMPEG-1Visual、ITU-TH.262或ISO/IECMPEG-2Visual、ITU-TH.263、ISO/IECMPEG-4Visual,ITU-TH.264(还称为ISO/IECMPEG-4AVC),包含可分级视频编解码(SVC)及多视图视频编解码(MVC)扩展。应理解,本发明实施例的技术不限于任何特定编解码标准或技术。
此外,图1仅为实例且本发明的技术可应用于未必包含编码装置与解码装置之间的任何数据通信的视频编解码应用(例如,单侧的视频编码或视频解码)。在其它实施例中,从本地存储器检索数据,经由网络流式传输数据,或以类似方式操作数据。编码装置可编码视频数据且将视频编码数据存储到存储器,和/或解码装置可从存储器检索编码数据且解码该编码数据。在许多实施例中,通过彼此不进行通信而仅编码数据到存储器和/或从存储器检索编码数据及解码该编码数据的多个装置执行编码和解码。
视频编码器20及视频解码器30各自可实现为多种合适电路中的任一者,例如一个或多个微处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)、离散逻辑、硬件或其任何组合。视频编码器20及视频解码器30也可以部分地或者全部以软件实施,则源装置12及目的地装置14可将软件的指令存储于合适的非瞬时计算机可读存储媒体中,且可使用一个或多个处理器执行硬件中的指令以执行本发明实施例提供的方法。可将前述各者(包含硬件、软件、硬件与软件的组合等)中的任一者视为一个或多个处理器。视频编码器20或视频解码器30可包含在一个或多个编码器或解码器中,视频编码器20或视频解码器30可整合为其它装置中的组合式编码器/解码器(编解码器(CODEC))的部分。
所述视频编码器20编码视频数据。视频数据可包括一个或多个图像帧。视频编码器20可产生码流数据,所述码流数据以比特流的形式包含了图像帧的编码数据及相关联数据。相关联数据可包含序列参数集(SPS)、图片参数集(PPS)及其它语法结构(例如标识信息)。SPS可含有应用于一个或多个序列的参数。PPS可含有应用于一个或多个图片的参数。语法结构是指码流中以指定次序排列的一个或多个语法元素的集合。
为产生图像帧的编码数据,视频编码器20可将图片分割成编码树型块(CTB)。在一些例子中,CTB可被称作“树型块”、“最大编码单元”(LCU)或“编码树型单元”。CTB不限于特定大小且可包含一个或多个编码单元(CU),CU的划分方式可以依据四叉树加二叉树结构(QTBT structure)。每一个CTB可以与图片内的具有相等大小的像素块相关联。每一像素可对应一个亮度(luminance或luma)采样及两个色度(chrominance或chroma)采样。因此,每一个CTB可与一个亮度采样块及两个色度采样块相关联。图片的CTB可分成一个或多个条带。在一些实例中,每一个条带包含整数个数的CTB。作为编码图片的一部分,视频编码器20可产生所述图片的每一条带的编码信息,即编码所 述条带内的CTB。为了编码CTB,视频编码器20可对与CTB相关联的像素块递归地执行四叉树分割、二叉树分割或者四叉树加二叉树分割,以将像素块分割成递减的像素块。所述较小的像素块可以和CU相关联。在本发明实施例中的图像块可以是CU、CU相关联的图像块或者其他图像块。需要说明的是,在HEVC中包含的图像块有编码块CU、预测块PU和变换块TU,JEM模型对视频图像的编码结构进行了进一步的改进,具体的,被称为“四叉树结合二叉树”(QTBT)的块编码结构被引入进来。QTBT结构摒弃了HEVC中的CU,PU,TU等概念,支持更灵活的CU划分形状,一个CU可以正方形,也可以是长方形。一个CTU首先进行四叉树划分,该四叉树的叶节点进一步进行二叉树划分。同时,在二叉树划分中存在两种划分模式,对称水平分割和对称竖直分割。二叉树的叶节点被称为CU,JEM的CU在预测和变换的过程中都不可以被进一步划分,也就是说JEM的CU,PU,TU具有相同的块大小。在现阶段的JEM中,CTU的最大尺寸为256×256亮度像素。本发明的图像块可以包括但不限于上述图像块中任一种。
JCT-VC开发了H.265(HEVC)标准。HEVC标准化基于称作HEVC测试模型(HM)的视频解码装置的演进模型。H.265的最新标准文档可从http://www.itu.int/rec/T-REC-H.265获得,最新版本的标准文档为H.265(12/16),该标准文档以全文引用的方式并入本文中。HM假设视频解码装置相对于ITU-TH.264/AVC的现有算法具有若干额外能力。例如,H.264提供9种帧内预测编码模式,而HM可提供多达35种帧内预测编码模式。
JVET致力于开发H.266标准。H.266标准化的过程基于称作H.266测试模型的视频解码装置的演进模型。H.266的算法描述可从http://phenix.int-evry.fr/jvet获得,其中最新的算法描述包含于JVET-F1001-v2中,该算法描述文档以全文引用的方式并入本文中。同时,可从https://jvet.hhi.fraunhofer.de/svn/svn_HMJEMSoftware/获得JEM测试模型的参考软件,同样以全文引用的方式并入本文中。
图2为本申请实施例中视频编码器20的一种示意性框图。视频编码器20可执行视频帧的图像块的帧内编码和帧间编码。帧内编码依赖于空间预测来减少或去除给定视频帧或图像内的视频的空间冗余。帧间编码依赖于时间预测来减少或去除视频序列的邻近帧或图像内的视频的时间冗余。帧内模式(I模式)可指若干基于空间的压缩模式中的任一者。帧间模式(例如单向预测(P模式)或双向预测(B模式)等)可指若干基于时间的压缩模式中的任一者。
在图2的可行的实施方式中,视频编码器20包含分割单元35、预测单元41、参考图像存储器64、求和器50、变换处理单元52、量化单元54和熵编码单元56。预测单元41包含运动估计单元42、运动补偿单元44和帧内预测模块46。对于视频块重构建,视频编码器20也包含反量化单元58、反变换单元60和求和器62。也可包含解块滤波器(图2中未展示)以对块边界进行滤波从而从经重构建视频中去除块效应伪影。在需要时,解块滤波器将通常对求和器62的输出进行滤波。除了解块滤波器之外,也可使用额外环路滤波器(环路内或环路后)。
如图2中所展示,视频编码器20接收视频数据,且分割单元35将数据分割成视频块。 此分割也可包含分割成条带、图像块或其它较大单元,以及(例如)根据LCU及CU的四叉树结构进行视频块分割。视频编码器20示例性地说明编码在待编码的视频条带内的视频块的组件。一般来说,条带可划分成多个视频块(且可能划分成称作图像块的视频块的集合)。
预测单元41可基于编码质量与代价计算结果(例如,码率-失真代价(或者称为率失真代价),RDcost)选择当前视频块的多个可能编码模式中的一者,例如多个帧内编码模式中的一者或多个帧间编码模式中的一者。预测单元41可将所得经帧内编码或经帧间编码的块(或称为预测图像块)提供到求和器50以产生残余块数据且将所得经帧内编码或经帧间编码的预测图像块提供到求和器62以重构出重建块从而用作参考图像中的块。
预测单元41内的运动估计单元42及运动补偿单元44执行相对于一个或多个参考图像中的一个或多个块(可以称为参考图像块)的当前视频块(或者称为当前图像块)的帧间预测编码以提供时间压缩。运动估计单元42可经配置以根据视频序列的预定模式确定视频条带或者当前图像块或者当前图像块所在区域的帧间预测模式。预定模式可将序列中的视频条带可以指定为P条带、B条带或GPB条带。运动估计单元42及运动补偿单元44可高度集成,但为概念目的而分别说明。通过运动估计单元42所执行的运动估计用于确定当前图像块的运动矢量的过程。例如,运动矢量可指示当前视频帧或图像内的图像块(或者称为视频块)相对于参考图像内的参考图像块的位移。
参考图像块为依据像素差而被发现为与当前图像块紧密匹配的块,像素差可通过绝对差和(SAD)、平方差和(SSD)或其它差度量确定。在一些可行的实施方式中,视频编码器20可计算存储于参考图像存储器64中的参考图像的子整数(sub-integer)像素位置的值。例如,视频编码器20可内插参考图像的四分之一像素位置、八分之一像素位置或其它分数像素位置的值。因此,运动估计单元42可执行相对于全像素位置及分数像素位置的运动搜索且输出具有分数像素精确度的运动矢量。
运动估计单元42通过比较当前图像块的位置与参考图像块的位置而计算经帧间预测的当前图像块的运动矢量。可从第一参考图像列表(列表0)或第二参考图像列表(列表1)选择参考图像,每个列表各自对应存储于参考图像存储器64中的一个或多个参考图像。运动估计单元42将经计算运动矢量发送到熵编码单元56及运动补偿单元44。
由运动补偿单元44执行的运动补偿可涉及基于由运动估计所确定的运动矢量提取或确定参考图像块,可能执行到子像素精确度的内插。在获取当前图像块的运动矢量后,运动补偿单元44即可在一个或两个参考图像列表中的一者中定位运动矢量所指向的参考图像块。视频编码器20通过从正在编码的当前图像块(也可称为当前视频块)的像素值减去参考图像块的像素值来形成残余图像块(或者称为残余视频块),从而获得像素差值。像素差值形成残余图像块的数据,且可包含亮度及色度差分量两者。求和器50表示执行此减法运算的一个或多个组件。运动补偿单元44也可产生与当前图像块块和/或视频条带相关联的语法元素(例如本发明实施例提供的)以供视频解码器30用于解码并获得当前图像块的重建块或者视频条带的图像块的重建块。
对于双向预测的图像块(例如但不限于位于B条带的PU),则该图像块可与称作“列表0”和“列表1”的两个参考图像列表相关联。在一些可行的实施方式中,含有B条带 的图像可与为列表0和列表1的组合的列表组合相关联。
此外,对于双向预测的图像块(例如但不限于位于B条带的PU),则运动估计单元42可针对图像块执行单向预测或双向预测,其中,在一些可行的实施方式中,双向预测为分别基于列表0和列表1的参考图像列表的图像进行的预测,在另一些可行的实施方式中,双向预测为分别基于当前帧(当前图像块所在的帧)在显示顺序上的已重建的未来帧和已重建的过去帧进行的预测。当运动估计单元42针对当前图像块执行单向预测时,运动估计单元42可在列表0或列表1的参考图像中搜索当前图像块的参考图像块。运动估计单元42可接着产生指示列表0或列表1中的含有参考图像块的参考图像的参考索引和指示当前图像块与参考图像块之间的空间位移的运动矢量。运动估计单元42可输出参考索引、预测方向标识和运动矢量作为当前图像块的运动信息。预测方向标识可指示参考索引指示列表0或列表1中的参考图像。运动补偿单元44可基于由当前图像块的运动信息指示的参考图像块当前图像块的预测图像块(或者称为预测性图像块)。
当运动估计单元42针对当前图像块执行双向预测时,运动估计单元42可在列表0中的参考图像(参考图像也可以称为参考帧)中搜索当前图像块的参考图像块且还可在列表1中的参考图像中搜索当前图像块的另一参考图像块。运动估计单元42可接着产生指示列表0和列表1中的含有参考图像块的参考图像的参考索引和指示参考图像块与当前图像块之间的空间位移的运动矢量。运动估计单元42可输出当前图像块的参考索引和运动矢量作为当前图像块的运动信息。运动补偿单元44可基于由当前图像块的运动信息指示的参考图像块确定当前图像块的预测图像块。
在一些可行的实施方式中,运动估计单元42不向熵编码模块56输出当前图像块的运动信息的完整集合。而是,运动估计单元42可参考另一图像块的运动信息来通知当前图像块的运动信息。举例来说,运动估计单元42可确定当前图像块的运动信息充分类似于相邻图像块的运动信息。在此实施方式中,运动估计单元42可在与当前图像块相关联的语法结构中指示一个指示值,所述指示值向视频解码器30指示当前图像块具有与相邻图像块相同的运动信息或具有可从相邻图像块导出的运动信息。在另一实施方式中,运动估计单元42可在与当前图像块相关联的语法结构中识别与相邻图像块相关联的候选预测运动矢量和运动矢量差(MVD)。MVD指示当前图像块的运动矢量和与相邻图像块相关联的所指示候选预测运动矢量之间的差。视频解码器30可使用候选预测运动矢量和MVD来确定当前图像块的运动矢量。
如前文所描述,预测模块41可产生用于当前图像块的候选预测运动矢量列表。候选预测运动矢量列表中的一个或多个可包括一个或多个候选预测运动矢量和从候选预测运动矢量推导出的一或多个额外候选预测运动矢量。
预测单元41内的帧内预测单元46可执行基于与当前图像块相同的图像或一个或多个与当前图像块相邻的相邻图像块(可以是条带中的)的对当前图像块的帧内预测编码以提供空间压缩。因此,作为通过运动估计单元42及运动补偿单元44执行的帧间预测(如前文所描述)的替代,帧内预测单元46可帧内预测当前图像块。明确地说,帧内预测单元46可确定用以编码当前图像块的帧内预测模式。在一些可行的实施方式中,帧内预测单元46可(例如)在单独编码遍历期间使用各种帧内预测模式来编码当前图像 块,且帧内预测单元46(或在一些可行的实施方式中,模式选择单元40)可从经测试模式选择使用的适当帧内预测模式。
在预测单元41经由帧间预测或帧内预测产生当前视频块的预测图像块之后,视频编码器20通过从当前图像块减去预测图像块而形成残余图像块。残余图像块中的残余视频数据可包含于一个或多个TU中且应用于变换处理单元52(也可以是残余图像块直接应用于变换处理单元52)。变换处理单元52使用例如离散余弦变换(DCT)或概念上类似的变换(例如,离散正弦变换DST)将残余视频数据变换成残余变换系数。变换处理单元52可将残余视频数据从像素域转换到变换域(例如,频域)。
变换处理单元52可将所得变换系数发送到量化单元54。量化单元54对变换系数进行量化以进一步减小码率。量化过程可减少与系数中的一些或全部相关联的比特深度。可通过调整量化参数来修改量化的程度。在一些可行的实施方式中,量化单元54可接着执行包含经量化变换系数的矩阵的扫描。替代地,熵编码单元56可执行扫描。
在量化之后,熵编码单元56可熵编码经量化变换系数。例如,熵编码单元56可执行上下文自适应性可变长度解码(CAVLC)、上下文自适应性二进制算术解码(CABAC)、基于语法的上下文自适应性二进制算术解码(SBAC)、概率区间分割熵(PIPE)解码或另一熵编码方法或技术。熵编码单元56也可熵编码当前视频条带的运动矢量(或者当前图像块的运动矢量)及其它语法元素。在通过熵编码单元56进行熵编码之后,可编码码流传输到视频解码器30或存档以供稍后传输或由视频解码器30检索获取。
熵编码单元56可编码指示选定帧内预测模式的信息。视频编码器20可在包括多个帧内预测模式索引表和多个经修改帧内预测模式索引表(也称作码字映射表)的所传输的码流配置数据中包含各种块的编码上下文的定义及用于上下文中的每一者的MPM、帧内预测模式索引表和经修改帧内预测模式索引表的指示。
反量化单元58及反变换单元60分别应用反量化及反变换,以在像素域中重建残余图像块以获得用作参考图像的参考图像块。运动补偿单元44可通过将残余图像块与参考图像列表中的一者内的参考图像中的一者的预测图像块相加来重建出参考图像块。运动补偿单元44也可将一个或多个内插滤波器应用于重建出的残余图像块以计算子整数像素值以用于运动估计。求和器62将残余图像块与通过运动补偿单元44所产生的经运动补偿参考图像块的预测图像块相加以产生参考图像块以供存储于参考图像存储器64中。参考图像块可由运动估计单元42及运动补偿单元44用作参考图像块以帧间预测后续视频帧或图像中的块。
图3为本发明实施例中视频解码器30的一种示意性框图。在图3的可行的实施方式中,视频解码器30包含熵编码单元80、预测单元81、反量化单元86、反变换单元88、求和器90和参考图像存储器92。预测单元81包含运动补偿单元82和帧内预测单元84。在一些可行的实施方式中,视频解码器30可执行来自图2的视频编码器20描述的编码流程的解码流程。视频解码器30的解码流程可以与视频编码器的编码流程互逆。
在解码过程期间,视频解码器30从视频编码器20接收表示已编码视频条带的图像块(或者已编码图像块)及相关联的语法元素的已编码视频码流。视频解码器30的熵编码单元80熵解码码流以产生经量化系数、运动矢量及其它语法元素。熵编码单元80将运动矢量及其它语法元素转递到预测单元81。视频解码器30可在视频条带层级和/ 或图像块层级处接收语法元素。
在视频条带已解码(已解码也可以称为经解码)为经帧内解码(I)条带或者当前图像块为用于帧内预测的图像块时,预测单元81的帧内预测单元84可基于用信号发送的帧内预测模式及来自当前帧或图像的先前已解码块的数据而产生当前图像块或当前视频条带的图像块的预测数据。
在视频图像已解码为经帧间解码(例如,B、P或GPB)条带或者当前图像块为用于帧间解码的图像块时,预测单元81的运动补偿单元82基于从熵编码单元80所接收的运动矢量及其它语法元素而产生当前图像块的预测图像块。预测图像块可从一个或两个参考图像列表中的某一参考图像中确定。视频解码器30可基于存储于参考图像存储器92中的参考图像使用默认构建技术来构建参考图像列表(列表0和/或列表1)。
运动补偿单元82通过解析运动矢量及其它语法元素来确定当前图像块或者当前视频条带的图像块(在当前图像块位于条带中时,当前图像块即为当前视频条带的图像块)的预测信息,且使用预测信息来解码获得的当前图像块的预测图像块。例如,运动补偿单元82使用所接收的语法元素中的一些来确定用以解码当前图像块的预测模式(例如,帧内预测或帧间预测)、帧间预测条带类型(例如,B条带、P条带或GPB条带)(或者是当前图像块所在帧的类型)、条带的参考图像列表中的一者或多者的构建信息(或者是当前图像块的参考图像列表中的一者或多者的构建信息)、条带的每一经帧间编码视频块的运动矢量(或者是当前图像块的运动矢量)、条带的每一已帧间解码图像块的帧间预测状态(或者是已帧间解码图像块的帧间预测状态)及用以解码当前视频条带中的视频块(或者解码当前图像块)的其它信息。
运动补偿单元82也可基于内插滤波器执行内插。运动补偿单元82可使用如由视频编码器20在当前图像块的编码期间所使用的内插滤波器来计算参考块的子整数像素的内插值。在此应用中,运动补偿单元82可从所接收的语法元素确定由视频编码器20使用的内插滤波器且使用内插滤波器来获得当前图像块的预测图像块。
如果当前图像块是使用帧间预测而编码,则运动补偿单元82可产生用于当前图像块的候选预测运动矢量列表。码流中可包括识别选定候选预测运动矢量在当前图像块的候选预测运动矢量列表中的位置的数据。在产生用于当前图像块的候选预测运动矢量列表之后,运动补偿单元82可基于由当前图像块的运动信息指示的一或多个参考块产生用于当前图像块的预测图像块。当前图像块的参考图像块可在与当前图像块不同的时间的图像帧中。运动补偿单元82可基于由当前图像块的候选预测运动矢量列表中的选定的运动信息确定当前图像块的运动信息。
反量化单元86对码流中所提供且通过熵编码单元80所解码的经量化变换系数进行反量化(例如,解量化)。反量化过程可包含使用通过视频编码器20针对图像块或者视频条带中的图像块所计算的量化参数确定量化的程度,且同样地确定应该应用的反量化的程度。反变换单元88将反变换(例如,反DCT、反整数变换或概念上类似的反变换过程)应用于变换系数以便在像素域中产生残余图像块。
在运动补偿单元82基于运动矢量及其它语法元素产生当前图像块的预测图像块之后,视频解码器30通过将来自反变换单元88的残余图像块与通过运动补偿单元82产生的对应预测图像块求和来形成经解码视频块(也就是当前图像块的重建图像块)。求 和器90表示执行此求和运算的一个或多个组件。在需要时,也可应用解块滤波器来对经解码块进行滤波以便去除块效应伪影。其它环路滤波器(在解码环路中或在解码环路之后)也可用以使像素转变平滑,或以其它方式改进视频质量。给定帧或图像中的经解码视频块接着存储于参考图像存储器92中,参考图像存储器92存储供后续运动补偿所使用的参考图像。参考图像存储器92也存储供稍后呈现于例如图1的显示装置32的显示装置上的经解码视频。
如前文所注明,本发明一些实施例的技术示例性地涉及帧间编码和帧间解码。应理解,本发明一些实施例的技术可通过本发明实施例中所描述的视频编码器和视频解码器中的任一者进行,视频编码器和视频解码器包含(例如)如关于图1到3所展示及描述的视频编码器20及视频解码器30。即,在一种可行的实施方式中,关于图2所描述的预测单元41可在当前图像块的编码期间在执行帧间预测时执行下文中所描述的特定技术。在另一可行的实施方式中,关于图3所描述的预测单元81可在当前图像块的解码期间在执行帧间预测时执行下文中所描述的特定技术。因此,对一般性“视频编码器”或“视频解码器”的引用可包含视频编码器20、视频解码器30或另一视频编码或编码单元。
图4为本发明实施例提供的一种基于模板匹配的编码方法的流程示意图。其中,该方法可以由源装置12执行,或者具体的可以由视频编码器20执行,或者具体的可以由预测单元41执行。该方法可以包括:
S401、根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真。
其中,该方法还可以包括:确定当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
其中,运动信息可以包括运动矢量和参考索引。
其中,确定当前图像块的运动信息列表可以根据当前图像块所在帧或者所在区域(例如,slice)的参考图像列表来确定,具体的,确定第一运动信息列表可以根据第一参考图像列表(例如,list0)来确定,确定第一运动信息列表。确定第二运动信息列表可以根据第二参考图像列表(例如,list1)来确定。
其中,当前图像块所在的帧可以是用于双向预测的帧,上述两个运动信息列表可以是合并模式的候选运动信息列表或者高级运动矢量预测(Advanced Motion Vector Prediction,AMVP)模式的运动信息列表。上述两个运动信息列表可以根据当前图像块周围的已编码图像块的运动信息建立得到。
其中,第一运动信息列表中的任一运动信息包括运动矢量和参考索引,参考索引用于指示参考帧(或者称为参考图像)在第一参考帧列表(或者称为第一参考图像列表或者前向参考图像列表,List0)中的位置。第二运动信息列表中的任一运动信息包括运动矢量和参考索引,参考索引用于指示参考帧在第二参考帧列表(或者称为第二参考图像列表或者后向参考图像列表,List1)中的位置。
其中,第一运动信息列表中任一运动信息对应的参考图像块为已重建图像块(为 重建得到的图像块)。第二运动信息列表中任一运动信息对应的参考图像块为已重建图像块(为重建得到的图像块)。
需要说明的是,本领域技术人员应理解,根据第一运动信息列表确定第一运动信息的过程中,同时也确定了第一模板失真,以及第一运动信息对应的参考图像块的模板。另外,第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失指的是第一运动信息对应的参考图像块的模板和当前图像块的模板之间的差异。后文中类似的描述不再赘述。
其中,第一运动信息可以为当前图像块的第一运动信息。
其中,根据所述第一运动信息列表,确定第一运动信息可以包括:将所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第一初始运动信息;在所述第一初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第一运动信息。
在一些可行的实施方式中,模板失真可以通过如下公式计算得到:
Figure PCTCN2017092514-appb-000001
其中,P为当前图像块的模板,Q为运动信息列表中任一运动信息所指向的参考图像块的模板,(x,y)为P与Q之间运动信息列表中任一运动信息的运动矢量,M,N为当前图像块和参考图像块的长和宽,SAD为模板失真,或者称为绝对误差和(SAD,Sum of Absolute Difference)。
其中,模板失真除了可以用绝对误差和来表示外,还可以用均方误差和(SSD)来表示。
在一些可行的实施方式中,上述模板可以使用“L”型模板。如图5所示,当前图像块(curBlock)的左边相邻块和上边相邻块组成了一个“L”型模板(Template)。由于模板和当前当前图像块的空间位置紧邻,两者的运动信息应当保持基本一致,因此,模板的运动信息可作为当前图像块的运动信息。其中,当前图像块的左边相邻块和上边相邻块,是经过重建生成的,在编码端和解码端都是可获得的。
其中,除了使用“L”型模板,也可以使用其他的模板。
其中,参考图像块所在的区域的大小和与参考图像块的位置关系可以是预设的。参考图像块所在的区域内的像素是已重建得到的。在一些可行的实现方式中,在所述第一初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第一运动信息可以包括:
在参考图像块所在的区域内,遍历所有和所述当前图像块的模板具有相同尺寸和形状的至少两个模板,计算至少两个模板和当前图像块的模板之间的模板失真。将模板失真最小的模板与当前图像块的模板之间的运动信息作为该第一运动信息。其中,遍历的过程中,至少两个模板之间的间隔可以是整像素值,也可以是非整像素值,例如但不限于二分之一像素、四分之一像素、八分之一像素或二分之三像素。
S402、根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真。
其中,第二运动信息可以是当前图像块的第二运动信息。
其中,根据所述第二运动信息列表,确定第二运动信息可以包括:将所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第二初始运动信息;在所述第二初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第二运动信息。
其中,S402的过程可以参考S401的过程,在此不再赘述。
S403、根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
其中,计算率失真代价的具体过程可以如下:
根据第一运动信息(或者称为前向运动信息)进行对当前图像块进行运动补偿(Motion Compensation,MC)、变换(Transform,T)、量化(Quantization,Q)、熵编码,得到第一率失真代价(或者称为前向预测的率失真代价),根据第二后向运动信息(或者称为后向运动信息)对当前图像块进行运动补偿、变换、量化、熵编码,得到第二率失真代价(或者称为后向预测的率失真代价),根据第一运动信息和第二运动信息对当前图像块进行双向运动补偿、变换、量化、熵编码,得到双向率失真代价(或者称为双向预测的率失真代价)。
其中,第一率失真代价计算公式可以为:RDCost0=D0+λR0
其中,RDCost0表示第一率失真代价,D0表示当前图像块的以第一运动信息进行编码(可以包括运动补偿,以及包括变换、量化和熵编码中至少一项)的失真,R0表示当前图像块以第一运动信息进行编码(可以包括运动补偿,以及包括变换、量化和熵编码中至少一项)消耗的比特数,λ是乘子,可以由编码端决定。
其中,第二率失真代价计算公式可以为:RDCost1=D1+λR1
其中,RDCost1表示第二率失真代价,D1表示当前图像块的以第二运动信息进行编码(可以包括运动补偿,以及包括变换、量化和熵编码中至少一项)的失真,R1表示当前图像块以第二运动信息进行编码(可以包括运动补偿,以及包括变换、量化和熵编码中至少一项)消耗的比特数,λ是乘子,可以由编码端决定。
其中,双向率失真代价计算公式可以为:RDCostBi=DBi+λRBi
其中,RDCostBi表示双向率失真代价,DBi表示当前图像块的以第一运动信息和第二运动信息进行编码(可以包括运动补偿,以及包括变换、量化和熵编码中至少一项)的失真,RBi表示当前图像块以第一运动信息和第二运动信息进行编码(可以包括运动补偿,以及包括变换、量化和熵编码中至少一项)消耗的比特数,λ是乘子,可以由编码端决定。
其中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价。其中,关于非低延时参考结构(Non-LowDelay configuration)和低延时的参考结构(LowDelay configuration)的内容可以参考HM 7.0、H.265以及H.266相关内容,其中非低延时参考结构可以理解成不是低延时参考结构的参考结构。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到。其中,第一码流数据还可以包括当前图像块的编码数据。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。其中,第二码流数据还可以包括当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。其中,第一单向码流数据还可以包括当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。其中,第二单向码流数据还可以包括当前图像块的编码数据。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
其中,模板失真阈值可以是第一模板失真和第二模板失真中的最小值。模板失真 阈值也可以是第一模板失真和第二模板失真中的最小值乘以预设的系数得到的值,该系数可以是大于或者等于1并且小于或者等于3的任意实数,例如2或者1.25。
在一些可行的实现方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,并且在所述双向模板失真大于模板失真阈值时,并且在第一模板失真小于或者等于第二模板失真时,根据第一运动信息对当前图像块进行单向预测,从而得到当前图像块的编码数据。或者,在所述当前图像块所在帧的参考结构为低延时参考结构时,并且在所述双向模板失真大于模板失真阈值时,并且在第一模板失真大于第二模板失真时,根据第二运动信息对当前图像块进行单向预测,从而得到当前图像块的编码数据。
在一些可行的实现方式中,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真可以包括:
如果第一模板失真小于或者等于第二模板失真,更新模板当前图像块的模板Tc,得到当前图像块的新的模板Tc’,Tc’=2*Tc-T0,其中T0为第一运动信息对应的参考图像块的模板,并根据当前图像块的新的模板在第二运动信息对应的参考图像块所在的区域或者第二初始运动信息对应的参考图像所在的区域进行运动搜索,得到调整后的第二运动信息,计算当前图像块的新的模板和调整后的第二运动信息对应的参考图像块的模板之间的模板失真,即为双向模板失真。
如果第一模板失真小于或者等于第二模板失真,更新模板当前图像块的模板Tc,得到当前图像块的新的模板Tc’,Tc’=2*Tc-T1,其中T1为第二运动信息对应的参考图像块的模板,并根据当前图像块的新的模板在第一运动信息对应的参考图像块所在的区域或者第一初始运动信息对应的参考图像所在的区域进行运动搜索,得到调整后的第一运动信息,计算当前图像块的新的模板和调整后的第一运动信息对应的参考图像块的模板之间的模板失真,即为双向模板失真。
在另一些可行的实施方式中,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真也可以包括:
将所述第一模板失真和所述第二模板失真的和作为双向模板失真。或者,将所述第一模板失真和所述第二模板失真的和与预设的另一系数的乘积作为双向模板失真。该另一系数可以是大于或者等于1并且小于或者等于3的任意实数,例如2或者1.25。
在一些可行的实施方式中,双向模板失真还可以通过以下方式得到:
根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真。具体的,双向模板失真的值可以是当前图像块的模板与双向模板的绝对误差和,双向模板为所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板加权和,例如,双向模板可以是所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板的和的一半。或者,双向模板失真的值可以是当前图像块的模板与双向模板的绝对误差和与预设的另一系数的乘积的值,该另一系数可以是大于或者等于1并且小于或者等于3的任意实数,例如2或者1.25。
关于运动搜索的内容,请参考S401,在此不再赘述。
在一些可行的实施方式中,判断所述当前图像块所在帧的参考结构为低延时参考 结构还是位非低延时参考结构的过程可以具体如下:如果当前帧(也就是当前图像块所在帧)的参考列表里面的参考帧(或者称为参考图像)的编号(Picture of Count,POC)都小于当前帧的编号,则当前图像块所在帧的参考结构为低延时的结构,否则当前图像块所在帧的参考结构为非低延时参考结构。在一种示例中,可以用POC_list0表示第一参考帧列表(例如List0)里参考帧的编号,POC_list1表示第二参考帧列表(List1)里参考帧的编号,POC_cur表示当前帧的编号。对于低延时参考结构可以满足如下条件:POC_cur>POC_list0、POC_cur>POC_list1都成立。具体过程也可以参考JEM5.0.1中的描述。
S404、在所述双向率失真代价小于或者等于所述第一率失真代价和所述第二率失真代价中的最小值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表和所述第二运动信息列表对所述当前图像块进行双向预测得到。
其中,双向码流数据还可以包括当前图像块的编码数据。
其中,当前图像块的编码数据可以是对当前图像块进行双向预测(例如,基于两个参考图图像列表的运动补偿),并进一步进行变换、量化和熵编码中至少一项得到数据。后文中通过双向预测得到的编码数据与此内容类似,后文不再赘述。
其中,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测可以包括:
将第一运动信息对应的参考图像块和第二运动信息对应的参考图像块作为当前图像块的参考图像块,获得当前图像块的预测图像块,对所述当前图像块进行编码还可以进一步对当前图像块的预测图像块进行变换、量化和熵编码中至少一种操作,从而获得当前图像块的双向码流数据。之后的关于单向预测的内容与此类似,不再赘述。
在一些可行的实施方式中,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测可以被替换为如下方案:
如果第一模板失真小于或者等于第二模板失真,更新模板当前图像块的模板Tc,得到当前图像块的新的模板Tc’,Tc’=2*Tc-T0,其中T0为第一运动信息对应的参考图像块的模板,并根据当前图像块的新的模板在第二运动信息对应的参考图像块所在的区域或者第二初始运动信息对应的参考图像所在的区域进行运动搜索,得到调整后的第二运动信息,根据所述第一运动信息和调整后的第二运动信息对所述当前图像块进行双向预测。
如果第一模板失真小于或者等于第二模板失真,更新模板当前图像块的模板Tc,得到当前图像块的新的模板Tc’,Tc’=2*Tc-T1,其中T1为第二运动信息对应的参考图像块的模板,并根据当前图像块的新的模板在第一运动信息对应的参考图像块所在的区域或者第一初始运动信息对应的参考图像所在的区域进行运动搜索,得到调整后的第一运动信息,根据调整后的第一运动信息和第二运动信息对所述当前图像块进行双向预测。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价大于所述 第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。其中,第一单向码流数据还可以包括当前图像块的编码数据。其中,当前图像块的编码数据可以是对当前图像块进行单向预测(例如,运动补偿),并进一步进行变换、量化和熵编码中至少一项得到数据。后文中通过单向预测得到的编码数据与此内容类似,后文不再赘述。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测到。其中,第二单向码流数据还可以包括当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到。其中,第一码流数据还可以包括当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括预测方向标识,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。其中,第二码流数据还可以包括当前图像块的编码数据。
上述方法中,预测方向标识的值的方案,可以采用如下编码方案:
预测方向 语法元素 二进制化
双向预测 2 ‘1’
前向预测 0 ‘00’
后向预测 1 ‘01’
其中,双向预测表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表以及所述当前图像块的第二运动信息列表对当前图像块进行双向预测得到,前向预测表示表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对当前图像块进行单向预测得到,后向预测表示所述当前图像块的编码数据根据所 述当前图像块的第二运动信息列表对当前图像块进行单向预测得到。
其中,作为语法元素,双向预测时,预测方向标识的值可以为双向预测值,例如为2,作为二进制化后的值,双向预测值可以为‘1’。
其中,作为语法元素,前向预测时,预测方向标识的值可以第一单向预测值,例如为0,作为二进制化后的值,第一单向预测值可以为‘00’。
其中,作为语法元素,后向预测时,预测方向标识的值可以为第二单向预测值,例如1,作为二进制化后的值,第二单向预测值可以为‘01’。
上述方法中,预测方向标识的值的方案,也可以采用如下另一种编码方案:
预测方向 语法元素 二进制化
双向预测 0 ‘0’
非双向预测 1 ‘1’
其中,非双向预测表示表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对当前图像块进行单向预测得到。
其中,作为语法元素,双向预测时,预测方向标识的值可以为双向预测值,例如0,作为二进制化后的值,双向预测值可以为‘0’。
其中,作为语法元素,非双向预测时,预测方向标识的值可以为非双向预测值,例如为1,作为二进制化后的值,非双向预测值可以为‘1’。
关于编码的相关过程可以参考图1至图3实施例中的相关描述,在此不再赘述。
图6为本发明实施例提供的一种基于模板匹配的解码方法的流程示意图。其中,该方法可以由目的地装置14执行,或者具体的可以由视频解码器30执行,或者具体的可以由预测单元81执行。该方法可以包括:
S601、获取预测方向标识和当前图像块的编码数据。
其中,预测方向标识可以为当前图像块的预测方向标识,也可以为当前图像块所在区域的预测方向标识,也可以为当前图像块所在帧的预测方向标识。
关于编码数据和码流数据的内容与前文类似,在此不再赘述。
在一些可行的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构(Non-LowDelay)时,获取所述预测方向标识。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述预测方向标识的值表示当前图像块的编码数据根据当前图像块的第一运动信息列表对当前图像块进行双向预测得到时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。在一些可行的实施方式中,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块可以包括:根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的 重建图像块。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述预测方向标识的值表示当前图像块的编码数据根据当前图像块的第二运动信息列表对当前图像块进行双向预测得到时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。在一些可行的实施方式中,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块可以包括:根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构时,并且在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。在一些可行的实施方式中,该方法还可以包括:在所述双向模板失真大于模板失真阈值并且第一模板失真小于或者等于第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。在一些可行的实施方式中,该方法还可以包括:在所述双向模板失真大于模板失真阈值并且第一模板失真大于第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时(LowDelay)参考结构时,根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图 像块的重建图像块,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。在一些可行的实施方式中,该方法还可以包括:在所述双向模板失真大于模板失真阈值并且第一模板失真小于或者等于第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。在一些可行的实施方式中,该方法还可以包括:在所述双向模板失真大于模板失真阈值并且第一模板失真大于第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,判断所述当前图像块所在帧的参考结构为低延时参考结构还是位非低延时参考结构的过程可以具体可以参考图4对应的实施例,在此不再赘述。
S602、在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真。
其中,该方法还可以包括:确定所述当前图像块的第一运动信息列表和所述当前图像块的第二运动信息列表。
其中,预测方向标识的内容可参考图4实施例中的内容,在此不再赘述。
其中,关于确定运动信息的具体内容,可参考图4实施例,在此不再赘述。
S603、根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真。
其中,关于确定运动信息的具体内容,可参考图4实施例,在此不再赘述。
S604、根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块可以包括:
根据第一运动信息和第二运动信息,确定当前图像块的预测图像块;对当前图像块的编码数据进行熵解码、反量化和反变换中的至少一种操作,从而获得当前图像块的残余图像块,将当前图像块的预测图像块和残余图像块相加,从而获得当前图像块的重建图像块。具体过程可以参考图3中的描述,在此不再赘述。
在一些可行的实施方式中,该方法还可以包括:在所述预测方向标识的值表示当前图像块的编码数据根据当前图像块的第一运动信息列表对当前图像块进行双向预测得到时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。其中,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块可以包括:根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一运动信息和所述当前图像块的编码数据,得到所 述当前图像块的重建图像块。类似过程可以参考上文及图2中的描述,在此不再赘述。
在一些可行的实施方式中,该方法还可以包括:在所述预测方向标识的值表示当前图像块的编码数据根据当前图像块的第二运动信息列表对当前图像块进行双向预测得到时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。关于具体的实施方式,与参考上文及图2中的描述类似,在此不再赘述。
在一些可行的实施方式中,该方法还可以包括:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
关于预测方向标识、模板失真以及其他类似的内容可以参考图6中的描述,在此不再赘述。
关于解码的相关过程可以参考图1至图3实施例中的相关描述,在此不再赘述。
图7为本发明实施例提供的一种基于模板匹配的编码方法的流程示意图。其中,该方法可以由源装置12执行,或者具体的可以由视频编码器20执行,或者具体的可以由预测单元41执行。该方法可以包括:
S701、将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息。
其中,该方法还可以包括:确定所述第一参考图像列表和所述第二参考图像列表。其中,所述第一参考图像列表和所述第二参考图像列表可以是当前图像块所在帧的参考图像列表,也可以是当前图像块所在区域(slice)的参考图像列表,也可以是当前图像块的参考图像列表。其中,第一运动信息为当前图像块的第一运动信息。
其中,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配指的是将当前图像块的模板在第一参考图像列表中的参考图像中进行模板匹配。
其中,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息可以包括:根据第一参考图像列表,确定当前图像块的第一初始运动信息;根据所述第一初始运动信息和当前图像块,在第一初始运动信息对应的参考图像块所在的区域中,对第一初始运动信息对应的参考图像块周围的参考图像块进行模板匹配,将模板失真最小的运动信息作为第一运动信息。其中,这里的模板失真 最小可以指的是包括第一初始运动信息对应的模板失真在内的模板失真中模板失真最小。
其中,根据第一参考图像列表,确定当前图像块的第一初始运动信息可以包括:根据第一参考图像列表,确定当前图像块的第一运动信息列表,将所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第一初始运动信息。其中,第一运动信息对应的模板失真小于或者等于第一初始运动信息对应的模板失真。
其中,根据所述第一初始运动信息和当前图像块,在第一初始运动信息对应的参考图像块所在的区域中,对第一初始运动信息对应的参考图像块周围的参考图像块进行模板匹配,将模板失真最小的运动信息作为第一运动信息的过程也可以称为:在所述第一初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第一运动信息,该过程可以包括:
在参考图像块所在的区域内,遍历所有和所述当前图像块的模板具有相同尺寸和形状的至少两个模板,计算至少两个模板和当前图像块的模板之间的模板失真。将模板失真最小的模板与当前图像块的模板之间的运动信息作为该第一运动信息。其中,所述至少两个模板的遍历顺序可以按照预设的顺序遍历。至少两个模板中的相邻模板之间的距离可以是预设的长度,如整像素或者非整像素。
在一些可行的实施方式中,根据第一参考图像列表,确定当前图像块的第一初始运动信息可以包括:根据第一参考图像列表,确定当前图像块的第一运动信息列表,将第一运动信息列表中模板失真最小的模板失真对应的运动信息作为第一初始运动信息。
所述第二参考图像列表、第二运动信息,以及将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息的操作与所述第一参考图像列表、第一运动信息,以及将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息的操作的内容相似,在此不再赘述。
S702、根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
在一些可行的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构,并且在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包 括所述当前图像块的编码数据。
其中,第一单向率失真条件可以包括第一率失真代价小于或者等于第二率失真代价。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构,并且在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
其中,第二单向率失真条件可以包括第一率失真代价大于第二率失真代价。所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件可以为所述第一率失真代价和所述第二率失真代价不满足第一单向率失真条件。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构,并且在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据。
其中,第一单向模板失真条件可以包括第一模板失真小于或者等于第二模板失真。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为非低延时参考结构,并且在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。
其中,第二单向模板失真条件可以包括第一模板失真大于第二模板失真。或者,满足第二单向模板失真条件可以为不满足第一单向模板失真条件。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。其中,该方法还可以包括:在所述双向模板失 真、所述第一模板失真和所述第二模板失真不满足所述双向模板失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据;或者,在所述双向模板失真、所述第一模板失真和所述第二模板失真不满足所述双向模板失真条件,并且所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。
应理解,依据模板匹配过程可知,在确定第一运动信息的同时,则确定了第一运动信息对应的参考图像块的模板以及第一模板失真。在确定第二运动信息的同时,则确定了第二运动信息对应的参考图像块的模板以及第二模板失真。
其中,该双向模板失真的值可以是当前图像块的模板与双向模板的绝对误差和,双向模板为所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板加权和,例如,双向模板可以是所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板的和的一半。
其中,本实施例中双向模板失真的获取方式也可以为图4实施例中的双向模板失真的获取方式。
其中,双向模板失真条件可以包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可以根据所述第一模板失真和所述第二模板失真得到。其中,模板失真阈值可以是第一模板失真和第二模板失真中的最小值。模板失真阈值也可以是第一模板失真和第二模板失真中的最小值乘以预设的系数得到的值,该系数可以是大于或者等于1并且小于或者等于3的任意实数,例如2或者1.25。S703、在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价满足双向率失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。
其中,本实施例中的预测皆可以称为运动补偿或者运动补偿预测,其中单向预测可以称为单向运动补偿或者单向运动补偿预测,双向预测可以称为双向运动补偿预测或者双向运动补偿。
其中,双向率失真条件可以包括双向率失真代价小于或者等于第一率失真代价和第二率失真代价中的最小值。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述 第一码流数据包括所述当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据。
在一些可行的实施方式中,该方法还可以包括:在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。
上述方法中,预测方向标识的值的方案,可以采用如下编码方案:
预测方向 语法元素 二进制化
双向预测 2 ‘1’
前向预测 0 ‘00’
后向预测 1 ‘01’
其中,双向预测表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表对当前图像块进行双向预测得到,前向预测表示表示所述当前图像块的编码数据根据所述第一参考图像列表对当前图像块进行单向预测得到,后向预测表示所述当前图像块的编码数据根据所述第二参考图像列表对当前图像块进行单向预测得到。
其中,作为语法元素,双向预测时,预测方向标识的值可以为双向预测值,例如为2,作为二进制化后的值,双向预测值可以为‘1’。
其中,作为语法元素,前向预测时,预测方向标识的值可以第一单向预测值,例如为0,作为二进制化后的值,第一单向预测值可以为‘00’。
其中,作为语法元素,后向预测时,预测方向标识的值可以为第二单向预测值, 例如1,作为二进制化后的值,第二单向预测值可以为‘01’。
上述方法中,预测方向标识的值的方案,也可以采用如下另一种编码方案:
预测方向 语法元素 二进制化
双向预测 0 ‘0’
非双向预测 1 ‘1’
其中,非双向预测表示表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对当前图像块进行单向预测得到。
其中,作为语法元素,双向预测时,预测方向标识的值可以为双向预测值,例如0,作为二进制化后的值,双向预测值可以为‘0’。
其中,作为语法元素,非双向预测时,预测方向标识的值可以为非双向预测值,例如为1,作为二进制化后的值,非双向预测值可以为‘1’。
图7实施例中与图4以及图6实施例中相似的内容可参考图4以及图6实施例中的描述,在此不再赘述。
在图7的基础上,图8为本发明实施例提供的一种基于模板匹配的编码方法的流程示意图。其中,该方法可以由源装置12执行,或者具体的可以由视频编码器20执行,或者具体的可以由预测单元41执行。该方法可以包括:
S801、将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息。
其中,具体的实现过程可以参考图1至图7中的描述,在此不再赘述。
S802、根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
其中,具体的实现过程可以参考图1至图7中的描述,在此不再赘述。
S803、判断所述双向率失真代价、所述第一率失真代价和所述第二率失真代价是否满足双向率失真条件,在满足时,执行S804,在不满足时执行S805。
S804、根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。结束流程。
S805、判断第一率失真代价和所述第二率失真代价是否满足第一单向率失真条件,在满足时,执行S806,在不满足时,执行S807。
S806、根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述 当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据。结束流程。
S807、根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。结束流程。
图8实施例中与图4至图7实施例中相似的内容可参考图4至图7实施例中的描述,在此不再赘述。
在图7的基础上,图9为本发明实施例提供的一种基于模板匹配的编码方法的流程示意图。其中,该方法可以由源装置12执行,或者具体的可以由视频编码器20执行,或者具体的可以由预测单元41执行。该方法可以包括:
S901、将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息。
S902、判断当前图像块所在帧的参考结构为非低延时参考结构还是位低延时参考结构,在所述当前图像块所在帧的参考结构为非低延时参考结构时,执行S903,在所述当前图像块所在帧的参考结构为低延时参考结构时,执行S909。
S903、根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
S904、判断所述双向率失真代价、所述第一率失真代价和所述第二率失真代价是否满足双向率失真条件,在满足时,执行S905,在不满足时,执行S906。
S905、根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。结束流程。
S906、判断所述第一率失真代价和所述第二率失真代价是否满足第一单向率失真条件,在满足时,执行S907,在不满足时,执行S908。
S907、根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据。结束流程。
S908、根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图 像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。结束流程。
S909、根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真。
S910、判断所述双向模板失真、所述第一模板失真和所述第二模板失真是否满足双向模板失真条件,在满足时执行S911,在不满足时,执行S912。
S911、根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。结束流程。
S912、判断所述第一模板失真和所述第二模板失真是否满足第一单向模板失真条件,在满足时,执行S913,在不满足时,执行S914。
S913、根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。结束流程。
S914、根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。结束流程。
图9实施例中与图4至图7实施例中相似的内容可参考图4至图7实施例中的描述,在此不再赘述。
在图7的基础上,图9为本发明实施例提供的一种基于模板匹配的编码方法的流程示意图。其中,该方法可以由源装置12执行,或者具体的可以由视频编码器20执行,或者具体的可以由预测单元41执行。该方法可以包括:
S1001、将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息。
S1002、判断当前图像块所在帧的参考结构为非低延时参考结构还是位低延时参考结构,在所述当前图像块所在帧的参考结构为非低延时参考结构时,执行S1003,在所述当前图像块所在帧的参考结构为低延时参考结构时,执行S1009。
S1003、根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
S1004、判断所述双向率失真代价、所述第一率失真代价和所述第二率失真代价是否满足双向率失真条件,在满足时,执行S1005,在不满足时,执行S1006。
S1005、根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。结束流程。
S1006、判断所述第一模板失真和所述第二模板失真是否满足第一单向模板失真条件,在满足时,执行S1007,在不满足时,执行S1008.
S1007、根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据。结束流程。
S1008、根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。结束流程。S1009、根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真。
S1010、判断所述双向模板失真、所述第一模板失真和所述第二模板失真是否满足双向模板失真条件,在满足时执行S1011,在不满足时,执行S1012。
S1011、根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。结束流程。
S1012、判断所述第一模板失真和所述第二模板失真是否满足第一单向模板失真条件,在满足时,执行S1013,在不满足时,执行S1014。
S1013、根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。结束流程。
S1014、根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。结束流程。
图10实施例中与图4至图7实施例中相似的内容可参考图4至图7实施例中的描述,在此不再赘述。
图11为本发明实施例提供的一种解码方法的流程示意图。其中,该方法可以由目的地装置14执行,或者具体的可以由视频解码器30执行,或者具体的可以由预测单元81执行。该方法可以包括:
S1101、获取当前图像块的预测方向标识和所述当前图像块的编码数据。
在一些可行的实施方式中,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
其中,获取当前图像块的预测方向标识和所述当前图像块的编码数据可以包括:获取当前图像块的码流数据,解析码流数据,从而获取当前图像块的预测方向标识和所述当前图像块的编码数据。其中,预测方向标识的值可以是直接写入码流数据的,也可以被编码(例如熵编码)后写入码流数据的。
在一些可行的实施方式中,该方法还可以包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信 息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。其中,该方法还可以包括:在所述双向模板失真、所述第一模板失真和所述第二模板失真不满足所述双向模板失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述双向模板失真、所述第一模板失真和所述第二模板失真不满足所述双向模板失真条件,并且所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,双向模板失真条件可以包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可以根据所述第一模板失真和所述第二模板失真得到。其中,模板失真阈值可以是第一模板失真和第二模板失真中的最小值。模板失真阈值也可以是第一模板失真和第二模板失真中的最小值乘以预设的系数得到的值,该系数可以是大于或者等于1并且小于或者等于3的任意实数,例如2或者1.25。
其中,第一单向模板失真条件可以包括第一模板失真小于或者等于第二模板失真。其中,第二单向模板失真条件可以包括第一模板失真大于第二模板失真。或者,满足第二单向模板失真条件可以为不满足第一单向模板失真条件。
其中,对于将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真这部分内容的具体实现,可参考上文中关于将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息的描述,在此不再赘述。
S1102、在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。其中,关于将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息的实现,可参考上文中图1至图10中的描述,在此不再赘述。其中,关于根据所述第一运 动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块的实现,可参考上文中图1至图10中的描述,在此不再赘述。
在一些可行的实施方式中,该方法还可以包括:
在所述预测方向标识的值表示所述当前图像块根据所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,该方法还可以包括:
在所述预测方向标识的值表示所述当前图像块根据所述当前图像块的编码数据根据第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,该方法还可以包括:
在所述预测方向标识的值表示所述当前图像块根据当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;在所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
图11实施例中与图4至图10实施例中相似的内容可参考图4至图10实施例中的描述,在此不再赘述。
在图11基础上,图12为本发明实施例提供的一种解码方法的流程示意图。其中,该方法可以由目的地装置14执行,或者具体的可以由视频解码器30执行,或者具体的可以由预测单元81执行。该方法可以包括:
S1201、获取当前图像块的预测方向标识和所述当前图像块的编码数据。
S1202、在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1203、在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所 述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1204、在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
图12实施例中与图4至图11实施例中相似的内容可参考图4至图10实施例中的描述,在此不再赘述。
在图11基础上,图13为本发明实施例提供的一种解码方法的流程示意图。其中,该方法可以由目的地装置14执行,或者具体的可以由视频解码器30执行,或者具体的可以由预测单元81执行。该方法可以包括:
S1301、获取当前图像块的编码数据。
S1302、判断当前图像块所在帧的参考结构为非低延时参考结构还是位低延时参考结构,在所述当前图像块所在帧的参考结构为非低延时参考结构时,执行S1303,在所述当前图像块所在帧的参考结构为低延时参考结构时,执行S1307。
S1303、获取当前图像块的预测方向标识。
S1304、在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1305、在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1306、在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1307、将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图 像块之间的第二模板失真;根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真。
S1308、判断所述双向模板失真、所述第一模板失真和所述第二模板失真是否满足双向模板失真条件,在满足时,执行S1309,在不满足时,执行S1310。
S1309、根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1310、判断所述第一模板失真和所述第二模板失真是否满足第一单向模板失真条件,在满足时,执行S1311,在不满足时,执行S1012。
S1311、根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1312、根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
图13实施例中与图4至图11实施例中相似的内容可参考图4至图10实施例中的描述,在此不再赘述。
在图11基础上,图14为本发明实施例提供的一种解码方法的流程示意图。其中,该方法可以由目的地装置14执行,或者具体的可以由视频解码器30执行,或者具体的可以由预测单元81执行。该方法可以包括:
S1401、获取当前图像块的编码数据。
S1402、判断当前图像块所在帧的参考结构为非低延时参考结构还是位低延时参考结构,在所述当前图像块所在帧的参考结构为非低延时参考结构时,执行S1403,在所述当前图像块所在帧的参考结构为低延时参考结构时,执行S1409。
S1403、获取当前图像块的预测方向标识。
S1404、在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1405、在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息。
S1406、判断所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真是否满足第一单向模板失真条件,在满足时,执行S1407,在不满足时,执行S1408.
S1407、根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1408、根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1409、将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真。
S1410、判断所述双向模板失真、所述第一模板失真和所述第二模板失真是否满足双向模板失真条件,在满足时,执行S1411,在不满足时,执行S1412。
S1411、根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1412、判断所述第一模板失真和所述第二模板失真是否满足第一单向模板失真条件,在满足时,执行S1413,在不满足时,执行S1414。
S1413、根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
S1414、根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。结束流程。
图14实施例中与图4至图11实施例中相似的内容可参考图4至图10实施例中的描述,在此不再赘述。
参阅图15所示,本发明实施例提供一种编码装置1500,该装置包括匹配单元1501、确定单元1502以及预测单元1503,其中,
匹配单元1501,用于根据所当前图像块的述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真。
在一些可行的实施方式中,匹配单元1501可以用于:将所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第一初始运动信息;在所述第一初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第一运动信息;
将所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真中最小的模板失真对应的运动信息作为第二初始运动信息;在所述第二初始运动信息对应的参考图像块所在的区域进行运动搜索,得到所述第二运动信息。
确定单元1502,用于根据所述第一运动信息和所述第二运动信息,确定双向运动 信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
在一些可行的实施方式中,确定单元1502可以用于:
仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
预测单元1503,用于在所述双向率失真代价小于或者等于所述第一率失真代价和所述第二率失真代价中的最小值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表和所述第二运动信息列表对所述当前图像块进行双向预测得到。
在一些可行的实施方式中,所述预测单元1503还可以用于:
在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到。
或者,在一些可行的实施方式中,所述预测单元1503还可以用于:在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。
在一些可行的实施方式中,所述预测单元1503还可以用于:在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。
或者,在一些可行的实施方式中,所述预测单元1503还可以用于:在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单 向预测得到。
在一些可行的实施方式中,所述预测单元1503还可以用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。其中,该预测单元1503还可以用于:在所述双向模板失真大于模板失真阈值时,并且第一模板失真小于或者等于第二模板失真时,根据所述第一运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。其中,预测单元1503还可以用于:在所述双向模板失真大于模板失真阈值时,并且第一模板失真大于第二模板失真时,根据所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。
可以理解的是,本实施例的编码装置的各个单元的功能可以根据上述编码方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
参阅图16所示,本发明实施例提供一种解码装置1600,该装置包括获取单元1601、和重建单元1602,其中,
获取单元1601,用于获取预测方向标识和当前图像块的编码数据。
在一些可行的实施方式中,获取单元1601可以用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
重建单元1602,用于在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,重建单元1602还可以用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
或者,重建单元1602还可以用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,重建单元1602还可以用于:在所述预测方向标识的值 表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,重建单元1602还可以用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息列表、所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。重建单元1602还可以用于在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。重建单元1602还可以用于在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
可以理解的是,本实施例的解码装置的各个单元的功能可以根据上述解码方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
参阅图17所示,本发明实施例提供一种编码装置1700,该装置包括匹配单元1701、确定单元1702以及预测单元1703,其中,
匹配单元1701,用于将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息。
确定单元1702,用于根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息。
预测单元1703,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价满足双向率失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。
在一些可行的实施方式中,所述预测单元1703还可以用于:
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据;
在一些可行的实施方式中,所述预测单元1703还可以用于:
在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
在一些可行的实施方式中,所述确定单元1702可以用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
在一些可行的实施方式中,所述预测单元1703还可以用于:在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据;
在一些可行的实施方式中,所述预测单元1703还可以用于:在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。
在一些可行的实施方式中,确定单元1702还可以用于:
在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;相应的,所述预测单元1703还可以用于:在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。所述预测单元1703还可以用于:在所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。所述预测单元1703还可以用于:在所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的编码数据。
可以理解的是,本实施例的编码装置的各个单元的功能可以根据上述编码方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
参阅图18所示,本发明实施例提供一种解码装置1800,该装置包括获取单元1801和重建单元1802,其中,
获取单元1801,用于获取当前图像块的预测方向标识和所述当前图像块的编码数据;
重建单元1802,用于在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,所述重建单元1802还可以用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
在一些可行的实施方式中,所述重建单元1802还可以用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
在一些可行的实施方式中,所述重建单元1802还可以用于:
在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配, 从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
在所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,所述第一单向模板失真条件可以包括所述第一模板失真小于或者等于所述第二模板失真。
其中,所述第二单向模板失真条件可以包括所述第一模板失真大于所述第二模板失真。
在一些可行的实施方式中,获取单元1801用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
在一些可行的实施方式中,所述重建单元1802还可以用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;
根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。所述重建单元1802还可以用于:在所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。所述重建单元1802还可以用于:在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
其中,所述双向模板失真条件可以包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可以根据所述第一模板失真和所述第二模板失真得到。
可以理解的是,本实施例的编码装置的各个单元的功能可以根据上述编码方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
图19是本发明实施例提供的计算机设备1900的硬件结构示意图。如图19所示,计算机设备1900可以作为编码装置1500或1700的一种实现方式,计算机设备1900包括处理器1902、存储器1904、输入/输出接口1906、通信接口1908和总线1910。其中,处理 器1902、存储器1904、输入/输出接口1906和通信接口1908通过总线1910实现彼此之间的通信连接。
应理解,具体来说,计算机设备1900可以是计算机设备或者运营商网络中的管理服务器或者NodeB(基站)、RNC(无线网络控制器)、网关等设备。
处理器1902可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现本发明实施例所提供的编码装置1500或1700中包括的单元所需执行的功能,或者执行本发明方法实施例提供的编码方法。处理器1902可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1902中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1902可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1904,处理器1902读取存储器1904中的信息,结合其硬件完成上述方法的步骤。
存储器1904可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器1904可以存储操作系统以及其他应用程序。在通过软件或者固件来实现本发明实施例提供的编码装置1500或1700中包括的单元所需执行的功能,或者执行本发明方法实施例提供的编码方法时,用于实现本发明实施例提供的技术方案的程序代码保存在存储器1904中,并由处理器1902来执行编码装置1500或1700中包括的单元所需执行的操作,或者执行本发明方法实施例提供的编码方法。
输入/输出接口1906用于接收输入的数据和信息,输出操作结果等数据。
通信接口1908使用例如但不限于收发器一类的收发装置,来实现计算机设备1900与其他设备或通信网络之间的通信。
总线1910可包括在计算机设备1900各个部件(例如处理器1902、存储器1904、输入/输出接口1906和通信接口1908)之间传送信息的通路。
应注意,尽管图19所示的计算机设备1900仅仅示出了处理器1902、存储器1904、输入/输出接口1906、通信接口1908以及总线1910,但是在具体实现过程中,本领域的技术人员应当明白,计算机设备1900还包含实现正常运行所必须的其他器件,例如显示屏幕。同时,根据具体需要,本领域的技术人员应当明白,计算机设备1900还可包含实现其他附加功能的硬件器件。此外,本领域的技术人员应当明白,计算机设备1900也可仅仅包含实现本发明实施例所必须的器件,而不必包含图19中所示的全部器件。
图20是本发明实施例提供的计算机设备2000的硬件结构示意图。如图20所示,计算机设备2000可以作为解码装置1600或1800的一种实现方式,计算机设备2000包括处 理器2002、存储器2004、输入/输出接口2006、通信接口2008和总线2010。其中,处理器2002、存储器2004、输入/输出接口2006和通信接口2008通过总线2010实现彼此之间的通信连接。应理解,具体来说,计算机设备2000可以是计算机设备或者运营商网络中的管理服务器或者NodeB(基站)、RNC(无线网络控制器)、网关等设备。
处理器2002可以采用通用的中央处理器(Central Processing Unit,CPU),微处理器,应用专用集成电路(Application Specific Integrated Circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现本发明实施例所提供的解码装置1600或1800中包括的单元所需执行的功能,或者执行本发明方法实施例提供的解码方法。处理器2002可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器2002中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2002可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器2004,处理器2002读取存储器2004中的信息,结合其硬件完成上述方法的步骤。
存储器2004可以是只读存储器(Read Only Memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(Random Access Memory,RAM)。存储器2004可以存储操作系统以及其他应用程序。在通过软件或者固件来实现本发明实施例提供的解码装置1600或1800中包括的单元所需执行的功能,或者执行本发明方法实施例提供的解码方法时,用于实现本发明实施例提供的技术方案的程序代码保存在存储器2004中,并由处理器2002来执行解码装置1600或1800中包括的单元所需执行的操作,或者执行本发明方法实施例提供的解码方法。
输入/输出接口2006用于接收输入的数据和信息,输出操作结果等数据。
通信接口2008使用例如但不限于收发器一类的收发装置,来实现计算机设备2000与其他设备或通信网络之间的通信。
总线2010可包括在计算机设备2000各个部件(例如处理器2002、存储器2004、输入/输出接口2006和通信接口2008)之间传送信息的通路。
应注意,尽管图20所示的计算机设备2000仅仅示出了处理器2002、存储器2004、输入/输出接口2006、通信接口2008以及总线2010,但是在具体实现过程中,本领域的技术人员应当明白,计算机设备2000还包含实现正常运行所必须的其他器件,例如显示屏幕。同时,根据具体需要,本领域的技术人员应当明白,计算机设备2000还可包含实现其他附加功能的硬件器件。此外,本领域的技术人员应当明白,计算机设备2000也可仅仅包含实现本发明实施例所必须的器件,而不必包含图20中所示的全部器件。
在一个或多个实例中,所描述的功能可以硬件、软件、固件或其任何组合来实施。 如果以软件实施,则功能可作为一个或多个指令或代码而存储于计算机可读媒体上或经由计算机可读媒体而发送,且通过基于硬件的处理单元执行。计算机可读媒体可包含计算机可读存储媒体(其对应于例如数据存储媒体等有形媒体)或通信媒体,通信媒体包含(例如)根据通信协议促进计算机程序从一处传送到另一处的任何媒体。以此方式,计算机可读媒体大体上可对应于(1)非瞬时的有形计算机可读存储媒体,或(2)例如信号或载波等通信媒体。数据存储媒体可为可由一个或多个计算机或一个或多个处理器存取以检索指令、代码及/或数据结构以用于实施本发明中所描述的技术的任何可用媒体。计算机程序产品可包含计算机可读媒体。
通过实例而非限制,某些计算机可读存储媒体可包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储器、磁盘存储器或其它磁性存储装置、快闪存储器,或可用以存储呈指令或数据结构的形式的所要程序代码且可由计算机存取的任何其它媒体。而且,任何连接可适当地称为计算机可读媒体。举例来说,如果使用同轴电缆、光缆、双绞线、数字用户线(DSL)或无线技术(例如,红外线、无线电及微波)而从网站、服务器或其它远程源发送指令,则同轴电缆、光缆、双绞线、DSL或无线技术(例如,红外线、无线电及微波)包含于媒体的定义中。然而,应理解,计算机可读存储媒体及数据存储媒体不包含连接、载波、信号或其它瞬时媒体,而是有关非瞬时有形存储媒体。如本文中所使用,磁盘及光盘包含压缩光盘(CD)、激光光盘、光学光盘、数字影音光盘(DVD)、软性磁盘及蓝光光盘,其中磁盘通常以磁性方式复制数据,而光盘通过激光以光学方式复制数据。以上各物的组合还应包含于计算机可读媒体的范围内。
可由例如一个或多个数字信号处理器(DSP)、通用微处理器、专用集成电路(ASIC)、现场可编程逻辑阵列(FPGA)或其它等效集成或离散逻辑电路等一个或多个处理器来执行指令。因此,如本文中所使用的术语“处理器”可指代前述结构或适于实施本文中所描述的技术的任何其它结构中的任一者。另外,在一些方面中,可将本文中所描述的功能性提供于经配置以用于编码及解码的专用硬件及/或软件模块内,或并入于组合式编解码器中。而且,所述技术可完全实施于一个或多个电路或逻辑元件中。
本发明的技术可以广泛地由多种装置或设备来实施,所述装置或设备包含无线手持机、集成电路(IC)或IC集合(例如,芯片组)。在本发明中描述各种组件、模块或单元以强调经配置以执行所揭示技术的装置的功能方面,但未必要求通过不同硬件单元来实现。确切地说,如上文所描述,各种单元可组合于编解码器硬件单元中,或通过交互操作性硬件单元(包含如上文所描述的一个或多个处理器)的集合结合合适软件及/或固件来提供。
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。
在本发明的各种实施例中,应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
另外,本文中术语“系统”和“网络”在本文中常可互换使用。应理解,本文中 术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
在本申请所提供的实施例中,应理解,“与A相应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (44)

  1. 一种基于模板匹配的解码方法,其特征在于,包括:
    获取预测方向标识和当前图像块的编码数据;
    在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
    或者,在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息 各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
  6. 一种基于模板匹配的编码方法,其特征在于,包括:
    根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
    在所述双向率失真代价小于或者等于所述第一率失真代价和所述第二率失真代价中的最小值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表和所述第二运动信息列表对所述当前图像块进行双向预测得到。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到;
    或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。
  8. 根据权利要求6或7所述的方法,其特征在于,仅在所述当前图像块所在帧的 参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到;
    或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。
  10. 根据权利要求8或9所述的方法,其特征在于,所述方法还包括:
    在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
  11. 一种基于模板匹配的解码装置,其特征在于,所述装置包括:
    获取单元,用于获取预测方向标识和当前图像块的编码数据;
    重建单元,用于在所述预测方向标识的值表示所述当前图像块的编码数据根据当前图像块的第一运动信息列表以及当前图像块的第二运动信息列表对所述当前图像块进行双向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  12. 根据权利要求11所述的装置,其特征在于,所述重建单元还用于:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
    或者,所述重建单元还用于:在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到 时,根据所述第二运动信息列表和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  13. 根据权利要求11所述的装置,其特征在于,所述重建单元还用于:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述当前图像块的第一运动信息列表或者所述当前图像块的第二运动信息列表对所述当前图像块进行单向预测得到时,根据所述第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    在所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  14. 根据权利要求11至13任一项所述的装置,其特征在于,所述获取单元用于:
    仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
  15. 根据权利要求14所述的装置,其特征在于,所述重建单元还用于:
    在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
  16. 一种基于模板匹配的编码装置,其特征在于,所述装置包括:
    匹配单元,用于根据所述当前图像块的第一运动信息列表,确定第一运动信息,所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真小于或者等于所述第一运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;根据所述当前图像块的第二运动信息列表,确定第二运动信息,所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真小于或者等于所述第二运动信息列表中的运动信息各自对应的参考图像块与所述当前图像块的模板失真;
    确定单元,用于根据所述第一运动信息和所述第二运动信息,确定双向运动信息 对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
    预测单元,用于在所述双向率失真代价小于或者等于所述第一率失真代价和所述第二率失真代价中的最小值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表和所述第二运动信息列表对所述当前图像块进行双向预测得到。
  17. 根据权利要求16所述的装置,其特征在于,所述预测单元还用于:
    在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价小于或者等于所述第二率失真代价时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表对所述当前图像块进行单向预测得到;
    或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一率失真代价大于所述第二率失真代价时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二运动信息列表对所述当前图像块进行单向预测得到。
  18. 根据权利要求16或17所述的装置,其特征在于,所述确定单元用于:
    仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
  19. 根据权利要求18所述的装置,其特征在于,所述预测单元还用于:
    在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真小于或者等于所述第二模板失真时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到;
    或者,在所述双向率失真代价大于所述第一率失真代价和所述第二率失真代价中的最小值,并且所述第一模板失真大于所述第二模板失真时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一运动信息列表或所述第二运动信息列表对所述当前图像块进行单向预测得到。
  20. 根据权利要求18或19所述的装置,其特征在于,所述预测单元还用于:
    在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一模板失真和所述第二模板失真,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真小于或者等于模板失真阈值时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据,所述模板失真阈值根据所述第一模板失真和所述第二模板失真得到。
  21. 一种基于模板匹配的解码方法,其特征在于,包括:
    获取当前图像块的预测方向标识和所述当前图像块的编码数据;
    在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  22. 根据权利要求21所述的方法,其特征在于,所述方法还包括:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
    或者,在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  23. 根据权利要求21所述的方法,其特征在于,所述方法还包括:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
    在所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  24. 根据权利要求23所述的方法,其特征在于,所述第一单向模板失真条件包括所述第一模板失真小于或者等于所述第二模板失真,所述第二单向模板失真条件包括所述第一模板失真大于所述第二模板失真。
  25. 根据权利要求21至24任一项所述的方法,其特征在于,仅在所述当前图像 块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
  26. 根据权利要求25所述的方法,其特征在于,所述方法还包括:在所述当前图像块所在帧的参考结构为低延时参考结构时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;
    根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  27. 根据权利要求26所述的方法,其特征在于,所述双向模板失真条件包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可以根据所述第一模板失真和所述第二模板失真得到。
  28. 一种基于模板匹配的编码方法,其特征在于,包括:
    将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
    根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
    在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价满足双向率失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。
  29. 根据权利要求28所述的方法,其特征在于,所述方法还包括:
    在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据;
    或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单 向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
  30. 根据权利要求28或29所述的方法,其特征在于,仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
  31. 根据权利要求30所述的方法,其特征在于,所述方法还包括:
    在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据;
    或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。
  32. 根据权利要求30或31所述的方法,其特征在于,所述方法还包括:
    在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。
  33. 一种基于模板匹配的解码装置,其特征在于,所述装置包括:
    获取单元,用于获取当前图像块的预测方向标识和所述当前图像块的编码数据;
    重建单元,用于在所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表和第二参考图像列表中的参考图像对所述当前图像块进行双向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  34. 根据权利要求33所述的装置,其特征在于,所述重建单元还用于:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像 列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;
    或者,在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  35. 根据权利要求33所述的装置,其特征在于,所述重建单元还用于:
    在所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表中的参考图像或所述第二参考图像列表中的参考图像对所述当前图像块进行单向预测得到时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
    在所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块;或者,在所述第一模板失真所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  36. 根据权利要求35所述的装置,其特征在于,所述第一单向模板失真条件包括所述第一模板失真小于或者等于所述第二模板失真,所述第二单向模板失真条件包括所述第一模板失真大于所述第二模板失真。
  37. 根据权利要求33至36任一项所述的方法,其特征在于,获取单元用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,获取所述预测方向标识。
  38. 根据权利要求37所述的装置,其特征在于,所述重建单元还用于:在所述当前图像块所在帧的参考结构为低延时参考结构时,将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息、所述第一运动信息对应的参考图像块的模板和所述第一运动信息对应的参考图像块与所述当前图像块之间的第一模板失真,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息、所述第二运动信息对应的参考图像块的模板和所述第二运动信息对应的参考图像块与所述当前图像块之间的第二模板失真;
    根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
    在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息、所述第二运动信息和所述当前图像块的编码数据,得到所述当前图像块的重建图像块。
  39. 根据权利要求38所述的装置,其特征在于,所述双向模板失真条件包括所述双向模板失真小于或者等于模板失真阈值,模板失真阈值可以根据所述第一模板失真和所述第二模板失真得到。
  40. 一种基于模板匹配的编码装置,其特征在于,包括:
    匹配单元,用于将当前图像块在所述第一参考图像列表中的参考图像中进行模板匹配,从而获得第一运动信息,将当前图像块在所述第二参考图像列表中的参考图像中进行模板匹配,从而获得第二运动信息;
    确定单元,用于根据所述第一运动信息和所述第二运动信息,确定双向运动信息对应的双向预测的双向率失真代价、所述第一运动信息对应的单向预测的第一率失真代价以及所述第二运动信息对应的单向预测的第二率失真代价,所述双向运动信息包括所述第一运动信息和所述第二运动信息;
    预测单元,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价满足双向率失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的双向码流数据,所述双向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表以及所述第二参考图像列表进行双向预测得到,所述双向码流数据包括所述当前图像块的编码数据。
  41. 根据权利要求40所述的装置,其特征在于,所述预测单元还用于:
    在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第一单向率失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一码流数据,所述第一码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据第一参考图像列表对所述当前图像块进行单向预测得到,所述第一码流数据包括所述当前图像块的编码数据;
    或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一率失真代价和所述第二率失真代价满足第二单向率失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二码流数据,所述第二码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块根据所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二码流数据包括所述当前图像块的编码数据。
  42. 根据权利要求40或41所述的装置,其特征在于,所述确定单元用于:仅在所述当前图像块所在帧的参考结构为非低延时参考结构时,根据所述第一运动信息和所述第二运动信息,确定所述双向率失真代价、所述第一率失真代价以及所述第二率失真代价。
  43. 根据权利要求42所述的装置,其特征在于,所述预测单元还用于:
    在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第一单向模板失真条件时,根据所述第一运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第一单向码流数据,所述第一单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第一单向码流数据包括所述当前图像块的编码数据;
    或者,在所述双向率失真代价、所述第一率失真代价和所述第二率失真代价不满足所述双向率失真条件,并且所述第一模板失真和所述第二模板失真满足第二单向模板失真条件时,根据所述第二运动信息对所述当前图像块进行单向预测,从而得到所述当前图像块的第二单向码流数据,所述第二单向码流数据包括被编入预测方向标识的码流数据,所述预测方向标识的值表示所述当前图像块的编码数据根据所述第一参考图像列表或者所述第二参考图像列表对所述当前图像块进行单向预测得到,所述第二单向码流数据包括所述当前图像块的编码数据。
  44. 根据权利要求42或43所述的装置,其特征在于,所述确定单元还用于:
    在所述当前图像块所在帧的参考结构为低延时参考结构时,根据所述第一运动信息对应的参考图像块的模板和第二运动信息对应的参考图像块的模板,确定对所述当前图像块进行双向预测的双向模板失真;
    相应的,所述预测单元还用于:在所述双向模板失真、所述第一模板失真和所述第二模板失真满足双向模板失真条件时,根据所述第一运动信息和所述第二运动信息对所述当前图像块进行双向预测,从而得到所述当前图像块的编码数据。
PCT/CN2017/092514 2017-07-11 2017-07-11 一种基于模板匹配的解码方法及装置 WO2019010634A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201780092906.2A CN110832859B (zh) 2017-07-11 2017-07-11 一种基于模板匹配的解码方法及装置
PCT/CN2017/092514 WO2019010634A1 (zh) 2017-07-11 2017-07-11 一种基于模板匹配的解码方法及装置
EP17917349.7A EP3644608A4 (en) 2017-07-11 2017-07-11 METHOD AND DEVICE FOR DECODING BASED ON A TEMPLATE
US16/738,996 US20200145653A1 (en) 2017-07-11 2020-01-09 Decoding method and apparatus based on template matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/092514 WO2019010634A1 (zh) 2017-07-11 2017-07-11 一种基于模板匹配的解码方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/738,996 Continuation US20200145653A1 (en) 2017-07-11 2020-01-09 Decoding method and apparatus based on template matching

Publications (1)

Publication Number Publication Date
WO2019010634A1 true WO2019010634A1 (zh) 2019-01-17

Family

ID=65001071

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/092514 WO2019010634A1 (zh) 2017-07-11 2017-07-11 一种基于模板匹配的解码方法及装置

Country Status (4)

Country Link
US (1) US20200145653A1 (zh)
EP (1) EP3644608A4 (zh)
CN (1) CN110832859B (zh)
WO (1) WO2019010634A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11412253B2 (en) * 2020-02-24 2022-08-09 Alibaba Group Holding Limited Methods for combining decoder side motion vector refinement with wrap-around motion compensation
CN114666600B (zh) * 2022-02-14 2023-04-07 北京大学 基于不规则模板的数据编码方法、装置、电子设备及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102067601A (zh) * 2008-04-11 2011-05-18 汤姆森特许公司 视频编码和解码中模板匹配预测(tmp)的方法和装置
US20120201295A1 (en) * 2009-08-21 2012-08-09 Sk Telecom Co., Ltd. Method and apparatus for intra-prediction encoding/decoding
CN102668562A (zh) * 2009-10-20 2012-09-12 汤姆森特许公司 运动矢量预测和细化
US20160286229A1 (en) * 2015-03-27 2016-09-29 Qualcomm Incorporated Motion vector derivation in video coding

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8873626B2 (en) * 2009-07-02 2014-10-28 Qualcomm Incorporated Template matching for video coding
US9781446B2 (en) * 2009-12-10 2017-10-03 Thomson Licensing Dtv Method for coding and method for decoding a block of an image and corresponding coding and decoding devices
US20110176611A1 (en) * 2010-01-15 2011-07-21 Yu-Wen Huang Methods for decoder-side motion vector derivation
US8995527B2 (en) * 2010-02-19 2015-03-31 Qualcomm Incorporated Block type signalling in video coding
CN102215386B (zh) * 2010-04-09 2013-03-27 华为技术有限公司 视频图像块处理方法及装置
CA2995507C (en) * 2015-09-02 2021-05-25 Mediatek Inc. Method and apparatus of decoder side motion derivation for video coding
CN106604035B (zh) * 2017-01-22 2019-10-18 北京君泊网络科技有限责任公司 一种用于视频编码和压缩的运动估计的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102067601A (zh) * 2008-04-11 2011-05-18 汤姆森特许公司 视频编码和解码中模板匹配预测(tmp)的方法和装置
US20120201295A1 (en) * 2009-08-21 2012-08-09 Sk Telecom Co., Ltd. Method and apparatus for intra-prediction encoding/decoding
CN102668562A (zh) * 2009-10-20 2012-09-12 汤姆森特许公司 运动矢量预测和细化
US20160286229A1 (en) * 2015-03-27 2016-09-29 Qualcomm Incorporated Motion vector derivation in video coding

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
US20200145653A1 (en) 2020-05-07
EP3644608A4 (en) 2020-06-10
CN110832859A (zh) 2020-02-21
EP3644608A1 (en) 2020-04-29
CN110832859B (zh) 2022-02-25

Similar Documents

Publication Publication Date Title
US10771813B2 (en) Reference frame encoding method and apparatus, and reference frame decoding method and apparatus
CN112840658B (zh) 帧间预测方法及装置
TWI714565B (zh) 視訊寫碼中運動向量推導
CN110719483B (zh) 视频解码、编码方法和装置、计算机设备及存储介质
CN111107356B (zh) 图像预测方法及装置
TW201803348A (zh) 用於在視頻寫碼中之並列參考指標的一致性約束
US11438578B2 (en) Video picture prediction method and apparatus
TW201830964A (zh) 基於在視訊寫碼中之一預測模式導出雙邊濾波器資訊
TW201838415A (zh) 在視訊寫碼中判定用於雙邊濾波之鄰近樣本
TW201711463A (zh) 判定用於視訊寫碼之照明補償狀態之系統及方法
WO2017129023A1 (zh) 解码方法、编码方法、解码设备和编码设备
JP2015510357A (ja) Bスライス中の予測ユニットの単方向インター予測への制限
JP7148612B2 (ja) ビデオデータインター予測の方法、装置、ビデオエンコーダ、ビデオデコーダ及びプログラム
CN110868587B (zh) 一种视频图像预测方法及装置
TWI826487B (zh) 用於視訊寫碼中之適應性運動向量差解析度及增加的運動向量儲存精確度的運動向量捨位
CN116582681A (zh) 合并模式的编码器、解码器及对应方法
WO2019154424A1 (zh) 视频解码方法、视频解码器以及电子设备
CN110868602B (zh) 视频编码器、视频解码器及相应方法
JP2023089018A (ja) ビデオ・エンコーダ、ビデオ・デコーダおよび対応する方法
US20200145653A1 (en) Decoding method and apparatus based on template matching
TW201921938A (zh) 具有在用於視訊寫碼之隨機存取組態中之未來參考訊框之可調適圖像群組結構
RU2778993C2 (ru) Способ и аппаратура предсказания видеоизображений
RU2787812C2 (ru) Способ и аппаратура предсказания видеоизображений
WO2019227297A1 (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: 17917349

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017917349

Country of ref document: EP

Effective date: 20200123