CN109429064B - Video data coding and decoding method, device and medium - Google Patents

Video data coding and decoding method, device and medium Download PDF

Info

Publication number
CN109429064B
CN109429064B CN201710725341.9A CN201710725341A CN109429064B CN 109429064 B CN109429064 B CN 109429064B CN 201710725341 A CN201710725341 A CN 201710725341A CN 109429064 B CN109429064 B CN 109429064B
Authority
CN
China
Prior art keywords
coding unit
motion information
information
sub
current coding
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710725341.9A
Other languages
Chinese (zh)
Other versions
CN109429064A (en
Inventor
陈焕浜
杨海涛
高山
刘杉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710725341.9A priority Critical patent/CN109429064B/en
Priority to PCT/CN2018/092494 priority patent/WO2019037533A1/en
Priority to TW107129127A priority patent/TWI694713B/en
Publication of CN109429064A publication Critical patent/CN109429064A/en
Application granted granted Critical
Publication of CN109429064B publication Critical patent/CN109429064B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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

Landscapes

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

Abstract

The embodiment of the invention provides a method and a device for coding and decoding video data, relates to the field of data processing, and can reduce the complexity of coding and decoding the video data. The method comprises the following steps: determining whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, acquiring the respective motion information of at least two sub-coding units, determining a first candidate motion information list of the current coding unit according to the respective motion information of the at least two sub-coding units, and acquiring the prediction information of the current coding unit according to the first candidate motion information list, wherein the at least two sub-coding units are the sub-coding units obtained after the current coding unit is divided, and the first candidate motion information list comprises the respective motion information of the at least two sub-coding units and the candidate motion information of the current coding unit.

Description

Video data coding and decoding method, device and medium
Technical Field
The embodiment of the invention relates to the field of data processing, in particular to a method and a device for coding and decoding video data.
Background
With the development of information technology, video data is becoming a main mode for users to acquire information in daily life more and more, the data volume of video data is generally large (especially high-definition video and the like), in order to reduce the storage space occupied by the video data and reduce the transmission bandwidth occupied in the process of transmitting the video data, the video data can be compressed and encoded and then stored or transmitted, and when the video data is played, the video data is decoded and played.
Currently, in encoding and decoding video data, encoding and decoding of the video data are two reciprocal processes, and taking encoding of the video data as an example, in an encoding method, each frame of the video data may be encoded in units of encoding units. Specifically, a video frame (i.e., a picture) is divided into at least two image blocks (each image block may be referred to as a coding unit), then for each coding unit, motion information of the coding unit is determined, a prediction value of the coding unit (i.e., a pixel value of the coding unit) is determined according to the motion information of the coding unit, and the coding unit is encoded according to the prediction information of the coding unit, so that the video recording apparatus encodes all the coding units of each video frame of video data according to the above-described method, thereby completing the encoding of the video data. In another encoding method, since all pixel values in a coding unit use the same motion information, and in the coding unit, not all pixel values may have the same motion information, in this case, a coding unit may be further divided into at least two sub-coding units, then the motion information of each sub-coding unit of the coding unit is obtained by using a sub-coding unit based motion vector prediction (SMVP) technique, a decoding end motion vector derivation (DMVD) technique, or a non-translational motion model, and further, the prediction value of each sub-coding unit is determined according to the motion information of each sub-coding unit, so as to obtain the prediction value of the coding unit, and finally, according to the prediction value of the coding unit, the coding units are coded such that the video recording apparatus codes all the coding units of each video frame of the video data according to the above-described method, thereby completing the coding of the video data.
However, in the above method, when the size of the coding unit is small, it may not be necessary to divide the coding unit into sub-coding units for encoding or decoding, but the video recording apparatus still divides the coding unit into sub-coding units and encodes or decodes the sub-coding units to complete the encoding or decoding of the coding unit, and thus may cause the encoding or decoding of the video data to be complicated.
Disclosure of Invention
The application provides a video data coding and decoding method and device, which can reduce the complexity of video data coding and decoding.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, the present application provides a method for encoding and decoding video data, which may include: determining whether the information of the current coding unit meets the coding and decoding conditions of the sub coding unit; if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, acquiring the respective motion information of at least two sub-coding units; and determining a first candidate motion information list of the current coding unit according to the respective motion information of the at least two sub-coding units, and obtaining the prediction information of the current coding unit according to the first candidate motion information list. Wherein the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units includes that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit;
prediction information of at least one coding unit adjacent to the current coding unit is obtained from motion information of sub coding units of the adjacent coding unit.
The current coding unit comprises a coding block, the coding block comprises an image block in a first video frame, at least two sub-coding units are obtained after the current coding unit is divided, each sub-coding unit comprises a sub-coding block, and the first candidate motion information list comprises motion information of each of the at least two sub-coding units and candidate motion information of the current coding unit.
According to the video data coding and decoding method, whether the current coding unit is divided into the sub-coding units for coding or decoding can be determined according to the actual situation of the current coding unit according to whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, and when the size of the current coding unit is small, the current coding unit does not need to be divided into the sub-coding units for coding or decoding, so that the complexity of coding and decoding the video data can be reduced.
In a first optional implementation manner of the first aspect, the method for coding and decoding video data provided by the present application may be applied to a decoding device, and the obtaining the prediction information of the current coding unit according to the first candidate motion information list may include: acquiring indication information indicating first target candidate motion information in the first candidate motion information list, determining the first target candidate motion information according to the first candidate motion information list and the indication information of the first target candidate motion information, and determining prediction information of the current coding unit according to the first target candidate motion information.
In this application, after the decoding device obtains the first candidate motion information list, the decoding device may obtain the indication information of the first target candidate motion information from the code stream of the current coding unit received by the decoding device, and thus, the decoding device may accurately determine the first target candidate motion information according to the first candidate motion information list and the indication information of the first target candidate motion information.
In a second optional implementation manner of the first aspect, the video data coding and decoding method provided by the present application may be applied to a decoding device, and if the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the video data coding and decoding method provided by the present application may further include: determining a second candidate motion information list of the current coding unit, acquiring indication information for indicating second target candidate motion information in the second candidate motion information list, determining second target candidate motion information according to the second candidate motion information list and the indication information of the second target candidate motion information, and finally determining prediction information of the current coding unit according to the second target candidate motion information, wherein the second candidate motion information list comprises candidate motion information of the current coding unit and does not comprise motion information of at least two sub-coding units.
In the present application, under the condition that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding units, the prediction information of the current coding unit can be directly determined according to the second target candidate motion information in the second candidate motion information list without acquiring the respective motion information of at least two sub-coding units (i.e., without dividing the current coding unit into the sub-coding units for coding and decoding), so that the complexity of video data coding and decoding can be reduced.
In a second optional implementation manner of the first aspect, the video data coding and decoding method provided by the present application may be applied to a decoding device, and the method may further include: the decoding device decodes the code stream which is received after the current coding unit codes to obtain first residual error information, and determines the reconstruction information of the current coding unit according to the prediction information and the first residual error information of the current coding unit.
In the application, the decoding device determines the reconstruction information of the current coding unit according to the prediction information and the first residual information of the current coding unit, that is, the decoding device can obtain the complete information of the current coding unit, and then the decoding device can obtain the complete information of the video data to be decoded by determining the reconstruction information of all the coding units, so that the decoding device can smoothly play the video data.
In a fourth optional implementation manner of the first aspect, the method for coding and decoding video data provided by the present application may be applied to a coding apparatus, and the obtaining prediction information of a current coding unit according to a first candidate motion information list may include: first target candidate motion information is determined in the first candidate motion information list, and prediction information of the current coding unit is determined according to the first target candidate motion information.
In the application, the encoding device may determine a candidate motion information list of the current encoding unit according to respective motion information of at least two sub-encoding units and by combining the motion information of the current encoding unit, and then determine optimal operation information from the candidate motion information list by using a rate distortion optimization technique, so as to determine prediction information of the current encoding unit according to the optimal motion information, thereby making the determined prediction information of the current encoding unit more accurate.
In a fifth optional implementation manner of the first aspect, the video data coding and decoding method provided by the present application may be applied to a coding device, and if the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the video data coding and decoding method provided by the present application may further include: determining a second candidate motion information list of the current coding unit, and determining second target candidate motion information in the second candidate motion information list, and determining prediction information of the current coding unit according to the second target candidate motion information, the second candidate motion information list including candidate motion information of the current coding unit, excluding motion information of each of the at least two sub-coding units.
In this application, when the information of the current coding unit does not satisfy the coding/decoding conditions of the sub-coding units, the coding device may directly determine the prediction information of the current coding unit according to the second target candidate motion information (which is the candidate motion information of the current coding unit) in the second candidate motion information list without acquiring the motion information of at least two sub-coding units (i.e., without dividing the current coding unit into sub-coding units for coding), so that the complexity of coding/decoding the video data can be reduced.
In a sixth optional implementation manner of the first aspect, the video data coding and decoding method provided by the present application may be applied to a coding device, and the method may further include: and encoding indication information for indicating the target candidate motion information into the code stream of the current coding unit.
In the application, after the encoding device completes encoding of the current encoding unit, the encoding device may encode the indication information of the first target candidate motion information or the indication information of the second target candidate motion information determined by the encoding device into the code stream, so that when the decoding device receives the code stream encoded by the current encoding unit, the decoding device may obtain the indication information of the first target candidate motion information or the indication information of the second target candidate motion information of the current encoding unit from the code stream.
In a seventh optional implementation manner of the first aspect, the video data coding and decoding method provided by the present application may be applied to a coding device, and the method may include: the encoding apparatus acquires original information of a current coding unit and encodes the current coding unit according to prediction information of the current coding unit and the original information of the current coding unit.
In the application, according to the prediction information of the current coding unit and the original information of the current coding unit, the current coding unit is coded, and then the coding equipment can obtain the coded video data by coding all the coding units, so the coding equipment can compress the video data, thereby when storing the video data, the large storage space is not required to be occupied, when the coding equipment sends the video data to other equipment, the large transmission bandwidth is not required to be occupied, so the video data coding is favorable for the storage and the quick transmission of the video data.
In a second aspect, the present application provides a method for encoding and decoding video data, which may include: determining whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, obtaining respective motion information of at least two sub-coding units, wherein the at least two sub-coding units are sub-coding units obtained after the current coding unit is divided, and obtaining prediction information of the current coding unit according to the respective motion information of the at least two sub-coding units.
Wherein the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units includes that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit;
prediction information of at least one coding unit adjacent to the current coding unit is obtained from motion information of sub coding units of the adjacent coding unit.
According to the video data coding and decoding method, whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units can be determined, whether the current coding unit is divided into the sub-coding units to be coded and decoded is determined according to the actual situation of the current coding unit, and when the size of the current coding unit is small, the current coding unit does not need to be divided into the sub-coding units to be coded and decoded, so that the complexity of coding and decoding the video data can be reduced.
In a first optional implementation manner of the second aspect, the method for obtaining motion information of each of at least two sub-coding units may include: and acquiring the motion information of the current coding unit, and performing motion search by taking the motion information of the current coding unit as the initial motion information of each of the at least two sub-coding units respectively, so as to obtain the motion information of each of the at least two sub-coding units.
In the present application, a search algorithm may be adopted to determine the motion information of the current coding unit, and then determine the respective motion information of at least two sub-coding units, so that the respective motion information of at least two sub-coding units may be accurately determined.
In a second optional implementation manner of the second aspect, if the information of the current coding unit does not satisfy the sub-coding unit coding/decoding condition, the method of video data provided by the present application may further include: motion information of the current coding unit is acquired, and prediction information of the current coding unit is determined according to the motion information of the current coding unit.
In the present application, under the condition that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding units, the respective motion information of at least two sub-coding units does not need to be acquired (i.e., the current coding unit does not need to be divided into the sub-coding units for coding and decoding), and the prediction information of the current coding unit can be directly determined according to the motion information of the current coding unit, so that the complexity of coding and decoding the video data can be reduced.
In a third optional implementation manner of the second aspect, the video data coding and decoding method provided by the present application may be applied to a decoding device, and the method for acquiring motion information of each of at least two sub-coding units may include: obtaining prediction mode indication information, a value of which is used for indicating whether the prediction mode is an affine transformation mode, if the value of the prediction mode indication information indicates that the current prediction mode is the affine transformation mode, obtaining motion information of at least two pixel positions of the current coding unit, and determining respective motion information of at least two sub-coding units according to the motion information of the at least two pixel positions.
In the application, because the encoding device can encode the prediction mode indication information into the code stream of the current encoding unit, the decoding device can acquire the prediction mode indication information of the current encoding unit from the received code stream encoded by the current encoding unit, and determine whether to adopt the affine transformation mode of the non-translational motion model to determine the prediction information of the current encoding unit according to the prediction mode indication information.
In a fourth optional implementation manner of the second aspect, the video data coding and decoding method provided by the present application may be applied to a coding device, and the method for acquiring motion information of each of at least two sub-coding units may include: motion information of at least two pixel positions of the current coding unit is acquired, and respective motion information of at least two sub-coding units is determined according to the motion information of the at least two pixel positions.
In a fifth optional implementation manner of the second aspect, the video data coding and decoding method provided by the present application may be applied to an encoding device, and the method may further include: the prediction mode of the current coding unit is determined according to the prediction information of the current coding unit, and prediction mode indication information is coded into a code stream of the current coding unit, wherein the value of the prediction mode indication information is used for indicating whether the prediction mode is an affine transformation mode or not.
In the application, the encoding device encodes the prediction mode indication information of the current encoding unit into the code stream of the current encoding unit, so that after the decoding device receives the code stream of the current encoding unit, the decoding device can know whether the prediction mode of the current encoding unit is the affine transformation mode or not according to the prediction mode indication information.
In a sixth optional implementation manner of the second aspect, the video data coding and decoding method provided by the present application may be applied to a coding device. If the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding units, the video data coding and decoding method provided by the application may further include: prediction information of the current coding unit is determined from a set of candidate prediction modes, which does not include an affine transformation mode.
In the present application, since the non-translational motion model is only used to obtain the motion information of the sub-coding unit, if the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the coding device cannot determine the motion information of the current coding unit by using the non-translational motion model, and the coding device determines the prediction information of the current coding unit by using one of the candidate prediction mode sets.
In a third aspect, the present application provides an apparatus for encoding and decoding video data, which may include a determining module and an obtaining module. The determining module may be configured to determine whether information of the current coding unit satisfies a coding/decoding condition of the sub-coding unit; the obtaining module may be configured to obtain motion information of each of the at least two sub-coding units when the determining module determines that the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units; the determining module may be further configured to determine a first candidate motion information list of the current coding unit according to the motion information of each of the at least two sub-coding units acquired by the acquiring module, and obtain the prediction information of the current coding unit according to the first candidate motion information list.
Wherein the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units includes that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit;
prediction information of at least one coding unit adjacent to the current coding unit is obtained from motion information of sub coding units of the adjacent coding unit.
The current coding unit comprises a coding block, the coding block comprises an image block in a first video frame, at least two sub-coding units are obtained after the current coding unit is divided, each sub-coding unit comprises a sub-coding block, and the first candidate motion information list comprises motion information of each of the at least two sub-coding units and candidate motion information of the current coding unit.
In a first optional implementation manner of the third aspect, the encoding and decoding apparatus of video data provided by the present application may be a decoding device, and the obtaining module may be further configured to obtain indication information used for indicating first target candidate motion information in the first candidate motion information list; the determining module is specifically configured to determine the first target candidate motion information according to the first candidate motion information list and the indication information of the first target candidate motion information, and determine the prediction information of the current coding unit according to the first target candidate motion information.
In a second optional implementation manner of the third aspect, the encoding and decoding apparatus of video data provided by the present application may be a decoding device, and the decoding device may further include a decoding module, where the decoding module may be configured to decode a code stream received after being encoded by the current encoding unit to obtain first residual information, and the determining module may be further configured to determine reconstruction information of the current encoding unit according to the prediction information and the first residual information of the current encoding unit.
In a third optional implementation manner of the third aspect, the video data encoding and decoding apparatus provided by the present application may be a decoding device, and the determining module may be further configured to determine a second candidate motion information list of the current coding unit when the information of the current coding unit does not satisfy the encoding and decoding conditions of the sub coding unit; the obtaining module may be further configured to obtain indication information indicating second target candidate motion information in the second candidate motion information list; the determining module may be further configured to determine second target candidate motion information according to a second candidate motion information list and indication information of the second target candidate motion information acquired by the acquiring module, and determine prediction information of the current coding unit according to the second target candidate motion information, where the second candidate motion information list includes candidate motion information of the current coding unit and does not include motion information of each of the at least two sub-coding units.
In a fourth optional implementation manner of the third aspect, the video data encoding and decoding apparatus provided in this application may be an encoding device, where the determining module is specifically configured to determine first target candidate motion information in the first candidate motion information list acquired by the acquiring module, and determine prediction information of a current coding unit according to the first target candidate motion information.
In a fifth optional implementation manner of the third aspect, the video data coding and decoding apparatus provided by the present application may be an encoding device, and the determining module may be further configured to determine a second candidate motion information list of the current coding unit, determine second target candidate motion information in the second candidate motion information list, and determine prediction information of the current coding unit according to the second target candidate motion information, where the information of the current coding unit does not satisfy the coding and decoding conditions of the sub coding units, and the second candidate motion information list includes the candidate motion information of the current coding unit and does not include respective motion information of at least two sub coding units.
In a sixth optional implementation manner of the third aspect, the video data encoding and decoding apparatus provided in this application may be an encoding device, where the encoding device further includes an encoding module, and the encoding module may be configured to encode, into a code stream of a current encoding unit, indication information for indicating the first target candidate motion information or indication information of the second target candidate motion information.
In a sixth optional implementation manner of the third aspect, the video data encoding and decoding apparatus provided in the present application may be an encoding device, and the obtaining module may be further configured to obtain original information of a current encoding unit; the encoding module may be further configured to encode the current coding unit according to the prediction information of the current coding unit and the original information of the current coding unit.
For technical effects of the third aspect and various alternative implementations thereof, reference may be made to the above description of the technical effects of the first aspect and various alternative implementations thereof, and details are not described here.
In a fourth aspect, the present application provides an apparatus for encoding and decoding video data, which may include a determining module and an obtaining module. The determining module may be configured to determine whether information of the current coding unit satisfies a coding/decoding condition of the sub-coding unit; the obtaining module may be configured to obtain motion information of each of the at least two sub-coding units when the determining module determines that the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units; the determining module may be further configured to obtain prediction information of the current coding unit according to the motion information of each of the at least two sub-coding units obtained by the obtaining module.
Wherein the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units includes that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit;
prediction information of at least one coding unit adjacent to the current coding unit is obtained from motion information of sub coding units of the adjacent coding unit.
The current coding unit comprises a coding block, the coding block comprises an image block in a first video frame, at least two sub-coding units are obtained after the current coding unit is divided, and the sub-coding units comprise sub-coding blocks.
In a first optional implementation manner of the fourth aspect, the obtaining module is specifically configured to obtain motion information of the current coding unit, and perform motion search for initial motion information of each of the at least two sub-coding units by using the motion information of the current coding unit, so as to obtain motion information of each of the at least two sub-coding units.
In a second optional implementation manner of the fourth aspect, the obtaining module may be further configured to obtain motion information of the current coding unit when the information of the current coding unit does not satisfy the coding and decoding conditions of the sub coding unit; the determining module may be further configured to determine prediction information of the current coding unit according to the motion information of the current coding unit acquired by the acquiring module.
In a third optional implementation manner of the fourth aspect, the video data encoding and decoding apparatus provided by the present application may be a decoding device, where the obtaining module is specifically configured to obtain the prediction mode indication information, and in a case that a value of the prediction mode indication information indicates that the current prediction mode is an affine transformation mode, obtain motion information of at least two pixel positions of the current coding unit, and determine motion information of each of at least two sub-coding units according to the motion information of the at least two pixel positions, where the value of the prediction mode indication information is used for indicating whether the prediction mode is an affine transformation mode.
In a fourth optional implementation manner of the fourth aspect, the video data encoding and decoding apparatus provided in this application may be an encoding device, and the obtaining module is further configured to obtain motion information of at least two pixel positions of a current encoding unit, and determine motion information of each of at least two sub-encoding units according to the motion information of the at least two pixel positions.
In a fifth optional implementation manner of the fourth aspect, the video data encoding and decoding apparatus provided by the present application may be an encoding device, and the encoding device may further include an encoding module, where the determining module is further configured to determine a prediction mode of a current coding unit according to prediction information of the current coding unit; the encoding module may be configured to encode, into a code stream of the current coding unit, prediction mode indication information determined by the determination module, a value of the prediction mode indication information indicating whether the prediction mode is an affine transformation mode.
In a sixth optional implementation manner of the fourth aspect, the video data encoding and decoding apparatus provided by the present application may be an encoding device; the determining module may be further configured to determine the prediction information of the current coding unit according to a candidate prediction mode set in a case that the information of the current coding unit does not satisfy the sub-coding unit coding/decoding condition, where the candidate prediction mode set does not include the affine transformation mode.
For technical effects of the fourth aspect and various alternative implementations thereof, reference may be made to the above description of the technical effects of the second aspect and various alternative implementations thereof, which is not described herein again.
In the first to fourth aspects, the size information of the current coding unit satisfying the sub-coding unit codec size condition includes that the size information of the current coding unit satisfies any one of the following conditions:
the pixel number of the current coding unit is greater than or equal to a first threshold value;
the ratio of the pixel number of the current coding unit to the pixel number of the first sub-coding unit is greater than or equal to a second threshold value, and the first sub-coding unit is one of at least two sub-coding units;
the width of the current coding unit is greater than or equal to a third threshold, or the height of the current coding unit is greater than or equal to a fourth threshold.
In this application, the decoding apparatus or the encoding apparatus determines that the information of the current coding unit satisfies the coding/decoding conditions of the sub-coding units, the decoding apparatus or the encoding apparatus may determine to decode or encode the current coding unit by dividing the current coding unit into the sub-coding units, the coding/decoding conditions of the sub-coding units may include multiple types, so that the decoding apparatus or the encoding apparatus may determine whether to divide the current coding unit into the sub-coding units according to multiple optional coding/decoding conditions of the sub-coding units, and select an appropriate decoding method or encoding method to complete decoding or encoding of the current coding unit.
In a fifth aspect, the present application provides an apparatus for encoding and decoding video data, which may include a processor and a memory coupled to the processor. The memory has stored thereon a computer program that is executed by the processor to implement the method of encoding and decoding video data as described in any one of the above first aspect and its various alternative implementations.
In a sixth aspect, the present application provides a computer-readable storage medium, in which a computer program is recorded, and the program, when executed by a processor, implements the video data encoding and decoding method according to the first aspect and any one of the various alternative implementations thereof.
In a seventh aspect, the present application provides a computer program product comprising instructions, which when run on a video data codec device, cause the device to perform the video data codec method according to any one of the first aspect and its various optional implementations.
For the description of the related contents and technical effects of the fifth aspect to the seventh aspect, reference may be made to the above description of the related contents and technical effects of the first aspect and various optional implementations thereof, and details are not repeated here.
In an eighth aspect, the present application provides an apparatus for encoding and decoding video data, which includes a processor and a memory coupled to the processor. The memory has stored thereon a computer program that is executed by the processor to implement the method of encoding and decoding video data as described in any one of the second aspect and its various alternative implementations.
In a ninth aspect, the present application provides a computer-readable storage medium, in which a computer program is recorded, and the program, when executed by a processor, implements the video data encoding and decoding method according to the second aspect and any one of its various alternative implementations.
In a tenth aspect, the present application provides a computer program product comprising instructions that, when run on a video data codec device, cause the device to perform the video data codec method according to any one of the second aspect and its various alternative implementations.
For the descriptions of the relevant contents and technical effects of the eighth aspect to the tenth aspect, reference may be made to the above description of the relevant contents and technical effects of the second aspect and various optional implementations thereof, which are not described herein again.
Drawings
Fig. 1 is a first schematic diagram illustrating a video frame being divided into coding units according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a coding unit divided into sub-coding units according to an embodiment of the present invention;
FIG. 3 is a second schematic diagram illustrating a division of a video frame into coding units according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a method of intra prediction according to an embodiment of the present invention;
FIG. 5(a) is a first schematic diagram illustrating an inter-frame prediction method according to an embodiment of the present invention;
FIG. 5(b) is a diagram illustrating a method of inter-frame prediction according to an embodiment of the present invention;
FIG. 5(c) is a third schematic diagram illustrating an inter-frame prediction method according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating motion vectors of a coding unit according to an embodiment of the present invention;
fig. 7 is a hardware schematic diagram of an encoding apparatus according to an embodiment of the present invention;
fig. 8 is a hardware schematic diagram of a decoding device according to an embodiment of the present invention;
fig. 9 is a first schematic diagram illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 10 is a first schematic diagram illustrating a method for obtaining motion information of sub-coding units according to an embodiment of the present invention;
fig. 11 is a schematic diagram illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 12 is a third schematic diagram illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 13 is a fourth schematic view illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 14 is a fifth schematic view illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 15 is a sixth schematic view illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 16 is a seventh schematic diagram illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 17 is a schematic diagram illustrating an eighth method for encoding and decoding video data according to an embodiment of the present invention;
fig. 18 is a diagram illustrating a method for encoding and decoding video data according to an embodiment of the present invention;
fig. 19 is a first diagram illustrating a method for determining motion information of a coding unit according to an embodiment of the present invention;
fig. 20 is a first diagram illustrating a method for determining motion information of sub-coding units according to an embodiment of the present invention;
fig. 21 is a schematic diagram illustrating a method for encoding and decoding video data according to an embodiment of the present invention;
fig. 22 is an eleventh schematic view illustrating a method for encoding and decoding video data according to an embodiment of the present invention;
fig. 23 is a diagram illustrating a second method for determining motion information of a sub-coding unit according to an embodiment of the present invention;
fig. 24 is a twelfth schematic view illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 25 is a thirteenth schematic diagram illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 26 is a fourteenth schematic diagram illustrating a video data encoding and decoding method according to an embodiment of the present invention;
fig. 27 is a first schematic structural diagram of an apparatus for encoding and decoding video data according to an embodiment of the present invention;
fig. 28 is a schematic structural diagram of a second apparatus for encoding and decoding video data according to an embodiment of the present invention.
Detailed Description
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second," and the like, in the description and in the claims of embodiments of the present invention are used for distinguishing between different objects and not for describing a particular order of the objects. For example, the first threshold value and the second threshold value, etc. are used to distinguish different threshold values, rather than to describe a particular order of the threshold values.
In the embodiments of the present invention, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the embodiments of the present invention, the meaning of "a plurality" means two or more unless otherwise specified. For example, a plurality of coding units refers to two or more coding units; the plurality of processing units means two or more processing units.
First, some concepts involved in a method and an apparatus for encoding and decoding video data according to an embodiment of the present invention are explained.
An encoding unit: including a coding block means dividing a video frame (i.e. an image) to be coded into a plurality of image blocks, where a coding block includes an image block in a video frame, for example, a video frame as shown in fig. 1, and assuming that the size of the video frame is 128 × 128, the video frame is divided into 4 image blocks with a size of 64 × 64 on average, and then the video frame may include 4 coding blocks, for example, where one coding block includes image block 1 in fig. 1.
A sub-coding unit: including a sub-coding block means that a coding unit of the video frame is divided into a plurality of sub-blocks, each of which may be referred to as a sub-coding block, for example, as shown in fig. 2, the video frame is divided into 4 coding blocks on average, and for a coding block, the coding block is further divided into 4 sub-blocks, each of which is a sub-coding block (e.g., sub-coding block 1 and sub-coding block 2 in fig. 2 are sub-coding blocks of coding block 1).
In the video data encoding process, taking one coding unit of video data to be encoded as an example, the encoding apparatus may first determine prediction information of the coding unit and then encode the coding unit according to the prediction information of the coding unit. In the process of decoding video data, taking a coding unit of video data to be decoded as an example, the decoding device may first determine prediction information of the coding unit and then determine reconstruction information of the coding unit according to the prediction information of the coding unit. In summary, in the process of encoding and decoding video data, a method of determining prediction information of a coding unit may include intra prediction and inter prediction. The following describes intra prediction and inter prediction, respectively.
Residual information of the coding unit: refers to a difference between the real information (i.e., original information) of the coding unit and the prediction information of the coding unit, i.e., a difference between the real information of the coding unit and the prediction information of the coding unit.
Reconstruction information of coding unit: the method includes the steps of determining a reconstruction value of a pixel value of a coding unit according to prediction information of the coding unit and residual information of the coding unit, specifically, adding the prediction information of the coding unit and the residual information of the coding unit, and then performing related filtering operation on the sum of the prediction information of the coding unit and the residual information of the coding unit to eliminate a block effect and obtain reconstruction information of the coding unit.
For a video frame to be encoded, after the video frame to be encoded is generally divided into a plurality of coding units, the video frame to be encoded is encoded in the order from left to right and from top to bottom in units of coding units, for example, as shown in fig. 3, the video frame is divided into 9 coding units, which are denoted as CU1-CU9, CU1-CU9 can be sequentially encoded according to the position order of CU1-CU9, and the encoding of the first video frame is completed.
Intra-frame prediction: when encoding a current coding unit (which may be referred to as a current coding unit), prediction information of the current coding unit, that is, a pixel value of a predicted current coding unit, may be determined by reconstruction information of a coding unit adjacent to the current coding unit (that is, spatially adjacent) within a video frame (which may be referred to as a first video frame) in which the current coding unit is located (the coding unit adjacent to the current coding unit has completed encoding).
Inter-frame prediction: when encoding a current coding unit (e.g., a current coding unit), prediction information of the current coding unit may be determined according to a video frame adjacent to a video frame (which may be referred to as a first video frame) in which the current coding unit is located (i.e., a video frame adjacent to the first video frame is used as a reference frame of the first video frame, and then an image block (which may be referred to as a reference block) most similar to the current coding unit is determined in a second video frame, and the reference block is used as prediction information of the current coding unit). Specifically, the inter-frame prediction includes prediction modes such as forward prediction, backward prediction, and bidirectional prediction, the forward prediction refers to determining prediction information of the current coding unit in a frame preceding the first video frame, for example, as shown in fig. 5(a), the first video frame is denoted as F1, the frame preceding the first video frame is denoted as F0, and in F0, the image block C0 is prediction information of the current coding unit C1; backward prediction refers to determining prediction information of a current coding unit in a frame subsequent to the first video frame, for example, as shown in fig. 5(b), the first video frame is denoted as F0, the frame subsequent to the first video frame is denoted as F2, and in F2, the image block C2 is prediction information of the current coding unit; bi-prediction refers to determining prediction information of a current coding unit in a frame preceding a first video frame, determining prediction information of a current coding unit in a frame succeeding the current coding unit, and then determining prediction information of the current coding unit according to the two prediction information, as shown in fig. 5(C), the first video frame is denoted as F1, the frame preceding the first video frame is denoted as F0, the frame succeeding the first video frame is denoted as F2, an image block C0 in F0 is one prediction information of the current coding unit, an image block C2 in F2 is also one prediction information of the current coding unit, and finally, determining prediction information of the current coding unit according to C0 and C2.
Motion vector of coding unit: in the case of encoding and decoding video data by using an inter-frame prediction method, for a coding unit (e.g., a current coding unit), a video frame in which the current coding unit is located is a first video frame, and in a reference frame (a previous frame and/or a next frame of the first video frame) of the first video frame, if an image block (referred to as a first image block) at a position corresponding to the current coding unit is a second image block, an image block most matched with the current coding unit (i.e., most similar to the current coding unit), a motion vector of the current coding unit refers to a motion displacement moving from the first image block to the second image block. As shown in fig. 6, F1 indicates the first video frame, F2 indicates the reference frame of the first video frame, and assuming that CU1 is the current coding unit, the image block at the corresponding position of CU1 in F2 is CU2, CU3 in F2 is the image block most matched with CU1, and the motion vector of the central pixel of the image block is taken as the motion vector of the image block, if the motion vector of CU2 is (0,0), the lower left of CU2 is 1 in longitudinal distance from CU2, and the lower left of 1 in lateral distance is CU3, the relative motion displacement between CU2 and CU3 is (-1, 1), and the motion vector of CU1 is (-1, 1).
Based on the problems of video data encoding and decoding in the background art, embodiments of the present invention provide a method and an apparatus for encoding and decoding video data, where an encoding device may determine whether information of an encoding unit satisfies encoding and decoding conditions of a sub-encoding unit according to actual conditions of the encoding unit, and then encode the video data by using a corresponding encoding method, and similarly, a decoding device may also determine whether information of the encoding unit satisfies encoding and decoding conditions of the sub-encoding unit, and then decode the video data by using a corresponding decoding method, so that complexity of encoding and decoding the video data can be reduced.
The method and the device for encoding and decoding the video data can be applied to a scene of encoding the video data or decoding the video data, and the method can be applied to equipment with encoding and/or decoding functions; the decoding device obtains the encoded video data, and the encoding device can decode the video data and recover the complete information of the video data, so that the video data can be ensured to be played smoothly.
The encoding and decoding methods of video data provided by the embodiments of the present invention may be applied to encoding equipment and decoding equipment, where the encoding equipment and the decoding equipment may be a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a handset such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or other similar equipment.
The following describes each constituent element of the encoding apparatus provided by the embodiment of the present invention in detail with reference to fig. 7. As shown in fig. 7, an encoding apparatus provided in an embodiment of the present invention includes: video source 10, video encoder 11 and output interface 12. Those skilled in the art will appreciate that the configuration of the encoding apparatus shown in fig. 7 does not constitute a limitation of the encoding apparatus, and may include more or less components than those shown in fig. 7, or may combine some of the components shown in fig. 7, or may be arranged differently than those shown in fig. 7.
Video source 10 may comprise a video capture device, such as a video camera, a video archive containing previously captured video data, a video input interface to receive video data from a video content provider, and/or a computer graphics system for generating video data, or a combination of the aforementioned video data sources.
The video encoder 11 may encode the video data acquired by the encoding apparatus according to an encoding standard (e.g., h.264) and convert the encoded video data into a code that can be recognized by a machine, so as to compress the video data, which is beneficial to transmission and storage of the video data. The video encoder 11 may be a Central Processing Unit (CPU), a general purpose processor, a Digital Signal Processor (DSP), an application-specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof, which may implement or execute various exemplary logic blocks, modules, and circuits described in the disclosure of the embodiments of the present invention; the video encoder 11 may also be a combination that performs a computational function, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
The output interface 12 is an interface circuit for transmitting data to other devices, the output interface 12 may be a transceiver, a transceiver circuit, or other structures with transceiving functions, including a modulator/demodulator (modem) and/or a transmitter, and in the video codec system, the output interface 12 may transmit encoded video data to a decoding device.
Optionally, the encoding apparatus shown in fig. 7 may further include a wireless fidelity (WiFi) module, a bluetooth module, and the like, which are not described herein again.
The following describes each constituent element of the decoding device provided in the embodiment of the present invention in detail with reference to fig. 8. As shown in fig. 8, a decoding apparatus provided in an embodiment of the present invention includes: an input interface 20, a video decoder 21, and a display device 22. Those skilled in the art will appreciate that the structure of the encoding apparatus shown in fig. 8 does not constitute a limitation of the encoding apparatus, and may include more or less components than those shown in fig. 8, or may combine some of the components shown in fig. 8, or may be arranged differently than those shown in fig. 8.
The input interface 20 is used for receiving data transmitted by other devices (e.g. encoding devices), and the input interface 20 may be a receiver and/or a modem. In a video codec system, the input interface 20 may receive encoded video data transmitted by an encoding apparatus.
The video decoder 21 can restore and decode, i.e., decompress, the encoded video data it receives, so that the decoded video data can be played in a display device. The video decoder 21 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof, that may implement or execute the various illustrative logical blocks, modules, and circuits described in this disclosure; the video decoder 21 may also be a combination that performs a computational function, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, or the like.
The display device 22 is used for displaying the decoded video data, and the display device may include various display devices, such as a Liquid Crystal Display (LCD), a plasma display, an organic light-emitting diode (OLED) display, or other types of display devices. Alternatively, the display device 22 may be integrated into the decoding apparatus, and the display device 22 may be provided outside the decoding apparatus, independently of the decoding apparatus.
In combination with the application scenario and the communication system, an embodiment of the present invention provides a method for encoding and decoding video data, where the method may include encoding video data and decoding video data, and the method for encoding video data and the method for decoding video data are respectively described below.
Optionally, in the embodiment of the present invention, when encoding and decoding the current coding unit, different methods such as a motion vector prediction method (for example, an SMVP technology), a DMVD technology, or a non-translational motion model may be adopted to encode and decode the current coding unit, and the following three methods are taken as examples respectively to exemplarily describe an encoding and decoding process of the current coding unit.
The method comprises the following steps: coding and decoding by adopting SMVP technology
In the embodiments of the present invention, methods for encoding and decoding by using an SMVP technique are described, respectively, where the SMVP technique is used for encoding, the method for encoding and decoding video data provided in the embodiments of the present invention may be applied to an encoding device, and where the SMVP technique is used for decoding, the method for encoding and decoding video data provided in the embodiments of the present invention may be applied to a decoding device.
First, when encoding by using the SMVP technique, as shown in fig. 9, the method for encoding and decoding video data according to the embodiment of the present invention may include S101 to S104:
s101, the encoding device determines whether the information of the current encoding unit meets the encoding and decoding conditions of the sub encoding unit.
The current coding unit comprises a coding block, the coding block comprises an image block in a current coding video frame, and the current coding video frame is a frame of video data to be coded.
In this embodiment of the present invention, after acquiring video data, an encoding device encodes the video data, where encoding of video data by the encoding device refers to encoding each frame of video data, and specifically, taking a frame (for example, a first video frame) in video data to be encoded (i.e., video data acquired by the encoding device) as an example, the encoding device divides the first video frame into a plurality of encoding units, and then encodes each encoding unit to complete encoding of the first video frame.
It should be noted that, in the embodiment of the present invention, for the related description of the coding unit, reference may be made to the related description of the coding unit in the introduction of some concepts related to the embodiment of the present invention in the above embodiment, and the size of the coding unit may be determined according to actual situations, for example, for a 256 × 256 video frame, the video frame may be divided into 4 coding units with a size of 128 × 128, the video frame may also be divided into 16 coding units with a size of 64 × 64, and the video frame may also be divided into 64 coding units with a size of 32 × 32, which is not limited in the embodiment of the present invention.
In the embodiment of the present invention, since the size of the video frame is usually larger, and the encoding device directly processes all data of the video frame, which may occupy more resources of the encoding device, and may cause that the encoding device cannot process other services, when encoding the video frame, after dividing each video frame into a plurality of encoding units, the encoding device may complete encoding of the entire video frame by encoding each encoding unit, so that it can be ensured that the encoding device can successfully complete encoding of the video data.
After the coding device divides a video frame into a plurality of coding units, in the process of coding one coding unit (for example, the current coding unit) by the coding device, because the motion directions of all pixel points of the current coding unit may be different, if the current coding unit is directly coded, the prediction information of the current coding unit may be determined to be inaccurate, so that the coding result of the current coding unit is inaccurate, the coding device may first determine whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, then determine whether the current coding unit is subdivided into at least two sub-coding units according to the determined result, and then select a proper coding method to code the at least two sub-coding units, so as to complete the coding of the current coding unit.
In an embodiment of the present invention, the information of the current coding unit satisfying the sub-coding unit coding/decoding condition may include that the information of the current coding unit satisfies at least one of the following conditions a1 and a 2:
a1, the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit.
In the embodiment of the present invention, the size information of the current coding unit satisfies the coding/decoding size condition of the sub coding unit, and the size information of the current coding unit satisfies any one of the following conditions B1-B3:
b1, the number of pixels of the current coding unit is greater than or equal to the first threshold.
In the embodiment of the present invention, when the number of pixels of the current coding unit is greater than or equal to the preset first threshold, it indicates that the size of the current coding unit is relatively large, and the coding device may occupy more resources of the coding device for coding the coding unit.
B2, the ratio of the pixel number of the current coding unit to the pixel number of the first sub-coding unit is larger than or equal to a second threshold value.
In an embodiment of the present invention, the first sub-coding unit is one of at least two sub-coding units after the current coding unit is divided into the at least two sub-coding units, and a size of the sub-coding unit may be preset. The ratio of the number of pixels of the current coding unit to the number of pixels of the first sub-coding unit is greater than or equal to a preset second threshold, which also indicates that the size of the current coding unit is larger.
B3, the width of the current coding unit is greater than or equal to a third threshold, or the height of the current coding unit is greater than or equal to a fourth threshold.
In the embodiment of the present invention, the width of the current coding unit is greater than a preset third threshold, which indicates that the size of the current coding unit is larger, or the width of the current coding unit is greater than or equal to a fourth threshold, which indicates that the size of the current coding unit is larger.
In the embodiment of the present invention, the first threshold, the second threshold, the third threshold, and the fourth threshold may be set according to actual situations, and the embodiment of the present invention is not particularly limited. Wherein the third threshold may be equal to the fourth threshold.
A2, the prediction information of at least one coding unit adjacent to the current coding unit is obtained from the motion information of the sub coding units of the adjacent coding unit.
In the embodiment of the present invention, when a video recording device encodes a current coding unit, if the video recording device determines that prediction information of a coding unit adjacent to the current coding unit in an already encoded coding unit is obtained according to motion information of a sub coding unit of the adjacent coding unit, the video recording device determines that the prediction information of the current coding unit may also be obtained according to the motion information of the sub coding unit of the current coding unit.
S102, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, the coding equipment acquires the respective motion information of at least two sub-coding units.
The at least two sub-coding units are sub-coding units obtained after the current coding unit is divided, and each sub-coding unit comprises a sub-coding block.
It is to be understood that, since the motion information may indicate that a current coding unit or a sub-coding unit may be obtained by shifting an already coded coding unit or sub-coding unit, the prediction information of the current coding unit may be quickly determined according to the motion information as long as the motion information of the coding unit or the sub-coding unit is determined.
In an embodiment of the present invention, if the information of the current coding unit satisfies at least one of a1 and a2, the encoding apparatus may divide the current coding unit into at least two sub-coding units and then acquire motion information of each of the at least two sub-coding units.
It should be noted that, in the embodiment of the present invention, the encoding device may determine the size of the sub-coding unit according to an actual situation, for example, the size of the current coding unit is 64 × 64, the encoding device may divide the current coding unit into 4 sub-coding units with the size of 32 × 32, the encoding device may also divide the current coding unit into 16 sub-coding units with the size of 16 × 16, and the current coding unit may also be divided into 32 sub-coding units with the size of 8 × 8, which is not limited in the embodiment of the present invention.
In an embodiment of the present invention, the motion information of the sub coding unit includes at least one of prediction direction indication information of the sub coding unit, a motion vector of the sub coding unit, and reference block indication information of the sub coding unit.
In this embodiment of the present invention, when a current coding unit is coded, a method for determining prediction information of the current coding unit may include forward prediction, backward prediction, or bidirectional prediction, and the prediction direction indication information of the sub coding unit is used to indicate whether a method for determining prediction information of the current coding unit is forward prediction, backward prediction, bidirectional prediction, or other prediction directions; for the description of the motion vector of the sub-coding unit, reference may be made to the related description of the motion vector of the coding unit in the above embodiments, and details are not repeated here; the reference block indication information of a sub-coding unit refers to an index of a video frame where an image block (which may be referred to as a reference block) most similar to the sub-coding unit is located, and it can be known from the index of the video frame which frame of the video data to be encoded the reference block is.
For example, in the embodiment of the present invention, assuming that, in the motion information of the sub-coding units, the prediction indication direction of one sub-coding unit (which may be referred to as a first sub-coding unit) is forward prediction, the motion vector of the first sub-coding unit is (1, 0), and the reference block indication information of the first sub-coding unit is 10, the encoding apparatus determines that, in a video frame (which may be referred to as a second video frame) in which the first sub-coding unit is located and which is ahead of the video frame (which is a current coding unit), and which has an index of 10, a sub-coding unit (which may be referred to as a second sub-coding unit) corresponding to the position of the first sub-coding unit is determined, and then, in the second video frame, a sub-coding unit (which may be referred to as a third sub-coding unit) having a distance of (1, 0) from the second sub-coding unit is the most similar to the first sub-coding unit, the pixel value of the third sub coding unit is used as the pixel value of the first sub coding unit, i.e. the third sub coding unit is used as the prediction information of the first sub coding unit.
It should be noted that, in the embodiment of the present invention, a method for acquiring motion information of each of at least two sub-coding units is described in detail in S103 below.
S103, the encoding device determines a first candidate motion information list of the current encoding unit according to the respective motion information of the at least two sub-encoding units.
Wherein the first candidate motion information list includes motion information and a current coding unit of each of the at least two sub-coding units.
In the embodiment of the present invention, S103 may be specifically implemented by S103a-S103 e:
s103a, the encoding apparatus acquires motion information of a plurality of image blocks spatially adjacent to the current coding unit, checks the availability and repetition of the motion information of the plurality of image blocks, and adds the motion information to the first candidate motion information list according to the check result.
In the embodiment of the present invention, an encoding device obtains motion information of a plurality of image blocks spatially adjacent to a current encoding unit to obtain a plurality of motion information, and uses the plurality of motion information as candidate motion information of the current encoding unit, where unavailable motion information may exist in the candidate motion information of the current encoding unit, for example, motion information does not exist in an uncoded image block; repeated motion information may also exist in the candidate motion information of the current coding unit, and taking the example that the coding device determines the motion information of 4 spatially adjacent image blocks, 2 motion information among the 4 motion information obtained by the coding device are the same, and then the 2 motion information are repeated. After the encoding apparatus determines unavailable motion information and duplicated motion information, the encoding apparatus deletes unavailable motion information and duplicated motion information (one motion information is retained in the duplicated motion information, and the remaining duplicated motion information is deleted), from among the candidate motions, and then adds the remaining motion information (motion information other than the unavailable and duplicated motion information in the candidate motion information) to the first candidate motion information list.
Optionally, in this embodiment of the present invention, the number of the image blocks adjacent to the spatial domain of the current coding unit may include a plurality of image blocks, specifically, the number of the image blocks adjacent to the spatial domain of the current coding unit may be determined according to an actual situation, and this embodiment of the present invention is not limited specifically.
It should be noted that, in the embodiment of the present invention, the size of the image block adjacent to the spatial domain of the current coding unit may be the same as the size of the current coding unit, or may be different from the size of the current coding unit, that is, the size of the image block adjacent to the spatial domain of the current coding unit may be smaller than the size of the current coding unit, may be equal to the size of the current coding unit, or may be larger than the size of the current coding unit, which is not specifically limited in the embodiment of the present invention.
S103b, the encoding apparatus obtains the motion information of each of the at least two sub-coding units, checks the availability and repetition of the motion information of each of the at least two sub-coding units, and adds the motion information of the sub-coding units to the first candidate motion information list according to the check result.
In this embodiment of the present invention, for all sub-coding units in at least two sub-coding units, an Advanced Temporal Motion Vector Prediction (ATMVP) method may be used to obtain motion information of each sub-coding unit, which is hereinafter referred to as ATMVP motion information of the sub-coding unit, and/or a spatial-temporal motion vector prediction (STMVP) method may be used to obtain motion information of each sub-coding unit, which is hereinafter referred to as STMVP motion information of the sub-coding unit.
It should be noted that, in the following embodiments, methods for determining a candidate motion information list of a current coding unit are described by taking, as an example, motion information of a sub coding unit acquired by a coding device as ATMVP motion information and STMVP motion information. In practical application, the ATMVP motion information and/or STMVP motion information may be selectively obtained according to practical situations, and the embodiment of the present invention is not particularly limited.
In this embodiment of the present invention, taking one sub-coding unit (for example, referred to as a first sub-coding unit) of at least two sub-coding units as an example, a method for a coding device to acquire ATMVP motion information of the first sub-coding unit is as follows: the encoding device obtains the motion information of the image block at the corresponding position in the reference frame of the first video frame where the first sub-encoding unit is located (referred to as the corresponding block of the first sub-encoding unit for short), and scales the motion information to obtain the motion information of the first sub-encoding unit.
For example, if the Picture Order Count (POC) of the video frame (i.e., the first video frame) where the first sub-coding unit is located is D1, the POC of the reference frame of the first video frame is D2, the POC of the video frame (e.g., called the second video frame) where the corresponding block of the first sub-coding unit is located is D3, the POC of the reference frame of the second video frame (i.e., the video frame where the corresponding block of the first sub-coding unit is located) is D4, and the motion information of the corresponding block of the first sub-coding unit is MV, the motion information MVs of the first sub-coding unit can be obtained by equation (1):
Figure GDA0002592509470000171
where σ denotes a scaling factor, which may characterize the degree to which MVs are scaled relative to MV.
In this embodiment of the present invention, taking one sub-coding unit (e.g., the first sub-coding unit) of at least two sub-coding units as an example, the method for the coding device to acquire the STMVP motion information of the first sub-coding unit is as follows: the coding device acquires motion information of image blocks of a first sub-coding unit which are adjacent in a spatial domain (for example, above and to the left of the first sub-coding unit), acquires motion information of image blocks of the first sub-coding unit which are adjacent in a temporal domain (for example, adjacent in a lower left corner of the first sub-coding unit), and then averages the motion information of the image blocks which are adjacent in the spatial domain and the motion information of the image blocks which are adjacent in the temporal domain to obtain the motion information of the first sub-coding unit.
Illustratively, as shown in fig. 10, an image block 1 represents a first sub-coding unit, an image block 2 and an image block 3 are spatially adjacent image blocks of the first sub-coding unit, an image block 4 is temporally adjacent image blocks of the first sub-coding unit, the coding apparatus determines motion information of the spatially adjacent image blocks 2 and 3 of the image block 1 and motion information of the temporally adjacent image block 3, and then averages the motion information of the image blocks 2, 3, and 4.
In the embodiment of the present invention, after the encoding device acquires the motion information (i.e., ATMVP motion information and STMVP motion information) of all the sub-encoding units of the current encoding unit, the encoding device checks the availability and repetition of the motion information of all the sub-encoding units, deletes unavailable motion information and repeated motion information, and then adds the remaining motion information (motion information other than the unavailable and repeated motion information) to the first candidate motion information list.
S103c, if the length of the motion information in the first candidate motion information list is smaller than the first length threshold, the encoding apparatus continues to acquire the motion information of the spatially neighboring image blocks of the current coding unit, and checks the usability and repetition thereof, and adds the motion information to the first candidate motion information list according to the check result, otherwise, directly performs S103 d.
In this embodiment of the present invention, the first candidate motion information list of the encoding apparatus includes candidate motion information of the current encoding unit and motion information of all sub-encoding units of the current encoding unit, the length of the motion information in the first candidate motion information list is the number of motion information in the first candidate motion information list, the first length threshold is that, on the premise of not considering deleting unavailable and repeated motion information, the first candidate motion information number is equal to the number of motion information of a sub-encoding unit, for example, the encoding apparatus acquires motion information of 4 spatially adjacent image blocks of the current encoding unit, so that the number of candidate motion information of the current encoding unit is 4, the motion information of a sub-encoding unit acquired by the encoding apparatus includes ATMVP and STMVP, so that the number of motion information of a sub-encoding unit is 2, so that the first length threshold of the first candidate motion information list is 6, if the encoding apparatus deletes one motion information among the 4 candidate motion information of the current coding unit in S103a, the length of the first candidate motion information list is 3, and then, in S103b, the encoding apparatus does not delete the motion information, adds 2 motion information of the sub coding unit (i.e., ATMVP motion information and STMVP motion information) to the first candidate motion information list, and the length of the first candidate motion information list is 5.
In this embodiment of the present invention, the length of the motion information in the first candidate motion information list is smaller than the first length threshold, which indicates that the number of the motion information in the first candidate motion information list is small, and then the encoding device may continue to add new motion information to the first candidate motion information list.
S103d, the encoding apparatus obtains the motion information of the temporally adjacent image block of the current coding unit, scales it, and adds it to the first candidate motion information list.
Optionally, in this embodiment of the present invention, in S103d, the image block adjacent to the current coding unit in the time domain (that is, the image block in the reference frame of the first video frame) may be an image block at a specific specified position, and if the motion information of the image block does not exist, one image block in the reference block corresponding to the position of the current coding unit may be selected from the reference frame of the first video frame, and the motion information of the image block is added to the first candidate motion information list.
In this embodiment of the present invention, the size of the image block adjacent to the current coding unit in the time domain may be the same as the size of the current coding unit, or may be different from the size of the current coding unit, which is not limited in this embodiment of the present invention.
S103e, if the length of the motion information in the first candidate motion information list is smaller than the second length threshold, the encoding apparatus fills the first candidate motion information list.
In the embodiment of the present invention, the second length threshold refers to the length of the first candidate motion information list after S103d without considering deletion of the candidate motion information of the current coding unit and the motion information of each of the at least two sub-coding units. Illustratively, the number of candidate motion information of the current coding unit in S103a is 4, and the number of motion information of each of at least two sub-coding units in S103b is 2, then the second length threshold is 7.
In this embodiment of the present invention, if the encoding device determines that the length of the motion information in the first candidate motion information list is smaller than the second length threshold, the encoding device fills new motion information into the first candidate motion information list, so that the length of the first candidate motion information list is equal to the second length threshold.
Optionally, in this embodiment of the present invention, the encoding device may fill the first candidate motion information list with motion information whose motion vector is (0,0), and the encoding device may further determine motion information to be filled according to video frames before and after the first video frame where the current coding unit is located. The method for filling motion information is a common prior art and will not be described herein.
To this end, the encoding apparatus acquires a first candidate motion information list of the current encoding unit, so that the encoding apparatus may determine prediction information of the current encoding unit according to motion information in the first candidate motion information list.
And S104, the coding equipment obtains the prediction information of the current coding unit according to the first candidate motion information list.
Optionally, with reference to fig. 9, as shown in fig. 11, in the embodiment of the present invention, S104 may be implemented by S104a-S104 b:
s104a, the encoding apparatus determines first target candidate motion information in the first candidate motion information list.
In this embodiment of the present invention, after acquiring a first candidate motion information list, an encoding device may determine optimal motion information (referred to as first target candidate motion information) from the first candidate motion information list, where the first target candidate motion information is one candidate motion information with a smallest residual (i.e., the first residual information) of prediction information of a current coding unit determined according to all candidate motion information in the first candidate motion information list.
Optionally, in this embodiment of the present invention, the encoding device may determine the first target candidate motion information from the first candidate motion information list by using a rate distortion optimization technique. Specifically, the encoding device may calculate a rate-distortion cost according to all candidate motion information in the first candidate motion list by using the following formula (2), and then select motion information with the smallest rate-distortion cost as the first target candidate motion information:
J=RAD+λR (2)
wherein J represents a rate distortion cost, RAD represents an absolute error sum between prediction information and original information of a current coding unit, λ represents a lagrangian multiplier (λ may be a preset constant), and R represents a code rate of video data.
In the embodiment of the present invention, the encoding apparatus estimates prediction information of the current coding unit from each candidate motion information in the first candidate motion information list. Specifically, the encoding apparatus determines prediction information of the current coding unit according to candidate motion information of the current coding unit in the first candidate motion information list, determines prediction information of each sub-coding unit according to motion information of the sub-coding units in the first candidate motion information, for example, according to motion information of all sub-coding units of the current coding unit, and obtains the prediction information of the current coding unit, and then calculates a plurality of prediction information rate-distortion costs according to formula (2), and selects candidate motion information with the smallest rate-distortion cost as the first target candidate motion information.
S104b, the encoding apparatus determines prediction information of the current coding unit based on the first target candidate motion information.
In this embodiment of the present invention, the determining, by the encoding device, the prediction information of the current coding unit according to the first target candidate motion information may specifically be: the encoding apparatus takes the pixel values of the image block corresponding to the first target motion candidate information as prediction information of the current coding unit.
Optionally, in this embodiment of the present invention, with reference to fig. 11, as shown in fig. 12, after the step S104, the method for encoding and decoding video data according to this embodiment of the present invention may further include the step S105:
and S105, the coding device codes indication information for indicating the first target candidate motion information into a code stream of the current coding unit.
In the embodiment of the invention, after the coding device finishes coding the current coding unit, the coding device can encode the indication information of the first target candidate motion information determined by the coding device into the code stream, so that when the decoding device receives the code stream coded by the current coding unit, the decoding device can acquire the indication information of the first target candidate motion information of the current coding unit from the code stream.
Optionally, in this embodiment of the present invention, the indication information of the first target candidate motion information may be an index of the first target candidate motion information in the first candidate motion information list, and certainly, the indication information of the first target candidate motion information is also set as other indication information meeting the use requirement, which is not limited in this embodiment of the present invention.
In this embodiment of the present invention, with reference to fig. 9, after the above S104, the method for encoding and decoding video data according to this embodiment of the present invention may further include S106:
s106, the encoding device acquires the original information of the current encoding unit.
S107, the encoding device encodes the current coding unit according to the prediction information of the current coding unit and the original information of the current coding unit.
In the embodiment of the present invention, in a process of encoding video data, original information of a current encoding unit is known information (that is, a real pixel value in the current encoding unit), after acquiring the original information of the current encoding unit, an encoding device subtracts the original information of the current encoding unit from prediction information of the current encoding unit to obtain residual information (hereinafter, referred to as first residual information) of the current encoding unit, and then the encoding device encodes the first residual information to obtain second residual information, that is, a code stream after the current encoding unit is encoded.
Specifically, the encoding device encodes the first residual information, which includes transforming (for example, Discrete Cosine Transform (DCT), etc.), quantizing, and entropy encoding the first residual information, to obtain second residual information, that is, the encoded current encoding unit.
Optionally, in the embodiment of the present invention, the encoding device sends the information (i.e., the code stream) of the encoded current encoding unit to the decoding device, so that after the decoding device receives the second residual information sent by the encoding device, the decoding device may decode the second residual information, and recover the complete information of the current encoding unit corresponding to the second residual information.
Optionally, in this embodiment of the present invention, after the encoding device determines the prediction information and the first residual information of the current encoding unit, the encoding device may determine the reconstruction information of the current encoding unit.
In this embodiment of the present invention, an encoding device adds prediction information of a current encoding unit to first residual information determined by the encoding device to obtain reconstruction information of the current encoding unit, where the reconstruction information of the current encoding unit is used by the encoding device to encode another unit to be encoded (for example, a unit to be encoded is a first encoding unit), and the first encoding unit is one encoding unit in a video frame to be encoded. For example, if the first coding unit is the next coding unit of the current coding unit, and the coding apparatus determines the prediction information of the first coding unit during the process of coding the first coding unit, the reconstruction information of the current coding unit may be used as the reference information of the first coding unit.
In this embodiment of the present invention, in the process of encoding video data, through the above S101, if the encoding device determines that the information of the current coding unit does not satisfy the sub-coding unit encoding and decoding conditions, it indicates that the size of the current coding unit is smaller, the encoding device does not need to divide the current coding unit into at least two sub-coding units, and then determines the prediction information of the current coding unit according to the motion information of the sub-coding units, and the encoding device may determine the prediction information of the current coding unit according to the motion information of the current coding unit, so that the complexity of the encoding device for encoding video data may be reduced.
Specifically, in this embodiment of the present invention, with reference to fig. 9, as shown in fig. 13, if the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the method for coding and decoding video data according to the embodiment of the present invention may further include S108 to S110:
s108, if the information of the current coding unit does not meet the coding and decoding conditions of the sub coding unit, the coding equipment determines a second motion information list of the current coding unit, wherein the second candidate motion information list comprises candidate motion information of the current coding unit.
Wherein the second motion information list does not include the motion information of each of the at least two sub-coding units.
In this embodiment of the present invention, if the decoding device determines that the information of the current coding unit satisfies the coding/decoding conditions of the sub-coding unit, the decoding device may know the length of the candidate motion information list of the current decoding unit, for example, generally, when the information of one coding unit satisfies the coding/decoding conditions of the sub-coding unit, the length of the candidate motion information list may be 7, and when the information of one coding unit does not satisfy the coding/decoding conditions of the sub-coding unit, the length of the candidate motion information list may be 5.
Specifically, the encoding apparatus determines that the second candidate motion information list includes obtaining at least one candidate motion information of the current coding unit and then adding the at least one candidate motion information to the first candidate motion information list, and the above S108 may be implemented by S108a to S108 d:
s108a, the encoding apparatus obtains the motion information of a plurality of image blocks spatially adjacent to the current coding unit, checks the usability and repetition of the motion information of the plurality of image blocks, and adds the motion information to the second candidate motion information list of the current coding unit according to the checking result.
For a specific description of S108a, reference may be made to the description related to S103a in the foregoing embodiment, and details are not repeated here.
S108b, if the length of the motion information in the second candidate motion information list is smaller than the third length threshold, the encoding apparatus continues to acquire the motion information of the spatially neighboring image blocks of the current coding unit, and checks the usability and repetition thereof, and adds the motion information to the second candidate motion information list according to the check result, otherwise, directly performs S108 c.
In the embodiment of the present invention, the third length threshold refers to the number of motion information candidates of the current coding unit without considering deletion of motion information among the motion information candidates acquired by the coding apparatus in S108 a.
For other descriptions of S108b, reference may be made to the description of S103c in the foregoing embodiments, and details are not repeated here.
S108c, the encoding device obtains the motion information of the image blocks adjacent in the time domain of the current coding unit, and adds the motion information to the second candidate motion information list after scaling.
For a specific description of S108c, reference may be made to the description related to S103d in the foregoing embodiment, and details are not repeated here.
S108d, if the length of the motion information in the second candidate motion information list is smaller than the fourth length threshold, the encoding apparatus fills the second candidate motion information list.
In the embodiment of the present invention, the fourth length threshold refers to the length of the second candidate motion information list after S108c without considering the candidate motion information of the current coding unit determined in the deletions S108a and S108 b. If the encoding device determines that the length of the motion information in the second candidate motion information list is smaller than the fourth length threshold, the encoding device fills new motion information into the second candidate motion information list, so that the length of the second candidate motion information list is equal to the fourth length threshold.
The second candidate motion information may be acquired through the above-described S108a-S108d, so that the encoding apparatus may determine prediction information of the current coding unit from the motion information in the second candidate motion information list.
It should be noted that, in the embodiment of the present invention, the second candidate motion information list in S108d is different from the candidate motion information list in S103e, the first candidate motion information list described in S103e includes the motion information of the second candidate motion information list in S108d, and the candidate motion information list in S103e includes the motion information of each of the at least two sub-coding units and the motion information of the current coding unit.
S109, the encoding apparatus determines second target candidate motion information in the second candidate motion information list.
S110, the encoding device determines the prediction information of the current encoding unit according to the second target candidate motion information.
For other descriptions of S109-S110, reference may be specifically made to the related descriptions of 104a-S104b in S104 in the foregoing embodiment, and details are not repeated here.
Optionally, in this embodiment of the present invention, with reference to fig. 13, after S110, the method for encoding and decoding video data according to this embodiment of the present invention may further include S111:
and S111, the encoding device encodes indication information for indicating the second target candidate motion information into a code stream of the current encoding unit.
It should be noted that, in the embodiment of the present invention, in the case that the information of the current coding unit does not satisfy the sub-coding unit coding/decoding condition, the prediction information of the current coding unit may be determined through S108 to S110, and the above-mentioned S106 to S107 may be performed to code the current coding unit.
In the embodiment of the present invention, an encoding device encodes (i.e., compresses) video data and then transmits the encoded video data to a decoding device, and when playing the video data, the decoding device first decodes the encoded video data to obtain decoded video data (i.e., original video data), and then the decoding device can play the video data.
When decoding by using the SMVP technique, as shown in fig. 14, the method for encoding and decoding video data according to the embodiment of the present invention may include S201 to S204:
s201, the decoding device determines whether the information of the current coding unit meets the coding and decoding conditions of the sub coding unit.
It should be noted that, in the embodiment of the present invention, in the process of decoding video data, the coding and decoding conditions of the sub-coding unit may be the same as the coding and decoding conditions of the sub-coding unit in the process of coding video data, that is, the same as the coding and decoding conditions of the sub-coding unit in S101, and therefore, for specific description of S201, reference may be made to the related description of S101 in the above embodiment, and details are not repeated here.
S202, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, the decoding equipment acquires the respective motion information of at least two sub-coding units.
S203, the decoding device determines a first candidate motion information list of the current coding unit according to the respective motion information of the at least two sub-coding units.
In the embodiment of the present invention, for specific descriptions of S201 to S203, reference may be made to the related descriptions of S101 to S102 in the foregoing embodiment, and details are not described here again.
And S204, the decoding equipment obtains the prediction information of the current coding unit according to the first candidate motion information list.
In the embodiment of the present invention, with reference to fig. 14, as shown in fig. 15, S204 may be specifically implemented by S204a-S204 c:
s204a, the decoding apparatus acquires indication information indicating the first target candidate motion information in the first candidate motion information list.
It is to be understood that, in the above encoding process, after the encoding device determines the first target candidate motion information from the first candidate motion information list, the encoding device may encode indication information indicating the first target candidate motion information into a code stream of the current encoding unit (i.e., into a code stream of the encoded current encoding unit), and then send the encoded indication information to the decoding device, so that after the decoding device receives the code stream of the current encoding unit, the decoding device may obtain the indication information of the first target candidate motion information from the code stream of the current encoding unit, so as to determine the first target candidate motion information under the indication of the indication information of the first target candidate motion information.
For a specific description of the indication information of the first target candidate motion information, reference may be made to the related description of S105 in the foregoing embodiment, and details are not repeated here.
S204b, the decoding device determines the first target candidate motion information according to the first candidate motion information list and the indication information of the first target candidate motion information.
S204c, the decoding apparatus determines prediction information of the current coding unit according to the first target candidate motion information.
In this embodiment of the present invention, the decoding apparatus may determine the first target candidate motion information in the first candidate motion information list under the indication of the indication information of the first target candidate motion information, so as to determine the motion information of the current coding unit according to the first target candidate motion information.
For a specific description of S204c, reference may be made to the related description of S104b in the above embodiments, and details are not repeated here.
Optionally, in the embodiment of the present invention, after the step S204, the method for encoding and decoding video data provided in the embodiment of the present invention may further include the steps of S205 to S206:
s205, decoding the code stream received after the code stream is coded by the current coding unit by the decoding equipment to obtain first residual error information.
In the embodiment of the present invention, in the process of encoding video data, the encoding device encodes the current encoding unit, that is, encodes the first residual information in S107 described above, to obtain second residual information (that is, the code stream after the current encoding unit is encoded), the encoding device sends the code stream after the current encoding to the decoding device, and the decoding device decodes the code stream after the current encoding unit is encoded, that is, decodes the second residual information (including entropy decoding, inverse quantization and inverse transformation performed on the second residual information), to obtain the first residual information.
S206, the decoding device determines the reconstruction information of the current coding unit according to the prediction information and the first residual information of the current coding unit.
In the embodiment of the invention, the decoding device adds the prediction information of the current coding unit and the first residual error information, and then performs related filtering operation on the sum of the prediction information and the first residual error information to obtain the reconstruction information of the current coding unit, namely the decoding device can obtain the complete pixel information of the current coding unit, and further the decoding device can obtain the complete pixel information of the video data to be decoded by determining the reconstruction information of all the coding units, so that the decoding device can smoothly play the video data.
In this embodiment of the present invention, with reference to fig. 15, as shown in fig. 16, in step S201, if the decoding device determines that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the method for coding and decoding video data according to the embodiment of the present invention may further include steps S207 to S210:
s207, the decoding device determines a second candidate motion information list of the current coding unit, where the second candidate motion information list includes candidate motion information of the current coding unit.
Wherein the second candidate motion information list does not include motion information of each of the at least two sub-coding units.
In this embodiment of the present invention, for a method for determining the second candidate motion information list, reference may be made to the related description of the method for determining the second candidate motion information list in S108, and details are not repeated here.
And S208, if the information of the current coding unit does not meet the coding and decoding conditions of the sub coding unit, the decoding device acquires indication information for indicating second target candidate motion information in a second candidate motion information list.
It is to be understood that, in the process of encoding video data, after the encoding device determines the second target candidate motion information from the second candidate motion information list, the encoding device may encode indication information for indicating the second target candidate motion information into a code stream of the current coding unit (i.e., a code stream encoded into the encoded current coding unit), and then send the encoded indication information to the decoding device, so that after the decoding device receives the code stream of the current coding unit, the decoding device may obtain the indication information of the second target candidate motion information from the code stream of the current coding unit, so as to determine the second target candidate motion information under the indication of the indication information of the second target candidate motion information.
S209, the decoding device determines second target candidate motion information according to the second candidate motion information list and the indication information of the second target candidate motion information.
S210, the decoding device determines the prediction information of the current coding unit according to the second target candidate motion information.
In the embodiment of the present invention, since the method for determining the second target candidate motion information by the decoding device and determining the prediction information of the current coding unit according to the second target candidate motion information is similar to that in the above-mentioned encoding process, the method for determining the second target candidate motion information by the encoding device and determining the prediction information of the current coding unit according to the second target candidate motion information, for specific descriptions of S209 to S210, reference may be made to the related descriptions of S109 to S110 in the above-mentioned embodiment, and details are not repeated here.
It should be noted that, in the embodiment of the present invention, in the case that the information of the current coding unit does not satisfy the sub-coding unit coding/decoding condition, the prediction information of the current coding unit may be determined through S207-210, and the above-mentioned S205-S206 may be performed to decode the current coding unit.
In this embodiment of the present invention, in a case that information of a current coding unit satisfies a coding/decoding condition of a sub-coding unit, a first candidate motion information list including motion information of at least two sub-coding units and motion information of the current coding unit may be determined, and prediction information of the current coding unit may be determined according to the first candidate motion information list, so that coding/decoding of the current coding unit is completed; in case that the information of the current coding unit does not satisfy the sub coding unit coding condition, a first candidate motion information list including motion information of the current coding unit may be determined, and prediction information of the current coding unit may be determined according to the first candidate motion information list, and coding and decoding of the current coding unit may be completed.
The video data encoding and decoding method provided by the embodiment of the present invention may be applied to a video data encoding and decoding process, and may first determine whether information of a current coding unit satisfies encoding and decoding conditions of sub-coding units, acquire respective motion information of at least two sub-coding units if the information of the current coding unit satisfies the encoding and decoding conditions of the sub-coding units, then determine a first candidate motion information list including the respective motion information of the at least two sub-coding units and the motion information of the current coding unit according to the respective motion information of the at least two sub-coding units, and then determine prediction information of the current coding unit according to the first candidate motion information list. Compared with the prior art, in the embodiment of the invention, whether the current coding unit is divided into the sub-coding units for coding or decoding can be determined according to the actual situation of the current coding unit and whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, and when the size of the current coding unit is smaller, the current coding unit does not need to be divided into the sub-coding units for coding or decoding, so that the complexity of coding and decoding the video data can be reduced.
The second method comprises the following steps: coding and decoding by adopting DMVD (digital video disk) technology
In the embodiments of the present invention, methods for encoding and decoding by using a DMVD technique are described, respectively, where the encoding by using the DMVD technique is performed, the encoding and decoding method for video data provided in the embodiments of the present invention may be applied to an encoding device, and the encoding and decoding method for video data provided in the embodiments of the present invention may be applied to a decoding device when the decoding by using the DMVD technique is performed.
First, when encoding is performed by using the DMVD technique, as shown in fig. 17, if the information of the current coding unit satisfies the coding/decoding conditions of the sub-coding units, the encoding apparatus may also use the DMVD technique to obtain the motion information of each of at least two sub-coding units, so as to determine the prediction information of the current coding unit. Specifically, with the DMVD technique, the method for determining the prediction information of the current coding unit may include S301 to S303:
s301, the encoding device determines whether the information of the current coding unit meets the coding and decoding conditions of the sub coding unit.
For the specific description of S301, refer to the above description related to S101 or S201, and are not described herein again.
S302, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, the coding equipment acquires the respective motion information of at least two sub-coding units.
In this embodiment of the present invention, as shown in fig. 18 in combination with fig. 17, S302 may specifically be implemented by S3021 to S3022:
s3021, the encoding apparatus acquires motion information of the current encoding unit.
S3021 can be specifically realized by S3021a-S3021 c:
s3021a, the encoding apparatus constructs an initial search list of the current encoding unit.
S3021b, the encoding apparatus determines an initial search point from the initial search list of the current coding unit.
In the embodiment of the present invention, the encoding apparatus may use motion information of some image blocks adjacent to the current coding unit as an initial search list of the current coding unit, and then the encoding apparatus determines one motion information from the initial search list as an initial search point of the current coding unit.
Specifically, the method for the encoding apparatus to determine one motion information as the initial search point of the current coding unit from the initial search list may include: and the coding equipment selects the motion information corresponding to the template with the minimum matching error by adopting a motion estimation matching method according to all the motion information and the search templates in the initial search list, and takes the motion information corresponding to the template with the minimum matching error as an initial search point. Specifically, each piece of motion information in the search start list may correspond to one template, and the motion information corresponding to the template with the smallest error between the estimated information of the current coding unit and the original information of the current coding unit is used as the initial search point according to the information of the current coding unit estimated by all the templates.
S3021c, the encoding apparatus determines motion information of the current coding unit using the initial search point as a starting point and using a related search algorithm.
In the embodiment of the present invention, the encoding apparatus may determine the motion information of the current encoding unit by using a correlation search algorithm (e.g., a diamond search algorithm).
Illustratively, as shown in fig. 19, the initial search point is O, the initial search point O is used as a center point of a diamond, and extends in a horizontal direction and a vertical direction by a preset step (including a step in the horizontal direction and a step in the vertical direction), four points, D1, D2, D3 and D4, are determined, and then the four points are sequentially connected to obtain the diamond D1D2D3D4, and the midpoints of the four sides of the diamond D1D2D3D4, i.e., the midpoint D5 of the side D1D2, the midpoint D6 of the side D2D3, the midpoint D7 of the side D3D4 and the midpoint D8 of the side D4D1, are determined, so that 9 points, i.e., the midpoints of D1, D2, D3, D4, D5, D6, D7, D8 and O, are obtained, and represent 9 pieces of motion information, and the encoding apparatus determines one piece of motion information as current motion information.
It should be noted that, in the embodiment of the present invention, a method for determining, by an encoding apparatus, one piece of motion information from among pieces of motion information searched by the diamond search algorithm (for example, 9 pieces of motion information determined and searched in the example shown in fig. 19) is the same as a method for determining, by the encoding apparatus, one piece of motion information from an initial search list, which may specifically refer to the related description of S3021b in the above embodiment, and details of the method are not repeated here.
And S3022, the encoding device respectively performs motion search on the motion information of the current encoding unit as the initial motion information of each of the at least two sub-encoding units, so as to obtain the motion information of each of the at least two sub-encoding units.
In this embodiment of the present invention, the encoding device may determine, according to the motion information of the current coding unit, the motion information of each of all the sub-coding units of the current coding unit. Taking one sub-coding unit (e.g., the first sub-coding unit) of the current coding unit as an example, the method for the coding apparatus to acquire the motion information of the first sub-coding unit may include:
s3022a, the encoding apparatus determines the motion information of the first sub-coding unit by using the motion information of the current coding unit as the initial search point and using a related search algorithm (e.g., a cross search algorithm).
For example, as shown in fig. 20, the initial search point is O1, the initial search point O1 is a central point, the initial search point extends in the horizontal direction and the vertical direction by a preset step size (including a step size in the horizontal direction and a step size in the vertical direction), four points E1, E2, E3, and E4 are determined, and thus, 5 points E1, E2, E3, E4, and O are obtained, and the 5 points represent 5 pieces of motion information, so that the encoding apparatus determines one motion vector from the 5 motion vectors as the motion vector of the first sub-encoding unit.
It is understood that the encoding apparatus may determine the motion information of each of all sub-coding units of the current coding unit, i.e., determine the motion information of each of the at least two sub-coding units, through the above-described S3022 a.
It should be noted that, in the embodiment of the present invention, the encoding device determines the motion information of one encoding unit by using a certain search algorithm, or determines the motion information of one sub-encoding unit according to a certain search algorithm, and the decoding device also determines the motion information of the encoding unit or determines the motion information of the sub-encoding unit by using a corresponding search algorithm.
S303, the encoding device determines the prediction information of the current encoding unit according to the respective motion information of the at least two sub-encoding units.
In this embodiment of the present invention, after the encoding apparatus obtains the motion information of each of the at least two sub-coding units, the encoding apparatus may determine the prediction information of each sub-coding unit according to the motion information of each sub-coding unit of the current coding unit, so as to determine the prediction information of the current coding unit.
It should be noted that, in the embodiment of the present invention, after the encoding apparatus determines the prediction information of the current coding unit, the encoding apparatus may execute the above S106 to S107 to encode the current coding unit.
In this embodiment of the present invention, with reference to fig. 17, as shown in fig. 21, in step S301, if the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the method for coding and decoding video data according to the embodiment of the present invention may further include steps S304-S305:
s304, if the information of the current coding unit does not meet the coding and decoding conditions of the sub coding unit, the coding equipment acquires the motion information of the current coding unit.
For a specific description of S304, reference may be made to the related description of S3021 in the foregoing embodiment, and details are not repeated here.
S305, the coding device determines the prediction information of the current coding unit according to the motion information of the current coding unit.
Similarly, in the case that the information of the current coding unit does not satisfy the sub-coding unit coding/decoding condition, after the encoding apparatus determines the prediction information of the current coding unit, the above S103 to S107 may be performed to encode the current coding unit.
When decoding is performed by using the DMVD technique, the method for encoding and decoding video data provided by the embodiment of the present invention may include S401 to S403:
s401, the decoding device determines whether the information of the current coding unit meets the coding and decoding conditions of the sub coding unit.
For a specific description of S401, reference may be made to the related description of S101, S201, or S301 in the foregoing embodiments, and details are not repeated here.
S402, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, the decoding equipment acquires the respective motion information of at least two sub-coding units.
And S403, the decoding device determines the prediction information of the current coding unit according to the respective motion information of the at least two sub-coding units.
In the embodiment of the present invention, in the process of encoding and decoding video data by using the DMVD technique, a method for determining prediction information of a current coding unit by a decoding device is similar to a method for determining prediction information of a current coding unit by an encoding device, and therefore, for specific descriptions of S401 to S403, reference may be made to the related descriptions of S301 to S303, and details are not described here again.
It should be noted that, in the embodiment of the present invention, the prediction information of the current coding unit may be determined through S401 to 403, and S205 to S206 may be performed to decode the current coding unit.
In this embodiment of the present invention, through the foregoing S401, if the decoding device determines that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the coding and decoding method for video data provided in this embodiment of the present invention may further include S404-S405:
s404, the decoding device acquires the motion information of the current coding unit.
S405, the decoding device determines the prediction information of the current coding unit according to the motion information of the current coding unit.
For specific descriptions of S404-S405, reference may be made to the related descriptions of S304-305 in the above embodiments, and details are not repeated here.
Similarly, in the case that the information of the current coding unit does not satisfy the sub-coding unit coding/decoding condition, after the decoding apparatus determines the prediction information of the current coding unit, the above S205-S206 may be performed to decode the current coding unit.
The third method comprises the following steps: coding and decoding by adopting non-translational motion model
In the embodiment of the present invention, if the information of the current coding unit satisfies the coding and decoding conditions of the sub-coding units, the coding device may further obtain respective motion information of at least two sub-coding units by using a non-translational motion model method, so as to determine the motion information of the current coding unit. The commonly used non-translational motion model comprises a 6-parameter affine transformation model and a 4-parameter affine transformation model, and the embodiment of the invention takes the 4-parameter affine transformation model as an example to define the prediction information of the current coding unit.
In the embodiment of the present invention, when encoding is performed using a non-translational motion model, the video data encoding and decoding method provided in the embodiment of the present invention may include steps S501 to S503:
s501, the coding device determines whether the information of the current coding unit meets the coding and decoding conditions of the sub coding unit.
For a specific description of S501, reference may be made to the related description of S101, S201, S301, or S401 in the foregoing embodiments, and details are not repeated here.
S502, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, the coding equipment acquires the respective motion information of at least two sub-coding units.
In the embodiment of the present invention, as shown in fig. 22, the step S502 may be specifically implemented by steps S502a-S502 b:
s502a, the encoding apparatus acquires motion information of at least two pixel positions of the current coding unit.
In this embodiment of the present invention, the encoding device may determine the motion information of each sub-coding unit of the current coding unit according to the motion information of the coding unit in which the image block adjacent to the current coding unit (spatially adjacent) is located. Specifically, the encoding unit first determines motion information of at least two pixel positions of the current encoding unit according to the motion information of the encoding unit in which the image block adjacent to the current encoding unit is located. The following describes a method for determining motion information of at least two pixel positions of a current coding unit by a coding apparatus by taking the determination of motion information of two pixel positions of the upper left corner and the upper right corner of the current coding unit as an example.
Illustratively, as shown in FIG. 23, image block M1 in FIG. 23 is a neighboring image block of the current coding unit, M is the coded coding unit in which image block M1 is located, and the coordinate of the pixel at the upper left corner of M1 is (x)2,y2) The motion vector of the pixel point is (vx)2,vy2) And the coordinate of the pixel at the upper right corner of M1 is (x)3,y3) The motion vector of the pixel point is (vx)3,vy3) The pixel at the lower left corner of M1 has the coordinate (x)4,y4) The motion vector of the pixel point is (vx)4,vy4) (ii) a The coordinate of the pixel at the upper left corner of the coding unit of the current coding unit is (x)0,y0) The coordinate of the pixel at the upper right corner of the coding unit of the current coding unit is (x)1,y1) The motion vector (vx) of the pixel at the upper left corner of the current coding unit can be determined according to the following formula (3)0,vy0) And a motion vector (vx) of a pixel at the upper right corner of the current coding unit according to equation (4)1,vy1):
Figure GDA0002592509470000281
Wherein h is the height of M1 and w is the width of M1.
Figure GDA0002592509470000282
Wherein, WcIs the width of the current coding unit.
S502b, the encoding device determines the motion information of at least two sub-coding units according to the motion information of at least two pixel positions of the current coding unit.
In the embodiment of the present invention, still taking the motion information of two pixel positions at the top left corner and the top right corner of the current coding unit as an example, the pixel point (x) at the top left corner of the current coding unit is determined according to the above formula (3) and formula (4)0,y0) And pixel point (x) in the upper right corner of the current coding unit1,y1) May be determined according to equation (5):
Figure GDA0002592509470000283
wherein, (x, y) is the coordinate of one sub-coding unit.
Optionally, in the embodiment of the present invention, the coordinate of the central pixel point of the sub-coding unit may be used as the coordinate of the sub-coding unit.
It is understood that the motion information of each of the at least two sub-coding units can be determined by respectively substituting the coordinates of each of the at least two sub-coding units into equation (5).
S503, the encoding device determines the prediction information of the current encoding unit according to the respective motion information of the at least two sub-encoding units.
For a specific description of S503, reference may be made to the related description of S303 in the foregoing embodiment, and details are not repeated here.
Optionally, in this embodiment of the present invention, with reference to fig. 22, as shown in fig. 24, after S503, the method for encoding and decoding video data provided in this embodiment of the present invention may further include S504-S505:
and S504, the encoding device determines the prediction mode of the current encoding unit according to the prediction information of the current encoding unit.
In the embodiment of the present invention, when an encoding device encodes video data, information of a current encoding unit satisfies encoding and decoding conditions of sub-encoding units, after the encoding unit divides the current encoding unit into at least two sub-encoding units, the encoding device may first respectively predict prediction information of the current encoding unit by using methods (which may be referred to as prediction modes) such as the SMVP technology, the DMVD technology, and the non-translational motion model, and then determine which of the three encoding methods has the smallest rate distortion cost according to the rate distortion optimization technology, encode the video data by using the encoding method having the smallest rate distortion cost, and determine the prediction mode having the smallest rate distortion cost as the prediction mode of the current encoding unit.
S505, the encoding device encodes prediction mode indication information into a code stream of the current encoding unit, wherein the value of the prediction mode indication information is used for indicating whether the prediction mode of the current encoding unit is an affine transformation mode.
In the embodiment of the invention, the encoding device encodes the indication information of the prediction mode of the current encoding unit into the code stream of the current encoding unit, so that after the decoding device receives the code stream of the current encoding unit, the decoding device can know whether the prediction mode of the current encoding unit is the affine transformation mode or not according to the indication information of the prediction mode.
It is to be understood that, in the embodiment of the present invention, after the encoding apparatus determines the prediction information of the current coding unit, the encoding apparatus may perform the above S106 to S107 to encode the current coding unit.
It should be noted that, in the embodiment of the present invention, because the non-translational motion model is only used to obtain the motion information of the sub-coding units, if the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding units, the coding device cannot determine the motion information of the current coding unit by using the non-translational motion model, and the coding device may determine the motion information of the current coding unit by using another method for determining the motion information of the coding unit.
Optionally, with reference to fig. 22, as shown in fig. 25, in a case that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the coding and decoding method for video data provided in the embodiment of the present invention may further include S506:
s506, the encoding device determines the prediction information of the current encoding unit according to a candidate prediction mode set, wherein the candidate prediction mode set does not comprise an affine transformation mode.
In this embodiment of the present invention, the candidate prediction mode set may include a prediction mode encoded by using an SMVP technique, a prediction mode encoded by using a DMVD technique, and further include other prediction modes for predicting prediction information of a current coding unit, which is not limited in this embodiment of the present invention. In the case where the information of the current coding unit does not satisfy the sub-coding unit coding condition, the encoding apparatus may determine prediction information of the current coding unit using a certain method of the candidate prediction mode set, and may perform the above-described S106-S107 to encode the current coding unit.
When decoding is performed by using a non-translational motion model, the video data encoding and decoding method provided by the embodiment of the invention may include steps S601 to S603:
s601, the decoding device determines whether the information of the current coding unit meets the coding and decoding conditions of the sub coding unit.
For specific description of S601, refer to the foregoing embodiments, and for related description of S101, S201, S301, S401, or S501, details are not repeated here.
S602, if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, decoding to obtain the respective motion information of at least two sub-coding units.
In the embodiment of the present invention, as shown in fig. 26, the S602 may be specifically implemented by S602a-S602 c:
s602a, the decoding apparatus acquires prediction mode indication information whose value is used to indicate whether the prediction mode of the current coding unit is an affine transformation mode.
In the embodiment of the present invention, in the above embodiment, since the encoding device may encode the prediction mode indication information into the code stream of the current encoding unit, the decoding device may obtain the prediction mode indication information of the current encoding unit from the received code stream after being encoded by the current encoding unit, and determine whether to use the affine transformation mode of the non-translational motion model to determine the prediction information of the current encoding unit according to the prediction mode indication information.
S602b, if the value of the prediction mode indication information indicates that the current prediction mode is the affine transformation mode, the decoding apparatus acquires motion information of at least two pixel positions of the current coding unit.
S602c, the decoding apparatus determines motion information of each of the at least two sub-coding units according to the motion information of the at least two pixel positions.
For specific descriptions of S602b-S602c, reference may be made to the descriptions related to S502a-S502b in the foregoing embodiments, and further description is omitted here.
S603, the decoding device determines the prediction information of the current coding unit according to the respective motion information of the at least two sub-coding units.
For a specific description of S603, reference may be made to the related description of S403 in the foregoing embodiment, and details are not repeated here.
It should be noted that, in the embodiment of the present invention, when the decoding device determines that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding unit, the decoding device may adopt a method (a decoding method corresponding to the coding process of the coding device) other than the non-translational motion model to obtain the motion information of the current coding unit, and determine the prediction information of the current coding unit.
The method for encoding and decoding video data provided in the embodiments of the present invention may be applied to a process of encoding and decoding video data, and includes determining whether information of a current coding unit satisfies encoding and decoding conditions of sub-coding units, acquiring respective motion information of at least two sub-coding units if the information of the current coding unit satisfies the encoding and decoding conditions of the sub-coding units, determining prediction information of the current coding unit according to the respective motion information of the at least two sub-coding units, and completing encoding or decoding of the current coding unit. Compared with the prior art, in the embodiment of the invention, whether the information of the current coding unit meets the coding and decoding conditions of the sub-coding units can be determined, whether the current coding unit is divided into the sub-coding units for coding or decoding is determined according to the actual condition of the current coding unit, and when the size of the current coding unit is smaller, the current coding unit does not need to be divided into the sub-coding units for coding or decoding, so that the complexity of coding and decoding the video data can be reduced.
The above description mainly introduces the solutions provided in the embodiments of the present invention from the perspective of each network element. It is understood that each network element, for example, a video data codec, etc., includes a corresponding hardware structure and/or software modules for performing each function in order to implement the above functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments of the present invention, functional modules of a video data encoding and decoding apparatus and the like may be divided according to the above method examples, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In the case of dividing each functional module by corresponding functions, fig. 27 shows a schematic diagram of a possible structure of the video data coding and decoding apparatus according to the foregoing embodiment, and as shown in fig. 27, the apparatus may include: a determination module 30 and an acquisition module 31. The determination module 30 may be configured to enable the codec device supporting the video data to perform S101, S103, S104 (including S104a-S104b), S108, S109, S110, S201, S203, S204 (including S204b-S204c), S206, S207, S209, 210, S301, S303, S305, S401, S403, S405, S501, S503, S504, S506, S601, and S603 in the above method embodiments; the obtaining module 31 may be configured to enable the codec device supporting the video data to perform S102, S106, S202, S204a, S208, S302 (including S3021 to S3022), S304, S402, S404, S502 (including S502a to S502b), and S602 (including S602a to S602c) in the above method embodiments. Optionally, as shown in fig. 19, the apparatus for encoding and decoding video data may further include an encoding module 32 and a decoding module. The encoding module 32 may be configured to enable the codec device supporting the video data to perform S105, S107, S111, and S505 in the above method embodiment. The decoding module may be configured to enable the encoding and decoding apparatus supporting the video data to execute S205, S107, and S111 in the foregoing method embodiment, where all relevant contents of each step related to the foregoing method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In the case of using an integrated unit, fig. 28 shows a schematic diagram of a possible structure of the video data codec device according to the above embodiment. As shown in fig. 28, the apparatus may include: a processing module 40 and a communication module 41. The processing module 40 may be used to control and manage the actions of the video data codec, and the processing module 40 may be used to support the video data codec to perform the steps performed by the encoding device or the decoding device in the above method embodiments, and/or other processes for the techniques described herein. The communication module 41 may be used to support communication of the codec device of the video data with other network entities. Optionally, as shown in fig. 28, the apparatus for encoding and decoding video data may further include a storage module 42 for storing program codes and data of the encoding device.
The processing module 40 may be a processor or a controller (e.g., the video encoder 11 shown in fig. 7 and the video decoder 21 shown in fig. 8) such as a CPU, a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with the embodiment disclosure. The processor described above may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like. The communication module 51 may be a transceiver, a transceiver circuit, a communication interface, or the like (for example, the output interface 12 shown in fig. 7 and the input interface 20 shown in fig. 8 may be mentioned above). The storage module 42 may be a memory.
When the processing module 40 is a processor, the communication module 41 is a transceiver, and the storage module 42 is a memory, the processor, the transceiver, and the memory may be connected by a bus. The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the flow or functions according to embodiments of the invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy disk, magnetic tape), an optical medium (e.g., Digital Video Disk (DVD)), or a semiconductor medium (e.g., Solid State Drive (SSD)), among others.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (24)

