WO2021208588A1 - Video encoding and decoding methods and apparatus, and electronic device - Google Patents

Video encoding and decoding methods and apparatus, and electronic device Download PDF

Info

Publication number
WO2021208588A1
WO2021208588A1 PCT/CN2021/076735 CN2021076735W WO2021208588A1 WO 2021208588 A1 WO2021208588 A1 WO 2021208588A1 CN 2021076735 W CN2021076735 W CN 2021076735W WO 2021208588 A1 WO2021208588 A1 WO 2021208588A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
list
original
bidirectional
reference frame
Prior art date
Application number
PCT/CN2021/076735
Other languages
French (fr)
Chinese (zh)
Inventor
张弓
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021208588A1 publication Critical patent/WO2021208588A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • 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/587Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal sub-sampling or interpolation, e.g. decimation or subsequent interpolation of pictures in a video sequence

Definitions

  • the present disclosure relates to the field of image processing technology, and in particular to a video encoding method, a video decoding method, a video encoding device, and electronic equipment.
  • Video encoding is a way to convert files in the original video format into another video format file through compression technology, which can reduce the size of video data to a certain extent.
  • Inter-frame prediction is a type of video coding. It can use the correlation of pixels between adjacent frames to predict the predicted value, and then achieve the purpose of compressing the video.
  • the bidirectional predictive coding technology is a commonly used coding technology, which can use multiple frames before and after the current frame in the playback sequence as reference frames to perform motion estimation and inter-frame prediction to obtain the final prediction value.
  • the purpose of the present disclosure is to provide a video encoding method, a video decoding method, a video encoding device, and an electronic device, so as to overcome at least to a certain extent the problem of large motion vectors or large encoded data caused by large motion vector differences.
  • a video encoding method which includes: determining N pairs of original bidirectional reference frames in a reference frame list corresponding to a bidirectional predictive coding frame according to a preset selection rule; wherein, N takes a positive integer; Set the interpolation frame rule to perform interpolation processing on the original two-way reference frame of N, obtain T interpolation frame reference frames, and update the reference frame list according to the T interpolation frame reference frames to obtain the target reference frame list; where T is positive Integer; encode the bidirectional predictive coded frame according to the target reference frame list to obtain coded data; obtain the key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate the code stream data corresponding to the bidirectional predictive coded frame.
  • a video decoding method which includes: obtaining code stream data corresponding to a bidirectional predictive coded frame to be decoded; code stream data including coded data and key parameters; parsing the coded data and analyzing the coded data according to the key parameters Determine the target reference frame list corresponding to the encoded data; perform decoding and reconstruction based on the target reference frame list, and obtain the decoded bidirectional prediction reconstruction frame.
  • a video encoding device including: a reference acquisition module, configured to determine N pairs of original bidirectional reference frames in a reference frame list corresponding to a bidirectional predictive coding frame according to a preset selection rule; where N Take a positive integer; the first list determination module is used to perform frame interpolation processing on N pairs of original bidirectional reference frames according to preset frame interpolation rules, to obtain T frame interpolation reference frames, and to list the reference frames according to the T frame interpolation reference frames Update to obtain the target reference frame list; where T is a positive integer; the data encoding module is used to encode the two-way predictive encoding frame according to the target reference frame list to obtain the encoded data; the code stream generation module is used to obtain the generated frame insertion reference The key parameter of the frame, the key parameter is appended to the coded data, and the code stream data corresponding to the bidirectional predictive coded frame is generated.
  • a video decoding device which includes: a data acquisition module for acquiring code stream data corresponding to a bidirectional predictive coding frame to be decoded; code stream data includes coded data and key parameters; the second list is determined The module is used to analyze the encoded data and determine the target reference frame list corresponding to the encoded data according to the key parameters; the data reconstruction module is used to decode and reconstruct based on the target reference frame list to obtain the decoded bidirectional prediction reconstruction frame.
  • a computer-readable medium having a computer program stored thereon, and the computer program is executed by a processor to implement the above-mentioned video encoding method or video decoding method.
  • an electronic device which is characterized by comprising: a processor; and a memory, configured to store one or more programs, when the one or more programs are executed by one or more processors , Enabling one or more processors to implement the above-mentioned video encoding method or video decoding method.
  • the original bidirectional reference frame can be determined by determining the original bidirectional reference frame in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule, and then the determined original bidirectional reference frame can be obtained by interpolation T number of interpolated frame reference frames with relatively small relative motion between the bidirectional predictive coding frame, and finally a target reference frame list is formed according to the reference frame list and the T interpolated frame reference frames. Since there are T interpolated reference frames with relatively small relative motion between the target reference frame list and the bidirectional predictive coding frame, there will be no large motion vector or motion vector difference, and there will be no relatively large amount of coded data. Big problem.
  • FIG. 1 schematically shows a flowchart of a video encoding method in an exemplary embodiment of the present disclosure
  • Fig. 2 schematically shows a flowchart of a method for determining N pairs of original bidirectional reference frames according to a preset selection rule in an exemplary embodiment of the present disclosure
  • Fig. 3 schematically shows a flowchart of a method for obtaining T frame interpolation reference frames by performing frame interpolation processing according to a preset frame interpolation rule in an exemplary embodiment of the present disclosure
  • FIG. 4 schematically shows a flowchart of a method for determining the time phase of an interpolation frame reference frame corresponding to an original bidirectional reference frame in an exemplary embodiment of the present disclosure
  • FIG. 5 schematically shows a flowchart of a method for determining a third time point in an exemplary embodiment of the present disclosure
  • Fig. 6 schematically shows a flowchart of a video decoding method in an exemplary embodiment of the present disclosure
  • FIG. 7 schematically shows a flowchart of a method for determining a target reference frame list corresponding to encoded data according to key parameters in an exemplary embodiment of the present disclosure
  • FIG. 8 schematically shows a flowchart of a video encoding method in an exemplary embodiment of the present disclosure
  • Fig. 9 schematically shows a flowchart of a video decoding method in an exemplary embodiment of the present disclosure
  • FIG. 10 schematically shows a schematic diagram of determining a motion vector based on motion estimation in an exemplary embodiment of the present disclosure
  • FIG. 11 schematically shows a schematic diagram of a corrected motion vector in an exemplary embodiment of the present disclosure
  • FIG. 12 schematically shows a schematic diagram of frame interpolation based on motion compensation in an exemplary embodiment of the present disclosure
  • FIG. 13 schematically shows a schematic diagram of the implementation principle of one of the exemplary embodiments of the present disclosure
  • FIG. 14 schematically shows a schematic diagram of the implementation principle of another embodiment in the exemplary embodiment of the present disclosure.
  • FIG. 15 schematically shows a schematic diagram of the composition of a video encoding device in an exemplary embodiment of the present disclosure
  • FIG. 16 schematically shows a schematic diagram of the composition of a video decoding device in an exemplary embodiment of the present disclosure
  • FIG. 17 schematically shows a structural diagram of a computer system of an electronic device in an exemplary embodiment of the present disclosure.
  • this exemplary embodiment provides a video encoding method, which can be applied to terminal devices with image processing functions, such as mobile phones, tablet computers, and the like.
  • the foregoing video encoding method may include the following steps S110 to S140:
  • Step S110 Determine N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule.
  • N takes a positive integer.
  • the logarithm N of the original bidirectional reference frame can be set according to different reference frame lists, and the present disclosure does not specifically limit the logarithm of the selected original bidirectional reference frame.
  • the reference frame list there are only two frames of storage space, that is, when storing one frame forward original reference frame and one frame backward original reference frame, you can set N to be 1; for another example, there are multiple frames in the reference frame list
  • the value of N can be set according to the magnitude of the relative motion between frames.
  • the preset selection rules may include pairing rules and selection rules.
  • determining N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to the preset selection rule may include the following steps S210 to S220:
  • Step S210 Pair the original forward reference frame and the original backward reference frame in the reference frame list corresponding to the bidirectional predictive coding frame according to the pairing rule to generate at least one pair of candidate original bidirectional reference frames.
  • the pairing rule may include any rule for pairing one frame of original forward reference frame and one frame of original backward reference frame in the reference frame list, and the present disclosure does not specifically limit the pairing rule .
  • the frame number corresponding to the bidirectional predictive coding frame is A
  • the reference frame of bidirectional predictive coding must include a forward reference frame and a backward reference frame at the same time, at least one pair of candidate original bidirectional reference frames generated according to the pairing rule must also include one Frame original forward reference frame and one frame original backward reference frame.
  • Step S220 Determine N pairs as the original bidirectional reference frames from at least one pair of candidate original bidirectional reference frames according to the selection rule.
  • the selection rule may include any rule for determining N pairs as the original bidirectional reference frame among at least one pair of candidate original bidirectional reference frames, and the present disclosure does not specifically limit the pairing rule.
  • the selection rule can be to determine the N pairs of candidate original bidirectional reference frames that are closest to the current bidirectional predictive coding frame as the original bidirectional reference frame; N pairs of bidirectional reference frames are randomly selected and determined as the original bidirectional reference frames.
  • Step S120 Perform frame interpolation processing on N original bidirectional reference frames according to preset frame interpolation rules to obtain T frame interpolation reference frames, and update the reference frame list according to the T frame interpolation reference frames to obtain a target reference frame list.
  • the preset frame interpolation rule may be any frame interpolation rule for interpolating frames on the original reference frame pair, and may include frame interpolation method rules, time phase rules, etc., or may be both frame interpolation method rules and time phase rules. And other rules, this disclosure does not make any special restrictions on this.
  • the preset frame interpolation rules may include the following frame interpolation rules: perform one frame interpolation on N original bidirectional reference frames to obtain N primary frame interpolation reference frames, and then perform secondary frame interpolation on N primary frame interpolation reference frames, Obtain M secondary interpolation frame reference frames, and use N primary interpolation frame reference frames and M secondary interpolation frame reference frames together as T interpolation frame reference frames; for another example, the preset interpolation frame rule may include A pair of original bidirectional reference frames forms the time phase rule of the interpolated frame reference frame; for another example, the preset interpolated frame rule may include the above-mentioned interpolated frame method rule and the time phase rule set for the primary interpolated frame and the secondary interpolated frame at the same time.
  • the value of T may not necessarily be the same as the value of N, and T may be greater than N, less than or equal to N. This is the case in this disclosure. There are no special restrictions.
  • the frame interpolation process is performed on N original bidirectional reference frames according to the preset frame interpolation rule to obtain T frame interpolation reference frames, which may include The following steps S310 to S320:
  • step S310 the time phases of the interpolated frame reference frames corresponding to the N pairs of original bidirectional reference frames are respectively determined according to the time phase rule.
  • the time phase of the interpolated frame reference frame can be used to determine the position of the interpolated frame reference frame between the original bidirectional reference frames.
  • the time phase of the interpolated frame reference frame may be the time that the interpolated frame reference frame is later than the original forward reference frame in the original bidirectional reference frame; for another example, the time phase of the interpolated frame reference frame may be the time that the interpolated frame reference frame is earlier than the original bidirectional reference frame. The time of the original backward reference frame in the reference frame.
  • the time phase of the interpolated frame reference frame is the time of the interpolated frame reference frame later than the original forward reference frame in the original bidirectional reference frame, assuming that the time phase of a certain interpolated frame reference frame is 0.5, the corresponding original forward The time corresponding to the reference frame is the first second, and the time corresponding to the inserted frame reference frame is the 1.5 second.
  • determining the time phase of the interpolated frame reference frame corresponding to the original bidirectional reference frame through the time phase rule may include the following steps S410 to S420:
  • Step S410 Obtain the first frame number corresponding to the original forward reference frame in the original bidirectional reference frame, the first time point and the second frame number and second time point corresponding to the original backward reference frame, and the corresponding bidirectional predictive coding frame The third frame number.
  • Step S420 Determine a third time point between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number, and determine the third time point as the time phase of the interpolated frame reference frame .
  • the relationship between the frame number and the time point of each frame image in the video can be used to adaptively determine the time phase of the interpolated frame reference frame.
  • the third time point is determined between the first time point and the second time point, and the third time point is determined as the time phase of the interpolated frame reference frame.
  • the third time point is determined between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number. As shown in FIG. 5, the following steps S510 to S540:
  • Step S510 Calculate the first frame number difference corresponding to the first frame number and the second frame number, and calculate the time difference between the first time point and the second time point.
  • Step S520 Calculate the quotient of the time difference and the first frame number difference as the unit duration.
  • the unit duration between each frame can be determined according to the frame number and time point. Specifically, the frame number difference between the frame numbers corresponding to the original forward reference frame and the original backward reference frame can be calculated as the first frame number difference, and then the video corresponding to the original forward reference frame and the original backward reference frame can be calculated. The time difference between the first time point and the second time point, and finally the quotient of the time difference and the first frame number difference is calculated to obtain the unit duration between each frame.
  • Step S530 Calculate the product of the difference between the second frame number corresponding to the first frame number and the third frame number and the unit duration as the first duration, and determine the time point later than the first time point by the first duration as the third time point .
  • Step S540 Calculate the product of the third frame number difference corresponding to the second frame number and the third frame number and the unit duration as the second time length, and determine the time point earlier than the second time point by the second time as the third time point .
  • the frame number difference between the original forward reference frame, the original backward reference frame, and the current bidirectional predictive coding frame can be used to determine the corresponding interpolated frame reference frame.
  • the third point in time Specifically, the second frame number difference corresponding to the first frame number and the third frame number can be calculated first, and then the product of the second frame number difference and the unit duration can be calculated as the first duration, and finally the first time will be later than the first time point.
  • the time point of the duration is determined as the third time point; for example, the first time point is 10, and the calculated first time length is 0.5 units, then the third time point is 10.5; or, the second frame number and the first time point can be calculated first.
  • the third frame number difference corresponding to the three frame numbers is calculated, and the product of the third frame number difference and the unit duration is calculated as the second time length, and finally the time point earlier than the second time point by the second time point is determined as the third time point.
  • the third time point calculated by the above method is usually very close to the time point corresponding to the current bidirectional predictive coding frame Therefore, the relative motion between the final interpolated frame reference frame and the current bidirectional predictive coding frame will be relatively small, which can avoid the problem of large coding data caused by large motion vectors or motion vector differences; at the same time, it can also reduce the motion Estimated search range, thereby reducing coding time.
  • the aforementioned frame interpolation processing may use motion estimation motion compensation method, optical flow method, neural network frame interpolation, or other arbitrary frame rate conversion technology.
  • the aforementioned motion estimation motion compensation method may include the following two steps:
  • the motion estimation method is used to determine the motion vectors of all objects or regions in the two images.
  • the two images can be recorded as the current image and the reference image, the two images can be divided into blocks according to the preset size, and the divided images can be traversed to search for each block in the current image in the reference image. Match the block, determine the motion vector (forward MV) of each block of the current image relative to the reference image.
  • the motion vector backward MV
  • a correction operation is performed on the forward and backward MV, where the correction operation includes at least one or a combination of multiple operations such as filtering and weighting, and finally determines the forward or backward MV of each block, as shown in FIG. 11
  • step S320 frame interpolation is performed on N original bidirectional reference frames, respectively, to generate T frame interpolation reference frames in time phase.
  • the time phase can be determined according to the time phase of the interpolated frame reference frame corresponding to each pair of original bidirectional reference frames. Interpolate the frame to obtain the interpolated frame reference frame at the time phase.
  • the time difference between the generated interpolated frame reference frame and the bidirectional predictive coding frame can be controlled, and then the relative motion between the interpolated frame reference frame and the bidirectional predictive coding frame can be controlled, which can reduce the motion vector and the motion vector more effectively The size of the difference can more effectively reduce the search range of motion estimation.
  • the relative motion of the T interpolated frame reference frames to the current bidirectional coded frame is smaller than the original bidirectional reference frame. Therefore, it can be based on the T interpolated frames.
  • the frame reference frame updates the reference frame list to obtain the target reference frame list, and then encodes according to the target reference frame list to obtain encoded data.
  • updating the reference frame list according to the T interpolated frame reference frames to obtain the target reference frame list may include: adding the T interpolated frame reference frames to the reference frame list to generate the target reference frame list.
  • the generated T interpolated frame reference frames can be inserted into the reference frame list according to the previously determined time phase to form a list of target reference frames arranged in chronological order.
  • the sort order and the position of the inserted reference frame list can also be set for the inserted frame reference frame, which is not particularly limited in the present disclosure.
  • updating the reference frame list according to the T insertion frame reference frames to obtain the target reference frame list may also include: replacing the reference frame list with the list formed by the arrangement of the T insertion frame reference frames to generate the target reference frame List.
  • the T interpolated frame reference frames can also be converted into a list in other ways, and the present disclosure does not impose special restrictions on this.
  • the target reference frame list can also be obtained by performing other processing on the reference frame list and the T interpolated frame reference frames.
  • the process of obtaining the target reference frame list in the present disclosure is also No special restrictions.
  • the reference frame list and T interpolated frame reference frames can be filtered under certain conditions, and the target reference frame list can be formed according to the filtered reference frame list and the T interpolated frame reference frames; for another example, the target reference frame list can be formed by comparing the T interpolated reference frames.
  • the insertion frame reference frame is screened under certain conditions, and a target reference frame list is formed according to the filtered insertion frame reference frame.
  • Step S130 encoding the bidirectionally predictive encoded frame according to the target reference frame list to obtain encoded data.
  • encoding can be performed according to the target reference frame list to obtain encoded data. Since there are interpolated frame reference frames in the target reference frame list, there will be no large motion vector or motion vector difference when the bidirectional predictive coding frame is coded. At the same time, the search range of coding can be reduced and the coding speed can be increased.
  • Step S140 Obtain key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate code stream data corresponding to the bidirectional predictive coded frame.
  • the relevant data of the interpolated frame may also be needed in the decoding process. Therefore, some key parameters for generating the interpolated reference frame need to be transmitted together with the encoded data.
  • the key parameter for generating the interpolated frame reference frame may be used as the accessory parameter and the coded data to jointly generate the bitstream data corresponding to the bidirectional predictive coded frame.
  • the key parameters may include N pairs of frame numbers corresponding to the original forward reference frame and the original backward reference frame in the N pairs of original bidirectional reference frames, and the number T of the interpolated frame reference frames.
  • the frame numbers corresponding to the original forward reference frame and the original backward reference frame in the N pairs of original bidirectional reference frames are stored in pairs, so that the basis for generating each interpolated frame reference frame can be determined.
  • the encoding end and the decoding end can also be directly set as a set, that is, a certain encoding method is used on the encoding end, and the corresponding encoding method can be directly used in the decoding end.
  • Decoding method if a certain encoding method is used, only the used encoding method enable flag can be written in the key parameters, which means that the bidirectional predictive encoding frame uses the encoding method, and the corresponding decoding end can be based on The enable flag determines the corresponding decoding mode.
  • N pairs of frame numbers and the number of interpolated reference frames T can be written into the Supplementary Enhancement Information Unit (SEI), and the enable flag and the reference selected by each coding block in the bidirectional predictive coding frame
  • SEI Supplementary Enhancement Information Unit
  • the frame number complies with the standard to write the code stream.
  • other video coding standards can also be used for coding, and the code stream data can be written in different ways according to the coding standard, which is not specifically limited in the present disclosure.
  • a video decoding method is also provided, which can be applied to terminal devices with image processing functions, such as mobile phones and tablet computers.
  • the above-mentioned video decoding method may include step S610 to step S630, which will be described in detail below:
  • Step S610 Obtain code stream data corresponding to the bidirectional predictive coded frame to be decoded.
  • the acquired bitstream data corresponding to the bidirectional predictive encoded frame to be decoded includes encoded data and key parameters.
  • the encoded data refers to the encoded data obtained based on the foregoing encoding method
  • the key parameter is the key parameter for generating the interpolated frame reference frame in the foregoing encoding method.
  • the key parameter includes a key parameter used to determine the interpolated frame reference frame, for example, may be the frame number of the original bidirectional reference frame on which the interpolated frame reference frame is generated.
  • the encoding end and the decoding end can also be directly set up, that is, a certain encoding method is used on the encoding end, and the corresponding encoding can be directly used in the decoding end.
  • the key parameters may also include only the enable flag corresponding to the encoding method used during encoding, and during decoding, the corresponding decoding method can be determined according to the enable flag for decoding.
  • Step S620 Analyze the encoded data, and determine the target reference frame list corresponding to the encoded data according to the key parameters.
  • the key parameter may include N pairs of frame numbers and the number T, where N and T are both positive integers.
  • parsing the encoded data and determining the target reference frame list corresponding to the encoded data according to the key parameters may include the following steps S710 to S740:
  • Step S710 Analyze and reconstruct the encoded data to obtain a reference frame list corresponding to the bidirectionally predictive encoded frame to be decoded.
  • the reference frame list corresponding to the bidirectional predictive coded frame to be decoded is the original reference frame list when the bidirectional predictive coded frame to be decoded is decoded, and each reference frame in the reference frame list is a reference frame that can be used as a reference frame.
  • a video frame obtained by reconstructing the encoded data corresponding to the video frame. Before decoding the bidirectional predictive coded frame to be decoded, it is necessary to obtain a reference frame list corresponding to the bidirectional predictive coded frame to be decoded.
  • Step S720 Determine N pairs of original bidirectional reference frames in the reference frame list according to the N pairs of frame numbers.
  • the key parameters include the frame numbers of the N pairs of original bidirectional reference frames that generate the interpolated frame reference frame. Therefore, the N pairs of original bidirectional reference frames can be determined in the reference frame list through the N pairs of frame numbers, and then the interpolated frame can be determined. The basis for frame reference frame generation.
  • step S730 the original bidirectional reference frame, the number T and the coded data are interpolated and reconstructed based on N to obtain T interpolated reference frames.
  • the number of original bidirectional reference frames, the number of generated interpolated reference frames T, and the prediction residuals in the encoded data can be interpolated and reconstructed based on N to reproduce T interpolated reference frames.
  • step S740 the reference frame list is updated based on the T interpolated frame reference frames to obtain the target reference frame list.
  • the reference frame list can be updated according to the T interpolated frame reference frames, so as to obtain the target reference frame list.
  • the same method of constructing the target reference frame list as in the encoding process can be adopted.
  • updating the reference frame list according to the T interpolated frame reference frames to obtain the target reference frame list may include: adding the T interpolated frame reference frames to the reference frame list to generate the target reference frame list.
  • the generated T interpolated frame reference frames can be inserted into the reference frame list according to the previously determined time phase to form a list of target reference frames arranged in chronological order.
  • the sort order and the position of the inserted reference frame list can also be set for the inserted frame reference frame, which is not particularly limited in the present disclosure.
  • updating the reference frame list according to the T interpolated frame reference frames to obtain the target reference frame list may also include: replacing the reference frame list with the list formed by the arrangement of the T interpolated frame reference frames to generate the target reference frame list.
  • the T interpolated frame reference frames can also be converted into a list in other ways, and the present disclosure does not impose special restrictions on this.
  • the target reference frame list can also be obtained by performing other processing on the reference frame list and the T interpolated frame reference frames.
  • the process of obtaining the target reference frame list in the present disclosure is also No special restrictions.
  • the reference frame list and T interpolated frame reference frames can be filtered under certain conditions, and the target reference frame list can be formed according to the filtered reference frame list and the T interpolated frame reference frames; for another example, the target reference frame list can be formed by comparing the T interpolated reference frames.
  • the insertion frame reference frame is screened under certain conditions, and a target reference frame list is formed according to the filtered insertion frame reference frame.
  • Step S630 Perform decoding and reconstruction based on the target reference frame list to obtain a decoded bidirectional prediction reconstruction frame.
  • the encoded data can be decoded and reconstructed according to the target reference frame list to obtain the bidirectional predictive encoded frame corresponding to the bidirectional predictive encoded frame to be decoded.
  • the predicted value corresponding to the video to be decoded can be obtained according to the target reference frame list corresponding to the bidirectional predictive coded frame to be decoded, and the video frame can be reconstructed according to the prediction residual and the predicted value in the coded data to obtain the bidirectional predictive coded frame.
  • step S810 if the current coded frame is a bidirectional predictive coded frame, obtain its original reference frame list; step S820, determine N pairs of forward and backward original reference frames in the original reference frame list; step S830, input interpolation
  • the frame module performs frame insertion to form T frame insertion reference frames; step S840, accumulate the newly formed T frame insertion reference frames and the original reference frame list to form a target reference frame list; step S850, perform according to the target reference frame list
  • the predictive coding of the fixed video coding standard forms the coded data.
  • the number T of interpolated frame reference frames used in the current bidirectional predictive coding frame and the frame numbers of the original forward and backward reference frames selected by these interpolated frame reference frames are used as additional parameters and encoded data Commonly used as code stream data.
  • the rules for selecting the original two-way reference frame can be corresponded in the order of playback. For example, if the current frame is the k-th frame, then k-1 and k+1 form a pair, and then k-2 and k+2 form a pair.
  • the frame number of the reference frame selected by each encoding block in the current bidirectional predictive encoding frame may be required.
  • the data can also be used as an additional parameter Add code stream data; in addition, when this encoding method is used, the corresponding enable flag can be written into additional parameters to identify that the method is enabled during the encoding process.
  • step S910 when the current bitstream data is a bidirectional predictive coded frame, determine N pairs of original bidirectional reference frames in the original reference frame list according to additional parameters; step S920, according to the obtained N pairs of original bidirectional reference frames Perform interpolation frame reconstruction to obtain T interpolation frame reference frames; step S930, a target reference frame list formed based on the original reference frame list and T interpolation frame reference frames; step S940, parse the encoded data to obtain prediction residuals and predictions Value; Step S950, decoding and reconstruction based on the target reference frame list, prediction residuals, and prediction values, to obtain a decoded bidirectional prediction reconstruction frame.
  • An interpolated frame reference frame is formed, and the encoder only uses the formed interpolated frame reference frame as a reference for encoding during encoding.
  • the previous frame and the next frame are set as the original bidirectional reference frame by default, there is no need to form the key parameters of the interpolated frame reference frame, and only the enable flag can be written into the code stream information to indicate that the encoding method is used .
  • the corresponding strategy is used for decoding.
  • the previous frame and the following frame of the currently reconstructed bidirectional predictive coding frame are used as the original two-way predictive coding frame.
  • the original bidirectional reference frame is interpolated to obtain an interpolated frame reference frame, and the interpolated frame reference frame is used for reference decoding to obtain the decoded bidirectional predictive reconstructed frame.
  • T interpolated frame reference frames with the same time phase as the current bidirectional predictive coding frame are formed.
  • the encoder only uses the formed T interpolated frame reference frames as a reference for encoding, and writes the frame number of the original bidirectional reference frame and the number of interpolated frame reference frames T as additional parameters into the code stream.
  • the corresponding strategy is adopted for decoding.
  • the number T of the original bidirectional reference frame and the number of interpolated reference frames are added.
  • the parameters determine N pairs of original bidirectional reference frames, and then based on N pairs of original bidirectional reference frames, T interpolated frame reference frames with the same time phase as the current bidirectional predictive coding frame are formed, and the last T interpolated reference frames are decoded based on The decoded bidirectional prediction reconstructs the frame.
  • the B secondary interpolation frame reference frames may be sequentially numbered as the frame of the secondary interpolation frame reference frame.
  • the frame numbers are 0, 1, ..., B-2, B-1; then, the A one-time interpolated frame reference frames are sequentially numbered as the frame number of the one-time interpolated frame reference frame, for example, the frame numbers are respectively B, B+1,..., B+A-2, B+A-1.
  • the encoder When encoding, the encoder only refers to the target reference frame list formed by sorting A primary interpolated frame reference frames and B secondary interpolated frame reference frames. At the same time, it encodes the frame number of the original bidirectional reference frame and the primary interpolated frame reference. The number of frames A and the reference frame number B of the secondary interpolation frame are written into the code stream as additional parameters.
  • the corresponding strategy is adopted for decoding.
  • the frame number of the original bidirectional reference frame and the number of primary interpolated frame reference frames A and the number of secondary interpolated frame reference frames B determines N pairs of original bidirectional reference frames, and based on N pairs of original bidirectional reference frames, forms A one-time interpolated frame reference frames with the same time phase as the current bidirectional predictive coding frame, and then performs two-by-two based on the A one-time interpolated frame reference frames Re-interpolation frame, obtain B secondary-interpolation frame reference frames, and perform encoding and sorting with A primary-interpolation frame reference frames and B secondary-interpolation frame reference frames to form a target reference frame list containing T inter-frame reference frames, Finally, the T interpolated frame reference frames are used as references for decoding, and the decoded bidirectional prediction reconstructed frame is obtained.
  • this frame forward reference frame and a frame backward reference frame an interpolated frame reference frame with the same time phase as the current bidirectional predictive coding frame can be formed, and then this interpolated frame reference frame and the original front frame can be used respectively. Perform secondary interpolation to the reference frame and the original backward reference frame.
  • the time phase of the interpolation frame can be 0.5 to obtain a forward interpolation frame reference frame and a backward interpolation frame reference frame, and then pass the forward interpolation frame reference frame and The backward interpolation frame reference frame replaces the original forward reference frame and the original backward reference frame in the original reference frame list to form the target reference frame list.
  • the encoder When the encoder is encoding, it only refers to one frame of forward interpolated frame reference frame and one frame of backward interpolated frame reference frame in the target reference frame list. At the same time, it encodes the frame number of the original bidirectional reference frame and the number of interpolated frame reference frames 2 Write the code stream as an additional parameter.
  • the corresponding strategy is adopted for decoding.
  • a pair of original bidirectional reference frames is determined according to the frame number of the original bidirectional reference frame and the number of interpolated reference frames 2, and then Based on this pair of original bidirectional reference frames, one interpolated frame is obtained to obtain an interpolated frame reference frame with the same time phase as the current bidirectional predictive encoded frame, and then the interpolated frame reference frame, the original forward reference frame, and the original back Perform secondary interpolation to the reference frame, and the time phase of the interpolation frame can be 0.5 to obtain a forward interpolation frame reference frame and a backward interpolation frame reference frame to form a target reference frame list, and finally use two of the target reference frame lists.
  • Two interpolated frame reference frames are used as a reference for decoding, and a decoded bidirectional prediction reconstructed frame is obtained.
  • the embodiments of the present disclosure can reduce the relative motion between the current bidirectional predictive encoding frame and the reference frame in the video by inserting the frame before encoding, thereby reducing the motion vector or the motion vector difference, and avoiding the motion vector or the motion vector.
  • the embodiment of this example also provides a video encoding device 1500, including: a reference acquiring module 1510, a first list determining module 1520, a data encoding module 1530 and a code stream generating module 1540. in:
  • the reference acquisition module 1510 may be configured to determine N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule; where N is a positive integer.
  • the first list determining module 1520 may be configured to perform frame interpolation processing on N pairs of original bidirectional reference frames according to preset frame interpolation rules, obtain T frame interpolation reference frames, and update the reference frame list according to the T frame interpolation reference frames, Obtain a list of target reference frames; where T is a positive integer.
  • the data encoding module 1530 may be used to encode the bidirectionally predictive encoded frame according to the target reference frame list to obtain encoded data.
  • the code stream generating module 1540 may be used to obtain key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate code stream data corresponding to the bidirectional predictive coded frame.
  • the reference acquisition module 1510 may be used to pair the original forward reference frame and the original backward reference frame in the reference frame list corresponding to the bidirectional predictive coded frame according to the pairing rule to generate at least one pair of candidate original bidirectional Reference frame: Determine N pairs as the original bidirectional reference frame from at least one pair of candidate original bidirectional reference frames according to the selection rule.
  • the first list determining module 1520 may be used to determine the time phases of the interpolation frame reference frames corresponding to the N pairs of original bidirectional reference frames respectively according to the time phase rule; wherein, the time phase of the interpolation frame reference frame is used to determine the time phase of the interpolation frame.
  • the position of the frame reference frame between the original bidirectional reference frames; for N pairs of original bidirectional reference frames, frame interpolation is performed to generate T interpolated frame reference frames in time phase.
  • the first list determining module 1520 may be used to obtain the first frame number, the first time point, and the second frame number corresponding to the original forward reference frame in the original bidirectional reference frame, and the second frame number corresponding to the original backward reference frame.
  • the first list determining module 1520 may be used to calculate the first frame number difference corresponding to the first frame number and the second frame number, and calculate the time difference between the first time point and the second time point; calculate the time difference and The quotient of the first frame number difference is used as the unit duration; the product of the second frame number difference corresponding to the first frame number and the third frame number and the unit duration is calculated as the first duration, and the first duration will be later than the first time point by the first duration
  • the time point is determined as the third time point; or the product of the third frame number difference corresponding to the second frame number and the third frame number and the unit duration is calculated as the second time length, which will be a second time earlier than the second time point
  • the point is determined as the third time point.
  • the first list determining module 1520 may be used to add T interpolated frame reference frames to the reference frame list to generate a target reference frame list.
  • the first list determining module 1520 may be configured to replace the reference frame list with a list formed by the arrangement of T interpolated frame reference frames to generate a target reference frame list.
  • the key parameters include N pairs of frame numbers corresponding to the original forward reference frame and the original backward reference frame in the N pairs of original bidirectional reference frames, and the number T of interpolated reference frames.
  • a video decoding device 1600 is also provided, which is characterized in that it includes: a data acquisition module 1610, a second list determination module 1620, and a data reconstruction module 1630 . in:
  • the data acquisition module 1610 can be used to acquire code stream data corresponding to the bidirectional predictive coding frame to be decoded; the code stream data includes coded data and key parameters.
  • the second list determining module 1620 may be used to analyze the encoded data and determine the target reference frame list corresponding to the encoded data according to key parameters.
  • the data reconstruction module 1630 may be configured to perform decoding and reconstruction based on the target reference frame list, and obtain the bidirectional predictive coding frame corresponding to the bidirectional predictive coding frame to be decoded.
  • the second list determining module 1620 can be used to parse and reconstruct the encoded data to obtain the reference frame list corresponding to the bidirectional predictive encoded frame to be decoded; determine the N pairs of original bidirectional frames in the reference frame list according to the N pairs of frame numbers.
  • Reference frame Based on N, the original two-way reference frame, the number T and the coded data are inserted into the frame to obtain T interpolation frame reference frames; the reference frame list is updated based on the T interpolation frame reference frames, and the target reference frame list is obtained.
  • the second list determining module 1620 may be used to add T interpolated frame reference frames to the reference frame list to generate a target reference frame list.
  • the second list determining module 1620 may be configured to replace the reference frame list with a list formed by the arrangement of T interpolated frame reference frames to generate a target reference frame list.
  • modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory.
  • the features and functions of two or more modules or units described above may be embodied in one module or unit.
  • the features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.
  • Fig. 17 shows a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present invention.
  • the computer system 1700 includes a central processing unit (CPU) 1701, which can be based on a program stored in a read only memory (ROM) 1702 or a program loaded from a storage portion 1708 into a random access memory (RAM) 1703 And perform various appropriate actions and processing.
  • CPU 1701 various programs and data required for system operation are also stored.
  • the CPU 1701, the ROM 1702, and the RAM 1703 are connected to each other through a bus 1704.
  • An input/output (I/O) interface 1705 is also connected to the bus 1704.
  • the following components are connected to the I/O interface 1705: an input part 1706 including a keyboard, a mouse, etc.; an output part 1707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers, etc.; a storage part 1708 including a hard disk, etc. ; And a communication section 1709 including a network interface card such as a LAN card, a modem, and the like. The communication section 1709 performs communication processing via a network such as the Internet.
  • the driver 1710 is also connected to the I/O interface 1705 as needed.
  • a removable medium 1711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1710 as needed, so that the computer program read therefrom is installed into the storage portion 1708 as needed.
  • an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication part 1709, and/or installed from the removable medium 1711.
  • CPU central processing unit
  • the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more for realizing the specified logic function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by It is realized by a combination of dedicated hardware and computer instructions.
  • the units described in the embodiments of the present invention may be implemented in software or hardware, and the described units may also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • this application also provides a computer-readable medium.
  • the computer-readable medium may be included in the electronic device described in the above-mentioned embodiment; or it may exist alone without being assembled into the electronic device. middle.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, the electronic device realizes the method in the following embodiments.
  • the electronic device of FIG. 1 can implement the various steps shown in FIG. 1 to FIG. 7.

Abstract

The present disclosure relates to the technical field of image processing, and specifically relates to a video encoding method, a video decoding method, a video encoding apparatus, and an electronic device. The method comprises: according to a preset selection rule, determining N pairs of original bidirectional reference frames in a reference frame list corresponding to a bidirectional predictive encoded frame; performing frame interpolation processing on the N pairs of original bidirectional reference frames according to a preset frame interpolation rule to obtain T frame interpolation reference frames, and updating the reference frame list according to the T frame interpolation reference frames so as to obtain a target reference frame list; encoding the bidirectional predictive encoded frame according to the target reference frame list to obtain encoded data; acquiring key parameters for generating the frame interpolation reference frames, and adding the key parameters to the encoded data to generate bit stream data corresponding to the bidirectional predictive encoded frame. The present disclosure may overcome the problem of large encoded data caused by large motion vectors or motion vector differences.

Description

视频编码、解码方法及装置和电子设备Video encoding and decoding method and device and electronic equipment
交叉引用cross reference
本公开要求于2020年4月17日提交的申请号为202010307909.7名称为“视频编码、解码方法及装置和电子设备”的中国专利申请的优先权,该中国专利申请的全部内容通过引用全部并入本文。This disclosure claims the priority of a Chinese patent application filed on April 17, 2020 with the application number 202010307909.7 titled "Video encoding and decoding method and device and electronic equipment", and the entire content of the Chinese patent application is incorporated by reference in its entirety. This article.
技术领域Technical field
本公开涉及图像处理技术领域,具体涉及一种视频编码方法、视频解码方法、视频编码装置和电子设备。The present disclosure relates to the field of image processing technology, and in particular to a video encoding method, a video decoding method, a video encoding device, and electronic equipment.
背景技术Background technique
视频编码是一种通过压缩技术将原始视频格式的文件转换成另一种视频格式文件的方式,能够在一定程度上降低视频数据的大小。帧间预测是视频编码的一种,它可以利用相邻帧之间像素点的相关性进行预测得到预测值,进而实现对视频进行压缩的目的。帧间预测具体包括三种,单向预测、双向预测和重叠补偿预测。其中,双向预测编码技术是一种常用的编码技术,它能够以当前帧在播放顺序上的前后多帧为参考帧进行运动估计和帧间预测得到最终预测值。Video encoding is a way to convert files in the original video format into another video format file through compression technology, which can reduce the size of video data to a certain extent. Inter-frame prediction is a type of video coding. It can use the correlation of pixels between adjacent frames to predict the predicted value, and then achieve the purpose of compressing the video. There are three types of inter-frame prediction, one-way prediction, two-way prediction and overlap compensation prediction. Among them, the bidirectional predictive coding technology is a commonly used coding technology, which can use multiple frames before and after the current frame in the playback sequence as reference frames to perform motion estimation and inter-frame prediction to obtain the final prediction value.
公开内容Public content
本公开的目的在于提供一种视频编码方法、视频解码方法、视频编码装置和电子设备,进而至少在一定程度上克服运动矢量或运动矢量差较大导致的编码数据较大的问题。The purpose of the present disclosure is to provide a video encoding method, a video decoding method, a video encoding device, and an electronic device, so as to overcome at least to a certain extent the problem of large motion vectors or large encoded data caused by large motion vector differences.
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。Other characteristics and advantages of the present disclosure will become apparent through the following detailed description, or partly learned through the practice of the present disclosure.
根据本公开的第一方面,提供一种视频编码方法,包括:根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧;其中,N取正整数;根据预设插帧规则对N对原始双向参考帧进行插帧处理,获得T个插帧参考帧,并根据T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表;其中,T取正整数;根据目标参考帧列表对双向预测编码帧进行编码获得编码数据;获取生成插帧参考帧的关键参数,将关键参数附加在编码数据中,生成双向预测编码帧对应的码流数据。According to a first aspect of the present disclosure, a video encoding method is provided, which includes: determining N pairs of original bidirectional reference frames in a reference frame list corresponding to a bidirectional predictive coding frame according to a preset selection rule; wherein, N takes a positive integer; Set the interpolation frame rule to perform interpolation processing on the original two-way reference frame of N, obtain T interpolation frame reference frames, and update the reference frame list according to the T interpolation frame reference frames to obtain the target reference frame list; where T is positive Integer; encode the bidirectional predictive coded frame according to the target reference frame list to obtain coded data; obtain the key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate the code stream data corresponding to the bidirectional predictive coded frame.
根据本公开的第二方面,提供一种视频解码方法,包括:获取待解码双向预测编码帧对应的码流数据;码流数据包括编码数据和关键参数;对编码数据进行解析,并根据关键参数确定编码数据对应的目标参考帧列表;基于目标参考帧列表进行解码重建,获得解码后的双向预测重建帧。According to a second aspect of the present disclosure, a video decoding method is provided, which includes: obtaining code stream data corresponding to a bidirectional predictive coded frame to be decoded; code stream data including coded data and key parameters; parsing the coded data and analyzing the coded data according to the key parameters Determine the target reference frame list corresponding to the encoded data; perform decoding and reconstruction based on the target reference frame list, and obtain the decoded bidirectional prediction reconstruction frame.
根据本公开的第三方面,提供一种视频编码装置,包括:参考获取模块,用于根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧;其中,N取正整数;第一列表确定模块,用于根据预设插帧规则对N对原始双向参考帧进行插帧处理,获得T个插帧参考帧,并根据T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表;其中,T取正整数;数据编码模块,用于根据目标参考帧列表对双向预测编码帧进行编码获得编码数据;码流生成模块,用于获取生成插帧参考帧的关键参数,将关键参数附加在编码数据中,生成双向预测编码帧对应的码流数据。According to a third aspect of the present disclosure, there is provided a video encoding device, including: a reference acquisition module, configured to determine N pairs of original bidirectional reference frames in a reference frame list corresponding to a bidirectional predictive coding frame according to a preset selection rule; where N Take a positive integer; the first list determination module is used to perform frame interpolation processing on N pairs of original bidirectional reference frames according to preset frame interpolation rules, to obtain T frame interpolation reference frames, and to list the reference frames according to the T frame interpolation reference frames Update to obtain the target reference frame list; where T is a positive integer; the data encoding module is used to encode the two-way predictive encoding frame according to the target reference frame list to obtain the encoded data; the code stream generation module is used to obtain the generated frame insertion reference The key parameter of the frame, the key parameter is appended to the coded data, and the code stream data corresponding to the bidirectional predictive coded frame is generated.
根据本公开的第四方面,提供一种视频解码装置,包括:数据获取模块,用于获取待解码双向预测编码帧对应的码流数据;码流数据包括编码数据和关键参数;第二列表 确定模块,用于对编码数据进行解析,并根据关键参数确定编码数据对应的目标参考帧列表;数据重建模块,用于基于目标参考帧列表进行解码重建,获得解码后的双向预测重建帧。According to a fourth aspect of the present disclosure, a video decoding device is provided, which includes: a data acquisition module for acquiring code stream data corresponding to a bidirectional predictive coding frame to be decoded; code stream data includes coded data and key parameters; the second list is determined The module is used to analyze the encoded data and determine the target reference frame list corresponding to the encoded data according to the key parameters; the data reconstruction module is used to decode and reconstruct based on the target reference frame list to obtain the decoded bidirectional prediction reconstruction frame.
根据本公开的第五方面,提供一种计算机可读介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述的视频编码方法或视频解码方法。According to a fifth aspect of the present disclosure, there is provided a computer-readable medium having a computer program stored thereon, and the computer program is executed by a processor to implement the above-mentioned video encoding method or video decoding method.
根据本公开的第六方面,提供一种电子设备,其特征在于,包括:处理器;以及存储器,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现上述的视频编码方法或视频解码方法。According to a sixth aspect of the present disclosure, there is provided an electronic device, which is characterized by comprising: a processor; and a memory, configured to store one or more programs, when the one or more programs are executed by one or more processors , Enabling one or more processors to implement the above-mentioned video encoding method or video decoding method.
本公开的一种实施例所提供的视频编码方法中,可以通过根据预设选取规则在双向预测编码帧对应的参考帧列表确定原始双向参考帧,进而对确定的原始双向参考帧进行插帧获得T个与双向预测编码帧之间相对运动较小的插帧参考帧,最后根据参考帧列表和T个插帧参考帧形成目标参考帧列表。由于目标参考帧列表中,存在T个与双向预测编码帧之间相对运动较小的插帧参考帧,因此不会产生较大的运动矢量或者运动矢量差,进而也不会出现编码数据量较大的问题。In the video encoding method provided by an embodiment of the present disclosure, the original bidirectional reference frame can be determined by determining the original bidirectional reference frame in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule, and then the determined original bidirectional reference frame can be obtained by interpolation T number of interpolated frame reference frames with relatively small relative motion between the bidirectional predictive coding frame, and finally a target reference frame list is formed according to the reference frame list and the T interpolated frame reference frames. Since there are T interpolated reference frames with relatively small relative motion between the target reference frame list and the bidirectional predictive coding frame, there will be no large motion vector or motion vector difference, and there will be no relatively large amount of coded data. Big problem.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments consistent with the disclosure, and are used together with the specification to explain the principle of the disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the attached picture:
图1示意性示出本公开示例性实施例中一种视频编码方法的流程图;Fig. 1 schematically shows a flowchart of a video encoding method in an exemplary embodiment of the present disclosure;
图2示意性示出本公开示例性实施例中根据预设选取规则确定N对原始双向参考帧的方法的流程图;Fig. 2 schematically shows a flowchart of a method for determining N pairs of original bidirectional reference frames according to a preset selection rule in an exemplary embodiment of the present disclosure;
图3示意性示出本公开示例性实施例中根据预设插帧规则进行插帧处理获得T个插帧参考帧的方法的流程图;Fig. 3 schematically shows a flowchart of a method for obtaining T frame interpolation reference frames by performing frame interpolation processing according to a preset frame interpolation rule in an exemplary embodiment of the present disclosure;
图4示意性示出本公开示例性实施例中确定原始双向参考帧对应的插帧参考帧的时间相位的方法的流程图;FIG. 4 schematically shows a flowchart of a method for determining the time phase of an interpolation frame reference frame corresponding to an original bidirectional reference frame in an exemplary embodiment of the present disclosure;
图5示意性示出本公开示例性实施例中确定第三时间点的方法的流程图;FIG. 5 schematically shows a flowchart of a method for determining a third time point in an exemplary embodiment of the present disclosure;
图6示意性示出本公开示例性实施例中一种视频解码方法的流程图;Fig. 6 schematically shows a flowchart of a video decoding method in an exemplary embodiment of the present disclosure;
图7示意性示出本公开示例性实施例中根据关键参数确定编码数据对应的目标参考帧列表的方法的流程图;FIG. 7 schematically shows a flowchart of a method for determining a target reference frame list corresponding to encoded data according to key parameters in an exemplary embodiment of the present disclosure;
图8示意性示出本公开示例性实施例中一种视频编码方法的流程图;Fig. 8 schematically shows a flowchart of a video encoding method in an exemplary embodiment of the present disclosure;
图9示意性示出本公开示例性实施例中一种视频解码方法的流程图;Fig. 9 schematically shows a flowchart of a video decoding method in an exemplary embodiment of the present disclosure;
图10示意性示出本公开示例性实施例中一种基于运动估计确定运动矢量的示意图;FIG. 10 schematically shows a schematic diagram of determining a motion vector based on motion estimation in an exemplary embodiment of the present disclosure;
图11示意性示出本公开示例性实施例中一种对修正后的运动矢量的示意图;FIG. 11 schematically shows a schematic diagram of a corrected motion vector in an exemplary embodiment of the present disclosure;
图12示意性示出本公开示例性实施例中一种基于运动补偿进行插帧的示意图;FIG. 12 schematically shows a schematic diagram of frame interpolation based on motion compensation in an exemplary embodiment of the present disclosure;
图13示意性示出本公开示例性实施例中一个实施例的实现原理的示意图;FIG. 13 schematically shows a schematic diagram of the implementation principle of one of the exemplary embodiments of the present disclosure;
图14示意性示出本公开示例性实施例中另一个实施例的实现原理的示意图;FIG. 14 schematically shows a schematic diagram of the implementation principle of another embodiment in the exemplary embodiment of the present disclosure;
图15示意性示出本公开示例性实施例中视频编码装置的组成示意图;FIG. 15 schematically shows a schematic diagram of the composition of a video encoding device in an exemplary embodiment of the present disclosure;
图16示意性示出本公开示例性实施例中视频解码装置的组成示意图;FIG. 16 schematically shows a schematic diagram of the composition of a video decoding device in an exemplary embodiment of the present disclosure;
图17示意性示出本公开示例性实施例中电子设备的计算机系统的结构示意图。FIG. 17 schematically shows a structural diagram of a computer system of an electronic device in an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms, and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed To those skilled in the art. The described features, structures or characteristics can be combined in one or more embodiments in any suitable way.
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。In addition, the drawings are only schematic illustrations of the present disclosure, and are not necessarily drawn to scale. The same reference numerals in the figures denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in the form of software, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices.
在相关技术中,在对帧与帧之间的相对运动较大的视频进行双向预测编码时,由于帧与帧之间的相对运动较大,因此会产生较大的运动矢量或者运动矢量差,而对这些较大的运行矢量或者运动矢量差进行编码时,可能会形成较大的数据量,因此会导致编码数据数据量较大的问题;同时,在帧与帧之间的相对运动较大时,还可能会导致运动估计的搜索范围过大,进而导致编码过程耗时较长的问题。In the related art, when bidirectional predictive coding is performed on a video with relatively large frame-to-frame relative motion, since the relative motion between frames is relatively large, a large motion vector or motion vector difference will be generated. When encoding these large running vectors or motion vector differences, a larger amount of data may be formed, which will lead to the problem of a larger amount of encoded data; at the same time, the relative motion between frames is relatively large. At this time, it may also cause the search range of motion estimation to be too large, which in turn leads to the problem that the encoding process takes a long time.
针对上述的现有技术所存在的缺点和不足,本示例实施方式中提供了一种视频编码方法,可以应用于具有图像处理功能的终端设备,例如手机、平板电脑等。In view of the above-mentioned shortcomings and deficiencies in the prior art, this exemplary embodiment provides a video encoding method, which can be applied to terminal devices with image processing functions, such as mobile phones, tablet computers, and the like.
参考图1中所示,上述的视频编码方法可以包括以下步骤S110至S140:Referring to FIG. 1, the foregoing video encoding method may include the following steps S110 to S140:
步骤S110,根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧。Step S110: Determine N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule.
其中,N取正整数。需要说明的是,针对不同属性的视频,原始双向参考帧的对数N可以根据不同的参考帧列表进行设定,本公开对选取的原始双向参考帧的对数不做特殊限定。例如,在参考帧列表仅中只有两帧的存储空间,即存储一帧前向原始参考帧和一帧后向原始参考帧时,可以设置N取1;再如,对参考帧列表中存在多帧前向原始参考帧和多帧后向原始参考帧时,可以根据帧与帧之间的相对运动的大小程度设定N的取值。Among them, N takes a positive integer. It should be noted that, for videos with different attributes, the logarithm N of the original bidirectional reference frame can be set according to different reference frame lists, and the present disclosure does not specifically limit the logarithm of the selected original bidirectional reference frame. For example, in the reference frame list, there are only two frames of storage space, that is, when storing one frame forward original reference frame and one frame backward original reference frame, you can set N to be 1; for another example, there are multiple frames in the reference frame list When the frame forward original reference frame and the multi-frame backward original reference frame, the value of N can be set according to the magnitude of the relative motion between frames.
本示例实施方式中,预设选取规则可以包括成对规则和选取规则。此时,参照图2所示,根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧,可以包括以下步骤S210至S220:In this example embodiment, the preset selection rules may include pairing rules and selection rules. At this time, referring to FIG. 2, determining N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to the preset selection rule may include the following steps S210 to S220:
步骤S210,根据成对规则对双向预测编码帧对应的参考帧列表中的原始前向参考帧和原始后向参考帧进行配对,生成至少一对候选原始双向参考帧。Step S210: Pair the original forward reference frame and the original backward reference frame in the reference frame list corresponding to the bidirectional predictive coding frame according to the pairing rule to generate at least one pair of candidate original bidirectional reference frames.
本示例实施方式中,成对规则可以包括用于对参考帧列表中的一帧原始前向参考帧和一帧原始后向参考帧进行配对的任意规则,本公开对配对的规则不做特殊限定。例如,双向预测编码帧对应的帧号为A时,可以设置帧号为A-k的原始前向参考帧和帧号为A+k的原始后向参考帧为一对;再如,还可以设置帧号为A-k的原始前向参考帧和帧号为A+(k+1)的原始后向参考帧为一对。In this example embodiment, the pairing rule may include any rule for pairing one frame of original forward reference frame and one frame of original backward reference frame in the reference frame list, and the present disclosure does not specifically limit the pairing rule . For example, when the frame number corresponding to the bidirectional predictive coding frame is A, you can set the original forward reference frame with the frame number Ak and the original backward reference frame with the frame number A+k as a pair; for another example, you can also set the frame The original forward reference frame numbered Ak and the original backward reference frame numbered A+(k+1) are a pair.
需要说明的是,由于双向预测编码的参考帧必须同时包括一帧前向参考帧和一帧后向参考帧,因此根据成对规则配对生成的至少一对候选原始双向参考帧,必须同时包括一帧原始前向参考帧和一帧原始后向参考帧。It should be noted that since the reference frame of bidirectional predictive coding must include a forward reference frame and a backward reference frame at the same time, at least one pair of candidate original bidirectional reference frames generated according to the pairing rule must also include one Frame original forward reference frame and one frame original backward reference frame.
步骤S220,根据选取规则在至少一对候选原始双向参考帧中确定N对作为原始双向参考帧。Step S220: Determine N pairs as the original bidirectional reference frames from at least one pair of candidate original bidirectional reference frames according to the selection rule.
本示例实施方式中,选取规则可以包括用于在至少一对候选原始双向参考帧中确定N对作为原始双向参考帧的任意规则,本公开对配对的规则不做特殊限定。例如,选取规则可以是将与当前的双向预测编码帧最接近的N对候选原始双向参考帧确定为原始双向参考帧;再如,选取规则还可以是随机规则,即可以在至少一对候选原始双向参考帧中随机选择N对确定为原始双向参考帧。In this example embodiment, the selection rule may include any rule for determining N pairs as the original bidirectional reference frame among at least one pair of candidate original bidirectional reference frames, and the present disclosure does not specifically limit the pairing rule. For example, the selection rule can be to determine the N pairs of candidate original bidirectional reference frames that are closest to the current bidirectional predictive coding frame as the original bidirectional reference frame; N pairs of bidirectional reference frames are randomly selected and determined as the original bidirectional reference frames.
步骤S120,根据预设插帧规则对N对原始双向参考帧进行插帧处理,获得T个插帧参考帧,并根据T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表。Step S120: Perform frame interpolation processing on N original bidirectional reference frames according to preset frame interpolation rules to obtain T frame interpolation reference frames, and update the reference frame list according to the T frame interpolation reference frames to obtain a target reference frame list.
本示例实施方式中,预设插帧规则可以是对原始参考帧对进行插帧的任意插帧规则,可以包括插帧方式规则、时间相位规则等,或者可以同时插帧方式规则和时间相位规则等多个规则,本公开对此不做特殊限定。In this example embodiment, the preset frame interpolation rule may be any frame interpolation rule for interpolating frames on the original reference frame pair, and may include frame interpolation method rules, time phase rules, etc., or may be both frame interpolation method rules and time phase rules. And other rules, this disclosure does not make any special restrictions on this.
例如,预设插帧规则可以包括以下插帧方式规则:对N对原始双向参考帧进行一次插帧得到N个一次插帧参考帧,再对N个一次插帧参考帧进行二次插帧,得到M个二次插帧参考帧,将N个一次插帧参考帧和M个二次插帧参考帧共同作为T个插帧参考帧;再如,预设插帧规则可以包括用于确定每一对原始双向参考帧形成的插帧参考帧的时间相位的规则;再如,预设插帧规则可以同时包括上述插帧方式规则以及针对一次插帧和二次插帧设置的时间相位规则。For example, the preset frame interpolation rules may include the following frame interpolation rules: perform one frame interpolation on N original bidirectional reference frames to obtain N primary frame interpolation reference frames, and then perform secondary frame interpolation on N primary frame interpolation reference frames, Obtain M secondary interpolation frame reference frames, and use N primary interpolation frame reference frames and M secondary interpolation frame reference frames together as T interpolation frame reference frames; for another example, the preset interpolation frame rule may include A pair of original bidirectional reference frames forms the time phase rule of the interpolated frame reference frame; for another example, the preset interpolated frame rule may include the above-mentioned interpolated frame method rule and the time phase rule set for the primary interpolated frame and the secondary interpolated frame at the same time.
需要说明的是,由于插帧参考帧可以根据各种预设插帧规则实现,因此T的取值可以与N的取值不一定相同,T可以大于N、小于或者等于N,本公开对此均不作特殊限制。It should be noted that since the frame interpolation reference frame can be implemented according to various preset frame interpolation rules, the value of T may not necessarily be the same as the value of N, and T may be greater than N, less than or equal to N. This is the case in this disclosure. There are no special restrictions.
举例而言,在预设插帧规则包括时间相位规则时,参照图3所示,根据预设插帧规则对N对原始双向参考帧进行插帧处理,获得T个插帧参考帧,可以包括以下步骤S310至S320:For example, when the preset frame interpolation rule includes the time phase rule, referring to FIG. 3, the frame interpolation process is performed on N original bidirectional reference frames according to the preset frame interpolation rule to obtain T frame interpolation reference frames, which may include The following steps S310 to S320:
步骤S310,通过时间相位规则分别确定N对原始双向参考帧对应的插帧参考帧的时间相位。In step S310, the time phases of the interpolated frame reference frames corresponding to the N pairs of original bidirectional reference frames are respectively determined according to the time phase rule.
其中,插帧参考帧的时间相位可以用于确定插帧参考帧在原始双向参考帧之间的位置。例如,插帧参考帧的时间相位可以是插帧参考帧晚于原始双向参考帧中原始前向参考帧的时间;再如,插帧参考帧的时间相位可以是插帧参考帧早于原始双向参考帧中原始后向参考帧的时间。Wherein, the time phase of the interpolated frame reference frame can be used to determine the position of the interpolated frame reference frame between the original bidirectional reference frames. For example, the time phase of the interpolated frame reference frame may be the time that the interpolated frame reference frame is later than the original forward reference frame in the original bidirectional reference frame; for another example, the time phase of the interpolated frame reference frame may be the time that the interpolated frame reference frame is earlier than the original bidirectional reference frame. The time of the original backward reference frame in the reference frame.
具体的,在插帧参考帧的时间相位是插帧参考帧晚于原始双向参考帧中原始前向参考帧的时间时,假设某一插帧参考帧的时间相位为0.5,对应的原始前向参考帧对应的时间为第1秒,则插帧参考帧对应的时间则为第1.5秒。Specifically, when the time phase of the interpolated frame reference frame is the time of the interpolated frame reference frame later than the original forward reference frame in the original bidirectional reference frame, assuming that the time phase of a certain interpolated frame reference frame is 0.5, the corresponding original forward The time corresponding to the reference frame is the first second, and the time corresponding to the inserted frame reference frame is the 1.5 second.
本示例实施方式中,参照图4,通过时间相位规则确定原始双向参考帧对应的插帧参考帧的时间相位,可以包括以下步骤S410至S420:In this exemplary embodiment, referring to FIG. 4, determining the time phase of the interpolated frame reference frame corresponding to the original bidirectional reference frame through the time phase rule may include the following steps S410 to S420:
步骤S410,获取原始双向参考帧中原始前向参考帧对应的第一帧号、第一时间点和原始后向参考帧对应的第二帧号、第二时间点,以及双向预测编码帧对应的第三帧号。Step S410: Obtain the first frame number corresponding to the original forward reference frame in the original bidirectional reference frame, the first time point and the second frame number and second time point corresponding to the original backward reference frame, and the corresponding bidirectional predictive coding frame The third frame number.
步骤S420,根据第一帧号、第二帧号和第三帧号在第一时间点和第二时间点中间确定第三时间点,并将第三时间点确定为插帧参考帧的时间相位。Step S420: Determine a third time point between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number, and determine the third time point as the time phase of the interpolated frame reference frame .
本示例实施方式中,为了使插帧参考帧与双向预测编码帧之间的相对运动更小,需要使插帧参考帧与双向预测编码帧更接近。此时可以利用视频中各帧图像的帧号、所在的时间点之间的关系,自适应的确定插帧参考帧的时间相位。具体的,在获取了原始前向参考帧的对应的第一帧号、第一时间点和原始后向参考帧对应的第二帧号、第二时间点以及双向预测编码帧对应的第三帧号,根据第一帧号、第二帧号和第三帧号在第一时间点和第二时间点中间确定第三时间点,并将第三时间点确定为插帧参考帧的时间相位。In this exemplary embodiment, in order to make the relative motion between the interpolated frame reference frame and the bidirectional predictive coded frame smaller, it is necessary to make the interpolated frame reference frame closer to the bidirectional predictive coded frame. At this time, the relationship between the frame number and the time point of each frame image in the video can be used to adaptively determine the time phase of the interpolated frame reference frame. Specifically, after acquiring the corresponding first frame number, the first time point of the original forward reference frame, the second frame number corresponding to the original backward reference frame, the second time point, and the third frame corresponding to the bidirectional predictive coding frame According to the first frame number, the second frame number, and the third frame number, the third time point is determined between the first time point and the second time point, and the third time point is determined as the time phase of the interpolated frame reference frame.
本示例实施方式中,根据第一帧号、第二帧号和第三帧号在第一时间点和第二时间点中间确定第三时间点,参照图5所示,可以包括以下步骤S510至S540:In this exemplary embodiment, the third time point is determined between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number. As shown in FIG. 5, the following steps S510 to S540:
步骤S510,计算第一帧号和第二帧号对应的第一帧号差,并计算第一时间点和第二时间点的时间差。Step S510: Calculate the first frame number difference corresponding to the first frame number and the second frame number, and calculate the time difference between the first time point and the second time point.
步骤S520,计算时间差与第一帧号差的商作为单位时长。Step S520: Calculate the quotient of the time difference and the first frame number difference as the unit duration.
本示例实施方式中,由于视频中各帧的帧号与各帧所在的时间点存在一定的固有关联,因此可以根据帧号和时间点确定各帧之间的单位时长。具体的,可以先计算原始前 向参考帧和原始后向参考帧对应的帧号的帧号差为第一帧号差,再计算原始前向参考帧和原始后向参考帧在视频中对应的第一时间点和第二时间点的时间差,最后计算时间差和第一帧号差的商,得到各帧之间的单位时长。In this exemplary embodiment, since the frame number of each frame in the video is inherently associated with the time point at which each frame is located, the unit duration between each frame can be determined according to the frame number and time point. Specifically, the frame number difference between the frame numbers corresponding to the original forward reference frame and the original backward reference frame can be calculated as the first frame number difference, and then the video corresponding to the original forward reference frame and the original backward reference frame can be calculated. The time difference between the first time point and the second time point, and finally the quotient of the time difference and the first frame number difference is calculated to obtain the unit duration between each frame.
步骤S530,计算第一帧号和第三帧号对应的第二帧号差与单位时长的乘积为第一时长,并将比第一时间点晚第一时长的时间点确定为第三时间点。Step S530: Calculate the product of the difference between the second frame number corresponding to the first frame number and the third frame number and the unit duration as the first duration, and determine the time point later than the first time point by the first duration as the third time point .
步骤S540,计算第二帧号和第三帧号对应的第三帧号差与单位时长的乘积为第二时长,并将比第二时间点早第二时长的时间点确定为第三时间点。Step S540: Calculate the product of the third frame number difference corresponding to the second frame number and the third frame number and the unit duration as the second time length, and determine the time point earlier than the second time point by the second time as the third time point .
本示例实施方式中,在确定了各帧之间的单位时长之后,可以分别根据原始前向参考帧、原始后向参考帧和当前的双向预测编码帧的帧号差确定插帧参考帧对应的第三时间点。具体的,可以先计算第一帧号和第三帧号对应的第二帧号差,再计算第二帧号差与单位时长的乘积作为第一时长,最后将比第一时间点晚第一时长的时间点确定为第三时间点;例如,第一时间点为10,计算得到的第一时长为0.5个单位,则第三时间点为10.5;或者,可以先计算第二帧号和第三帧号对应的第三帧号差,再计算第三帧号差与单位时长的乘积作为第二时长,最后将比第二时间点早第二时长的时间点确定为第三时间点。In this exemplary embodiment, after determining the unit duration between each frame, the frame number difference between the original forward reference frame, the original backward reference frame, and the current bidirectional predictive coding frame can be used to determine the corresponding interpolated frame reference frame. The third point in time. Specifically, the second frame number difference corresponding to the first frame number and the third frame number can be calculated first, and then the product of the second frame number difference and the unit duration can be calculated as the first duration, and finally the first time will be later than the first time point. The time point of the duration is determined as the third time point; for example, the first time point is 10, and the calculated first time length is 0.5 units, then the third time point is 10.5; or, the second frame number and the first time point can be calculated first. The third frame number difference corresponding to the three frame numbers is calculated, and the product of the third frame number difference and the unit duration is calculated as the second time length, and finally the time point earlier than the second time point by the second time point is determined as the third time point.
需要说明的是,由于视频中各帧的帧号与各帧所在的时间点存在一定的固有关联,通过上述方法计算得到的第三时间点通常与当前的双向预测编码帧对应的时间点非常接近,因此最终得到的插帧参考帧与当前的双向预测编码帧的相对运动也会比较小,进而能够避免运动矢量或运动矢量差较大导致的编码数据较大的问题;同时,也能够缩小运动估计的搜索范围,进而减少编码时间。It should be noted that since the frame number of each frame in the video is inherently associated with the time point where each frame is located, the third time point calculated by the above method is usually very close to the time point corresponding to the current bidirectional predictive coding frame Therefore, the relative motion between the final interpolated frame reference frame and the current bidirectional predictive coding frame will be relatively small, which can avoid the problem of large coding data caused by large motion vectors or motion vector differences; at the same time, it can also reduce the motion Estimated search range, thereby reducing coding time.
本示例实施方式中,上述的插帧处理可以采用运动估计运动补偿法、光流法、神经网络插帧或者其他任意帧率转化技术。In this exemplary embodiment, the aforementioned frame interpolation processing may use motion estimation motion compensation method, optical flow method, neural network frame interpolation, or other arbitrary frame rate conversion technology.
举例而言,上述的运动估计运动补偿方法可以包括以下两个步骤:For example, the aforementioned motion estimation motion compensation method may include the following two steps:
1、运动估计1. Motion estimation
根据至少两幅图像,采用运动估计的方法确定两幅图像中所有物体或区域的运动矢量。具体的,可以将两幅图像记为当前图像和参考图像,按照预设大小对两幅图像进行分块,并对分块后的图像进行遍历,搜索当前图像中每个块在参考图像中的匹配块,确定当前图像每个块相对于参考图像的运动矢量(前向MV),同理,采用上述方法确定参考图像每个块相对于当前图像的运动矢量(后向MV),如图10所示。According to at least two images, the motion estimation method is used to determine the motion vectors of all objects or regions in the two images. Specifically, the two images can be recorded as the current image and the reference image, the two images can be divided into blocks according to the preset size, and the divided images can be traversed to search for each block in the current image in the reference image. Match the block, determine the motion vector (forward MV) of each block of the current image relative to the reference image. Similarly, use the above method to determine the motion vector (backward MV) of each block of the reference image relative to the current image, as shown in Figure 10. Shown.
随后,对前后向MV进行修正操作,其中,修正操作包括滤波,加权等多种操作中至少一种或多种的组合,最终确定每个块的前向或后向MV,如图11所示Subsequently, a correction operation is performed on the forward and backward MV, where the correction operation includes at least one or a combination of multiple operations such as filtering and weighting, and finally determines the forward or backward MV of each block, as shown in FIG. 11
2、运动补偿2. Motion compensation
通过插帧时间相位对最终确定的每个块的前向或后向MV进行校正,然后在插帧图像中生成每个插值块相对于当前图像和参考图像的映射MV,按照该映射MV在参考图像和当前图像中找到对应块,进行两个块的权重插值,生成该插值块的所有像素,最终得到插帧图像,如图12所示。Correct the final forward or backward MV of each block through the interpolated frame time phase, and then generate a mapping MV of each interpolated block relative to the current image and the reference image in the interpolated frame image. Find the corresponding block in the image and the current image, perform weight interpolation of the two blocks, generate all the pixels of the interpolation block, and finally get the interpolated frame image, as shown in Figure 12.
步骤S320,针对N对原始双向参考帧分别进行插帧,以生成T个在时间相位的插帧参考帧。In step S320, frame interpolation is performed on N original bidirectional reference frames, respectively, to generate T frame interpolation reference frames in time phase.
本示例实施方式中,在确定了N对原始双向参考帧对应的插帧参考帧的时间相位后,可以根据每一对原始双向参考帧对应的插帧参考帧的时间相位分别进行该时间相位的插帧,得到在该时间相位的插帧参考帧。通过设置时间相位规则,能够控制生成的插帧参考帧与双向预测编码帧之间的时间差,进而控制插帧参考帧与双向预测编码帧之间相对运动,能够更有效的降低运动矢量和运动矢量差的大小,更有效的缩小运动估计的检索范围。In this example embodiment, after determining the time phase of the interpolated frame reference frame corresponding to the N pairs of original bidirectional reference frames, the time phase can be determined according to the time phase of the interpolated frame reference frame corresponding to each pair of original bidirectional reference frames. Interpolate the frame to obtain the interpolated frame reference frame at the time phase. By setting the time and phase rules, the time difference between the generated interpolated frame reference frame and the bidirectional predictive coding frame can be controlled, and then the relative motion between the interpolated frame reference frame and the bidirectional predictive coding frame can be controlled, which can reduce the motion vector and the motion vector more effectively The size of the difference can more effectively reduce the search range of motion estimation.
本示例实施方式中,在得到了T个插帧参考帧后,由于T个插帧参考帧相对于原始 双向参考帧而言,与当前双向编码帧的相对运动更小,因此可以根据T个插帧参考帧对参考帧列表进行更新,得到目标参考帧列表,进而根据目标参考帧列表进行编码,得到编码数据。In this exemplary embodiment, after T interpolated frame reference frames are obtained, the relative motion of the T interpolated frame reference frames to the current bidirectional coded frame is smaller than the original bidirectional reference frame. Therefore, it can be based on the T interpolated frames. The frame reference frame updates the reference frame list to obtain the target reference frame list, and then encodes according to the target reference frame list to obtain encoded data.
本示例实施方式中,根据T个插帧参考帧对参考帧列表进行更新,得到目标参考帧列表,可以包括:将T个插帧参考帧添加至参考帧列表,生成目标参考帧列表。此时,可以将生成的T个插帧参考帧按照之前确定的时间相位插入参考帧列表中,形成一个按时间顺序排列的目标参考帧列表。此外,还可以针对插帧参考帧设置排序顺序和插入参考帧列表的位置,本公开对此不做特殊限定。In this exemplary embodiment, updating the reference frame list according to the T interpolated frame reference frames to obtain the target reference frame list may include: adding the T interpolated frame reference frames to the reference frame list to generate the target reference frame list. At this time, the generated T interpolated frame reference frames can be inserted into the reference frame list according to the previously determined time phase to form a list of target reference frames arranged in chronological order. In addition, the sort order and the position of the inserted reference frame list can also be set for the inserted frame reference frame, which is not particularly limited in the present disclosure.
本示例实施方式中,根据T个插帧参考帧对参考帧列表进行更新,得到目标参考帧列表,还可以包括:利用T个插帧参考帧排列形成的列表替换参考帧列表,生成目标参考帧列表。此时,可以直接对T个插帧参考帧设置排序方式和帧号,并根据排序方式和帧号将T个插帧参考帧排列起来形成一个列表,并根据该列表替换参考帧列表,生成目标参考帧列表。此外,还可以通过其他方式将T个插帧参考帧转换为一个列表,本公开对此也不做特殊限制。In this exemplary embodiment, updating the reference frame list according to the T insertion frame reference frames to obtain the target reference frame list may also include: replacing the reference frame list with the list formed by the arrangement of the T insertion frame reference frames to generate the target reference frame List. At this time, you can directly set the sorting method and frame number for the T interpolated frame reference frames, and arrange the T interpolated frame reference frames according to the sorting method and frame number to form a list, and replace the reference frame list according to the list to generate the target Reference frame list. In addition, the T interpolated frame reference frames can also be converted into a list in other ways, and the present disclosure does not impose special restrictions on this.
需要说明的是,在其它示例实施方式中,还可以通过对参考帧列表和T个插帧参考帧做其它处理,得到目标参考帧列表,本公开对得到目标参考帧列表所做的处理过程也不做特殊限定。例如,可以对参考帧列表和T个插帧参考帧进行一定条件的筛选,并根据通过筛选的参考帧列表和T个插帧参考帧形成目标参考帧列表;再如,还可以通过对T个插帧参考帧进行一定条件的筛选,并根据通过筛选插帧参考帧形成目标参考帧列表。It should be noted that, in other exemplary embodiments, the target reference frame list can also be obtained by performing other processing on the reference frame list and the T interpolated frame reference frames. The process of obtaining the target reference frame list in the present disclosure is also No special restrictions. For example, the reference frame list and T interpolated frame reference frames can be filtered under certain conditions, and the target reference frame list can be formed according to the filtered reference frame list and the T interpolated frame reference frames; for another example, the target reference frame list can be formed by comparing the T interpolated reference frames. The insertion frame reference frame is screened under certain conditions, and a target reference frame list is formed according to the filtered insertion frame reference frame.
步骤S130,根据目标参考帧列表对双向预测编码帧进行编码获得编码数据。Step S130, encoding the bidirectionally predictive encoded frame according to the target reference frame list to obtain encoded data.
本示例实施方式中,在得到目标参考帧列表后,可以根据目标参考帧列表进行编码得到编码数据。由于目标参考帧列表中存在插帧参考帧,因此在对双向预测编码帧进行编码时,不会出现较大的运动矢量或者运动矢量差,同时也能缩小编码的搜索范围,加快编码速度。In this exemplary embodiment, after the target reference frame list is obtained, encoding can be performed according to the target reference frame list to obtain encoded data. Since there are interpolated frame reference frames in the target reference frame list, there will be no large motion vector or motion vector difference when the bidirectional predictive coding frame is coded. At the same time, the search range of coding can be reduced and the coding speed can be increased.
步骤S140,获取生成插帧参考帧的关键参数,将关键参数附加在编码数据中,生成双向预测编码帧对应的码流数据。Step S140: Obtain key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate code stream data corresponding to the bidirectional predictive coded frame.
本示例实施方式中,由于在编码过程中使用了插帧编码帧,在解码过程中可能也需要插帧编码帧的相关数据,因此需要将生成插帧参考帧的一些关键参数与编码数据共同传输至解码端进行解码。具体的,可以将生成插帧参考帧的关键参数作为附件参数与编码数据共同生成双向预测编码帧对应的码流数据。In this example embodiment, since the interpolated frame is used in the encoding process, the relevant data of the interpolated frame may also be needed in the decoding process. Therefore, some key parameters for generating the interpolated reference frame need to be transmitted together with the encoded data. To the decoding end for decoding. Specifically, the key parameter for generating the interpolated frame reference frame may be used as the accessory parameter and the coded data to jointly generate the bitstream data corresponding to the bidirectional predictive coded frame.
本示例实施方式中,关键参数可以包括N对原始双向参考帧中的原始前向参考帧和原始后向参考帧对应的N对帧号以及插帧参考帧的数量T。具体的,将N对原始双向参考帧中的原始前向参考帧和原始后向参考帧对应的帧号成对存储,进而可以确定生成各插帧参考帧的依据。In this exemplary embodiment, the key parameters may include N pairs of frame numbers corresponding to the original forward reference frame and the original backward reference frame in the N pairs of original bidirectional reference frames, and the number T of the interpolated frame reference frames. Specifically, the frame numbers corresponding to the original forward reference frame and the original backward reference frame in the N pairs of original bidirectional reference frames are stored in pairs, so that the basis for generating each interpolated frame reference frame can be determined.
此外,在一种示例实施方式中,也可以直接将编码端和解码端进行配套的设置,即在编码端用了某一种编码方式,对应的可以直接使用解码端中与该编码方式对应的解码方式。在这种情况下,若使用了某一编码方式,可以只在关键参数中写入使用的编码方式使能标志,即表示该双向预测编码帧使用了该编码方式,对应的解码端则可以根据该使能标志确定对应的解码方式。In addition, in an exemplary embodiment, the encoding end and the decoding end can also be directly set as a set, that is, a certain encoding method is used on the encoding end, and the corresponding encoding method can be directly used in the decoding end. Decoding method. In this case, if a certain encoding method is used, only the used encoding method enable flag can be written in the key parameters, which means that the bidirectional predictive encoding frame uses the encoding method, and the corresponding decoding end can be based on The enable flag determines the corresponding decoding mode.
需要说明的是,上述编码可以基于H.264视频编码标准进行。在这种情况下,可以将N对帧号以及插帧参考帧的数量T写入补充增强信息单元(SEI)中,并将使能标志和双向预测编码帧中每个编码块所选取的参考帧号遵照该标准进行码流写入。此外,还可以采用其他的视频编码标准进行编码,并根据编码标准以不同的方式写入码流数据中,本公开对此也不做特殊限定。It should be noted that the foregoing encoding may be performed based on the H.264 video encoding standard. In this case, N pairs of frame numbers and the number of interpolated reference frames T can be written into the Supplementary Enhancement Information Unit (SEI), and the enable flag and the reference selected by each coding block in the bidirectional predictive coding frame The frame number complies with the standard to write the code stream. In addition, other video coding standards can also be used for coding, and the code stream data can be written in different ways according to the coding standard, which is not specifically limited in the present disclosure.
在本公开的另一种示例实施例中,还提供了一种视频解码方法,可以应用于具有图 像处理功能的终端设备,例如手机、平板电脑等。参照图6所示,上述的视频解码方法可以包括步骤S610至步骤S630,以下进行详细阐述:In another exemplary embodiment of the present disclosure, a video decoding method is also provided, which can be applied to terminal devices with image processing functions, such as mobile phones and tablet computers. As shown in FIG. 6, the above-mentioned video decoding method may include step S610 to step S630, which will be described in detail below:
步骤S610,获取待解码双向预测编码帧对应的码流数据。Step S610: Obtain code stream data corresponding to the bidirectional predictive coded frame to be decoded.
本示例实施方式中,获取的待解码双向预测编码帧对应的码流数据中包括编码数据和关键参数。其中,编码数据是指基于上述编码方法获得的编码数据,关键参数则是上述编码方法中生成插帧参考帧的关键参数。具体的,关键参数包括用于确定插帧参考帧的关键参数,例如可以是生成插帧参考帧所依据的原始双向参考帧的帧号。In this exemplary embodiment, the acquired bitstream data corresponding to the bidirectional predictive encoded frame to be decoded includes encoded data and key parameters. Among them, the encoded data refers to the encoded data obtained based on the foregoing encoding method, and the key parameter is the key parameter for generating the interpolated frame reference frame in the foregoing encoding method. Specifically, the key parameter includes a key parameter used to determine the interpolated frame reference frame, for example, may be the frame number of the original bidirectional reference frame on which the interpolated frame reference frame is generated.
需要说明的是,在一种示例实施方式中,也可以直接将编码端和解码端进行配套的设置,即在编码端用了某一种编码方式,对应的可以直接使用解码端中与该编码方式对应的解码方式。在这种情况下,关键参数中也可以只包括编码时使用的编码方式对应的使能标志,在解码时,可以根据该使能标识确定对应的解码方式进行解码即可。It should be noted that, in an exemplary embodiment, the encoding end and the decoding end can also be directly set up, that is, a certain encoding method is used on the encoding end, and the corresponding encoding can be directly used in the decoding end. The corresponding decoding method. In this case, the key parameters may also include only the enable flag corresponding to the encoding method used during encoding, and during decoding, the corresponding decoding method can be determined according to the enable flag for decoding.
步骤S620,对编码数据进行解析,并根据关键参数确定编码数据对应的目标参考帧列表。Step S620: Analyze the encoded data, and determine the target reference frame list corresponding to the encoded data according to the key parameters.
本示例实施方式中,关键参数可以包括N对帧号和数量T,其中,N和T均为正整数。此时,参照图7所示,对编码数据进行解析,并根据关键参数确定编码数据对应的目标参考帧列表,可以包括以下步骤S710至S740:In this example embodiment, the key parameter may include N pairs of frame numbers and the number T, where N and T are both positive integers. At this time, referring to FIG. 7, parsing the encoded data and determining the target reference frame list corresponding to the encoded data according to the key parameters may include the following steps S710 to S740:
步骤S710,对编码数据进行解析重建,获得待解码双向预测编码帧对应的参考帧列表。Step S710: Analyze and reconstruct the encoded data to obtain a reference frame list corresponding to the bidirectionally predictive encoded frame to be decoded.
本示例实施方式中,待解码双向预测编码帧对应的参考帧列表是在对待解码双向预测编码帧进行解码时的原始的参考帧列表,参考帧列表中的各参考帧是对可作为参考帧的视频帧对应的编码数据重建得到的视频帧。在对待解码双向预测编码帧进行解码之前,需要先获取待解码双向预测编码帧对应的参考帧列表。In this exemplary embodiment, the reference frame list corresponding to the bidirectional predictive coded frame to be decoded is the original reference frame list when the bidirectional predictive coded frame to be decoded is decoded, and each reference frame in the reference frame list is a reference frame that can be used as a reference frame. A video frame obtained by reconstructing the encoded data corresponding to the video frame. Before decoding the bidirectional predictive coded frame to be decoded, it is necessary to obtain a reference frame list corresponding to the bidirectional predictive coded frame to be decoded.
步骤S720,根据N对帧号在参考帧列表中确定N对原始双向参考帧。Step S720: Determine N pairs of original bidirectional reference frames in the reference frame list according to the N pairs of frame numbers.
本示例实施方式中,在关键参数中包括生成插帧参考帧的N对原始双向参考帧的帧号,因此可以通过N对帧号在参考帧列表中确定N对原始双向参考帧,进而确定插帧参考帧生成的依据。In this example embodiment, the key parameters include the frame numbers of the N pairs of original bidirectional reference frames that generate the interpolated frame reference frame. Therefore, the N pairs of original bidirectional reference frames can be determined in the reference frame list through the N pairs of frame numbers, and then the interpolated frame can be determined. The basis for frame reference frame generation.
步骤S730,基于N对原始双向参考帧、数量T和编码数据进行插帧重建,获得T个插帧参考帧。In step S730, the original bidirectional reference frame, the number T and the coded data are interpolated and reconstructed based on N to obtain T interpolated reference frames.
本示例实施方式中,可以基于N对原始双向参考帧数量、生成的插帧参考帧数量T,以及编码数据中的预测残差等数据进行插帧重建,复现T个插帧参考帧。In this exemplary embodiment, the number of original bidirectional reference frames, the number of generated interpolated reference frames T, and the prediction residuals in the encoded data can be interpolated and reconstructed based on N to reproduce T interpolated reference frames.
步骤S740,基于T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表。In step S740, the reference frame list is updated based on the T interpolated frame reference frames to obtain the target reference frame list.
本示例实施方式中,在复现T个插帧参考帧后,可以根据T个插帧参考帧对参考帧列表进行更新,进而得到目标参考帧列表。为了复现编码时使用的目标参考帧列表,可以采用与编码过程相同的目标参考帧列表的构建方式。In this exemplary embodiment, after T number of interpolated frame reference frames are reproduced, the reference frame list can be updated according to the T interpolated frame reference frames, so as to obtain the target reference frame list. In order to reproduce the target reference frame list used in encoding, the same method of constructing the target reference frame list as in the encoding process can be adopted.
举例而言,根据T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表,可以包括:将T个插帧参考帧添加至参考帧列表,生成目标参考帧列表。此时,可以将生成的T个插帧参考帧按照之前确定的时间相位插入参考帧列表中,形成一个按时间顺序排列的目标参考帧列表。此外,还可以针对插帧参考帧设置排序顺序和插入参考帧列表的位置,本公开对此不做特殊限定。For example, updating the reference frame list according to the T interpolated frame reference frames to obtain the target reference frame list may include: adding the T interpolated frame reference frames to the reference frame list to generate the target reference frame list. At this time, the generated T interpolated frame reference frames can be inserted into the reference frame list according to the previously determined time phase to form a list of target reference frames arranged in chronological order. In addition, the sort order and the position of the inserted reference frame list can also be set for the inserted frame reference frame, which is not particularly limited in the present disclosure.
再如,根据T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表,还可以包括:利用T个插帧参考帧排列形成的列表替换参考帧列表,生成目标参考帧列表。此时,可以直接对T个插帧参考帧设置排序方式和帧号,并根据排序方式和帧号将T个插帧参考帧排列起来形成一个列表,并根据该列表替换参考帧列表,生成目标参考帧列表。此外,还可以通过其他方式将T个插帧参考帧转换为一个列表,本公开对此也不做特殊限制。For another example, updating the reference frame list according to the T interpolated frame reference frames to obtain the target reference frame list may also include: replacing the reference frame list with the list formed by the arrangement of the T interpolated frame reference frames to generate the target reference frame list. At this point, you can directly set the sorting method and frame number for the T interpolated frame reference frames, and arrange the T interpolated frame reference frames according to the sorting method and frame number to form a list, and replace the reference frame list according to the list to generate the target Reference frame list. In addition, the T interpolated frame reference frames can also be converted into a list in other ways, and the present disclosure does not impose special restrictions on this.
需要说明的是,在其它示例实施方式中,还可以通过对参考帧列表和T个插帧参考帧做其它处理,获得目标参考帧列表,本公开对获得目标参考帧列表所做的处理过程也不做特殊限定。例如,可以对参考帧列表和T个插帧参考帧进行一定条件的筛选,并根据通过筛选的参考帧列表和T个插帧参考帧形成目标参考帧列表;再如,还可以通过对T个插帧参考帧进行一定条件的筛选,并根据通过筛选插帧参考帧形成目标参考帧列表。It should be noted that, in other exemplary embodiments, the target reference frame list can also be obtained by performing other processing on the reference frame list and the T interpolated frame reference frames. The process of obtaining the target reference frame list in the present disclosure is also No special restrictions. For example, the reference frame list and T interpolated frame reference frames can be filtered under certain conditions, and the target reference frame list can be formed according to the filtered reference frame list and the T interpolated frame reference frames; for another example, the target reference frame list can be formed by comparing the T interpolated reference frames. The insertion frame reference frame is screened under certain conditions, and a target reference frame list is formed according to the filtered insertion frame reference frame.
步骤S630,基于目标参考帧列表进行解码重建,获得解码后的双向预测重建帧。Step S630: Perform decoding and reconstruction based on the target reference frame list to obtain a decoded bidirectional prediction reconstruction frame.
本示例实施方式中,在复现了编码时的目标参考帧列表后,可以根据目标参考帧列表对编码数据进行解码重建,得到待解码双向预测编码帧对应额双向预测编码帧。举例而言,可以根据待解码双向预测编码帧对应的目标参考帧列表得到待解码视频对应的预测值,并根据编码数据中的预测残差和预测值进行视频帧重建,得到双向预测编码帧。In this exemplary embodiment, after the target reference frame list during encoding is reproduced, the encoded data can be decoded and reconstructed according to the target reference frame list to obtain the bidirectional predictive encoded frame corresponding to the bidirectional predictive encoded frame to be decoded. For example, the predicted value corresponding to the video to be decoded can be obtained according to the target reference frame list corresponding to the bidirectional predictive coded frame to be decoded, and the video frame can be reconstructed according to the prediction residual and the predicted value in the coded data to obtain the bidirectional predictive coded frame.
对于上述编码和解码的方案,本公开的实施例提供了如下5个具体的实施例:For the foregoing encoding and decoding solutions, the embodiments of the present disclosure provide the following five specific embodiments:
实施例1:Example 1:
编码过程:Encoding process:
参照图8所示,步骤S810,若当前编码帧为双向预测编码帧时,获取其原始参考帧列表;步骤S820,在原始参考帧列表中确定N对前后向原始参考帧;步骤S830,输入插帧模块进行插帧,形成T个插帧参考帧;步骤S840,将新形成的T个插帧参考帧和原始参考帧列表进行累计,形成目标参考帧列表;步骤S850,根据目标参考帧列表进行固定视频编码标准的预测编码形成编码数据,将当前双向预测编码帧所使用的插帧参考帧数量T和这些插帧参考帧选取的原始前、后向参考帧的帧号作为附加参数与编码数据共同作为码流数据。Referring to Figure 8, step S810, if the current coded frame is a bidirectional predictive coded frame, obtain its original reference frame list; step S820, determine N pairs of forward and backward original reference frames in the original reference frame list; step S830, input interpolation The frame module performs frame insertion to form T frame insertion reference frames; step S840, accumulate the newly formed T frame insertion reference frames and the original reference frame list to form a target reference frame list; step S850, perform according to the target reference frame list The predictive coding of the fixed video coding standard forms the coded data. The number T of interpolated frame reference frames used in the current bidirectional predictive coding frame and the frame numbers of the original forward and backward reference frames selected by these interpolated frame reference frames are used as additional parameters and encoded data Commonly used as code stream data.
其中,选取原始双向参考帧的规则,可以按播放顺序进行对应。例如,当前帧为第k帧,那么k-1和k+1形成一对,那么k-2和k+2形成一对。此外,也可以选择任意原始参考帧对为一对;在根据原始双向参考帧进行插帧时,插帧参考帧的时间相位可人工设定;也可以根据当前帧在原始双向参考帧的时间相位自适应的设定,例如,若参考帧对为k-1和k+1,设两个参考帧的时间段总长为1,则自适应时间相位为0.5;若参考帧对为k-1和k+2,设两个参考帧的时间段总长为1,则自适应时间相位为0.33;在插帧过程中是每对原始双向参考帧形成一个插帧参考帧,因此T=N。Among them, the rules for selecting the original two-way reference frame can be corresponded in the order of playback. For example, if the current frame is the k-th frame, then k-1 and k+1 form a pair, and then k-2 and k+2 form a pair. In addition, any pair of original reference frames can also be selected as a pair; when inserting frames based on the original two-way reference frame, the time phase of the inserted frame reference frame can be manually set; or according to the time phase of the current frame in the original two-way reference frame Adaptive setting, for example, if the reference frame pair is k-1 and k+1, and the total length of the two reference frames is set to 1, then the adaptive time phase is 0.5; if the reference frame pair is k-1 and k+2, suppose the total length of the two reference frames is 1, then the adaptive time phase is 0.33; in the frame insertion process, each pair of original bidirectional reference frames forms an inserted frame reference frame, so T=N.
需要说明的是,在编码的过程和解码重建的过程中,可能需要当前双向预测编码帧中每个编码块所选取的参考帧的帧号,在这种情况下,可以该数据也作为附加参数加入码流数据;此外,在使用了此种编码方式时,可以将对应的使能标记写入附加参数,以标识该方法在编码过程中使能。It should be noted that during the encoding process and the decoding and reconstruction process, the frame number of the reference frame selected by each encoding block in the current bidirectional predictive encoding frame may be required. In this case, the data can also be used as an additional parameter Add code stream data; in addition, when this encoding method is used, the corresponding enable flag can be written into additional parameters to identify that the method is enabled during the encoding process.
解码过程:Decoding process:
参照图9所示,步骤S910,在当前码流数据为双向预测编码帧时,根据附加参数在原始参考帧列表中确定N对原始双向参考帧;步骤S920,根据得到的N对原始双向参考帧进行插帧重建,得到T个插帧参考帧;步骤S930,基于原始参考帧列表、T个插帧参考帧形成的目标参考帧列表;步骤S940,对编码数据进行解析,得到预测残差和预测值;步骤S950,基于目标参考帧列表、预测残差和预测值进行解码重建,得到解码后的双向预测重建帧。Referring to Figure 9, step S910, when the current bitstream data is a bidirectional predictive coded frame, determine N pairs of original bidirectional reference frames in the original reference frame list according to additional parameters; step S920, according to the obtained N pairs of original bidirectional reference frames Perform interpolation frame reconstruction to obtain T interpolation frame reference frames; step S930, a target reference frame list formed based on the original reference frame list and T interpolation frame reference frames; step S940, parse the encoded data to obtain prediction residuals and predictions Value; Step S950, decoding and reconstruction based on the target reference frame list, prediction residuals, and prediction values, to obtain a decoded bidirectional prediction reconstruction frame.
实施例2:Example 2:
编码过程:Encoding process:
如图13所示,确定当前的双向预测编码帧在播放顺序上的前一帧和后一帧作为原始双向参考帧,即N=1,对这一对原始双向参考帧进行中间相位的插值,形成一个插帧参考帧,编码器在进行编码时,仅以形成的一个插帧参考帧为参考进行编码。此外,由于默认设置前一帧和后一帧作为原始双向参考帧,因此可以不需要形成插帧参考帧的关键参数,可以只将使能标志写入码流信息,以标识使用了该编码方法。As shown in Figure 13, the previous frame and the next frame in the playback sequence of the current bidirectional predictive coding frame are determined as the original bidirectional reference frame, that is, N=1, and the intermediate phase interpolation is performed on this pair of original bidirectional reference frames. An interpolated frame reference frame is formed, and the encoder only uses the formed interpolated frame reference frame as a reference for encoding during encoding. In addition, since the previous frame and the next frame are set as the original bidirectional reference frame by default, there is no need to form the key parameters of the interpolated frame reference frame, and only the enable flag can be written into the code stream information to indicate that the encoding method is used .
解码过程:Decoding process:
如图13所示,解码时,采用对应的策略进行解码,对每个需要重建的双向预测编码帧中的解码块,采用当前重建的双向预测编码帧的前一帧和后一帧为原始双向参考帧,对原始双向参考帧进行插帧得到一个插帧参考帧,并以这个插帧参考帧进行参考解码,得到解码后的双向预测重建帧。As shown in Figure 13, when decoding, the corresponding strategy is used for decoding. For each decoded block in the bidirectional predictive coding frame that needs to be reconstructed, the previous frame and the following frame of the currently reconstructed bidirectional predictive coding frame are used as the original two-way predictive coding frame. For reference frame, the original bidirectional reference frame is interpolated to obtain an interpolated frame reference frame, and the interpolated frame reference frame is used for reference decoding to obtain the decoded bidirectional predictive reconstructed frame.
实施例3:Example 3:
编码过程:Encoding process:
如图14所示,仅对当前的双向预测编码帧,基于N对原始双向参考帧形成与当前的双向预测编码帧的时间相位相同的T个插帧参考帧。其中,在插帧过程中是每对原始双向参考帧形成一个插帧参考帧,因此T=N。编码器在编码时,仅以形成的T个插帧参考帧为参考进行编码,并将原始双向参考帧的帧号和插帧参考帧的数量T作为附加参数写入码流。As shown in FIG. 14, for only the current bidirectional predictive coding frame, based on N pairs of original bidirectional reference frames, T interpolated frame reference frames with the same time phase as the current bidirectional predictive coding frame are formed. Among them, in the frame insertion process, each pair of original bidirectional reference frames forms an insertion frame reference frame, so T=N. When encoding, the encoder only uses the formed T interpolated frame reference frames as a reference for encoding, and writes the frame number of the original bidirectional reference frame and the number of interpolated frame reference frames T as additional parameters into the code stream.
解码过程:Decoding process:
如图14所示,解码时,采用对应的策略进行解码,对每个需要重建的双向预测编码帧中的解码块,通过根据原始双向参考帧的帧号和插帧参考帧的数量T等附加参数确定N对原始双向参考帧,然后基于N对原始双向参考帧形成与当前的双向预测编码帧的时间相位相同的T个插帧参考帧,最后T个插帧参考帧为基础进行解码,得到解码后的双向预测重建帧。As shown in Figure 14, when decoding, the corresponding strategy is adopted for decoding. For each decoded block in the bidirectional predictive coding frame that needs to be reconstructed, the number T of the original bidirectional reference frame and the number of interpolated reference frames are added. The parameters determine N pairs of original bidirectional reference frames, and then based on N pairs of original bidirectional reference frames, T interpolated frame reference frames with the same time phase as the current bidirectional predictive coding frame are formed, and the last T interpolated reference frames are decoded based on The decoded bidirectional prediction reconstructs the frame.
实施例4:Example 4:
编码过程:Encoding process:
在编码时,针对当前的双向预测编码帧,先根据N对原始双向参考帧进行插帧,得到与当前的双向预测编码帧的时间相位相同的A个一次插帧参考帧,然后根据A个一次插帧参考帧进行两两的二次插帧,形成B个二次插帧参考帧。随后,通过A个一次插帧参考帧和B个二次插帧参考帧形成包含T个参考帧的目标参考帧列表,其中T=A+B。During encoding, for the current bidirectional predictive coded frame, first interpolate the original bidirectional reference frame according to N to obtain A one-time interpolated frame reference frames with the same time phase as the current bidirectional predictive coded frame, and then according to A one time Interpolation frame reference frames perform two-stage interpolation frames in pairs to form B two-stage interpolation frame reference frames. Subsequently, a target reference frame list including T reference frames is formed through A primary interpolation frame reference frames and B secondary interpolation frame reference frames, where T=A+B.
具体的,在对A个一次插帧参考帧和B个二次插帧参考帧进行排序时,可以先将B个二次插帧参考帧的依次编号,作为该二次插帧参考帧的帧号,例如,帧号分别为0,1,…,B-2,B-1;然后将A个一次插帧参考帧依次编号,作为一次插帧参考帧的帧号,例如,帧号分别为B,B+1,…,B+A-2,B+A-1。Specifically, when sorting the A primary interpolation frame reference frames and the B secondary interpolation frame reference frames, the B secondary interpolation frame reference frames may be sequentially numbered as the frame of the secondary interpolation frame reference frame. For example, the frame numbers are 0, 1, ..., B-2, B-1; then, the A one-time interpolated frame reference frames are sequentially numbered as the frame number of the one-time interpolated frame reference frame, for example, the frame numbers are respectively B, B+1,..., B+A-2, B+A-1.
编码器在进行编码时,仅参考通过A个一次插帧参考帧和B个二次插帧参考帧排序形成的目标参考帧列表进行编码,同时将原始双向参考帧的帧号、一次插帧参考帧数量A和二次插帧参考帧数量B作为附加参数写入码流。When encoding, the encoder only refers to the target reference frame list formed by sorting A primary interpolated frame reference frames and B secondary interpolated frame reference frames. At the same time, it encodes the frame number of the original bidirectional reference frame and the primary interpolated frame reference. The number of frames A and the reference frame number B of the secondary interpolation frame are written into the code stream as additional parameters.
解码过程:Decoding process:
解码时,采用对应的策略进行解码,对每个需要重建的双向预测编码帧中的解码块,通过根据原始双向参考帧的帧号和一次插帧参考帧数量A和二次插帧参考帧数量B确定N对原始双向参考帧,然后基于N对原始双向参考帧形成与当前的双向预测编码帧的时间相位相同的A个一次插帧参考帧,然后根据A个一次插帧参考帧两两进行二次插帧,得到B个二次插帧参考帧,以A个一次插帧参考帧和B个二次插帧参考帧进行编码排序,形成包含T个插帧参考帧的目标参考帧列表,最终以T个插帧参考帧为参考进行解码,得到解码后的双向预测重建帧。When decoding, the corresponding strategy is adopted for decoding. For each decoding block in the bidirectional predictive coding frame that needs to be reconstructed, according to the frame number of the original bidirectional reference frame and the number of primary interpolated frame reference frames A and the number of secondary interpolated frame reference frames B determines N pairs of original bidirectional reference frames, and based on N pairs of original bidirectional reference frames, forms A one-time interpolated frame reference frames with the same time phase as the current bidirectional predictive coding frame, and then performs two-by-two based on the A one-time interpolated frame reference frames Re-interpolation frame, obtain B secondary-interpolation frame reference frames, and perform encoding and sorting with A primary-interpolation frame reference frames and B secondary-interpolation frame reference frames to form a target reference frame list containing T inter-frame reference frames, Finally, the T interpolated frame reference frames are used as references for decoding, and the decoded bidirectional prediction reconstructed frame is obtained.
实施例5:Example 5:
编码过程:Encoding process:
在一种实施例中,原始参考帧列表中有可能只有两帧的存储空间,即只能存储一帧原始前向参考帧和一帧原始后向参考帧。此时,可以根据这一帧前向参考帧和一帧后向参考帧形成与当前的双向预测编码帧的时间相位相同的1个插帧参考帧,然后分别以这个插帧参考帧和原始前向参考帧、原始后向参考帧进行二次插帧,插帧的时间相位可以 取0.5,得到一个前向插帧参考帧和一个后向插帧参考帧,然后通过前向插帧参考帧和后向插帧参考帧代替原始参考帧列表中的原始前向参考帧和原始后向参考帧形成目标参考帧列表。In an embodiment, there may be only two frames of storage space in the original reference frame list, that is, only one frame of original forward reference frame and one frame of original backward reference frame can be stored. At this time, according to this frame forward reference frame and a frame backward reference frame, an interpolated frame reference frame with the same time phase as the current bidirectional predictive coding frame can be formed, and then this interpolated frame reference frame and the original front frame can be used respectively. Perform secondary interpolation to the reference frame and the original backward reference frame. The time phase of the interpolation frame can be 0.5 to obtain a forward interpolation frame reference frame and a backward interpolation frame reference frame, and then pass the forward interpolation frame reference frame and The backward interpolation frame reference frame replaces the original forward reference frame and the original backward reference frame in the original reference frame list to form the target reference frame list.
编码器在进行编码时,仅参考目标参考帧列表中的一帧前向插帧参考帧和一帧后向插帧参考帧进行编码,同时将原始双向参考帧的帧号、插帧参考帧数量2作为附加参数写入码流。When the encoder is encoding, it only refers to one frame of forward interpolated frame reference frame and one frame of backward interpolated frame reference frame in the target reference frame list. At the same time, it encodes the frame number of the original bidirectional reference frame and the number of interpolated frame reference frames 2 Write the code stream as an additional parameter.
解码过程:Decoding process:
解码时,采用对应的策略进行解码,对每个需要重建的双向预测编码帧中的解码块,通过根据原始双向参考帧的帧号、插帧参考帧数量2确定1对原始双向参考帧,然后基于这一对原始双向参考帧进行一次插帧得到一个与当前的双向预测编码帧的时间相位相同的1个插帧参考帧,然后分别以这个插帧参考帧和原始前向参考帧、原始后向参考帧进行二次插帧,插帧的时间相位可以取0.5,得到一个前向插帧参考帧和一个后向插帧参考帧,形成目标参考帧列表,最后以目标参考帧列表中的两个插帧参考帧为参考进行解码,得到解码后的双向预测重建帧。When decoding, the corresponding strategy is adopted for decoding. For each decoding block in the bidirectional predictive coding frame that needs to be reconstructed, a pair of original bidirectional reference frames is determined according to the frame number of the original bidirectional reference frame and the number of interpolated reference frames 2, and then Based on this pair of original bidirectional reference frames, one interpolated frame is obtained to obtain an interpolated frame reference frame with the same time phase as the current bidirectional predictive encoded frame, and then the interpolated frame reference frame, the original forward reference frame, and the original back Perform secondary interpolation to the reference frame, and the time phase of the interpolation frame can be 0.5 to obtain a forward interpolation frame reference frame and a backward interpolation frame reference frame to form a target reference frame list, and finally use two of the target reference frame lists. Two interpolated frame reference frames are used as a reference for decoding, and a decoded bidirectional prediction reconstructed frame is obtained.
需要说明的是,本公开实施例可以通过编码前的插帧缩小视频中当前双向预测编码帧与参考帧之间的相对运动,进而减小运动矢量或运动矢量差,避免由于运动矢量或运动矢量差过大造成的编码数据过大的问题;同时,由于运动矢量或运动矢量差较小,因此在进行编码时,搜索的范围缩小,因此能够提高编码效率,缩短编码时间。It should be noted that the embodiments of the present disclosure can reduce the relative motion between the current bidirectional predictive encoding frame and the reference frame in the video by inserting the frame before encoding, thereby reducing the motion vector or the motion vector difference, and avoiding the motion vector or the motion vector. The problem of too large coded data caused by a large difference; at the same time, because the motion vector or the motion vector difference is small, the search range is reduced when encoding, so the coding efficiency can be improved and the coding time can be shortened.
需要注意的是,上述附图仅是根据本发明示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。It should be noted that the above-mentioned drawings are only schematic illustrations of the processing included in the method according to the exemplary embodiment of the present invention, and are not intended for limitation. It is easy to understand that the processing shown in the above drawings does not indicate or limit the time sequence of these processings. In addition, it is easy to understand that these processes can be executed synchronously or asynchronously in multiple modules, for example.
进一步的,参考图15所示,本示例的实施方式中还提供一种视频编码装置1500,包括:参考获取模块1510、第一列表确定模块1520、数据编码模块1530和码流生成模块1540。其中:Further, referring to FIG. 15, the embodiment of this example also provides a video encoding device 1500, including: a reference acquiring module 1510, a first list determining module 1520, a data encoding module 1530 and a code stream generating module 1540. in:
参考获取模块1510可以用于根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧;其中,N取正整数。The reference acquisition module 1510 may be configured to determine N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule; where N is a positive integer.
第一列表确定模块1520可以用于根据预设插帧规则对N对原始双向参考帧进行插帧处理,获得T个插帧参考帧,并根据T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表;其中,T取正整数。The first list determining module 1520 may be configured to perform frame interpolation processing on N pairs of original bidirectional reference frames according to preset frame interpolation rules, obtain T frame interpolation reference frames, and update the reference frame list according to the T frame interpolation reference frames, Obtain a list of target reference frames; where T is a positive integer.
数据编码模块1530可以用于根据目标参考帧列表对双向预测编码帧进行编码获得编码数据。The data encoding module 1530 may be used to encode the bidirectionally predictive encoded frame according to the target reference frame list to obtain encoded data.
码流生成模块1540可以用于获取生成插帧参考帧的关键参数,将关键参数附加在编码数据中,生成双向预测编码帧对应的码流数据。The code stream generating module 1540 may be used to obtain key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate code stream data corresponding to the bidirectional predictive coded frame.
本示例实施方式中,参考获取模块1510可以用于根据成对规则对双向预测编码帧对应的参考帧列表中的原始前向参考帧和原始后向参考帧进行配对,生成至少一对候选原始双向参考帧;根据选取规则在至少一对候选原始双向参考帧中确定N对作为原始双向参考帧。In this example embodiment, the reference acquisition module 1510 may be used to pair the original forward reference frame and the original backward reference frame in the reference frame list corresponding to the bidirectional predictive coded frame according to the pairing rule to generate at least one pair of candidate original bidirectional Reference frame: Determine N pairs as the original bidirectional reference frame from at least one pair of candidate original bidirectional reference frames according to the selection rule.
本示例实施方式中,第一列表确定模块1520可以用于通过时间相位规则分别确定N对原始双向参考帧对应的插帧参考帧的时间相位;其中,插帧参考帧的时间相位用于确定插帧参考帧在原始双向参考帧之间的位置;针对N对原始双向参考帧分别进行插帧,以生成T个在时间相位的插帧参考帧。In this example embodiment, the first list determining module 1520 may be used to determine the time phases of the interpolation frame reference frames corresponding to the N pairs of original bidirectional reference frames respectively according to the time phase rule; wherein, the time phase of the interpolation frame reference frame is used to determine the time phase of the interpolation frame. The position of the frame reference frame between the original bidirectional reference frames; for N pairs of original bidirectional reference frames, frame interpolation is performed to generate T interpolated frame reference frames in time phase.
本示例实施方式中,第一列表确定模块1520可以用于获取原始双向参考帧中原始前向参考帧对应的第一帧号、第一时间点和原始后向参考帧对应的第二帧号、第二时间点,以及双向预测编码帧对应的第三帧号;根据第一帧号、第二帧号和第三帧号在第一时间点和第二时间点中间确定第三时间点,并将第三时间点确定为插帧参考帧的时间相位。In this example embodiment, the first list determining module 1520 may be used to obtain the first frame number, the first time point, and the second frame number corresponding to the original forward reference frame in the original bidirectional reference frame, and the second frame number corresponding to the original backward reference frame. The second time point, and the third frame number corresponding to the bidirectional predictive coding frame; the third time point is determined between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number, and The third time point is determined as the time phase of the interpolated frame reference frame.
本示例实施方式中,第一列表确定模块1520可以用于计算第一帧号和第二帧号对应的第一帧号差,并计算第一时间点和第二时间点的时间差;计算时间差与第一帧号差的商作为单位时长;计算第一帧号和第三帧号对应的第二帧号差与单位时长的乘积为第一时长,并将比第一时间点晚第一时长的时间点确定为第三时间点;或计算第二帧号和第三帧号对应的第三帧号差与单位时长的乘积为第二时长,并将比第二时间点早第二时长的时间点确定为第三时间点。In this example embodiment, the first list determining module 1520 may be used to calculate the first frame number difference corresponding to the first frame number and the second frame number, and calculate the time difference between the first time point and the second time point; calculate the time difference and The quotient of the first frame number difference is used as the unit duration; the product of the second frame number difference corresponding to the first frame number and the third frame number and the unit duration is calculated as the first duration, and the first duration will be later than the first time point by the first duration The time point is determined as the third time point; or the product of the third frame number difference corresponding to the second frame number and the third frame number and the unit duration is calculated as the second time length, which will be a second time earlier than the second time point The point is determined as the third time point.
本示例实施方式中,第一列表确定模块1520可以用于将T个插帧参考帧添加至参考帧列表,生成目标参考帧列表。In this example embodiment, the first list determining module 1520 may be used to add T interpolated frame reference frames to the reference frame list to generate a target reference frame list.
本示例实施方式中,第一列表确定模块1520可以用于利用T个插帧参考帧排列形成的列表替换参考帧列表,生成目标参考帧列表。In this example embodiment, the first list determining module 1520 may be configured to replace the reference frame list with a list formed by the arrangement of T interpolated frame reference frames to generate a target reference frame list.
本示例实施方式中,关键参数包括N对原始双向参考帧中的原始前向参考帧和原始后向参考帧对应的N对帧号以及插帧参考帧的数量T。In this exemplary embodiment, the key parameters include N pairs of frame numbers corresponding to the original forward reference frame and the original backward reference frame in the N pairs of original bidirectional reference frames, and the number T of interpolated reference frames.
此外,参考图16所示,在本公开的示例性实施方式中,还提供了一种视频解码装置1600,其特征在于,包括:数据获取模块1610,第二列表确定模块1620和数据重建模块1630。其中:In addition, as shown in FIG. 16, in an exemplary embodiment of the present disclosure, a video decoding device 1600 is also provided, which is characterized in that it includes: a data acquisition module 1610, a second list determination module 1620, and a data reconstruction module 1630 . in:
数据获取模块1610可以用于获取待解码双向预测编码帧对应的码流数据;码流数据包括编码数据和关键参数。The data acquisition module 1610 can be used to acquire code stream data corresponding to the bidirectional predictive coding frame to be decoded; the code stream data includes coded data and key parameters.
第二列表确定模块1620可以用于对编码数据进行解析,并根据关键参数确定编码数据对应的目标参考帧列表。The second list determining module 1620 may be used to analyze the encoded data and determine the target reference frame list corresponding to the encoded data according to key parameters.
数据重建模块1630可以用于基于目标参考帧列表进行解码重建,获得待解码双向预测编码帧对应的双向预测编码帧。The data reconstruction module 1630 may be configured to perform decoding and reconstruction based on the target reference frame list, and obtain the bidirectional predictive coding frame corresponding to the bidirectional predictive coding frame to be decoded.
本示例实施方式中,第二列表确定模块1620可以用于对编码数据进行解析重建,获得待解码双向预测编码帧对应的参考帧列表;根据N对帧号在参考帧列表中确定N对原始双向参考帧;基于N对原始双向参考帧、数量T和编码数据进行插帧重建,获得T个插帧参考帧;基于T个插帧参考帧对参考帧列表进行更新,获得目标参考帧列表。In this example embodiment, the second list determining module 1620 can be used to parse and reconstruct the encoded data to obtain the reference frame list corresponding to the bidirectional predictive encoded frame to be decoded; determine the N pairs of original bidirectional frames in the reference frame list according to the N pairs of frame numbers. Reference frame: Based on N, the original two-way reference frame, the number T and the coded data are inserted into the frame to obtain T interpolation frame reference frames; the reference frame list is updated based on the T interpolation frame reference frames, and the target reference frame list is obtained.
本示例实施方式中,第二列表确定模块1620可以用于将T个插帧参考帧添加至参考帧列表,生成目标参考帧列表。In this example embodiment, the second list determining module 1620 may be used to add T interpolated frame reference frames to the reference frame list to generate a target reference frame list.
本示例实施方式中,第二列表确定模块1620可以用于利用T个插帧参考帧排列形成的列表替换参考帧列表,生成目标参考帧列表。In this example embodiment, the second list determining module 1620 may be configured to replace the reference frame list with a list formed by the arrangement of T interpolated frame reference frames to generate a target reference frame list.
上述的视频编码装置和视频解码装置中各模块的具体细节已经在对应的视频编码方法和视频解码方法中进行了详细的描述,因此此处不再赘述。The specific details of each module in the above-mentioned video encoding device and video decoding device have been described in detail in the corresponding video encoding method and video decoding method, and therefore will not be repeated here.
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.
图17示出了适于用来实现本发明实施例的电子设备的计算机系统的结构示意图。Fig. 17 shows a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present invention.
需要说明的是,图17示出的电子设备的计算机系统1700仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。It should be noted that the computer system 1700 of the electronic device shown in FIG. 17 is only an example, and should not bring any limitation to the function and scope of use of the embodiment of the present invention.
如图17所示,计算机系统1700包括中央处理单元(CPU)1701,其可以根据存储在只读存储器(ROM)1702中的程序或者从存储部分1708加载到随机访问存储器(RAM)1703中的程序而执行各种适当的动作和处理。在RAM 1703中,还存储有系统操作所需的各种程序和数据。CPU 1701、ROM 1702以及RAM 1703通过总线1704彼此相连。输入/输出(I/O)接口1705也连接至总线1704。As shown in FIG. 17, the computer system 1700 includes a central processing unit (CPU) 1701, which can be based on a program stored in a read only memory (ROM) 1702 or a program loaded from a storage portion 1708 into a random access memory (RAM) 1703 And perform various appropriate actions and processing. In RAM 1703, various programs and data required for system operation are also stored. The CPU 1701, the ROM 1702, and the RAM 1703 are connected to each other through a bus 1704. An input/output (I/O) interface 1705 is also connected to the bus 1704.
以下部件连接至I/O接口1705:包括键盘、鼠标等的输入部分1706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1707;包括硬盘等的 存储部分1708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1709。通信部分1709经由诸如因特网的网络执行通信处理。驱动器1710也根据需要连接至I/O接口1705。可拆卸介质1711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1710上,以便于从其上读出的计算机程序根据需要被安装入存储部分1708。The following components are connected to the I/O interface 1705: an input part 1706 including a keyboard, a mouse, etc.; an output part 1707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers, etc.; a storage part 1708 including a hard disk, etc. ; And a communication section 1709 including a network interface card such as a LAN card, a modem, and the like. The communication section 1709 performs communication processing via a network such as the Internet. The driver 1710 is also connected to the I/O interface 1705 as needed. A removable medium 1711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1710 as needed, so that the computer program read therefrom is installed into the storage portion 1708 as needed.
特别地,根据本发明的实施例,下文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1709从网络上被下载和安装,和/或从可拆卸介质1711被安装。在该计算机程序被中央处理单元(CPU)1701执行时,执行本申请的系统中限定的各种功能。In particular, according to an embodiment of the present invention, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 1709, and/or installed from the removable medium 1711. When the computer program is executed by the central processing unit (CPU) 1701, various functions defined in the system of the present application are executed.
需要说明的是,本发明所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the drawings illustrate the possible implementation architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more for realizing the specified logic function. Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by It is realized by a combination of dedicated hardware and computer instructions.
描述于本发明实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units described in the embodiments of the present invention may be implemented in software or hardware, and the described units may also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现如下述实施例中的方法。例如,的电子设备可以实现如图1至图7所示的各个步骤。As another aspect, this application also provides a computer-readable medium. The computer-readable medium may be included in the electronic device described in the above-mentioned embodiment; or it may exist alone without being assembled into the electronic device. middle. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, the electronic device realizes the method in the following embodiments. For example, the electronic device of FIG. 1 can implement the various steps shown in FIG. 1 to FIG. 7.
此外,上述附图仅是根据本发明示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned drawings are merely schematic illustrations of the processing included in the method according to the exemplary embodiment of the present invention, and are not intended for limitation. It is easy to understand that the processing shown in the above drawings does not indicate or limit the time sequence of these processings. In addition, it is easy to understand that these processes can be executed synchronously or asynchronously in multiple modules, for example.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Those skilled in the art will easily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptive changes of the present disclosure. These variations, uses, or adaptive changes follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field that are not disclosed in the present disclosure. . The description and the embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限。It should be understood that the present disclosure is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is limited only by the appended claims.