1. A method for encoding and decoding video data, characterized in that,
determining whether information of a current coding unit satisfies a sub-coding unit coding condition, the information of the current coding unit satisfying the sub-coding unit coding condition including that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit, and the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit includes that the size information of the current coding unit meets any one of the following conditions:
the number of pixels of the current coding unit is greater than or equal to a first threshold;
the ratio of the pixel number of the current coding unit to the pixel number of a first sub-coding unit is greater than or equal to a second threshold, and the first sub-coding unit is one of at least two sub-coding units;
the width of the current coding unit is larger than or equal to a third threshold value, or the height of the current coding unit is larger than or equal to a fourth threshold value;
the prediction information of at least one coding unit adjacent to the current coding unit is obtained according to the motion information of the sub coding units of the adjacent coding unit;
if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, acquiring respective motion information of at least two sub-coding units, wherein the at least two sub-coding units are the sub-coding units obtained after the current coding unit is divided;
determining a first candidate motion information list of the current coding unit according to the motion information of the at least two sub-coding units, wherein the first candidate motion information list comprises the motion information of the at least two sub-coding units and the candidate motion information of the current coding unit;
obtaining the prediction information of the current coding unit according to the first candidate motion information list;
if the information of the current coding unit is determined not to meet the coding and decoding conditions of the sub coding unit, determining a second candidate motion information list of the current coding unit, wherein the second candidate motion information list comprises candidate motion information of the current coding unit;
determining second target candidate motion information in the second candidate motion information list;
and determining the prediction information of the current coding unit according to the second target candidate motion information.
2. The method of claim 1, wherein the method is applied to a decoding device, and wherein obtaining the prediction information of the current coding unit according to the first candidate motion information list comprises:
acquiring indication information for indicating first target candidate motion information in the first candidate motion information list;
determining first target candidate motion information according to the first candidate motion information list and the indication information of the first target candidate motion information;
and determining the prediction information of the current coding unit according to the first target candidate motion information.
3. The method according to claim 1 or 2, wherein the method is applied to a decoding device, and if the information of the current CU does not satisfy the CU coding/decoding condition, the method further comprises:
acquiring indication information for indicating second target candidate motion information in the second candidate motion information list;
determining second target candidate motion information in the second candidate motion information list, comprising:
and determining second target candidate motion information according to the second candidate motion information list and the indication information of the second target candidate motion information.
4. The method of claim 1, wherein the method is applied to a coding device, and wherein obtaining the prediction information of the current coding unit according to the first candidate motion information list comprises:
determining first target candidate motion information in the first candidate motion information list;
and determining the prediction information of the current coding unit according to the first target candidate motion information.
5. The method of claim 4, applied to an encoding device, further comprising:
and encoding indication information for indicating target candidate motion information into the code stream of the current coding unit.
6. A method for encoding and decoding video data, characterized in that,
determining whether information of a current coding unit satisfies a sub-coding unit coding condition, the information of the current coding unit satisfying the sub-coding unit coding condition including that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit, and the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit includes that the size information of the current coding unit meets any one of the following conditions:
the number of pixels of the current coding unit is greater than or equal to a first threshold;
the ratio of the pixel number of the current coding unit to the pixel number of a first sub-coding unit is greater than or equal to a second threshold, and the first sub-coding unit is one of at least two sub-coding units;
the width of the current coding unit is larger than or equal to a third threshold value, or the height of the current coding unit is larger than or equal to a fourth threshold value;
the prediction information of at least one coding unit adjacent to the current coding unit is obtained according to the motion information of the sub coding units of the adjacent coding unit;
if the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, acquiring respective motion information of at least two sub-coding units, wherein the at least two sub-coding units are the sub-coding units obtained after the current coding unit is divided;
obtaining the prediction information of the current coding unit according to the respective motion information of the at least two sub-coding units;
if the information of the current coding unit does not meet the coding and decoding conditions of the sub coding units, acquiring the motion information of the current coding unit;
and determining the prediction information of the current coding unit according to the motion information of the current coding unit.
7. The method according to claim 6, wherein said obtaining motion information of each of at least two sub-coding units comprises:
acquiring motion information of the current coding unit;
and respectively performing motion search by taking the motion information of the current coding unit as the respective initial motion information of the at least two sub-coding units, so as to obtain the respective motion information of the at least two sub-coding units.
8. The method according to claim 6, wherein the method is applied to a decoding device, and the obtaining motion information of each of at least two sub-coding units comprises:
acquiring prediction mode indication information, wherein the value of the prediction mode indication information is used for indicating whether the prediction mode is an affine transformation mode or not;
if the value of the prediction mode indication information indicates that the current prediction mode is an affine transformation mode, acquiring motion information of at least two pixel positions of the current coding unit;
and determining the motion information of the at least two sub-coding units according to the motion information of the at least two pixel positions.
9. The method according to claim 6, wherein the method is applied to an encoding device, and the obtaining motion information of each of at least two sub-coding units comprises:
acquiring motion information of at least two pixel positions of the current coding unit;
and determining the motion information of the at least two sub-coding units according to the motion information of the at least two pixel positions.
10. The method according to claim 6 or 9, wherein the method is applied to an encoding device, the method further comprising:
determining a prediction mode of the current coding unit according to the prediction information of the current coding unit;
and coding the prediction mode indication information into a code stream of the current coding unit, wherein the value of the prediction mode indication information is used for indicating whether the prediction mode is an affine transformation mode.
11. The method according to claim 6 or 9, wherein the method is applied to an encoding apparatus, and if the information of the current CU does not satisfy the CU codec condition, the method further comprises:
determining prediction information for the current coding unit according to a set of candidate prediction modes, the set of candidate prediction modes not including an affine transformation mode.
12. The device for coding and decoding video data is characterized by comprising a determining module and an obtaining module;
the determining module is configured to determine whether the information of the current coding unit satisfies a sub-coding unit coding/decoding condition, where the information of the current coding unit satisfies the sub-coding unit coding/decoding condition includes that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit, and the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit includes that the size information of the current coding unit meets any one of the following conditions:
the number of pixels of the current coding unit is greater than or equal to a first threshold;
the ratio of the pixel number of the current coding unit to the pixel number of a first sub-coding unit is greater than or equal to a second threshold, and the first sub-coding unit is one of at least two sub-coding units;
the width of the current coding unit is larger than or equal to a third threshold value, or the height of the current coding unit is larger than or equal to a fourth threshold value;
the prediction information of at least one coding unit adjacent to the current coding unit is obtained according to the motion information of the sub coding units of the adjacent coding unit;
the obtaining module is configured to obtain respective motion information of at least two sub-coding units when the determining module determines that the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, where the at least two sub-coding units are sub-coding units obtained after the current coding unit is divided;
the determining module is further configured to determine a first candidate motion information list of the current coding unit according to the motion information of each of the at least two sub-coding units acquired by the acquiring module, where the first candidate motion information list includes the motion information of each of the at least two sub-coding units and candidate motion information of the current coding unit, and obtain prediction information of the current coding unit according to the first candidate motion information list;
the determining module is further configured to determine a second candidate motion information list of the current coding unit if the information of the current coding unit does not satisfy the coding/decoding conditions of the sub coding unit; and determining second target candidate motion information in the second candidate motion information list; and determining prediction information of the current coding unit according to the second target candidate motion information, wherein the second candidate motion information list comprises candidate motion information of the current coding unit.
13. The apparatus of claim 12, wherein the apparatus is a decoding device;
the obtaining module is further configured to obtain indication information indicating first target candidate motion information in the first candidate motion information list;
the determining module is specifically configured to determine first target candidate motion information according to the first candidate motion information list and indication information of the first target candidate motion information, and determine prediction information of the current coding unit according to the first target candidate motion information.
14. The apparatus according to claim 12 or 13, wherein the apparatus is a decoding device;
the obtaining module is further configured to obtain indication information indicating second target candidate motion information in the second candidate motion information list;
the determining module is specifically configured to determine second target candidate motion information according to the second candidate motion information list and the indication information of the second target candidate motion information acquired by the acquiring module.
15. The apparatus of claim 12, wherein the apparatus is an encoding device;
the determining module is specifically configured to determine first target candidate motion information in the first candidate motion information list acquired by the acquiring module, and determine prediction information of the current coding unit according to the first target candidate motion information.
16. The apparatus of claim 15, wherein the apparatus is an encoding device, the encoding device further comprising an encoding module;
and the coding module is used for coding indication information for indicating target candidate motion information into the code stream of the current coding unit.
17. The device for coding and decoding video data is characterized by comprising a determining module and an obtaining module;
the determining module is configured to determine whether the information of the current coding unit satisfies a sub-coding unit coding/decoding condition, where the information of the current coding unit satisfies the sub-coding unit coding/decoding condition includes that the information of the current coding unit satisfies at least one of the following conditions:
the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit, and the size information of the current coding unit meets the coding and decoding size condition of the sub coding unit includes that the size information of the current coding unit meets any one of the following conditions:
the number of pixels of the current coding unit is greater than or equal to a first threshold;
the ratio of the pixel number of the current coding unit to the pixel number of a first sub-coding unit is greater than or equal to a second threshold, and the first sub-coding unit is one of at least two sub-coding units;
the width of the current coding unit is larger than or equal to a third threshold value, or the height of the current coding unit is larger than or equal to a fourth threshold value;
the prediction information of at least one coding unit adjacent to the current coding unit is obtained according to the motion information of the sub coding units of the adjacent coding unit;
the obtaining module is configured to obtain respective motion information of at least two sub-coding units when the determining module determines that the information of the current coding unit meets the coding and decoding conditions of the sub-coding units, where the at least two sub-coding units are sub-coding units obtained after the current coding unit is divided;
the determining module is further configured to obtain prediction information of the current coding unit according to the motion information of the at least two sub-coding units obtained by the obtaining module;
the obtaining module is further configured to obtain motion information of the current coding unit when the information of the current coding unit does not satisfy the coding and decoding conditions of the sub-coding units;
the determining module is further configured to determine prediction information of the current coding unit according to the motion information of the current coding unit acquired by the acquiring module.
18. The apparatus of claim 17,
the obtaining module is specifically configured to obtain motion information of the current coding unit, and perform motion search using the motion information of the current coding unit as initial motion information of each of the at least two sub-coding units, so as to obtain motion information of each of the at least two sub-coding units.
19. The apparatus of claim 17, wherein the apparatus is a decoding device;
the obtaining module is specifically configured to obtain prediction mode indication information, and in a case that a value of the prediction mode indication information indicates that a current prediction mode is an affine transformation mode, obtain motion information of at least two pixel positions of the current coding unit, and determine respective motion information of the at least two sub-coding units according to the motion information of the at least two pixel positions, where the value of the prediction mode indication information is used for indicating whether the prediction mode is the affine transformation mode.
20. The apparatus of claim 17, wherein the apparatus is an encoding device;
the obtaining module is further configured to obtain motion information of at least two pixel positions of the current coding unit, and determine motion information of each of the at least two sub-coding units according to the motion information of the at least two pixel positions.
21. The apparatus according to claim 17 or 20, wherein the apparatus is an encoding device, the encoding device further comprising an encoding module;
the determining module is further configured to determine a prediction mode of the current coding unit according to the prediction information of the current coding unit;
and the encoding module is configured to encode the prediction mode indication information determined by the determining module into a code stream of the current coding unit, and a value of the prediction mode indication information is used to indicate whether the prediction mode is an affine transformation mode.
22. The apparatus according to claim 17 or 20, wherein the apparatus is an encoding device;
the determining module is further configured to determine the prediction information of the current coding unit according to a candidate prediction mode set in a case that the information of the current coding unit does not satisfy the coding and decoding conditions of the sub coding unit, where the candidate prediction mode set does not include an affine transformation mode.
23. An apparatus for encoding and decoding video data, comprising a processor and a memory coupled to the processor;
the memory has stored thereon a computer program which when executed by the processor implements a method of encoding and decoding video data as claimed in any one of claims 1 to 5 or implements a method of encoding and decoding video data as claimed in any one of claims 6 to 11.
24. A computer-readable storage medium, in which a computer program is recorded, which when executed by a processor implements the method for coding and decoding video data according to any one of claims 1 to 5, or implements the method for coding and decoding video data according to any one of claims 6 to 11.
CN201710725341.9A 2017-08-22 2017-08-22 Video data coding and decoding method, device and medium Active CN109429064B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201710725341.9A CN109429064B (en) 2017-08-22 2017-08-22 Video data coding and decoding method, device and medium
PCT/CN2018/092494 WO2019037533A1 (en) 2017-08-22 2018-06-22 Video data processing method and device
TW107129127A TWI694713B (en) 2017-08-22 2018-08-21 Method and apparatus for processing video data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710725341.9A CN109429064B (en) 2017-08-22 2017-08-22 Video data coding and decoding method, device and medium