Claims (20)

  1. 一种视频编码方法,其特征在于,包括:A video coding method, characterized in that it comprises:
    根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧;其中,N取正整数;Determine N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to the preset selection rule; wherein, N is a positive integer;
    根据预设插帧规则对N对所述原始双向参考帧进行插帧处理,获得T个插帧参考帧,并根据T个所述插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表;其中,T取正整数;Perform frame interpolation processing on the original bidirectional reference frame for N according to the preset frame interpolation rule to obtain T frame interpolation reference frames, and update the reference frame list according to the T frame interpolation reference frames to obtain the target reference Frame list; where T is a positive integer;
    根据所述目标参考帧列表对所述双向预测编码帧进行编码获得编码数据;Encoding the bidirectionally predictive encoded frame according to the target reference frame list to obtain encoded data;
    获取生成所述插帧参考帧的关键参数,将所述关键参数附加在所述编码数据中,生成所述双向预测编码帧对应的码流数据。Obtain key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate code stream data corresponding to the bidirectionally predictive coded frame.
  2. 根据权利要求1所述的方法,其特征在于,所述预设选取规则包括成对规则和选取规则;The method according to claim 1, wherein the preset selection rule includes a pairing rule and a selection rule;
    所述根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧,包括:The determining N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to the preset selection rule includes:
    根据所述成对规则对所述双向预测编码帧对应的参考帧列表中的原始前向参考帧和原始后向参考帧进行配对,生成至少一对候选原始双向参考帧;Pairing the original forward reference frame and the original backward reference frame in the reference frame list corresponding to the bidirectional predictive coding frame according to the pairing rule to generate at least one pair of candidate original bidirectional reference frames;
    根据所述选取规则在至少一对所述候选原始双向参考帧中确定N对作为所述原始双向参考帧。According to the selection rule, N pairs of at least one pair of candidate original bidirectional reference frames are determined as the original bidirectional reference frames.
  3. 根据权利要求1所述的方法,其特征在于,所述预设插帧规则包括时间相位规则;The method according to claim 1, wherein the preset frame interpolation rule comprises a time phase rule;
    所述根据预设插帧规则对N对所述原始双向参考帧进行插帧处理,获得T个插帧参考帧,包括:The performing frame insertion processing on N of the original bidirectional reference frames according to a preset frame insertion rule to obtain T frame insertion reference frames includes:
    通过所述时间相位规则分别确定N对所述原始双向参考帧对应的插帧参考帧的时间相位;其中,所述插帧参考帧的时间相位用于确定所述插帧参考帧在所述原始双向参考帧之间的位置;The time phases of the interpolated frame reference frames corresponding to the original bidirectional reference frames of N are respectively determined according to the time phase rule; wherein, the time phase of the interpolated frame reference frame is used to determine that the interpolated frame reference frame is in the original The position between two-way reference frames;
    针对N对所述原始双向参考帧分别进行插帧,以生成T个在所述时间相位的所述插帧参考帧。Frame interpolation is performed on the original bidirectional reference frames for N respectively to generate T frame interpolation reference frames in the time phase.
  4. 根据权利要求3所述的方法,其特征在于,通过所述时间相位规则确定所述原始双向参考帧对应的插帧参考帧的时间相位,包括:The method according to claim 3, wherein determining the time phase of the interpolated frame reference frame corresponding to the original bidirectional reference frame according to the time phase rule comprises:
    获取所述原始双向参考帧中原始前向参考帧对应的第一帧号、第一时间点和原始后向参考帧对应的第二帧号、第二时间点,以及所述双向预测编码帧对应的第三帧号;Acquire the first frame number corresponding to the original forward reference frame, the first time point and the second frame number and second time point corresponding to the original backward reference frame in the original bidirectional reference frame, and the corresponding bidirectional predictive coding frame The third frame number;
    根据所述第一帧号、所述第二帧号和所述第三帧号在所述第一时间点和所述第二时间点中间确定第三时间点,并将所述第三时间点确定为所述插帧参考帧的时间相位。A third time point is determined between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number, and the third time point Determined as the time phase of the interpolated frame reference frame.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述第一帧号、所述第二帧号和所述第三帧号在所述第一时间点和所述第二时间点中间确定第三时间点,包括:The method according to claim 4, wherein the first frame number, the second frame number, and the third frame number are set at the first time point and the second time point according to the first frame number, the second frame number, and the third frame number. Determine the third time point in the middle, including:
    计算所述第一帧号和所述第二帧号对应的第一帧号差,并计算所述第一时间点和第二时间点的时间差;Calculating a first frame number difference corresponding to the first frame number and the second frame number, and calculating a time difference between the first time point and the second time point;
    计算所述时间差与所述第一帧号差的商作为单位时长;Calculating the quotient of the time difference and the first frame number difference as the unit duration;
    计算所述第一帧号和所述第三帧号对应的第二帧号差与所述单位时长的乘积为第一时长,并将比所述第一时间点晚所述第一时长的时间点确定为第三时间点;或Calculate the product of the difference between the second frame number corresponding to the first frame number and the third frame number and the unit duration as the first duration, and set it to be later than the first time point by the first duration Point is determined as the third time point; or
    计算所述第二帧号和所述第三帧号对应的第三帧号差与所述单位时长的乘积 为第二时长,并将比所述第二时间点早所述第二时长的时间点确定为第三时间点。Calculate the product of the difference between the third frame number corresponding to the second frame number and the third frame number and the unit duration as the second duration, which will be earlier than the second time point by the second duration The point is determined as the third time point.
  6. 根据权利要求1所述的方法,其特征在于,所述根据T个所述插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表,包括:The method according to claim 1, wherein the updating the reference frame list according to the T interpolated frame reference frames to obtain a target reference frame list comprises:
    将T个所述插帧参考帧添加至所述参考帧列表,生成目标参考帧列表。Adding the T interpolated frame reference frames to the reference frame list to generate a target reference frame list.
  7. 根据权利要求1所述的方法,其特征在于,所述根据T个所述插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表,包括:The method according to claim 1, wherein the updating the reference frame list according to the T interpolated frame reference frames to obtain a target reference frame list comprises:
    利用T个所述插帧参考帧排列形成的列表替换所述参考帧列表,生成目标参考帧列表。Replace the reference frame list with a list formed by arranging the T interpolated frame reference frames to generate a target reference frame list.
  8. 根据权利要求1所述的方法,其特征在于,所述关键参数包括N对所述原始双向参考帧中的原始前向参考帧和原始后向参考帧对应的N对帧号以及所述插帧参考帧的数量T。The method according to claim 1, wherein the key parameters include N pairs of frame numbers corresponding to the original forward reference frame and the original backward reference frame in the original two-way reference frame, and the interpolation frame The number of reference frames T.
  9. 一种视频解码方法,其特征在于,包括:A video decoding method, characterized in that it comprises:
    获取待解码双向预测编码帧对应的码流数据;所述码流数据包括编码数据和关键参数;Obtain code stream data corresponding to the bidirectional predictive coding frame to be decoded; the code stream data includes coded data and key parameters;
    对所述编码数据进行解析,并根据所述关键参数确定所述编码数据对应的目标参考帧列表;Parse the encoded data, and determine a target reference frame list corresponding to the encoded data according to the key parameters;
    基于所述目标参考帧列表进行解码重建,获得解码后的双向预测重建帧。Perform decoding and reconstruction based on the target reference frame list, and obtain a decoded bidirectional prediction reconstruction frame.
  10. 根据权利要求9所述的方法,其特征在于,所述关键参数包括N对帧号和数量T;其中,N、T均为正整数;The method according to claim 9, wherein the key parameters include N pairs of frame numbers and the number T; wherein, N and T are both positive integers;
    所述对所述编码数据进行解析,并根据所述关键参数确定所述编码数据对应的目标参考帧列表,包括:The parsing the encoded data and determining the target reference frame list corresponding to the encoded data according to the key parameters includes:
    对所述编码数据进行解析重建,获得待解码双向预测编码帧对应的参考帧列表;Analyzing and reconstructing the encoded data to obtain a reference frame list corresponding to the bidirectional predictive encoded frame to be decoded;
    根据N对所述帧号在所述参考帧列表中确定N对原始双向参考帧;Determining N pairs of original bidirectional reference frames in the reference frame list according to N pairs of the frame numbers;
    基于N对所述原始双向参考帧、数量T和编码数据进行插帧重建,获得T个插帧参考帧;Performing frame interpolation reconstruction on the original bidirectional reference frames, the number T, and the encoded data based on N, to obtain T frame interpolation reference frames;
    基于所述T个插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表。The reference frame list is updated based on the T interpolated frame reference frames to obtain a target reference frame list.
  11. 根据权利要求10所述的方法,其特征在于,所述基于所述T个插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表,包括:The method according to claim 10, wherein the updating the reference frame list based on the T interpolated frame reference frames to obtain a target reference frame list comprises:
    将T个所述插帧参考帧添加至所述参考帧列表,生成目标参考帧列表。Adding the T interpolated frame reference frames to the reference frame list to generate a target reference frame list.
  12. 根据权利要求10所述的方法,其特征在于,所述基于所述T个插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表,包括:The method according to claim 10, wherein the updating the reference frame list based on the T interpolated frame reference frames to obtain a target reference frame list comprises:
    利用T个所述插帧参考帧排列形成的列表替换所述参考帧列表,生成目标参考帧列表。Replace the reference frame list with a list formed by arranging the T interpolated frame reference frames to generate a target reference frame list.
  13. 一种视频编码装置,其特征在于,包括:A video encoding device, characterized in that it comprises:
    参考获取模块,用于根据预设选取规则在双向预测编码帧对应的参考帧列表中确定N对原始双向参考帧;其中,N取正整数;The reference acquisition module is configured to determine N pairs of original bidirectional reference frames in the reference frame list corresponding to the bidirectional predictive coding frame according to a preset selection rule; wherein, N is a positive integer;
    第一列表确定模块,用于根据预设插帧规则对N对所述原始双向参考帧进行插帧处理,获得T个插帧参考帧,并根据T个所述插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表;其中,T取正整数;The first list determining module is configured to perform frame interpolation processing on N of the original bidirectional reference frames according to preset frame interpolation rules to obtain T frame interpolation reference frames, and compare the reference frames according to the T frame interpolation reference frames The frame list is updated to obtain the target reference frame list; where T is a positive integer;
    数据编码模块,用于根据所述目标参考帧列表对所述双向预测编码帧进行编码获得编码数据;A data encoding module, configured to encode the bidirectionally predictive encoded frame according to the target reference frame list to obtain encoded data;
    码流生成模块,用于获取生成所述插帧参考帧的关键参数,将所述关键参数附加在所述编码数据中,生成所述双向预测编码帧对应的码流数据。The code stream generation module is used to obtain key parameters for generating the interpolated frame reference frame, append the key parameters to the coded data, and generate code stream data corresponding to the bidirectionally predictive coded frame.
  14. 根据权利要求13所述的装置,其特征在于,所述预设选取规则包括成对 规则和选取规则;The device according to claim 13, wherein the preset selection rule comprises a pairing rule and a selection rule;
    所述参考模块还用于根据所述成对规则对所述双向预测编码帧对应的参考帧列表中的原始前向参考帧和原始后向参考帧进行配对,生成至少一对候选原始双向参考帧;根据所述选取规则在至少一对所述候选原始双向参考帧中确定N对作为所述原始双向参考帧。The reference module is further configured to pair the original forward reference frame and the original backward reference frame in the reference frame list corresponding to the bidirectional predictive coding frame according to the pairing rule to generate at least one pair of candidate original bidirectional reference frames ; Determine N pairs as the original bidirectional reference frame in at least one pair of the candidate original bidirectional reference frames according to the selection rule.
  15. 根据权利要求13所述的装置,其特征在于,所述预设插帧规则包括时间相位规则;The device according to claim 13, wherein the preset frame interpolation rule comprises a time phase rule;
    所述第一列表确定模块还用于通过所述时间相位规则分别确定N对所述原始双向参考帧对应的插帧参考帧的时间相位;其中,所述插帧参考帧的时间相位用于确定所述插帧参考帧在所述原始双向参考帧之间的位置;针对N对所述原始双向参考帧分别进行插帧,以生成T个在所述时间相位的所述插帧参考帧。The first list determining module is further configured to determine the time phases of the interpolated frame reference frames corresponding to the original bidirectional reference frames according to the time phase rule; wherein, the time phase of the interpolated frame reference frames is used to determine The position of the interpolated frame reference frame between the original bidirectional reference frames; interpolating the original bidirectional reference frames for N respectively to generate T interpolated frame reference frames in the time phase.
  16. 根据权利要求15所述的装置,其特征在于,通过所述时间相位规则确定所述原始双向参考帧对应的插帧参考帧的时间相位,包括:The apparatus according to claim 15, wherein the determining the time phase of the interpolated frame reference frame corresponding to the original bidirectional reference frame according to the time phase rule comprises:
    获取所述原始双向参考帧中原始前向参考帧对应的第一帧号、第一时间点和原始后向参考帧对应的第二帧号、第二时间点,以及所述双向预测编码帧对应的第三帧号;Acquire the first frame number corresponding to the original forward reference frame, the first time point and the second frame number and second time point corresponding to the original backward reference frame in the original bidirectional reference frame, and the corresponding bidirectional predictive coding frame The third frame number;
    根据所述第一帧号、所述第二帧号和所述第三帧号在所述第一时间点和所述第二时间点中间确定第三时间点,并将所述第三时间点确定为所述插帧参考帧的时间相位。A third time point is determined between the first time point and the second time point according to the first frame number, the second frame number, and the third frame number, and the third time point Determined as the time phase of the interpolated frame reference frame.
  17. 根据权利要求16所述的装置,其特征在于,所述根据所述第一帧号、所述第二帧号和所述第三帧号在所述第一时间点和所述第二时间点中间确定第三时间点,包括:The apparatus according to claim 16, wherein the first frame number, the second frame number, and the third frame number are set at the first time point and the second time point according to the first frame number, the second frame number, and the third frame number. Determine the third time point in the middle, including:
    计算所述第一帧号和所述第二帧号对应的第一帧号差,并计算所述第一时间点和第二时间点的时间差;Calculating a first frame number difference corresponding to the first frame number and the second frame number, and calculating a time difference between the first time point and the second time point;
    计算所述时间差与所述第一帧号差的商作为单位时长;Calculating the quotient of the time difference and the first frame number difference as the unit duration;
    计算所述第一帧号和所述第三帧号对应的第二帧号差与所述单位时长的乘积为第一时长,并将比所述第一时间点晚所述第一时长的时间点确定为第三时间点;或Calculate the product of the difference between the second frame number corresponding to the first frame number and the third frame number and the unit duration as the first duration, and set it to be later than the first time point by the first duration Point is determined as the third time point; or
    计算所述第二帧号和所述第三帧号对应的第三帧号差与所述单位时长的乘积为第二时长,并将比所述第二时间点早所述第二时长的时间点确定为第三时间点。Calculate the product of the difference between the third frame number corresponding to the second frame number and the third frame number and the unit duration as the second duration, which will be earlier than the second time point by the second duration The point is determined as the third time point.
  18. 一种视频解码装置,其特征在于,包括:A video decoding device, characterized in that it comprises:
    数据获取模块,用于获取待解码双向预测编码帧对应的码流数据;所述码流数据包括编码数据和关键参数;A data acquisition module for acquiring code stream data corresponding to the bidirectional predictive coding frame to be decoded; the code stream data includes coded data and key parameters;
    第二列表确定模块,用于对所述编码数据进行解析,并根据所述关键参数确定所述编码数据对应的目标参考帧列表;The second list determining module is configured to analyze the encoded data and determine the target reference frame list corresponding to the encoded data according to the key parameters;
    数据重建模块,用于基于所述目标参考帧列表进行解码重建,获得解码后的双向预测重建帧。The data reconstruction module is used to perform decoding and reconstruction based on the target reference frame list to obtain a decoded bidirectional prediction reconstruction frame.
  19. 根据权利要求18所述的装置,其特征在于,所述关键参数包括N对帧号和数量T;其中,N、T均为正整数;The device according to claim 18, wherein the key parameter includes N pairs of frame numbers and a number T; wherein, N and T are both positive integers;
    所述第二列表确定模块还用于对所述编码数据进行解析重建,获得待解码双向预测编码帧对应的参考帧列表;根据N对所述帧号在所述参考帧列表中确定N对原始双向参考帧;基于N对所述原始双向参考帧、数量T和编码数据进行插帧重建,获得T个插帧参考帧;基于所述T个插帧参考帧对所述参考帧列表进行更新,获得目标参考帧列表。The second list determining module is further configured to analyze and reconstruct the encoded data to obtain a reference frame list corresponding to the bidirectional predictive encoded frame to be decoded; determine N pairs of original frames in the reference frame list according to the N pairs of the frame numbers. Two-way reference frame; based on N, the original two-way reference frame, the number T and the encoded data are interpolated and reconstructed to obtain T interpolated frame reference frames; the reference frame list is updated based on the T interpolated frame reference frames, Obtain a list of target reference frames.
  20. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    处理器;以及Processor; and
    存储器,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如权利要求1至8中任一项所述的视频编码方法或权利要求9至12中任一项所述的视频解码方法。The memory is configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors can implement any one of claims 1 to 8 The video encoding method described in clause 1 or the video decoding method described in any one of claims 9 to 12.
PCT/CN2021/076735 2020-04-17 2021-02-18 Video encoding and decoding methods and apparatus, and electronic device WO2021208588A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010307909.7 2020-04-17
CN202010307909.7A CN111526370B (en) 2020-04-17 2020-04-17 Video encoding and decoding methods and devices and electronic equipment

Publications (1)

Publication Number Publication Date
WO2021208588A1 true WO2021208588A1 (en) 2021-10-21

Family

ID=71903120

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/076735 WO2021208588A1 (en) 2020-04-17 2021-02-18 Video encoding and decoding methods and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN111526370B (en)
WO (1) WO2021208588A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114758304A (en) * 2022-06-13 2022-07-15 江苏中腾石英材料科技股份有限公司 High-purity rounded quartz powder sieving equipment and sieving control method thereof

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111526370B (en) * 2020-04-17 2023-06-02 Oppo广东移动通信有限公司 Video encoding and decoding methods and devices and electronic equipment
CN111970562A (en) * 2020-08-17 2020-11-20 Oppo广东移动通信有限公司 Video processing method, video processing device, storage medium and electronic equipment
CN114363700A (en) * 2020-10-12 2022-04-15 阿里巴巴集团控股有限公司 Data processing method, data processing device, storage medium and computer equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000151989A (en) * 1998-11-06 2000-05-30 Seiko Epson Corp Picture data interpolation method, device therefor and medium recorded with picture data interpolation program
US20020150159A1 (en) * 2001-04-11 2002-10-17 Koninklijke Philips Electronics N.V. Decoding system and method for proper interpolation for motion compensation
CN1592398A (en) * 2003-03-28 2005-03-09 株式会社东芝 Method of generating frame interpolation and image display system therefor
CN103297778A (en) * 2013-05-27 2013-09-11 华为技术有限公司 Methods and equipment for encoding and decoding images
CN106658019A (en) * 2015-10-31 2017-05-10 华为技术有限公司 Coding and decoding method and device for reference frame
CN108012153A (en) * 2016-10-17 2018-05-08 联发科技股份有限公司 A kind of decoding method and device
CN111526370A (en) * 2020-04-17 2020-08-11 Oppo广东移动通信有限公司 Video encoding method, video decoding method, video encoding device, video decoding device and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100746006B1 (en) * 2005-07-19 2007-08-06 삼성전자주식회사 Method and apparatus for encoding and decoding in temporal direct mode hierarchical B structure adaptive
CN101188760A (en) * 2007-11-16 2008-05-28 中兴通讯股份有限公司 A video sequence coding method
US9131217B2 (en) * 2011-12-09 2015-09-08 Qualcomm Incorporated Reference picture list modification for view synthesis reference pictures
US10448013B2 (en) * 2016-12-22 2019-10-15 Google Llc Multi-layer-multi-reference prediction using adaptive temporal filtering
KR102295520B1 (en) * 2017-08-22 2021-08-27 구글 엘엘씨 Optical Flow Estimation for Motion Compensation Prediction in Video Coding
US11044477B2 (en) * 2019-12-16 2021-06-22 Intel Corporation Motion adaptive encoding of video

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000151989A (en) * 1998-11-06 2000-05-30 Seiko Epson Corp Picture data interpolation method, device therefor and medium recorded with picture data interpolation program
US20020150159A1 (en) * 2001-04-11 2002-10-17 Koninklijke Philips Electronics N.V. Decoding system and method for proper interpolation for motion compensation
CN1592398A (en) * 2003-03-28 2005-03-09 株式会社东芝 Method of generating frame interpolation and image display system therefor
CN103297778A (en) * 2013-05-27 2013-09-11 华为技术有限公司 Methods and equipment for encoding and decoding images
CN106658019A (en) * 2015-10-31 2017-05-10 华为技术有限公司 Coding and decoding method and device for reference frame
CN108012153A (en) * 2016-10-17 2018-05-08 联发科技股份有限公司 A kind of decoding method and device
CN111526370A (en) * 2020-04-17 2020-08-11 Oppo广东移动通信有限公司 Video encoding method, video decoding method, video encoding device, video decoding device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114758304A (en) * 2022-06-13 2022-07-15 江苏中腾石英材料科技股份有限公司 High-purity rounded quartz powder sieving equipment and sieving control method thereof
CN114758304B (en) * 2022-06-13 2022-09-02 江苏中腾石英材料科技股份有限公司 High-purity rounded quartz powder sieving equipment and sieving control method thereof