Publications (2)

Publication Number Publication Date
CN109429064A CN109429064A (en) 2019-03-05
CN109429064B true CN109429064B (en) 2021-03-30

Family

ID=65438407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710725341.9A Active CN109429064B (en) 2017-08-22 2017-08-22 Video data coding and decoding method, device and medium

Country Status (3)

Country Link
CN (1) CN109429064B (en)
TW (1) TWI694713B (en)
WO (1) WO2019037533A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021056220A1 (en) * 2019-09-24 2021-04-01 北京大学 Video coding and decoding method and apparatus
CN111314778B (en) * 2020-03-02 2021-09-07 北京小鸟科技股份有限公司 Coding and decoding fusion processing method, system and device based on multiple compression modes
CN112218092B (en) * 2020-10-17 2022-09-06 浙江大华技术股份有限公司 Encoding method, apparatus and storage medium for string encoding technique
CN112532974B (en) * 2020-11-24 2024-07-12 浙江大华技术股份有限公司 Encoding method, apparatus and storage medium for string encoding technique
WO2023220970A1 (en) * 2022-05-18 2023-11-23 Oppo广东移动通信有限公司 Video coding method and apparatus, and device, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327327A (en) * 2013-06-03 2013-09-25 电子科技大学 Selection method of inter-frame predictive coding units for HEVC
CN104602000A (en) * 2014-12-30 2015-05-06 北京奇艺世纪科技有限公司 Partition method and device for coding unit
KR101519557B1 (en) * 2013-12-27 2015-05-13 연세대학교 산학협력단 Apparatus and method for fast Intra Prediction Algorithm
CN105637870A (en) * 2013-09-13 2016-06-01 高通股份有限公司 Video coding techniques using asymmetric motion partitioning

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101752418B1 (en) * 2010-04-09 2017-06-29 엘지전자 주식회사 A method and an apparatus for processing a video signal
KR101373814B1 (en) * 2010-07-31 2014-03-18 엠앤케이홀딩스 주식회사 Apparatus of generating prediction block
GB2501517A (en) * 2012-04-27 2013-10-30 Canon Kk Scalable Encoding and Decoding of a Digital Image
CN103763570B (en) * 2014-01-20 2017-02-01 华侨大学 Rapid HEVC intra-frame prediction method based on SATD
CN104602017B (en) * 2014-06-10 2017-12-26 腾讯科技(北京)有限公司 Video encoder, method and apparatus and its inter-frame mode selecting method and device
JP6459761B2 (en) * 2015-05-01 2019-01-30 富士通株式会社 Moving picture coding apparatus, moving picture coding method, and moving picture coding computer program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327327A (en) * 2013-06-03 2013-09-25 电子科技大学 Selection method of inter-frame predictive coding units for HEVC
CN105637870A (en) * 2013-09-13 2016-06-01 高通股份有限公司 Video coding techniques using asymmetric motion partitioning
KR101519557B1 (en) * 2013-12-27 2015-05-13 연세대학교 산학협력단 Apparatus and method for fast Intra Prediction Algorithm
CN104602000A (en) * 2014-12-30 2015-05-06 北京奇艺世纪科技有限公司 Partition method and device for coding unit