Also Published As

Publication number Publication date
CN111526370A (en) 2020-08-11
CN111526370B (en) 2023-06-02

Similar Documents

Publication Publication Date Title
WO2021208588A1 (en) Video encoding and decoding methods and apparatus, and electronic device
TWI692245B (en) Video decoding apparatus, video encoding method and apparatus, and computer-readable storage medium
US8311106B2 (en) Method of encoding and decoding motion picture frames
WO2020140915A1 (en) Video processing method and apparatus
KR101459397B1 (en) Method and system for determining a metric for comparing image blocks in motion compensated video coding
KR20130062109A (en) Method and apparatus for encoding and decoding image
JP2021523604A (en) Motion compensation for video coding and decoding
US20220232208A1 (en) Displacement vector prediction method and apparatus in video encoding and decoding and device
WO2015188297A1 (en) Arithmetic coding/decoding method and device for video image block compression of weighted skip model
WO2019184556A1 (en) Bidirectional inter-frame prediction method and device
GB2519289A (en) Method and apparatus for displacement vector component transformation in video coding and decoding
WO2020181504A1 (en) Video encoding method and apparatus, and video decoding method and apparatus
TW201941612A (en) Improvements to advanced temporal motion vector prediction
CN113747242B (en) Image processing method, image processing device, electronic equipment and storage medium
WO2021012942A1 (en) Residual coding method and device, residual decoding method and device, storage medium, and electronic device
KR101431046B1 (en) Video data encoding method of encoding video data for fruc, apparatus and storage medium thereof
JP2021526325A (en) Data dependency in coding / decoding
WO2020043000A1 (en) Method for constructing candidate motion information list, and inter-frame prediction method and device
CN112449184B (en) Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device
WO2023185305A1 (en) Encoding method and apparatus, storage medium and computer program product
CN113824960B (en) Video encoding method, video encoding device, computer readable medium and electronic equipment
CN115511740A (en) Image processing method and device, storage medium and electronic equipment
CN111247804B (en) Image processing method and device
WO2023056392A1 (en) Method, apparatus, and medium for video processing
WO2023081820A1 (en) Method, apparatus, and medium for media processing

Legal Events

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

Ref document number: 21787818

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21787818

Country of ref document: EP

Kind code of ref document: A1