Also Published As

Publication number Publication date
TWI694713B (en) 2020-05-21
CN109429064A (en) 2019-03-05
TW201921934A (en) 2019-06-01
WO2019037533A1 (en) 2019-02-28

Similar Documents

Publication Publication Date Title
CN109429064B (en) Video data coding and decoding method, device and medium
US11831902B2 (en) Picture prediction method and picture prediction apparatus
CN104363451B (en) Image prediction method and relevant apparatus
TWI684356B (en) A method and apparatus for determining motion vector prediction value, computer readable storage medium
WO2017071480A1 (en) Reference frame decoding method
CN113748673A (en) Method, device and system for determining prediction weights for merge mode
CN113905235A (en) Video image processing method and device
WO2019153861A1 (en) Bidirectional interframe prediction method and apparatus
WO2019128716A1 (en) Image prediction method, apparatus, and codec
CN109076234A (en) Image prediction method and relevant device
US12010293B2 (en) Picture prediction method and apparatus, and computer-readable storage medium
WO2020048205A1 (en) Method and apparatus for acquiring reference frame applied to bidirectional inter-frame prediction
CN110876065A (en) Construction method of candidate motion information list, and inter-frame prediction method and device
WO2019233423A1 (en) Motion vector acquisition method and device
US20240146950A1 (en) Methods and apparatuses for decoder-side motion vector refinement in video coding
CN108259902A (en) Video data encoding and the video encoder for being configured as performing video data encoding
CN111656786B (en) Construction method of candidate motion information list, inter-frame prediction method and device
CN111357288B (en) Video image processing method and device
CN111355958B (en) Video decoding method and device
WO2024183561A1 (en) Coding method, decoding method, apparatus, device, storage medium and computer program
CN110971899B (en) Method for determining motion information, and inter-frame prediction method and device
CN110677645B (en) Image prediction method and device
KR20210046777A (en) Inter prediction method and apparatus, video encoder and video decoder

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant