WO2025199705A1 - 编解码方法、码流、编码器、解码器以及存储介质 - Google Patents

编解码方法、码流、编码器、解码器以及存储介质

Info

Publication number
WO2025199705A1
WO2025199705A1 PCT/CN2024/083659 CN2024083659W WO2025199705A1 WO 2025199705 A1 WO2025199705 A1 WO 2025199705A1 CN 2024083659 W CN2024083659 W CN 2024083659W WO 2025199705 A1 WO2025199705 A1 WO 2025199705A1
Authority
WO
WIPO (PCT)
Prior art keywords
current
block
time
domain
vectors
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/083659
Other languages
English (en)
French (fr)
Other versions
WO2025199705A9 (zh
Inventor
徐陆航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to PCT/CN2024/083659 priority Critical patent/WO2025199705A1/zh
Publication of WO2025199705A1 publication Critical patent/WO2025199705A1/zh
Publication of WO2025199705A9 publication Critical patent/WO2025199705A9/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • Intra Template Matching Prediction IntraTMP
  • Intra Block Copy IBC
  • an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:
  • a candidate merge list is constructed.
  • an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:
  • an encoder including a first determining unit and a first constructing unit, wherein:
  • a first determining unit is configured to determine at least one co-located image of the current block; and determine one or more time-domain candidate block vectors of the current block based on the at least one co-located image;
  • an encoder comprising a first memory and a first processor, wherein:
  • the first processor is configured to execute the method according to the second aspect when running a computer program.
  • a second determining unit is configured to determine at least one co-located image of the current block; and determine one or more time-domain candidate block vectors of the current block based on the at least one co-located image;
  • an embodiment of the present application provides a decoder, comprising a second memory and a second processor, wherein:
  • a second memory for storing a computer program capable of running on the second processor
  • the second processor is configured to execute the method according to the first aspect when running a computer program.
  • an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon.
  • the computer program When executed by a processor, it implements the method described in the first aspect or the method described in the second aspect.
  • an embodiment of the present application provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the method described in the first aspect, or implements the method described in the second aspect.
  • the embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. Whether on the encoding or decoding end, at least one co-located image of the current block is first determined; then, based on the at least one co-located image, one or more time-domain candidate block vectors of the current block are determined; and then, based on the one or more time-domain candidate block vectors, a candidate merge list is constructed.
  • the coding and decoding method proposed in the embodiments of the present application when constructing the candidate merge list, considers one or more time-domain candidate block vectors as candidates in the candidate merge list. This not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list without introducing additional software and hardware implementation complexity, thereby improving coding and decoding efficiency.
  • FIG1 is a schematic diagram of template matching of an IntraTMP technology
  • FIG2 is a schematic diagram of a matching block for determining a current block
  • FIG3A is a second schematic diagram of template matching using the IntraTMP technology
  • FIG3B is a third schematic diagram of template matching of the IntraTMP technology
  • FIG4 is a schematic diagram of adjacent positions and non-adjacent positions of a current block
  • FIG5 is a schematic diagram of relocating a new position according to a block vector
  • FIG6 is a schematic diagram of searching a block vector according to multiple positions within a reference block
  • FIG7 is a schematic diagram of a network architecture of a video codec provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a system block diagram of an encoder provided in an embodiment of the present application.
  • FIG10 is a flowchart diagram of a decoding method provided in an embodiment of the present application.
  • FIG12 is a second flow chart of a decoding method provided in an embodiment of the present application.
  • FIG13 is a schematic diagram of five candidate positions of a current block provided by an embodiment of the present application.
  • FIG14 is a third flow chart of a decoding method provided in an embodiment of the present application.
  • FIG15 is a fourth flow chart of a decoding method provided in an embodiment of the present application.
  • FIG16 is a flowchart diagram 1 of an encoding method provided in an embodiment of the present application.
  • FIG17 is a second flow chart of an encoding method provided in an embodiment of the present application.
  • FIG18 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application.
  • FIG19 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application.
  • FIG22 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application.
  • Non-adjacent block vectors (Non-adjacent BV);
  • History block vector prediction (HBVP) based on the historical encoding and decoding sequence
  • ARBVP Auto-relocated block vector prediction
  • MSE Mean Square Error
  • MSD Mean Square Differences
  • VVC Versatile Video Coding
  • VTM VVC Test Model
  • IBC Intra Block Copy
  • Intra-frame template matching prediction technology referred to as IntraTMP technology
  • IntraTMP technology is a special intra-frame prediction coding tool, mainly used for screen content coding.
  • IntraTMP is mainly implemented through the following process:
  • the matching block can be represented by the block vector BV pointing from the current block to the matching block.
  • the similarity between templates is represented by the size of the template error value. The smaller the template error value, the higher the similarity.
  • the template error value is calculated using SAD. The smaller the SAD value, the more similar the templates are.
  • the codec uses the flag intra_tmp_flag to indicate whether the current block is encoded using the IntraTMP mode. If so, the same template matching process is performed on the decoder to obtain the same predicted block on the decoder, without the need to additionally encode the block vector information from the current block to the matching block.
  • the IntraTMP adaptation for camera-captured content technology builds on the existing IntraTMP technology by proposing template matching with a step size S (i.e., every S points in the horizontal and vertical directions, where S>1).
  • a step size S i.e., every S points in the horizontal and vertical directions, where S>1).
  • the search is performed at alternate points in the horizontal and vertical directions within the search area. For example, if the current template matching block vector is (X0, Y0), the next template matching block vector should be (X0+S, Y0), and the vertical coordinate of the next template matching block vector should be Y0+S.
  • the template matching process can be divided into multiple rounds, each with a different search step size.
  • the matching results can be used to determine the next search range (e.g., within the neighborhood of these matching blocks).
  • Template matching can then be performed with a smaller step size S', as shown in Figure 3B, where 1 ⁇ S' ⁇ S), thereby optimizing the matching results.
  • This technology can effectively reduce the complexity of the IntraTMP mode while maintaining good coding efficiency.
  • the grid-filled area represents the template area; the arrows represent the block vectors, and the dotted boxes represent the matching blocks.
  • Template matching technology cannot necessarily accurately find the target block by simply comparing the cost value of the template area. Therefore, finding multiple candidate matching blocks from the reference area can make the search more error-tolerant.
  • IntraTMP multi-candidate technology uses a template matching process to obtain N candidate matching blocks within the reference area, or to construct a candidate block list of length N.
  • the candidate blocks in the list can be sorted by the template error value between them and the current block.
  • a candidate block in the list is selected as the final prediction block by index.
  • intra_tmp_idx For a coded block using IntraTMP multi-candidate technology, after decoding the IntraTMP flag intra_tmp_flag to true, it continues to decode intra_tmp_idx.
  • the intra_tmp_idx syntax element can represent the index of the selected candidate block.
  • the template matching process for constructing the candidate block list is as follows:
  • the first step is to perform the first search with a certain step length, for example, the horizontal step length and the vertical step length are both 4. Best matching blocks (the top N with the smallest template error values);
  • the same construction process is used at the encoding and decoding ends to obtain a consistent list of candidate blocks.
  • an embodiment of the present application provides a coding and decoding method, which first determines at least one co-located image of the current block; then, based on the at least one co-located image, determines one or more time-domain candidate block vectors of the current block; and then, based on the one or more time-domain candidate block vectors, constructs a candidate merge list.
  • the coding and decoding method proposed in the embodiment of the present application when constructing the candidate merge list, considers one or more time-domain candidate block vectors as candidates in the candidate merge list. This not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list without introducing additional software and hardware implementation complexity, thereby improving coding and decoding efficiency and coding and decoding performance.
  • the segmentation unit 101 segments a picture in an input video into one or more Coding Tree Units (CTUs).
  • the segmentation unit 101 segments the picture into a plurality of tiles (also known as tiles), and may further segment a tile into one or more bricks, where a tile or a brick may include one or more complete and/or partial CTUs.
  • the segmentation unit 101 may form one or more slices, where a slice may include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture.
  • the segmentation unit 101 may also form one or more sub-pictures, where a sub-picture may include one or more slices, tiles, or bricks.
  • the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the motion compensation unit 203 to obtain the inter-frame prediction block; when the intra-frame prediction mode (including the MIP mode indicated based on the MIP mode index value) is indicated for decoding the current decoding block, the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the intra-frame prediction unit 204 to obtain the intra-frame prediction block.
  • the inverse quantization unit 205 has the same function as the inverse quantization unit 110 in the encoder 100.
  • one or more corresponding co-located images can be determined based on a co-located image index in a bitstream.
  • determining at least one co-located image for the current block may include: decoding the bitstream, determining a co-located image index for the current block; and determining at least one co-located image for the current block based on the co-located image index.
  • the time domain candidate block vector of the current block can be obtained not only from one of the co-located images, but also from the two co-located images. No limitation is imposed here.
  • S1002 Determine one or more time-domain candidate block vectors of a current block according to at least one co-located image.
  • determining one or more time-domain candidate block vectors for the current block based on at least one co-located image may include: determining X first-category time-domain candidate block vectors based on the at least one co-located image; and determining one or more time-domain candidate block vectors for the current block based on the X first-category time-domain candidate block vectors; where X is a positive integer.
  • determining one or more time-domain candidate block vectors for the current block based on at least one co-located image may include: determining X time-domain candidate block vectors of the first category and Y time-domain candidate block vectors of the second category based on the at least one co-located image; and determining one or more time-domain candidate block vectors for the current block based on the X time-domain candidate block vectors of the first category and the Y time-domain candidate block vectors of the second category; wherein X and Y are both positive integers.
  • determining X first-category temporal candidate block vectors based on at least one co-located image may include: determining K temporal block vectors for each of the at least one co-located image, where K is an integer greater than or equal to 0; and determining the X first-category temporal candidate block vectors based on the K temporal block vectors for each of the at least one co-located image.
  • the value of K may be the same or different for different co-located images.
  • a zero time-domain block vector may be obtained for the first co-located image
  • a non-zero time-domain block vector may be obtained for the second co-located image
  • a non-zero time-domain block vector may be obtained for each of the first co-located image and the second co-located image.
  • the motion information of these reference positions does not include block vectors.
  • 0 time domain block vectors of the first co-located image can be obtained.
  • the reference positions in Table 3 are mostly the positions of the current block or the positions to the right, lower right, and upper bottom of the current block. Since these positions have not yet been encoded and decoded in the current image, the required information cannot be obtained.
  • the reference image in the time domain (specifically, the co-located image) has been encoded and decoded, and this information can be saved and obtained.
  • the reference position in the time domain can also be selected as a position in the current block, or in the upper left, upper, upper right, left, and lower left directions, without any limitation.
  • the first position index sequence may be the position index sequence in Table 3, such as 1, 2, 3, ..., 10, etc.
  • position index 1 is determined as the current reference position corresponding to the current position index.
  • H time-domain block vectors are determined based on the current reference position.
  • the reference position corresponding to position index 2 is determined as the current reference position.
  • the step of determining whether the current reference position satisfies the first condition is continued.
  • the reference position corresponding to position index 3 is determined as the current reference position. This process is repeated until the traversal of these 10 reference positions is completed, thereby obtaining K time-domain block vectors of the first co-located image.
  • the primary position in the current reference position meeting the first condition may include: the primary position in the current reference position being within the range of the first collocated image.
  • the secondary position in the current reference position meeting the first condition may include: the secondary position in the current reference position being within the range of the first collocated image.
  • the method may further include: when the current reference position does not meet the first condition, skipping the current reference position, determining the reference position corresponding to the next position index based on the first position index sequence, and using the reference position corresponding to the next position index as the current reference position, and continuing to execute the step of determining whether the current reference position meets the first condition.
  • the current reference position does not meet the first condition, which may include: the primary position in the current reference position does not meet the first condition and the secondary position in the current reference position does not meet the first condition.
  • the first condition can be to determine whether the main position or the secondary position is within the range of the co-located image, or the first condition can be to determine whether the main position or the secondary position is within the range of the co-located sub-image, slice, CTU, etc., without any limitation here.
  • the value of the variable H may be the same or different in different situations. Furthermore, if zero time-domain block vectors are obtained for the primary position in the current reference position, H time-domain block vectors may be further obtained based on the secondary position in the current reference position. If zero time-domain block vectors are also obtained for the secondary position, the current reference position is skipped, and the reference position corresponding to the next position index is determined based on the first position index sequence.
  • the reference position in the co-located image may include the 10 primary positions and 10 secondary positions in Table 3, and the primary positions are added in the order of position indexes 1 to 10.
  • the primary position does not meet the first condition (the primary position is not within the range of the co-located image, or other conditions may be met, such as not being within the range of the co-located sub-image, slice, CTU, etc.)
  • the corresponding secondary position is used to replace the primary position to determine the time domain block vector; if the secondary position also does not meet the first condition, the position index is skipped, and the primary position or secondary position of the next position index is directly added to determine one or more first-category time domain candidate block vectors.
  • a second-category temporal candidate block vector may also be determined in combination with the searched motion vector.
  • determining Y second-category temporal candidate block vectors based on at least one co-located image may include: determining I offset temporal block vectors for each of the at least one co-located image, where I is an integer greater than or equal to 0; and determining the Y second-category temporal candidate block vectors based on the I offset temporal block vectors for each of the at least one co-located image.
  • the value of I can be set to be equal to the value of Y.
  • the value of I may be the same or different for different co-located images.
  • a zero offset time-domain block vector may be obtained for the first co-located image
  • a non-zero offset time-domain block vector may be obtained for the second co-located image
  • a non-zero offset time-domain block vector may be obtained for each of the first co-located image and the second co-located image.
  • the first co-located image is any one of the at least one co-located image.
  • the method may include: determining a first motion vector for the first co-located image and determining one or more initial reference positions of a current block; offsetting the one or more initial reference positions based on the first motion vector to obtain one or more offset reference positions in the first co-located image; and determining the I offset time-domain block vectors for the first co-located image based on the one or more offset reference positions in the first co-located image.
  • the motion information of these offset reference positions does not include block vectors.
  • 0 offset time domain block vectors of the first co-located image can be obtained.
  • the order of the preset positions may be 0, 1, 2, 3, 4 as shown in FIG13 , and these five positions are spatially adjacent blocks of the current block.
  • the coordinates of these five positions in the current image are defined as shown in Table 4.
  • X2 and Y2 represent the horizontal coordinate and vertical coordinate of the upper left corner position of the current block in the current image
  • W and H represent the width and height of the current block.
  • the motion vector used for offset in the co-located image can also be obtained through other positions around the current block, and multiple motion vectors can also be found for a co-located image to guide the offset.
  • the method may further include: performing a correction operation on the motion vector of the current candidate position, and determining the corrected motion vector as the first motion vector of the first co-located image.
  • the motion vector of the current candidate position can be directly determined as the first motion vector of the first collocated image, or the motion vector of the current candidate position can be corrected and then determined as the first motion vector of the first collocated image.
  • the correction operation can be a rounding operation, the purpose of which is to avoid finding sub-pixel positions.
  • the current image has two co-located images: a first co-located image Frame0 and a second co-located image Frame1.
  • two motion vectors can be found, namely a first motion vector MV0' and a second motion vector MV1'.
  • MV0' and MV1' are first rounded (the purpose is to avoid finding sub-pixel positions) to obtain MV0 and MV1, so that one or more offset reference positions can be determined.
  • I offset time-domain block vectors are obtained.
  • the first co-located image finds motion vectors MV0 0 , MV0 1 , ..., then there should also be more offset reference positions at this time, and no limitation is made here.
  • X0 and Y0 represent the horizontal and vertical coordinates of the lower-right corner of the current block in the current image
  • X1 and Y1 represent the horizontal and vertical coordinates of the center of the current block in the current image
  • W and H represent the width and height of the current block.
  • MV0.X and MV0.Y represent the horizontal and vertical offsets of the integer motion vector corresponding to the first collocated image (Frame0)
  • MV1.X and MV1.Y represent the horizontal and vertical offsets of the integer motion vector corresponding to the second collocated image (Frame1).
  • determining I offset time domain block vectors for each of at least one co-located image based on one or more offset reference positions in a first co-located image and one or more offset reference positions in a second co-located image may include: determining a current offset reference position corresponding to a current position index; when the current offset reference position satisfies a second condition, determining J offset time domain block vectors based on the current offset reference position, where J is an integer greater than or equal to 0; determining an offset reference position corresponding to a next position index based on the second position index sequence, and using the offset reference position corresponding to the next position index as the current offset reference position, and continuing to execute the step of determining whether the current offset reference position satisfies the second condition until all offset reference positions are traversed, so as to obtain I offset time domain block vectors for each of at least one co-located image.
  • the second position index order may be the position index order in Table 5.
  • the method may further include: alternately setting one or more offset reference positions in the first collocated image and one or more offset reference positions in the second collocated image to determine the second position index order.
  • each offset reference position may include a primary position and a secondary position.
  • determining J offset time domain block vectors based on the current offset reference position may include:
  • the primary position in the current offset reference position meeting the second condition may include: the primary position in the current offset reference position being within the range of the first collocated image.
  • the secondary position in the current offset reference position meeting the second condition may include: the secondary position in the current offset reference position being within the range of the first collocated image.
  • the method may further include: when the current offset reference position does not meet the second condition, skipping the current offset reference position, determining the offset reference position corresponding to the next position index based on the second position index sequence, and using the offset reference position corresponding to the next position index as the current offset reference position, and continuing to execute the step of determining whether the current offset reference position meets the second condition.
  • the current offset reference position does not meet the second condition, which may include: the primary position in the current offset reference position does not meet the second condition and the secondary position in the current offset reference position does not meet the second condition.
  • the second condition can be to determine whether the main position or the secondary position is within the range of the same-position image, or the second condition can be to determine whether the main position or the secondary position is within the range of the same-position sub-image, slice, CTU, etc., without any limitation here.
  • the value of the variable J may be the same or different in different situations. Furthermore, if zero offset time-domain block vectors are obtained for the primary position in the current offset reference position, then J time-domain block vectors may be further obtained based on the secondary position in the current offset reference position. If zero offset time-domain block vectors are also obtained for the secondary position, then the current offset reference position is skipped, and then the offset reference position corresponding to the next position index is determined based on the first position index sequence.
  • the positions in Table 5 are respectively offset according to the first co-located image (Frame0) and the second co-located image (Frame1) by alternating the original 10 reference positions.
  • the primary positions can be added in the order of positions 1 to 20 in Table 5. If a similar primary position does not meet the second condition, the secondary position is used. If the secondary position also does not meet the second condition, the current position index is skipped and the primary position or secondary position of the next position index is directly added.
  • the second condition is the same as the first condition described above, and it can be determined whether the corresponding offset time domain block vector is determined according to the primary position or the secondary position, and then one or more second-category time domain candidate block vectors are determined.
  • one or more temporal candidate block vectors can be obtained accordingly.
  • corresponding motion information can be obtained from a reference position and/or offset reference position of at least one co-located image.
  • the motion information includes a block vector, a block flip type, whether illumination compensation is used, whether filtering is used, etc.
  • a block vector is then obtained based on the motion information obtained from the at least one co-located image. Exemplarily, if the current motion information includes one available block vector, then this block vector is obtained as the temporal candidate block vector; if the current motion information includes multiple available block vectors, then more than one block vector is obtained as the temporal candidate block vector.
  • the motion information contains several block vectors
  • several time-domain candidate block vectors can be obtained.
  • the reference position uses a prediction mode based on a non-block vector, then there may be 0 block vectors in the reference position, and the block vectors saved in the motion information may also be 0; if the reference position uses an IBC mode and it is an IBC weighted prediction mode, then there may be multiple (two) block vectors in the reference position, and the block vectors saved in the motion information may also be multiple. Otherwise, when the reference position uses an IntraTMP or non-weighted IBC prediction mode, there may be one block vector in the reference position, and the block vector saved in the motion information may also be one.
  • S1003 Construct a candidate merging list based on one or more time-domain candidate block vectors.
  • a candidate merge list may be constructed based on the one or more time-domain candidate block vectors.
  • the method may include:
  • S1502 Add one or more time-domain candidate block vectors to an initial merge list to obtain a candidate merge list.
  • the initial merge list is a merge list constructed according to related technologies.
  • the candidate block vectors included in the initial merge list may include block vectors at adjacent positions, block vectors at non-adjacent positions, block vectors based on historical information, and automatically relocated block vectors.
  • the adjacent positions and non-adjacent positions can refer to the adjacent and non-adjacent positions in FIG. 4 . If block vectors exist at these positions, they are determined to be block vectors at adjacent positions and block vectors at non-adjacent positions.
  • time-domain candidate block vectors may be added to the initial merge list. Furthermore, when adding time-domain candidate block vectors to the initial merge list, a duplicate check operation is required to avoid adding existing block vectors in the initial merge list to the initial merge list.
  • the method may further include: if a candidate identical to the current time-domain candidate block vector exists in the initial merged list, discarding the current time-domain candidate block vector; and if a candidate identical to the current time-domain candidate block vector does not exist in the initial merged list, adding the current time-domain candidate block vector to the initial merged list.
  • the resulting candidate merged list does not contain duplicate block vectors.
  • the first type of time domain candidate block vectors can be added first (in the order of the first position index), and then the second type of time domain candidate block vectors can be added (in the order of the second position index), and the addition is stopped until the initial merge list is filled.
  • the one or more time-domain candidate block vectors may include X first-category time-domain candidate block vectors and Y second-category time-domain candidate block vectors, where X and Y are both positive integers.
  • adding the one or more time-domain candidate block vectors to the initial merge list may include: adding the X first-category time-domain candidate block vectors to the initial merge list; and when the initial merge list is not full, continuing to add the Y second-category time-domain candidate block vectors to the initial merge list until the initial merge list is full.
  • adding one or more time-domain candidate block vectors to the initial merge list may include: adding N first-category time-domain candidate block vectors among X first-category time-domain candidate block vectors and M second-category time-domain candidate block vectors among Y second-category time-domain candidate block vectors to the initial merge list; wherein N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
  • the number of the first type of time domain candidate block vectors and the second type of time domain candidate block vectors added to the initial merge list can be set with an upper limit respectively or together, wherein the first threshold represents the upper limit of the number of the first type of time domain candidate block vectors added.
  • the second threshold represents the upper limit of the number of time-domain candidate block vectors of the second type to be added. Exemplarily, at most N time-domain candidate block vectors of the first type and M time-domain candidate block vectors of the second type are added to the initial merge list.
  • adding one or more time domain candidate block vectors to the initial merge list may include: adding P time domain candidate block vectors from the one or more time domain candidate block vectors to the initial merge list; wherein the P time domain candidate block vectors are composed of a first category of time domain candidate block vectors and a second category of time domain candidate block vectors, and P is an integer greater than 0 and less than or equal to a third threshold.
  • a total upper limit is set when adding time-domain candidate block vectors to the initial merge list, wherein the third threshold represents the total upper limit for adding first-category time-domain candidate block vectors and second-category time-domain candidate block vectors.
  • the third threshold represents the total upper limit for adding first-category time-domain candidate block vectors and second-category time-domain candidate block vectors.
  • a maximum of P time-domain candidate block vectors are added to the initial merge list, and the P time-domain candidate block vectors are composed of a number of first-category time-domain candidate block vectors and a number of second-category time-domain candidate block vectors.
  • a judgment condition for executing the present technical solution namely, a judgment condition for whether to add the temporal candidate block vector to the candidate merge list
  • the method can further include: determining a prediction mode for the current block; and when the prediction mode for the current block satisfies a preset condition, executing the step of determining at least one co-located image for the current block.
  • the prediction mode of the current block can be determined by decoding the bitstream. In some embodiments, if the prediction mode of the current block satisfies a preset condition, the prediction mode can be determined to use the Intra TMP mode for the current block and a candidate merge list is constructed for prediction; or the prediction mode can be determined to use the IBC mode for the current block and a candidate merge list is constructed for prediction.
  • this technical solution when the decoding end determines that the current block uses the IBC mode and needs to construct a merge list, or when it is determined that the current block uses the intraTMP mode and needs to construct a candidate merge list, this technical solution will apply a time-domain-based candidate block vector to supplement the constructed candidate merge list.
  • the method may further include: determining a video sequence to which the current block belongs; and when the video sequence is of the screen content category, performing the step of determining at least one co-located image of the current block. That is, in this embodiment of the present application, the time-domain-based candidate block vector may be used to supplement the constructed candidate merge list only when the video sequence is of the screen content category.
  • the method may further include: decoding the code stream, determining the value of the first syntax element; when the first syntax element indicates that the current block uses the time domain candidate block vector as a candidate for constructing a candidate merge list, executing the step of determining at least one co-located image of the current block.
  • the value of the first syntax element is the first value, then it can be determined that the first syntax element indicates that the current block uses the time domain candidate block vector as a candidate for constructing a candidate merge list; if the value of the first syntax element is the second value, then it can be determined that the first syntax element indicates that the current block does not use the time domain candidate block vector as a candidate for constructing a candidate merge list.
  • the first value is different from the second value.
  • the first value can be set to 1 and the second value can be set to 0; or the first value can be set to 0 and the second value can be set to 1; or the first value can be set to true and the second value can be set to false; or the first value can be set to false and the second value can be set to true.
  • whether the time-domain candidate block vector is added to the candidate merge list may be controlled by some syntax elements, which may be at the sequence level, frame level, slice level, or block level, etc.
  • the first decoded syntax element is enabled, the first type of time-domain candidate block vector and the second type of time-domain candidate block vector based on the time domain are added when constructing the candidate merge list.
  • the initial merge list of the IBC mode may include: block vectors of adjacent blocks, block vectors of non-adjacent blocks, block vectors based on historical information, and block vectors based on automatic repositioning, etc.; the initial merge list of the intraTMP mode may include: block vectors of adjacent blocks and block vectors of non-adjacent blocks.
  • the first type of time domain candidate block vectors and the second type of time domain candidate block vectors obtained above should be added to the candidate merging list in a certain order with the existing types of block vectors.
  • the first-category temporal candidate block vector and the second-category temporal candidate block vector should be added before the block vector based on automatic repositioning and after the block vector of the adjacent block.
  • the order can be:
  • Block vectors of adjacent blocks block vectors of non-adjacent blocks, first-category time-domain candidate block vectors, second-category time-domain candidate block vectors, block vectors based on historical information, block vectors based on automatic repositioning, etc.;
  • Block vectors of adjacent blocks first-category time-domain candidate block vectors, block vectors of non-adjacent blocks, second-category time-domain candidate block vectors, block vectors based on historical information, block vectors based on automatic repositioning, etc.;
  • the first type of time domain candidate block vector and the second type of time domain candidate block vector are The vector should be placed after the adjacent block vectors, and the order can be:
  • Block vectors of adjacent blocks first-category time-domain candidate block vectors, second-category time-domain candidate block vectors, block vectors of non-adjacent blocks, etc.;
  • Block vectors of adjacent blocks first-category time-domain candidate block vectors, block vectors of non-adjacent blocks, second-category time-domain candidate block vectors, etc.
  • the block vector based on automatic repositioning is also used to add to the candidate merge list of the IntraTMP mode.
  • the block vector based on automatic repositioning should be similarly added after the first type of time domain candidate block vector and the second type of time domain candidate block vector.
  • prediction can be performed based on the candidate merge list, and the reconstructed block of the current block can be further determined.
  • the method may further include: determining one or more target block vectors of the current block according to the candidate merge list, and determining a prediction block of the current block according to the one or more target block vectors of the current block.
  • one or more target block vectors of the current block are determined based on the candidate merge list.
  • the candidate merge list can be reordered based on the template error value of each candidate in the candidate merge list, and then combined with the block vector index obtained by decoding the code stream, so as to obtain one or more target block vectors.
  • a target block vector is obtained, then a reference block corresponding to the target block vector is determined, and a prediction block of the current block is determined based on the reference block; or, if at least two target block vectors are obtained, then at least two reference blocks corresponding to the at least two target block vectors are determined, and then a weighted operation is performed on the at least two reference blocks to determine the prediction block of the current block.
  • the method may further include: decoding a code stream to determine a residual block of a current block; and determining a reconstructed block of the current block according to the residual block of the current block and a predicted block of the current block.
  • an addition operation may be performed on the residual block of the current block and the prediction block of the current block to determine the reconstructed block of the current block, thereby realizing the reconstruction process of the current block.
  • An embodiment of the present application provides a decoding method that first determines at least one co-located image of a current block; then, based on the at least one co-located image, determines one or more time-domain candidate block vectors of the current block; and then, based on the one or more time-domain candidate block vectors, constructs a candidate merge list.
  • a decoding method that first determines at least one co-located image of a current block; then, based on the at least one co-located image, determines one or more time-domain candidate block vectors of the current block; and then, based on the one or more time-domain candidate block vectors, constructs a candidate merge list.
  • one or more time-domain candidate block vectors are considered as candidates in the candidate merge list. This not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list, such as the prediction effect of IBC and/or IntraTMP in the merge list mode, without introducing additional software and hardware implementation complexity,
  • FIG16 is a flow chart of a coding method provided in an embodiment of the present application. As shown in FIG16 , the method may include:
  • S1601 Determine at least one co-located image of the current block.
  • the encoding method of the embodiment of the present application is applied to the encoder.
  • the encoding method may specifically refer to a method for constructing a candidate merge list, and more specifically, a method for constructing a candidate merge list based on a time domain block vector.
  • the encoding method of the embodiment of the present application is mainly applicable to the intraTMP mode or IBC mode in the inter-frame prediction frame.
  • the candidate merge list it is possible to improve the situation where the candidate merge list cannot be filled according to the co-located image of the current block.
  • the current block can have one, two, or even more collocated images.
  • the current block can have two collocated images, such as a forward collocated image (Frame 0, reference image 0) preceding the current image and a backward collocated image (Frame 1, reference image 1) following the current image.
  • the current block is a block in the current image, and the reference position of the current block can be searched for in Frame 0 and Frame 1, respectively.
  • one or more corresponding co-located images can be determined based on the co-located image index in the bitstream.
  • the method may further include: determining a co-located image index for the current block based on at least one co-located image of the current block; encoding the co-located image index for the current block, and writing the resulting encoded bits into the bitstream.
  • the co-located image is a subset of the reference image, and the time domain motion vector MV/block vector BV can only be obtained from the co-located image.
  • each B-frame can have two reference image lists, List0 and List1.
  • the co-located image index specifically refers to whether the co-located image is in List0 or List1, so the co-located image index is the index value for obtaining List0 and List1.
  • an image can have more co-located images, or that more than one image in List0 and List1 can be a co-located image.
  • the co-located image index is used to indicate the position of the co-located image in the reference image list.
  • the current image includes the current block.
  • the current image may also have no co-located image.
  • the candidate merge list is still constructed according to the relevant technology.
  • there is a co-located image for the current image it can be determined that there may be one or more co-located images based on the co-located image index written into the bitstream by the encoding end.
  • the method may also include: if the number of indexes included in the co-located image index is one, then determining a co-located image of the current block; if the number of indexes included in the co-located image index is two, then determining the number of indexes of the current block. Two collocated images.
  • the current image to which the current block belongs if the current image has no co-located image index, then there is no co-located image for the current image, and the time domain candidate block vector of the current block cannot be further obtained; if the current image has only one co-located image index, then the current image has only one co-located image, and the time domain candidate block vector of the current block can be obtained from this one co-located image; if the current image has two co-located image indexes, then the current image has two co-located images, and the time domain candidate block vector of the current block can be obtained from these two co-located images; even more, if the current image has more than two co-located image indexes, then the current image has more than two co-located images, and the time domain candidate block vector of the current block can be obtained from these co-located images.
  • S1602 Determine one or more time-domain candidate block vectors of the current block according to at least one co-located image.
  • the reference position in the co-located image may be a block that is not predicted based on a block vector, so the motion information of the reference position does not include a block vector; even more, if all reference positions in the co-located image are blocks that are not predicted based on a block vector, then the motion information of these reference positions does not include a block vector, and at this time, 0 time domain block vector can be obtained based on the co-located image.
  • the value of K may be set equal to the value of X.
  • the first co-located image is any one of the at least one co-located image.
  • the method may include: determining one or more reference positions in the first co-located image; and determining K time-domain block vectors for the first co-located image based on the one or more reference positions.
  • the motion information of these reference positions does not include block vectors.
  • 0 time domain block vectors of the first co-located image can be obtained.
  • each co-located image there can be one or more reference positions, and the definitions of these reference positions are shown in the aforementioned Table 3.
  • X0 and Y0 represent the horizontal and vertical coordinates of the lower right corner of the current block in the current image
  • X1 and Y1 represent the horizontal and vertical coordinates of the lower right corner of the current block in the current image.
  • W and H represent the width and height of the current block.
  • the reference positions in Table 3 are mostly the positions of the current block or the positions to the right, lower right, and upper bottom of the current block. Since these positions have not yet been encoded and decoded in the current image, the required information cannot be obtained.
  • the reference image in the time domain (specifically, the co-located image) has been encoded and decoded, and this information can be saved and obtained.
  • the reference position in the time domain can also be selected as a position in the current block, or in the upper left, upper, upper right, left, and lower left directions, without any limitation.
  • determining K time domain block vectors of the first co-located image based on one or more reference positions may include: determining a current reference position corresponding to a current position index; when the current reference position satisfies a first condition, determining H time domain block vectors based on the current reference position, where H is an integer greater than or equal to 0; sequentially determining a reference position corresponding to a next position index based on the first position index, and using the reference position corresponding to the next position index as the current reference position, and continuing to execute the step of determining whether the current reference position satisfies the first condition until one or more reference positions are traversed, so as to obtain K time domain block vectors of the first co-located image.
  • H time-domain block vectors are determined based on the current reference position, for example, 0, 1, 2, or more time-domain block vectors may be determined. For example, if the current reference position uses a non-block-vector-based prediction mode, then there may be 0 time-domain block vectors; if the current reference position uses an IBC weighted prediction mode, then there may be multiple (two) time-domain block vectors; if the current reference position uses an IntraTMP or non-weighted IBC prediction mode, then there may be one time-domain block vector.
  • the first position index sequence may be the position index sequence in Table 3, such as 1, 2, 3, ..., 10, etc.
  • position index 1 is determined as the current reference position corresponding to the current position index.
  • H time-domain block vectors are determined based on the current reference position.
  • the reference position corresponding to position index 2 is determined as the current reference position.
  • the step of determining whether the current reference position satisfies the first condition is continued.
  • the reference position corresponding to position index 3 is determined as the current reference position. This process is repeated until the traversal of these 10 reference positions is completed, thereby obtaining K time-domain block vectors of the first co-located image.
  • each reference position may include a primary position and a secondary position.
  • determining H time-domain block vectors based on the current reference position may include: determining whether the primary position in the current reference position satisfies a first condition; when the primary position in the current reference position satisfies the first condition, determining H time-domain block vectors based on the primary position in the current reference position; when the primary position in the current reference position does not satisfy the first condition, determining whether the secondary position in the current reference position satisfies the first condition; when the secondary position in the current reference position satisfies the first condition, determining H time-domain block vectors based on the secondary position in the current reference position; when the primary position in the current reference position does not satisfy the first condition and the secondary position in the current reference position does not satisfy the first condition, skipping the current reference position and determining a reference position corresponding to a next position index based on the first position index sequence.
  • the primary position in the current reference position meeting the first condition may include: the primary position in the current reference position being within the range of the first collocated image.
  • the secondary position in the current reference position meeting the first condition may include: the secondary position in the current reference position being within the range of the first collocated image.
  • the method may further include: when the current reference position does not meet the first condition, skipping the current reference position, determining the reference position corresponding to the next position index based on the first position index sequence, and using the reference position corresponding to the next position index as the current reference position, and continuing to execute the step of determining whether the current reference position meets the first condition.
  • the current reference position does not meet the first condition, which may include: the primary position in the current reference position does not meet the first condition and the secondary position in the current reference position does not meet the first condition.
  • the first condition can be to determine whether the main position or the secondary position is within the range of the co-located image, or the first condition can be to determine whether the main position or the secondary position is within the range of the co-located sub-image, slice, CTU, etc., without any limitation here.
  • the value of the variable H may be the same or different in different situations. Furthermore, if zero time-domain block vectors are obtained for the primary position in the current reference position, H time-domain block vectors may be further obtained based on the secondary position in the current reference position. If zero time-domain block vectors are also obtained for the secondary position, the current reference position is skipped, and the reference position corresponding to the next position index is determined based on the first position index sequence.
  • the reference position in the co-located image may include the 10 primary positions and 10 secondary positions in Table 3, and the primary positions are added in the order of position indexes 1 to 10.
  • the primary position does not meet the first condition (the primary position is not within the range of the co-located image, or other conditions may be met, such as not being within the range of the co-located sub-image, slice, CTU, etc.)
  • the corresponding secondary position is used to replace the primary position to determine the time domain block vector; if the secondary position also does not meet the first condition, the position index is skipped, and the primary position or secondary position of the next position index is directly added to determine one or more first-category time domain candidate block vectors.
  • the second type of temporal candidate block vector in addition to determining the first type of temporal candidate block vector according to the reference position in Table 3, can also be determined in combination with the searched motion vector.
  • Y temporal candidate block vectors are determined based on at least one co-located image.
  • the second type of time domain candidate block vectors may include: determining I offset time domain block vectors for each of at least one co-located image, where I is an integer greater than or equal to 0; and determining Y second type of time domain candidate block vectors based on the I offset time domain block vectors for each of at least one co-located image.
  • the value of I can be set to be equal to the value of Y.
  • the value of I may be the same or different for different co-located images.
  • a zero offset time-domain block vector may be obtained for the first co-located image
  • a non-zero offset time-domain block vector may be obtained for the second co-located image
  • a non-zero offset time-domain block vector may be obtained for each of the first co-located image and the second co-located image.
  • the first co-located image is any one of the at least one co-located image.
  • the method may include: determining a first motion vector for the first co-located image and determining one or more initial reference positions of a current block; offsetting the one or more initial reference positions based on the first motion vector to obtain one or more offset reference positions in the first co-located image; and determining the I offset time-domain block vectors for the first co-located image based on the one or more offset reference positions in the first co-located image.
  • the first co-located image finds motion vectors MV0 0 , MV0 1 , ..., then there should also be more offset reference positions at this time, and no limitation is made here.
  • determining I offset time domain block vectors for each of at least one co-located image based on one or more offset reference positions in a first co-located image and one or more offset reference positions in a second co-located image may include: determining a current offset reference position corresponding to a current position index; when the current offset reference position satisfies a second condition, determining J offset time domain block vectors based on the current offset reference position, where J is an integer greater than or equal to 0; determining an offset reference position corresponding to a next position index based on the second position index sequence, and using the offset reference position corresponding to the next position index as the current offset reference position, and continuing to execute the step of determining whether the current offset reference position satisfies the second condition until all offset reference positions are traversed, so as to obtain I offset time domain block vectors for each of at least one co-located image.
  • the second position index order may be the position index order in Table 5.
  • the method may further include: alternately setting one or more offset reference positions in the first collocated image and one or more offset reference positions in the second collocated image to determine the second position index order.
  • J offset time domain block vectors are determined based on the current offset reference position, for example, 0, 1, 2, or more offset time domain block vectors may be determined. For example, if the current offset reference position uses a non-block vector-based prediction mode, then there may be 0 offset time domain block vectors; if the current offset reference position uses an IBC weighted prediction mode, then there may be multiple (two) offset time domain block vectors; if the current offset reference position uses an IntraTMP or non-weighted IBC prediction mode, then there may be one offset time domain block vector.
  • the primary position in the current offset reference position meeting the second condition may include: the primary position in the current offset reference position being within the range of the first collocated image.
  • the secondary position in the current offset reference position meeting the second condition may include: the secondary position in the current offset reference position being within the range of the first collocated image.
  • the method may further include: when the current offset reference position does not meet the second condition, skipping the current offset reference position, determining the offset reference position corresponding to the next position index based on the second position index sequence, and using the offset reference position corresponding to the next position index as the current offset reference position, and continuing to execute the step of determining whether the current offset reference position meets the second condition.
  • the second condition can be to determine whether the main position or the secondary position is within the range of the same-position image, or the second condition can be to determine whether the main position or the secondary position is within the range of the same-position sub-image, slice, CTU, etc., without any limitation here.
  • the value of the variable J may be the same or different in different situations. Furthermore, if zero offset time-domain block vectors are obtained for the primary position in the current offset reference position, then J time-domain block vectors may be further obtained based on the secondary position in the current offset reference position. If zero offset time-domain block vectors are also obtained for the secondary position, then the current offset reference position is skipped, and then the offset reference position corresponding to the next position index is determined based on the first position index sequence.
  • the motion information contains several block vectors
  • several time-domain candidate block vectors can be obtained.
  • the reference position uses a prediction mode based on a non-block vector, then there may be 0 block vectors in the reference position, and the block vectors saved in the motion information may also be 0; if the reference position uses an IBC mode and it is an IBC weighted prediction mode, then there may be multiple (two) block vectors in the reference position, and the block vectors saved in the motion information may also be multiple. Otherwise, when the reference position uses an IntraTMP or non-weighted IBC prediction mode, there may be one block vector in the reference position, and the block vector saved in the motion information may also be one.
  • S1603 Construct a candidate merge list based on one or more time-domain candidate block vectors.
  • a candidate merge list is constructed based on one or more time domain candidate block vectors.
  • the method may include: determining an initial merge list for the current block; adding one or more time domain candidate block vectors to the initial merge list to obtain a candidate merge list.
  • the initial merge list is a merge list constructed according to related technologies.
  • the candidate block vectors included in the initial merge list may include block vectors at adjacent positions, block vectors at non-adjacent positions, block vectors based on historical information, and automatically relocated block vectors.
  • the adjacent positions and non-adjacent positions can refer to the adjacent and non-adjacent positions in FIG. 4 . If block vectors exist at these positions, they are determined to be block vectors at adjacent positions and block vectors at non-adjacent positions.
  • time-domain candidate block vectors may be added to the initial merge list. Furthermore, when adding time-domain candidate block vectors to the initial merge list, a duplicate check operation is required to avoid adding existing block vectors in the initial merge list to the initial merge list.
  • the first type of time domain candidate block vectors can be added first (in the order of the first position index), and then the second type of time domain candidate block vectors can be added (in the order of the second position index), and the addition is stopped until the initial merge list is filled.
  • the one or more time-domain candidate block vectors may include X first-category time-domain candidate block vectors and Y second-category time-domain candidate block vectors, where X and Y are both positive integers.
  • adding the one or more time-domain candidate block vectors to the initial merge list may include: adding the X first-category time-domain candidate block vectors to the initial merge list; and when the initial merge list is not full, continuing to add the Y second-category time-domain candidate block vectors to the initial merge list until the initial merge list is full.
  • adding one or more time-domain candidate block vectors to the initial merge list may include: adding N first-category time-domain candidate block vectors among X first-category time-domain candidate block vectors and M second-category time-domain candidate block vectors among Y second-category time-domain candidate block vectors to the initial merge list; wherein N is an integer greater than 0 and less than or equal to a first threshold, and M is an integer greater than 0 and less than or equal to a second threshold.
  • the number of first-category time-domain candidate block vectors and second-category time-domain candidate block vectors added to the initial merge list can be individually or jointly capped, wherein the first threshold represents the upper limit for the number of first-category time-domain candidate block vectors added, and the second threshold represents the upper limit for the number of second-category time-domain candidate block vectors added.
  • the first threshold represents the upper limit for the number of first-category time-domain candidate block vectors added
  • the second threshold represents the upper limit for the number of second-category time-domain candidate block vectors added.
  • a maximum of N first-category time-domain candidate block vectors and M second-category time-domain candidate block vectors are added to the initial merge list.
  • a total upper limit is set when adding time-domain candidate block vectors to the initial merge list, wherein the third threshold represents the total upper limit for adding first-category time-domain candidate block vectors and second-category time-domain candidate block vectors.
  • the third threshold represents the total upper limit for adding first-category time-domain candidate block vectors and second-category time-domain candidate block vectors.
  • a maximum of P time-domain candidate block vectors are added to the initial merge list, and the P time-domain candidate block vectors are composed of a number of first-category time-domain candidate block vectors and a number of second-category time-domain candidate block vectors.
  • a judgment condition for executing the present technical solution can also be set, that is, a judgment condition for whether to add the time domain candidate block vector to the candidate merge list.
  • the method can also include: determining the current block Prediction mode; when the prediction mode of the current block meets a preset condition, executing the step of determining at least one co-located image of the current block.
  • the encoder may encode the prediction mode for the current block into the bitstream, so that the decoder can subsequently determine the prediction mode for the current block simply by decoding the bitstream.
  • the prediction mode may be determined to use the Intra TMP mode for the current block and a candidate merge list is constructed for prediction; or the prediction mode may be determined to use the IBC mode for the current block and a candidate merge list is constructed for prediction.
  • this technical solution when the encoding end determines that the current block uses the IBC mode and needs to construct a merge list, or when it determines that the current block uses the intraTMP mode and needs to construct a candidate merge list, this technical solution will apply a time-domain-based candidate block vector to supplement the constructed candidate merge list.
  • the method may further include: determining a video sequence to which the current block belongs; and when the video sequence is of the screen content category, performing the step of determining at least one co-located image of the current block. That is, in this embodiment of the present application, the time-domain-based candidate block vector may be used to supplement the constructed candidate merge list only when the video sequence is of the screen content category.
  • the method may further include: when the current block uses the time-domain candidate block vector as a candidate for constructing a candidate merge list, executing the step of determining at least one co-located image of the current block.
  • the method may further include: determining a value of a first syntax element; encoding the value of the first syntax element, and writing the obtained coded bits into a bitstream.
  • the first syntax element may be used to indicate whether the current block uses the time-domain candidate block vector as a candidate for constructing a candidate merge list. If the current block uses the time-domain candidate block vector as a candidate for constructing a candidate merge list, then the value of the first syntax element may be determined to be a first value; if the current block does not use the time-domain candidate block vector as a candidate for constructing a candidate merge list, then the value of the first syntax element may be determined to be a second value.
  • the first value is different from the second value.
  • the first value can be set to 1 and the second value can be set to 0; or the first value can be set to 0 and the second value can be set to 1; or the first value can be set to true and the second value can be set to false; or the first value can be set to false and the second value can be set to true.
  • the first value is 1 and the second value is 0, if the time domain candidate block vector is used as a candidate for constructing a candidate merge list in the current block, the value of the first syntax element 1 can be encoded into the bitstream; if the time domain candidate block vector is not used as a candidate for constructing a candidate merge list in the current block, the value of the first syntax element 0 can be encoded into the bitstream.
  • whether the time-domain candidate block vector is added to the candidate merge list can be controlled by some syntax elements, which can be sequence-level, frame-level, slice-level, or block-level.
  • some syntax elements which can be sequence-level, frame-level, slice-level, or block-level.
  • the subsequent decoding end adds the first-category time-domain candidate block vector and the second-category time-domain candidate block vector based on the time domain when constructing the candidate merge list. Otherwise, the first-category time-domain candidate block vector and the second-category time-domain candidate block vector based on the time domain will not be added.
  • the initial merge list of the IBC mode may include: block vectors of adjacent blocks, block vectors of non-adjacent blocks, block vectors based on historical information, and block vectors based on automatic repositioning, etc.; the initial merge list of the intraTMP mode may include: block vectors of adjacent blocks and block vectors of non-adjacent blocks.
  • the first type of time domain candidate block vectors and the second type of time domain candidate block vectors obtained above should be added to the candidate merging list in a certain order with the existing types of block vectors.
  • a target block vector is obtained, then a reference block corresponding to the target block vector is determined, and the prediction block of the current block is determined based on the reference block; or, if at least two target block vectors are obtained, then at least two reference blocks corresponding to the at least two target block vectors are determined, and then a weighted operation is performed on the at least two reference blocks to determine the prediction block of the current block.
  • S1702 Encode the residual block of the current block and write the obtained coded bits into a bitstream.
  • determining the residual block of the current block may include: determining an initial block of the current block; and determining the residual block of the current block based on the initial block of the current block and a predicted block of the current block.
  • the residual block of the current block may be determined by performing a subtraction operation on the initial block of the current block and the predicted block of the current block.
  • the embodiments of the present application provide a bitstream that is generated by bit-coding based on information to be coded.
  • the information to be coded includes at least one of the following: a residual value of a current block, a co-located image index of the current block, and a value of a first syntax element; the first syntax element is used to indicate whether the current block uses a time-domain candidate block vector as a candidate for constructing a candidate merge list.
  • An embodiment of the present application provides an encoding method, which first determines at least one co-located image of a current block; then, based on the at least one co-located image, determines one or more time-domain candidate block vectors of the current block; and then, based on the one or more time-domain candidate block vectors, constructs a candidate merge list.
  • one or more time-domain candidate block vectors are considered as candidates in the candidate merge list, which not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list, such as the prediction effect of IBC and/or IntraTMP in the merge list mode, without bringing additional software and hardware implementation complexity, thereby improving encoding and decoding efficiency.
  • the technical solution of the embodiment of the present application is located in the intraTMP mode or IBC mode in the inter-frame prediction frame in the entire encoding and decoding framework.
  • the present technical solution will apply the time domain-based candidate block vector to supplement the constructed candidate merge list, that is, to fill the IBC merge list or the IntraTmp merge list.
  • the present solution when the decoder determines that the current block uses the IBC mode and needs to construct a candidate merge list, or determines that the current block uses the intraTMP mode and needs to construct a candidate merge list, the present solution will apply a time-domain-based block vector to supplement the constructed candidate merge list, that is, to fill the IBC merge list or the IntraTmp merge list.
  • each frame image/each coding unit stores the motion information of the image/block in the motion information cache after encoding and decoding.
  • the motion information includes the following parts:
  • the motion information should include information such as motion vector
  • the motion information should include: block vector, block flip type, whether illumination compensation is used, whether filtering is used, etc.
  • IBC may be a weighted mode, in which case there may be multiple (two) block vectors, so the block vectors stored in the motion information may also be multiple.
  • Step 1 Find the cache storing the motion information of the co-located image according to the index of the co-located image
  • Step 2 obtaining motion information from the motion information cache according to the reference position information
  • Step three determine whether the motion information includes a block vector; if so, obtain the block vector.
  • the block vector obtained in the time domain may include the following features:
  • Feature A The block vector in the time domain can be obtained from the collocated picture.
  • the index of the collocated picture encoded into or parsed from the bitstream can be used to determine whether there are one or more collocated pictures (corresponding to the collocated pictures in step 1):
  • block vectors are further obtained from one or more frames of these co-located images.
  • one inter-frame has two co-located frames
  • the block vector can be obtained from only one of the co-located frames, or can also be obtained from both co-located frames.
  • a corresponding co-located image is obtained, and the number of co-located images of the current image is determined to be one or two based on the syntax elements parsed from the code stream: (1) If there is one, a time domain block vector is obtained from the one co-located image; (2) If there are two, a time domain block vector is obtained from both co-located images.
  • the present technical solution can search for block vectors based on a reference position from more than or equal to one co-located frame.
  • Feature B Obtain block vectors at one or more reference positions in the collocated image, such as the reference positions defined in Table 3 (corresponding to the reference positions in the collocated image in step 2):
  • X0 and Y0 represent the horizontal and vertical coordinates of the lower-right corner of the current block in the current image
  • X1 and Y1 represent the horizontal and vertical coordinates of the center of the current block in the current image
  • W and H represent the width and height of the current block.
  • temporal reference positions are mostly the positions of the current block or positions to the right, lower right, or above and below the current block. This is because these positions have not yet been coded or decoded within the current image, so the required information cannot be obtained. However, for the temporal reference image, the co-located image has already been coded and decoded, so this information can be stored and obtained.
  • the temporal position can also be selected as a position within the current block, or in the upper left, upper, upper right, left, or lower left directions.
  • the reference positions in the collocated image may include the 10 primary positions and 10 secondary positions in Table 3, and the primary positions are added sequentially according to position indexes 1 to 10.
  • the primary position does not meet the conditions (the primary position is not within the range of the collocated image, and the conditions here can also be other conditions such as not being within the range of the collocated sub-image, slice, CTU, etc.)
  • the corresponding secondary position is used to replace the primary position; if the secondary position also does not meet the conditions, the position index is skipped and the primary or secondary position of the next position index is directly added.
  • the motion vectors of the five positions around the current block in FIG. 13 and the reference image indexes pointed to by the motion vectors are found in the order of indexes 0-4.
  • the coordinates of these five positions in the current image are shown in Table 4.
  • the offset motion vector in the co-located image may be obtained by obtaining it from other positions around the current block. For one co-located image, multiple offset motion vectors may be found to guide the offset.
  • the reference position is offset based on the MV of the found collocated image. For example, if the current image has two collocated images, Frame0 and Frame1, and the two motion vectors found are MV0' and MV1', then MV0' and MV1' are first rounded (to avoid finding sub-pixel positions) to obtain MV0 and MV1. Then, according to the order in Table 5, the reference position in the corresponding collocated image is checked to see if it contains a block vector.
  • Feature C When the motion information obtained from the co-located image contains one or more block vectors (corresponding to the block vector obtained in step 3):
  • the motion information may include several block vectors, and then several block vectors are obtained. Specifically, if the motion information includes multiple block vectors, then greater than or equal to one block vector can be added as the time domain block vector.
  • the number of time domain block vectors and offset time domain block vectors can be set with an upper limit separately or together, for example, a maximum of N time domain block vectors, M offset time domain block vectors, or a maximum of P time domain and offset time domain block vectors in total;
  • the time domain block vector and the offset time domain block vector can be added only when the video sequence is of screen content type. Whether the time domain and offset time domain block vectors are added to the candidate merge list can be controlled by some syntax elements. These syntax elements can be sequence level, frame level, slice level or block level. When the encoding and decoding syntax elements are enabled, the time domain and offset time domain block vectors can be added when constructing the candidate merge list.
  • the initial merge list includes:
  • the aforementioned time domain block vectors and offset time domain block vectors should be added to the initial merge list in a certain order with the existing type of block vectors to obtain a candidate merge list.
  • Block vectors of adjacent blocks block vectors of non-adjacent blocks, block vectors based on historical information, first-category time-domain candidate block vectors, second-category time-domain candidate block vectors, block vectors based on automatic repositioning, etc.
  • Block vectors of adjacent blocks block vectors of non-adjacent blocks, first-category time-domain candidate block vectors, second-category time-domain candidate block vectors, etc.;
  • Block vectors of adjacent blocks first-category time-domain candidate block vectors, second-category time-domain candidate block vectors, block vectors of non-adjacent blocks, etc.;
  • Block vectors of adjacent blocks first-category time-domain candidate block vectors, block vectors of non-adjacent blocks, second-category time-domain candidate block vectors, etc.
  • the block vector based on automatic repositioning is also used to add to the candidate merge list of IntraTMP.
  • the block vector based on automatic repositioning should be similarly added after the time domain and offset time domain block vectors.
  • time-domain block vectors and offset time-domain block vectors as new types of block vector candidates can effectively reduce the situation where the merge list cannot be filled, and can improve the IBC and IntraTMP prediction effects in the merge list mode without introducing additional software and hardware implementation complexity.
  • a maximum of 8 time-domain block vectors and offset time-domain block vectors are used for the IBC Merge list.
  • the list is constructed in the order of block vectors of adjacent blocks, block vectors of non-adjacent blocks, time-domain block vectors, offset time-domain block vectors, block vectors based on historical information, and block vectors based on automatic repositioning. The following test results can be obtained.
  • the embodiment of the present application provides a method for constructing a candidate merge list based on a time domain candidate block vector.
  • the specific implementation of the aforementioned embodiment is described in detail through the above embodiment. It can be seen that according to the technical solution of the aforementioned embodiment, it is proposed here to use the time domain block vector and the offset time domain block vector as candidates for filling the candidate merge list; for the time domain and offset time domain candidate block vectors, it is possible to select from greater than or equal is obtained in a co-located image; when the motion information found based on the time domain includes multiple block vectors, more than or equal to one block vector can be obtained; for the number of time domain block vectors and offset time domain block vectors, the upper limit can be set separately or together when filling the candidate merge list; for time domain block vectors and offset time domain block vectors, whether to add the candidate merge list as a candidate can be determined based on the encoding/decoding syntax elements; in addition, for time domain block vectors and offset time domain block vectors, whether to add the candidate
  • one or more time domain candidate block vectors are considered as candidates in the candidate merge list, it can not only effectively reduce the situation where the candidate merge list cannot be filled, but also improve the prediction accuracy under the candidate merge list, such as the prediction effect of IBC and/or IntraTMP in the merge list mode, without bringing additional software and hardware implementation complexity, thereby improving the encoding and decoding efficiency.
  • FIG18 is a schematic diagram of the composition structure of an encoder provided in an embodiment of the present application.
  • the encoder 180 may include a first determining unit 1801 and a first constructing unit 1802, wherein:
  • the first determining unit 1801 is configured to determine at least one co-located image of the current block; and determine one or more time-domain candidate block vectors of the current block based on the at least one co-located image;
  • the first constructing unit 1802 is configured to construct a candidate merging list based on one or more time-domain candidate block vectors.
  • the first determination unit 1801 is further configured to determine X first-category time-domain candidate block vectors based on at least one co-located image; and determine one or more time-domain candidate block vectors for the current block based on the X first-category time-domain candidate block vectors; where X is a positive integer.
  • the first determination unit 1801 is further configured to determine Y second-category time-domain candidate block vectors based on at least one co-located image; and determine one or more time-domain candidate block vectors of the current block based on the Y second-category time-domain candidate block vectors; wherein Y is a positive integer.
  • the first determining unit 1801 is further configured to determine K time-domain block vectors for each of at least one co-located image, where K is an integer greater than or equal to 0; and determine X first-category time-domain candidate block vectors based on the K time-domain block vectors for each of the at least one co-located image.
  • the first determination unit 1801 is further configured to determine one or more reference positions in the first co-located image; and determine K time domain block vectors of the first co-located image based on the one or more reference positions; wherein the first co-located image is any one of the at least one co-located image.
  • the first determination unit 1801 is further configured to determine a current reference position corresponding to a current position index; when the current reference position satisfies a first condition, determine H time domain block vectors according to the current reference position, where H is an integer greater than or equal to 0; and sequentially determine a reference position corresponding to a next position index based on the first position index, and use the reference position corresponding to the next position index as the current reference position, and continue to execute the step of determining whether the current reference position satisfies the first condition until one or more reference positions are traversed to obtain K time domain block vectors of the first co-located image.
  • the encoder 180 further includes a first judgment unit 1803 configured to judge whether the primary position in the current reference position satisfies the first condition; the first determination unit 1801 is further configured to determine H time domain block vectors according to the primary position in the current reference position when the primary position in the current reference position satisfies the first condition; the first judgment unit 1803 is further configured to judge whether the secondary position in the current reference position satisfies the first condition when the primary position in the current reference position does not satisfy the first condition; the first determination unit 1801 is further configured to determine H time domain block vectors according to the secondary position in the current reference position when the secondary position in the current reference position satisfies the first condition.
  • the primary position in the current reference position satisfies the first condition, including: the primary position in the current reference position is within the range of the first co-located image; and the secondary position in the current reference position satisfies the first condition, including: the secondary position in the current reference position is within the range of the first co-located image.
  • the first determination unit 1801 is further configured to skip the current reference position when the current reference position does not meet the first condition, determine the reference position corresponding to the next position index based on the first position index sequence, and use the reference position corresponding to the next position index as the current reference position, and continue to execute the step of determining whether the current reference position meets the first condition; wherein, the current reference position does not meet the first condition, including: the primary position in the current reference position does not meet the first condition and the secondary position in the current reference position does not meet the first condition.
  • the first determination unit 1801 is further configured to determine I offset time domain block vectors for each of at least one co-located image, where I is an integer greater than or equal to 0; and determine Y second-category time domain candidate block vectors based on the I offset time domain block vectors for each of at least one co-located image.
  • the first determination unit 1801 is further configured to determine a first motion vector of the first co-located image, and determine one or more initial reference positions of the current block; offset the one or more initial reference positions according to the first motion vector to obtain one or more offset reference positions in the first co-located image; and determine I offset time domain block vectors of the first co-located image based on the one or more offset reference positions in the first co-located image; wherein the first co-located image is any one of the at least one co-located image.
  • the first determination unit 1801 is further configured to determine the motion vectors of each of multiple candidate positions around the current block and the reference image index pointed to by the motion vector; and determine the current candidate position among the multiple candidate positions based on a preset position order, and according to the current reference image index pointed to by the motion vector of the current candidate position, when the reference image indicated by the current reference image index is the first co-located image, determine the motion vector of the current candidate position as the first motion vector of the first co-located image.
  • the first determining unit 1801 is further configured to perform a correction operation on the motion vector of the current candidate position, and determine the corrected motion vector as the first motion vector of the first co-located image.
  • the first determination unit 1801 is further configured to determine a current offset reference position corresponding to a current position index; when the current offset reference position satisfies a second condition, determine J offset time domain block vectors according to the current offset reference position, where J is an integer greater than or equal to 0; and sequentially determine an offset reference position corresponding to a next position index based on the second position index, and use the offset reference position corresponding to the next position index as the current offset reference position, and continue to execute the step of determining whether the current offset reference position satisfies the second condition until all offset reference positions are traversed, so as to obtain I offset time domain block vectors for each of at least one co-located image.
  • the first determining unit 1801 is further configured to alternately set one or more offset reference positions in the first collocated image and one or more offset reference positions in the second collocated image to determine a second position index order.
  • the first determination unit 1801 is further configured to skip the current offset reference position when the current offset reference position does not meet the second condition, determine the offset reference position corresponding to the next position index based on the second position index sequence, and use the offset reference position corresponding to the next position index as the current offset reference position, and continue to execute the step of determining whether the current offset reference position meets the second condition; wherein, the current offset reference position does not meet the second condition, including: the primary position in the current offset reference position does not meet the second condition and the secondary position in the current offset reference position does not meet the second condition.
  • the first determining unit 1801 is further configured to determine an initial merge list of the current block; and add one or more time-domain candidate block vectors to the initial merge list to obtain a candidate merge list.
  • the first determination unit 1801 is further configured to discard the current time domain candidate block vector if there is a candidate item identical to the current time domain candidate block vector in the initial merge list; and add the current time domain candidate block vector to the initial merge list if there is no candidate item identical to the current time domain candidate block vector in the initial merge list.
  • the one or more time-domain candidate block vectors include X first-category time-domain candidate block vectors and Y second-category time-domain candidate block vectors, where X and Y are both positive integers; the first determining unit 1801 is further configured to add the X first-category time-domain candidate block vectors to an initial merge list; and when the initial merge list is not full, continue to add the Y second-category time-domain candidate block vectors to the initial merge list until the initial merge list is full.
  • the first determination unit 1801 is further configured to add N first-category time-domain candidate block vectors among the X first-category time-domain candidate block vectors and M second-category time-domain candidate block vectors among the Y second-category time-domain candidate block vectors to the initial merge list; wherein N is an integer greater than 0 and less than or equal to the first threshold, and M is an integer greater than 0 and less than or equal to the second threshold.
  • the first determination unit 1801 is further configured to add P time domain candidate block vectors from one or more time domain candidate block vectors to the initial merge list; wherein the P time domain candidate block vectors are composed of a first type of time domain candidate block vector and a second type of time domain candidate block vector, and P is an integer greater than 0 and less than or equal to a third threshold.
  • the first determining unit 1801 is further configured to determine a prediction mode of the current block; and when the prediction mode of the current block meets a preset condition, perform the step of determining at least one co-located image of the current block.
  • the first determining unit 1801 is further configured to determine a video sequence to which the current block belongs; and when the video sequence is a screen content category, perform the step of determining at least one co-located image of the current block.
  • the encoder 180 further includes an encoding unit 1804, wherein: the first determination unit 1801 is further configured to determine a value of a first syntax element; wherein the first syntax element is used to indicate whether the current block uses a time-domain candidate block vector as a candidate for constructing a candidate merge list; and the encoding unit 1804 is configured to perform encoding processing on the value of the first syntax element and write the obtained encoded bits into the bitstream.
  • the first determination unit 1801 is further configured to determine a co-located image index of the current block based on at least one co-located image of the current block; the encoding unit 1804 is further configured to encode the co-located image index of the current block and write the obtained encoded bits into the bitstream.
  • the first determination unit 1801 is further configured to determine one or more target block vectors of the current block based on the candidate merge list; determine the prediction block of the current block based on the one or more target block vectors of the current block; and determine the residual block of the current block based on the prediction block of the current block.
  • the encoding unit 1804 is further configured to perform encoding processing on the residual block of the current block and write the obtained encoding bits into the bitstream.
  • a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular.
  • the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.
  • FIG19 is a schematic diagram of the specific hardware structure of an encoder provided in an embodiment of the present application.
  • the encoder 180 may include: a first communication interface 1901, a first memory 1902, and a first processor 1903; each component is coupled together through a first bus system 1904.
  • the first bus system 1904 is used to realize the connection and communication between these components.
  • the first bus system 1904 also includes a power bus, a control bus, and a status signal bus.
  • various buses are labeled as the first bus system 1904 in FIG19. Among them,
  • the first communication interface 1901 is used to receive and send signals when sending and receiving information with other external network elements;
  • a first memory 1902 is used to store computer programs that can be run on the first processor 1903;
  • the first processor 1903 is configured to, when running the computer program, execute:
  • the first memory 1902 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
  • the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory can be a random access memory (RAM), which is used as an external cache.
  • RAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate synchronous DRAM
  • ESDRAM enhanced synchronous DRAM
  • SLDRAM synchronous link DRAM
  • DRRAM direct RAM
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly reflected as the execution of a hardware decoding processor, or a decoding processor can be used.
  • the software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc.
  • the storage medium is located in the first memory 1902.
  • the first processor 1903 reads the information in the first memory 1902 and, in conjunction with its hardware, completes the steps of the above method.
  • the embodiments described in this application can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or a combination thereof.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGAs field programmable gate arrays
  • the technology described in this application can be implemented by modules (such as processes, functions, etc.) that perform the functions described in this application.
  • the software code can be stored in a memory and executed by a processor.
  • the memory can be implemented in the processor or outside the processor.
  • the first processor 1903 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
  • This embodiment provides an encoder, in which, when constructing a candidate merge list, one or more time-domain candidate block vectors are considered as candidates in the candidate merge list. This not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list, such as the prediction effect of IBC and/or IntraTMP in the merge list mode, without bringing additional software and hardware implementation complexity, thereby improving the encoding and decoding efficiency.
  • FIG20 is a schematic diagram of the composition structure of a decoder provided in an embodiment of the present application.
  • the decoder 200 may include a second determining unit 2001 and a second constructing unit 2002, wherein:
  • the second determining unit 2001 is configured to determine at least one co-located image of the current block; and determine one or more time-domain candidate block vectors of the current block based on the at least one co-located image;
  • the second constructing unit 2002 is configured to construct a candidate merging list based on one or more time-domain candidate block vectors.
  • the decoder 200 further includes a decoding unit 2003 configured to decode the code stream and determine a co-located image index of the current block; and a second determining unit 2001 further configured to determine at least one co-located image of the current block based on the co-located image index.
  • the second determining unit 2001 is further configured to determine one co-located image of the current block if the number of indexes included in the co-located image index is one; and to determine two co-located images of the current block if the number of indexes included in the co-located image index is two.
  • the second determination unit 2001 is further configured to determine X first-category time-domain candidate block vectors based on at least one co-located image; and determine one or more time-domain candidate block vectors of the current block based on the X first-category time-domain candidate block vectors; where X is a positive integer.
  • the second determination unit 2001 is further configured to determine, based on at least one co-located image, X first-category time-domain candidate block vectors and Y second-category time-domain candidate block vectors; and determine, based on the X first-category time-domain candidate block vectors and the Y second-category time-domain candidate block vectors, one or more time-domain candidate block vectors for the current block; wherein X and Y are both positive integers.
  • the second determination unit 2001 is further configured to determine K time-domain block vectors for each of at least one co-located image, where K is an integer greater than or equal to 0; and determine X first-category time-domain candidate block vectors based on the K time-domain block vectors for each of the at least one co-located image.
  • the second determination unit 2001 is further configured to determine one or more reference positions in the first co-located image; and determine K time domain block vectors of the first co-located image based on the one or more reference positions; wherein the first co-located image is any one of the at least one co-located image.
  • the second determination unit 2001 is further configured to determine a current reference position corresponding to the current position index; when the current reference position satisfies the first condition, determine H time domain block vectors based on the current reference position, where H is an integer greater than or equal to 0; and determine the reference position corresponding to the next position index based on the first position index sequence, and use the reference position corresponding to the next position index as the current reference position, and continue to execute the step of determining whether the current reference position satisfies the first condition until one or more reference positions are traversed to obtain K time domain block vectors of the first co-located image.
  • the reference position includes a primary position and a secondary position; referring to FIG20 , the decoder 200 further includes a second judgment unit 2004, configured to judge whether the primary position in the current reference position satisfies the first condition; the second determination unit 2001 is further configured to determine H time domain block vectors according to the primary position in the current reference position when the primary position in the current reference position satisfies the first condition; the second judgment unit 2004 is further configured to judge whether the secondary position in the current reference position satisfies the first condition when the primary position in the current reference position does not satisfy the first condition; the second determination unit 2001 is further configured to determine H time domain block vectors according to the secondary position in the current reference position when the secondary position in the current reference position satisfies the first condition.
  • the primary position in the current reference position satisfies the first condition, including: the primary position in the current reference position is within the range of the first co-located image; and the secondary position in the current reference position satisfies the first condition, including: the secondary position in the current reference position is within the range of the first co-located image.
  • the second determination unit 2001 is further configured to skip the current reference position when the current reference position does not meet the first condition, determine the reference position corresponding to the next position index based on the first position index sequence, and use the reference position corresponding to the next position index as the current reference position, and continue to execute the step of determining whether the current reference position meets the first condition; wherein, the current reference position does not meet the first condition, including: the primary position in the current reference position does not meet the first condition and the secondary position in the current reference position does not meet the first condition.
  • the second determination unit 2001 is further configured to determine I offset time domain block vectors for each of at least one co-located image, where I is an integer greater than or equal to 0; and determine Y second-category time domain candidate block vectors based on the I offset time domain block vectors for each of at least one co-located image.
  • the second determination unit 2001 is further configured to determine a first motion vector of the first co-located image, and determine one or more initial reference positions of the current block; offset the one or more initial reference positions according to the first motion vector to obtain one or more offset reference positions in the first co-located image; and determine I offset time domain block vectors of the first co-located image based on the one or more offset reference positions in the first co-located image; wherein the first co-located image is any one of the at least one co-located image.
  • the second determination unit 2001 is further configured to determine the motion vectors of each of multiple candidate positions around the current block and the reference image index pointed to by the motion vector; and determine the current candidate position among the multiple candidate positions based on a preset position order, and according to the current reference image index pointed to by the motion vector of the current candidate position, when the reference image indicated by the current reference image index is the first co-located image, determine the motion vector of the current candidate position as the first motion vector of the first co-located image.
  • the second determining unit 2001 is further configured to perform a correction operation on the motion vector of the current candidate position, and determine the corrected motion vector as the first motion vector of the first co-located image.
  • the second determination unit 2001 is further configured to, when at least one co-located image includes a first co-located image and a second co-located image, determine a first motion vector of the first co-located image and a second motion vector of the second co-located image, and determine one or more initial reference positions of the current block; offset the one or more initial reference positions according to the first motion vector to obtain one or more offset reference positions in the first co-located image; and offset the one or more initial reference positions according to the second motion vector to obtain one or more offset reference positions in the second co-located image; and determine I offset time domain block vectors of each of the at least one co-located image based on the one or more offset reference positions in the first co-located image and the one or more offset reference positions in the second co-located image.
  • the second determining unit 2001 is further configured to alternately set one or more offset reference positions in the first collocated image and one or more offset reference positions in the second collocated image to determine a second position index order.
  • the offset reference position includes a primary position and a secondary position; the second judgment unit 2004 is further configured to judge whether the primary position in the current offset reference position satisfies the second condition; the second determination unit 2001 is further configured to determine J offset time domain block vectors based on the primary position in the current offset reference position when the primary position in the current offset reference position satisfies the second condition; the second judgment unit 2004 is further configured to judge whether the secondary position in the current offset reference position satisfies the second condition when the primary position in the current offset reference position does not satisfy the second condition; the second determination unit 2001 is further configured to determine J offset time domain block vectors based on the secondary position in the current offset reference position when the secondary position in the current offset reference position satisfies the second condition.
  • the primary position in the current offset reference position satisfies the second condition, including: the primary position in the current offset reference position is within the range of the first co-located image; and the secondary position in the current offset reference position satisfies the second condition, including: the secondary position in the current offset reference position is within the range of the first co-located image.
  • the second determination unit 2001 is further configured to skip the current offset reference position when the current offset reference position does not meet the second condition, determine the offset reference position corresponding to the next position index based on the second position index sequence, and use the offset reference position corresponding to the next position index as the current offset reference position, and continue to execute the step of determining whether the current offset reference position meets the second condition; wherein, the current offset reference position does not meet the second condition, including: the primary position in the current offset reference position does not meet the second condition and the secondary position in the current offset reference position does not meet the second condition.
  • the one or more time-domain candidate block vectors include X first-category time-domain candidate block vectors and Y second-category time-domain candidate block vectors, where X and Y are both positive integers; the second determining unit 2001 is further configured to add the X first-category time-domain candidate block vectors to an initial merge list; and when the initial merge list is not full, continue to add the Y second-category time-domain candidate block vectors to the initial merge list until the initial merge list is full.
  • the second determining unit 2001 is further configured to determine a prediction mode of the current block; and when the prediction mode of the current block meets a preset condition, perform the step of determining at least one co-located image of the current block.
  • the second constructing unit 2002 is further configured to determine that the current block uses the intra template matching prediction mode and construct a candidate merge list for prediction; or determine that the current block uses the intra block copy mode and construct a candidate merge list for prediction.
  • the second determining unit 2001 is further configured to determine a video sequence to which the current block belongs; and when the video sequence is a screen content category, perform the step of determining at least one co-located image of the current block.
  • the decoding unit 2003 is further configured to decode the code stream and determine the value of the first syntax element; the second determination unit 2001 is further configured to perform the step of determining at least one co-located image of the current block when the first syntax element indicates that the current block uses the time domain candidate block vector as a candidate for constructing the candidate merge list.
  • a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system.
  • the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit.
  • the aforementioned integrated units can be implemented in the form of hardware or software functional modules.
  • the second communication interface 2101 is used to receive and send signals during the process of sending and receiving information between other external network elements;
  • the second memory 2102 is used to store computer programs that can be run on the second processor 2103;
  • the second processor 2103 is configured to, when running the computer program, execute:
  • the second processor 2103 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
  • This embodiment provides a decoder in which, when constructing a candidate merge list, one or more time-domain candidate block vectors are considered as candidates in the candidate merge list. This not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list, such as the prediction effect of IBC and/or IntraTMP in the merge list mode, without bringing additional software and hardware implementation complexity, thereby improving the encoding and decoding efficiency.
  • FIG22 is a schematic diagram of the structure of a coding and decoding system provided in an embodiment of the present application.
  • the coding and decoding system 220 may include an encoder 2201 and a decoder 2202 .
  • the encoder 2201 may be the encoder described in any one of the aforementioned embodiments
  • the decoder 2202 may be the decoder described in any one of the aforementioned embodiments.
  • the present application also provides a computer-readable storage medium on which a computer program is stored.
  • a processor eg, the first processor or the second processor
  • the method as described in any one of the aforementioned embodiments is implemented.
  • embodiments of the present application further provide a computer program product, including a computer program or instructions.
  • a processor e.g., a first processor or a second processor
  • the method described in any one of the aforementioned embodiments is implemented.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are merely schematic.
  • the division of the units is merely a logical function division.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media that can store program codes.
  • whether it is the encoding end or the decoding end first determine at least one co-located image of the current block; then, based on the at least one co-located image, determine one or more time-domain candidate block vectors of the current block; and then, based on the one or more time-domain candidate block vectors, construct a candidate merge list.
  • the encoding and decoding method proposed in the embodiment of the present application when constructing the candidate merge list, considers one or more time-domain candidate block vectors as candidates in the candidate merge list. This not only effectively reduces the situation where the candidate merge list cannot be filled, but also improves the prediction accuracy under the candidate merge list, without bringing additional software and hardware implementation complexity, thereby improving encoding and decoding efficiency and also improving encoding and decoding performance.

Landscapes

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

Abstract

本申请公开了一种编解码方法、码流、编码器、解码器以及存储介质,该方法包括:确定当前块的至少一个同位图像;根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;基于一个或多个时域候选块向量,构建候选合并列表。这样,不仅可以改善候选合并列表无法填满的情况,而且还可以提高预测的准确性,进而提高编解码效率。

Description

编解码方法、码流、编码器、解码器以及存储介质 技术领域
本申请涉及视频编解码技术领域,尤其涉及一种编解码方法、码流、编码器、解码器以及存储介质。
背景技术
随着人们对视频显示质量要求的提高,高清和超高清等高分辨率视频应运而生。然而,高分辨率视频通常具有更多信息,因此需要更多带宽。为降低带宽要求,已经引入了涉及视频压缩的视频编码标准。
在视频编码标准中,无论是帧内模板匹配预测(Intra Template Matching Prediction,IntraTMP)技术还是帧内块复制(Intra Block Copy,IBC)技术,都是通过构建的候选合并列表进行预测。然而,在构建候选合并列表时,由于时常存在已有的块向量没法填满候选合并列表的情况,导致缺乏足够的候选信息而使得预测效果表现不好,降低了编解码效率。
发明内容
本申请提供一种编解码方法、码流、编码器、解码器以及存储介质,不仅可以改善候选合并列表无法填满的情况,而且还可以提高预测的准确性,进而提高编解码效率。
本申请的技术方案可以如下实现:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,该方法包括:
确定当前块的至少一个同位图像;
根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;
基于一个或多个时域候选块向量,构建候选合并列表。
第二方面,本申请实施例提供了一种编码方法,应用于编码器,该方法包括:
确定当前块的至少一个同位图像;
根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;
基于一个或多个时域候选块向量,构建候选合并列表。
第三方面,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少一项:
当前块的残差值、当前块的同位图像索引和第一语法元素的取值;其中,第一语法元素用于指示当前块是否使用时域候选块向量作为构建候选合并列表的候选项。
第四方面,本申请实施例提供了一种编码器,包括第一确定单元和第一构建单元,其中:
第一确定单元,配置为确定当前块的至少一个同位图像;以及根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;
第一构建单元,配置为基于一个或多个时域候选块向量,构建候选合并列表。
第五方面,本申请实施例提供了一种编码器,包括第一存储器和第一处理器,其中:
第一存储器,用于存储能够在第一处理器上运行的计算机程序;
第一处理器,用于在运行计算机程序时,执行如第二方面所述的方法。
第六方面,本申请实施例提供了一种解码器,包括第二确定单元和第二构建单元,其中:
第二确定单元,配置为确定当前块的至少一个同位图像;以及根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;
第二构建单元,配置为基于一个或多个时域候选块向量,构建候选合并列表。
第七方面,本申请实施例提供了一种解码器,包括第二存储器和第二处理器,其中:
第二存储器,用于存储能够在第二处理器上运行的计算机程序;
第二处理器,用于在运行计算机程序时,执行如第一方面所述的方法。
第八方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。
第九方面,本申请实施例提供了一种计算机程序产品,包括计算机程序或指令,计算机程序或指令被处理器执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。
本申请实施例提供了一种编解码方法、码流、编码器、解码器以及存储介质,无论是编码端还是解码端,首先确定当前块的至少一个同位图像;然后根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;再基于所述一个或多个时域候选块向量,构建候选合并列表。也就是说,本申请实施例提出的编解码方法,在构建候选合并列表时,考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,同时不会带来额外的软硬件实现复杂度,进而提升编解码效率。
附图说明
图1为一种IntraTMP技术的模板匹配示意图一;
图2为一种确定当前块的匹配块示意图;
图3A为一种IntraTMP技术的模板匹配示意图二;
图3B为一种IntraTMP技术的模板匹配示意图三;
图4为一种当前块的相邻位置与非相邻位置示意图;
图5为一种根据块向量重新定位新的位置示意图;
图6为一种根据参考块内的多个位置查找块向量示意图;
图7为本申请实施例提供的一种视频编解码的网络架构示意图;
图8为本申请实施例提供的一种编码器的系统框图示意图;
图9为本申请实施例提供的一种解码器的系统框图示意图;
图10为本申请实施例提供的一种解码方法的流程示意图一;
图11为本申请实施例提供的一种根据同位图像查找当前块的参考位置示意图;
图12为本申请实施例提供的一种解码方法的流程示意图二;
图13为本申请实施例提供的一种当前块的五个候选位置示意图;
图14为本申请实施例提供的一种解码方法的流程示意图三;
图15为本申请实施例提供的一种解码方法的流程示意图四;
图16为本申请实施例提供的一种编码方法的流程示意图一;
图17为本申请实施例提供的一种编码方法的流程示意图二;
图18为本申请实施例提供的一种编码器的组成结构示意图;
图19为本申请实施例提供的一种编码器的具体硬件结构示意图;
图20为本申请实施例提供的一种解码器的组成结构示意图;
图21为本申请实施例提供的一种解码器的具体硬件结构示意图;
图22为本申请实施例提供的一种编解码系统的组成结构示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:
编码块(Coding Block,CB);
块匹配(Block Maching,BM);
运动向量(Motion vector,MV);
块向量(Block Vector,BV);
相邻位置上的块向量(Spatial BV);
非相邻位置上的块向量(Non-adjacent BV);
历史编解码顺序上保存的块向量(History block vector prediction,HBVP);
自动重定位的块向量预测(Auto-relocated block vector prediction,ARBVP);
同位图像(Collocated picture);
绝对误差和(Sum of Absolute Difference,SAD);
绝对变换差和(Sum of Absolute Transformed Difference,SATD);
均方误差(Mean Square Error,MSE);
误差平方和(Sum of Squared Differences,SSD);
平均绝对差(Mean Absolute Deviation,MAD);
平均误差平方和(Mean Square Differences,MSD);
H.266/多功能视频编码(Versatile Video Coding,VVC);
VVC的参考软件测试平台(VVC Test Model,VTM);
帧内块复制(Intra Block Copy,IBC);
帧内模板匹配预测(Intra Template Matching Prediction,Intra TMP);
Beyond VVC的参考软件测试平台(Enhanced Compression Model,ECM)。
下面对相关技术中的帧内模板匹配预测技术和帧内块复制技术进行简单介绍。
(1)帧内模板匹配预测技术。
帧内模板匹配预测技术,简称IntraTMP技术,是一种特殊的帧内预测编码工具,主要应用于屏幕内容编码。IntraTMP主要通过以下流程实现:
选择当前块相邻的L型部分已重建像素作为模板,在给定的当前图像已重建区域中搜索最相似的模板,将最相似模板对应的重建块作为匹配块(或称为“参考块”),以得到当前块的预测块。如图1所示,图1中R1至R4是可用的IntraTMP搜索区域。依次在这些区域中按照光栅扫描(raster scan)顺序逐点寻找匹配块。
另外,如图2所示,匹配块可以由当前块指向匹配块的块向量BV表示,模板间的相似程度由模板误差值的大小表示,模板误差值越小则相似程度越高。例如,使用SAD计算模板误差值,SAD越小,表示模板越相似。
在这里,编解码器通过标志位intra_tmp_flag表示当前块是否使用IntraTMP模式编码。若是则在解码端进行同样的模板匹配过程以在解码端获得同样的预测块,不需要额外编码当前块到匹配块的块向量信息。
(2)针对摄像机捕获内容的IntraTMP适应技术。
针对摄像机捕获内容的IntraTMP适应(IntraTMP adaption for camera-captured content)技术在已有IntraTMP技术的基础上,提出以步长S(即水平、垂直方向每隔S点,S>1)进行模板匹配,如图3A所示,比如在搜索区域,不是按照raster scan逐点寻找匹配块,而是在搜索区域水平、垂直方向隔点搜索。示例性地,当前进行模板匹配的块向量是(X0,Y0),则下一个进行模板匹配的块向量应为(X0+S,Y0),下行进行模板匹配的块向量纵坐标应为Y0+S。此外,模板匹配过程可以分为多轮,每轮的搜索步长可以不同。例如以步长S完成第一轮搜索后,可以根据匹配结果(例如取前N个模板误差最小的匹配块)确定下一轮搜索的范围(例如在这些匹配块的邻近区域内),以更小的步长S‘进行模板匹配,如图3B所示,1≤S‘<S;从而优化匹配结果。该技术在保持较好编码效率的同时可有效降低IntraTMP模式的复杂度。在图3A和图3B所示,网格填充区域代表模板区域;箭头代表块向量,虚线框代表匹配块。
(3)IntraTMP多候选技术。
在给定的搜索区域,可能存在多个与当前块相似的参考块,而模板匹配技术仅通过比较模板区域的代价值并不一定能够精确地找到目标块,所以从参考区域内找出多个候选匹配块可以使得搜索容错率更高。
IntraTMP多候选技术通过模板匹配过程在参考区域内获取N个候选匹配块,或者说构建一个长度为N的候选块列表,列表内候选块可以根据与当前块之间的模板误差值大小排序。通过索引选中列表中某一候选块作为最终的预测块。对使用IntraTMP多候选技术的编码块,在解码IntraTMP标志位intra_tmp_flag为真后,继续解码intra_tmp_idx,该intra_tmp_idx语法元素可以表示选中候选块的索引。
在一种可能的实现方式中,用于构建候选块列表的模板匹配过程如下:
第一步,以一定步长进行第一遍搜索,例如水平步长、竖直步长均为4。得到N个有一定间距的最 优匹配块(模板误差值最小的前N个);
第二步,在第一步得到的N个匹配块邻近区域进行第二遍搜索,这些邻近区域可以根据第一步中的步长设置为不重叠的多个区域。从这些区域中得到M个最优的匹配块(可以包含第一步中得到的匹配块)。
在编码端和解码端使用同样的构建过程,得到一致的候选块列表。
Intra_tmp_idx可以使用定长编码或变长编码,例如,使用截断二元码(truncated binary)编码。
在一种可能的实现方式中,变长编码方式为:
索引越小(intra_tmp_idx值越小),对应候选块的模板误差值越小,统计上被选中的概率越大。可以为越小的intra_tmp_idx设置越短的码字,如表1所示。
表1
若intra_tmp_idx的最大值N较大,可以为较大的intra_tmp_idx分配相同长度的码字。例如,在ECM-11.0参考软件中,N为15,如表2所示。
表2
上述表2中,x可以用truncated binary得到。
(4)帧内模板匹配预测技术包含的一些其他特征。
除了以上描述的一些总体上的特征外,帧内模板匹配预测技术还可以包括以下特征:
A、基于子像素级别的帧内模板预测匹配。
它在通过模板匹配找到了一个或多个整数像素精度的候选块后,进一步通过整数像素精度进行插值,找到一个亚像素精度的候选目标;当亚像素精度的候选目标被选中时,语法元素中也应使用对应的标识来标识选中的亚像素精度。例如在ECM-11.0中,亚像素精度可以是1/4、1/2、3/4个像素精度。
B、融合多个候选块。
它使用模板匹配技术找到的多个候选块进行加权,从而获取到一个加权的预测块作为当前待预测块的预测值。例如在ECM-11.0中,用于加权的候选块为上述(3)中获取到的多个候选块,而用于加权的权重则是可以用每一个加权的候选块模板进行自适应计算得到。
C、帧内模板匹配技术的亮度补偿。
它与帧间的局部光照补偿技术(Local Illumination Compensation,LIC)类似,利用候选匹配块周围的L形区域与当前块周围的L形区域构建出线性模型或线性方程组,解析得到线性模型参数或者方程组的参数,用作于补偿候选块,补偿后的候选块将作为当前块的预测块。
(5)帧内块复制技术。
针对帧内块复制(Intra Block Copy,IBC)技术,是一种基于块匹配来获得预测像素的帧内预测技术。类似于帧间预测,通过由当前块指向参考块的块向量实现预测,区别在于帧间预测的参考块来自于参考图像已编码的重建部分,而IBC的参考块来自于当前图像的已编码的重建部分。块向量信息需要由码流传输,因而与帧间预测类似,存在IBC-AMVP模式和IBC-Merge模式。
IBC-AMVP模式:通过构建的合并候选(Merge Candidate)列表得到预测块向量,通过哈希搜索、全搜索等过程得到当前块的参考块和对应的最终块向量。根据预测块向量对最终块向量编码,提升编码效率;
IBC-Merge模式:通过构建的候选合并列表进行预测,候选合并列表可以包括相邻和非相邻位置的已编码块、历史的编码块和候选块向量的平均等编码信息。在构建候选合并列表后,可以根据列表内各个候选的模板误差值对列表重排序。模板误差值可以由各个候选的参考块模板与当前块模板间的误差值(例如SAD值)得到。
(6)IntraTMP的合并模式。
由于帧间预测与IBC技术中都有各自的合并模式(Merge mode),故在intraTMP技术中,通过构建候选合并列表作为增强上述(3)中的多匹配块列表的技术也被采纳进了ECM-12.0参考软件。
IntraTMP的合并模式(IntraTMP with Merge Candidates,IntraTMP-Merge)技术与IBC的合并模式类似,它们可以根据当前块周围(左,左上,左下,上,右上)区域中已编码块所使用的BV进行预测是否包含其模式。具体也如IBC-Merge模式,可以包括相邻和非相邻位置的已编码块、历史的编码块。
此外,intraTMP-Merge还可以包括与IBC-Merge相似的特征,例如根据参考块模板与当前块模板之间的误差值进行对候选合并列表的重排序。
(7)IntraTMP-Merge与IBC-Merge的异同。
A、构建候选合并列表时的相同点:
①都包括了搜索空间相邻的五个位置上是否含有可以使用BV的过程;
②都包括了搜索空间非相邻位置上是否含有可以使用BV的过程。
B、构建候选合并列表时的不同点:
①搜索空间非相邻的位置和位置的个数不同;
②在IBC中进一步包括历史块向量的信息。
(8)IntraTMP-Merge和IBC-Merge中块向量的类型。
用于构造块向量候选合并列表的块向量包括:相邻位置的块向量、非相邻位置的块向量、基于历史信息的块向量以及自动重定位的块向量等。相邻与非相邻块向量可参考图4中当前块的若干相邻和非相邻位置,这些位置上若存在块向量,则为相邻与非相邻的块向量。如图4所示,点填充小块为当前块,图4中的标号1-5处称为相邻位置候选,其余处称为非相邻位置候选。
基于历史信息类型的块向量是指使用一个长度为N的表,去根据编码和解码的顺序,记录和更新使用到的块向量。
自动重定位的块向量预测(Auto-Relocated Block vector prediction,AR-BVP)技术提出通过参考块的块向量来构造新的块向量的方法。示例性地,为当前块B0确定一个指引块向量(guiding BV)BV0,1并根据该块向量确定参考块B1。若在参考块B1的区域内存在块向量BV1,2(B1周围区域内相似度最大的块对应运动向量、或者模板最匹配的块对应的运动向量),则可以构造新的块向量BV0,2=BV0,1+BV1,2,作为当前块的候选块向量。递归地(截止条件:达到一定的递归深度、构建的新块向量对应的块误差小于阈值、超过预设区域、满足最大递归时间等),根据BV0,n可以确定参考块Bn,若在Bn的区域内存在块向量BVn,n+1,则可以构建新的块向量BV0,n+1=BV0,1+BV1,2+…+BVn,n+1,如图5所示。
其中,在确定参考块Bn所对应的块向量BVn,n+1时,可以检查多个位置。例如,依次检查参考块的中心、左上、右上、左下和右下处是否存在由IBC或IntraTMP模式预测的编码块,若存在则将其所保存的块向量作为块向量BVn,n+1,如图6所示。在图6中,CTR表示参考块的中心位置,LB表示参考块的左下位置,RB表示参考块的右下位置,LT表示参考块的左上位置,RT表示参考块的右上位置。
综上可知,在构建IntraTMP和IBC的候选合并列表时,相关技术中时常存在已有块向量没法填满候选合并列表的情况,这使得有的时候合并模式由于缺乏足够的候选信息,导致性能表现不好,降低了编解码效率。
基于此,本申请实施例提供了一种编解码方法,首先确定当前块的至少一个同位图像;然后根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;再基于所述一个或多个时域候选块向量,构建候选合并列表。也就是说,本申请实施例提出的编解码方法,在构建候选合并列表时,考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,同时不会带来额外的软硬件实现复杂度,进而能够提升编解码效率和编解码性能。
下面将结合附图对本申请各实施例进行详细说明。
图7为本申请实施例提供的一种视频编解码的网络架构示意图。如图7所示,该网络架构包括一个或多个电子设备13至1N和通信网络01,其中,电子设备13至1N可以通过通信网络01进行视频交互。电子设备在实施的过程中可以为各种类型的具有视频编解码功能的设备,例如,所述电子设备可以包括手机、平板电脑、个人计算机、个人数字助理、导航仪、数字电话、视频电话、电视机、传感设备、服务器等,本申请实施例不作限定。
在本申请实施例中,这里提供了一种包含解码方法和编码方法的视频编解码系统的网络架构。其中,本申请实施例中的解码器或编码器就可以为上述电子设备。也就是说,本申请实施例中的电子设备具有视频编解码功能,一般包括视频编码器(即编码器)和视频解码器(即解码器)。
图8为本申请实施例提供的一种编码器的系统框图示意图。如图8所示,编码器100可以包括:分割单元101、预测单元102、第一加法器107、变换单元108、量化单元109、反量化单元110、反变换 单元111、第二加法器112、滤波单元113、解码图片缓存(Decoded Picture Buffer,DPB)单元114和熵编码单元115。这里,编码器100的输入可以是由一系列图片或者一张静态图片组成的视频,编码器100的输出可以是用于表示输入视频的压缩版本的比特流(也可以称为“码流”)。
其中,分割单元101将输入视频中的图片分割成一个或多个编码树单元(Coding Tree Units,CTUs)。分割单元101将图片分成多个图块(或称为瓦片,tiles),还可以进一步将一个tile分成一个或多个砖块(bricks),这里,一个tile或者一个brick中可以包括一个或多个完整的和/或部分的CTUs。另外,分割单元101可以形成一个或多个切片(slices),其中一个slice可以包括图片中按照栅格顺序排列的一个或多个tiles,或者覆盖图片中矩形区域的一个或多个tiles。分割单元101还可形成一个或多个子图片,其中,一个子图片可以包括一个或多个slices、tiles或bricks。
在编码器100的编码过程中,分割单元101将CTU传送到预测单元102。通常,预测单元102可以由块分割单元103、运动估计(Motion Estimation,ME)单元104、运动补偿(Motion Compensation,MC)单元105和帧内预测单元106组成。具体地,块分割单元103迭代地使用四叉树分割、二叉树分割和三叉树分割而进一步将输入CTU划分成更小的编码单元(Coding Units,CUs)。预测单元102可使用ME单元104和MC单元105获取CU的帧间预测块。帧内预测单元106可使用包括MIP模式的各种帧内预测模式获取CU的帧内预测块。在示例中,率失真优化的运动估计方式可被ME单元104和MC单元105调用以获取帧间预测块,以及率失真优化的模式确定方式可被帧内预测单元106调用以获取帧内预测块。预测单元102输出CU的预测块,第一加法器107计算分割单元101的输出中的CU和CU的预测块之间的差值,即残差CU。变换单元108读取残差CU并对残差CU执行一个或多个变换操作以获取系数。量化单元109对系数进行量化并输出量化系数(即levels)。反量化单元110对量化系数执行缩放操作以输出重构系数。反变换单元111执行对应于变换单元108中的变换的一个或多个反变换并输出重构残差。第二加法器112通过使重构残差和来自预测单元102的CU的预测块相加而计算出重构CU。第二加法器112还将其输出发送到预测单元102以用作帧内预测参考。在图片或子图片中的所有CU被重构之后,滤波单元113对重构图片或子图片执行环路滤波。这里,滤波单元113包含一个或多个滤波器,例如去方块滤波器、采样自适应偏移(Sample Adaptive Offset,SAO)滤波器、自适应环路滤波器(Adaptive Loop Filter,ALF)、亮度映射和色度缩放(Luma Mapping with Chroma Scaling,LMCS)滤波器以及基于神经网络的滤波器等。或者,当滤波单元113确定CU不用作其它CU编码时的参考时,滤波单元113对CU中的一个或多个目标像素执行环路滤波。滤波单元113的输出是解码图片或子图片,这些解码图片或子图片缓存至DPB单元114。DPB单元114根据时序和控制信息输出解码图片或子图片。这里,存储在DPB单元114中的图片还可用作预测单元102执行帧间预测或帧内预测的参考。最后熵编码单元115将来自编码器100中解码图片所必需的参数(比如控制参数和补充信息等)转换成二进制形式,并根据每个数据单元的语法结构将这样的二进制形式写入码流中,即编码器100最终输出码流。
进一步地,编码器100可以是具有第一处理器和记录计算机程序的第一存储器。当第一处理器读取并运行计算机程序时,编码器100读取输入视频并生成对应的码流。另外,编码器100还可以是具有一个或多个芯片的计算设备。在芯片上实现为集成电路的这些单元具有与图8中相应单元类似的连接和数据交换功能。
图9为本申请实施例提供的一种解码器的系统框图示意图。如图9所示,该解码器200可以包括:解析单元201、预测单元202、反量化单元205、反变换单元206、加法器207、滤波单元208和解码图片缓存单元209。这里,解码器200的输入是用于表示视频或者一张静态图片的压缩版本的比特流,解码器200的输出可以是由一系列图片组成的解码视频或者一张解码的静态图片。
其中,解码器200的输入码流可以是编码器100所生成的码流。解析单元201对输入码流进行解析并从输入码流获取语法元素的值。解析单元201将语法元素的二进制表示转换成数字值并将数字值发送到解码器200中的单元以获取一个或多个解码图片。解析单元201还可从输入码流解析一个或多个语法元素以显示解码图片。
在解码器200的解码过程中,解析单元201将语法元素的值以及根据语法元素的值设置或确定的、用于获取一个或多个解码图片的一个或多个变量发送到解码器200中的单元。预测单元202确定当前解码块(例如CU)的预测块。这里,预测单元202可以包括运动补偿单元203和帧内预测单元204。具体地,当指示帧间解码模式用于对当前解码块进行解码时,预测单元202将来自解析单元201的相关参数传递到运动补偿单元203以获取帧间预测块;当指示帧内预测模式(包括基于MIP模式索引值指示的MIP模式)用于对当前解码块进行解码时,预测单元202将来自解析单元201的相关参数传送到帧内预测单元204以获取帧内预测块。反量化单元205具有与编码器100中的反量化单元110相同的功能。反量化单元205对来自解析单元201的量化系数(即levels)执行缩放操作以获取重构系数。反变换单 元206具有与编码器100中的反变换单元111相同的功能。反变换单元206执行一个或多个变换操作(即通过编码器100中的反变换单元111执行的一个或多个变换操作的反操作)以获取重构残差。加法器207对其输入(来自预测单元202的预测块和来自反变换单元206的重构残差)执行相加操作以获取当前解码块的重构块。重构块还发送到预测单元202以用作在帧内预测模式下编码的其它块的参考。
在图片或子图片中的所有CU被重构之后,滤波单元208对重构图片或子图片执行环路滤波。滤波单元208包含一个或多个滤波器,例如去方块滤波器、采样自适应补偿滤波器、自适应环路滤波器、亮度映射和色度缩放滤波器以及基于神经网络的滤波器等。或者,当滤波单元208确定重构块不用作对其它块解码时的参考时,滤波单元208对重构块中的一个或多个目标像素执行环路滤波。这里,滤波单元208的输出是解码图片或子图片,解码图片或子图片缓存至DPB单元209。DPB单元209根据时序和控制信息输出解码图片或子图片。存储在DPB单元209中的图片还可用作通过预测单元202执行帧间预测或帧内预测的参考。
进一步地,解码器200可以是具有第二处理器和记录计算机程序的第二存储器。当第一处理器读取并运行计算机程序时,解码器200读取输入码流并生成对应的解码视频。另外,解码器200还可以是具有一个或多个芯片的计算设备。在芯片上实现为集成电路的这些单元具有与图9中相应单元类似的连接和数据交换功能。
需要说明的是,本申请实施例的方法既可以应用于编码器,也可以应用于解码器,甚至还可以同时应用于编码器和解码器,这里不作具体限定。另外,当本申请实施例应用于编码器100时,“当前块”具体是指视频图像中的当前待编码的块(也可以简称为“编码块”);当本申请实施例应用于解码器200时,“当前块”具体是指视频图像中的当前待解码的块(也可以简称为“解码块”)。
在本申请的一实施例中,图10为本申请实施例提供的一种解码方法的流程示意图一。如图10所示,该方法可以包括:
S1001,确定当前块的至少一个同位图像。
需要说明的是,本申请实施例的解码方法应用于解码器。该解码方法具体可以是指一种候选合并列表的构建方法,更具体地,是一种基于时域块向量构建候选合并列表的方法。这样,基于图9所示解码器200的组成结构,本申请实施例的解码方法主要适用于帧间预测帧中的intraTMP模式或IBC模式。从而在构建候选合并列表时,能够根据当前块的同位图像来改善候选合并列表无法填满的情况。
还需要说明的是,在本申请实施例中,当前块的同位图像可以是一个,也可以是两个,甚至还可以是更多个。示例性地,如图11所示,当前块可以有两个同位图像,例如位于当前图像之前的前向同位图像(Frame0,参考图像0)和位于当前图像之后的后向同位图像(Frame1,参考图像1)。在这里,当前块为当前图像中的一个块,可以在Frame 0和Frame 1上分别搜索到当前块的参考位置。
在本申请实施例中,对于当前块来说,可以根据码流中的同位图像索引来确定对应的同位图像有一个或多个。在一些实施例中,确定当前块的至少一个同位图像,可以包括:解码码流,确定当前块的同位图像索引;根据同位图像索引,确定当前块的至少一个同位图像。
在本申请实施例中,当前图像中包括当前块。其中,对于当前图像来说,当前图像也可能没有同位图像,这时候就无法进一步获取时域候选块向量,这种情况下的候选合并列表仍然是根据相关技术构建的。在当前图像存在同位图像的情况下,这时候可以根据编码端写入码流中的同位图像索引来确定同位图像可以有一个或多个。
需要说明的是,在本申请实施例中,同位图像是参考图像中的一个子集,获取时域的运动向量MV/块向量BV时只可以从同位图像中获取。
还需要说明的是,在本申请实施例中,对于每一个B帧,它可以有两个参考图像列表List0和List1,同位图像索引具体是指同位图像为List0或List1中的哪一个,所以同位图像索引为获取List0和List1的索引值。另外,后续也不排除一个图像可以有更多的同位图像,或者List0和List1里都有超过一个图像是同位图像。也就是说,同位图像索引用于指示同位图像在参考图像列表中的位置。
在一种具体的实施例中,根据同位图像索引,确定当前块的至少一个同位图像,可以包括:若同位图像索引包括的索引数量为一个,则确定当前块的一个同位图像;若同位图像索引包括的索引数量为两个,则确定当前块的两个同位图像。
也就是说,对于当前块所属的当前图像来说,如果当前图像没有同位图像索引,那么当前图像不存在同位图像,也就无法进一步获取当前块的时域候选块向量;如果当前图像仅有一个同位图像索引,那么当前图像仅有一个同位图像,此时可以从这一个同位图像中获取当前块的时域候选块向量;如果当前图像有两个同位图像索引,那么当前图像有两个同位图像,此时可以从这两个同位图像中获取当前块的 时域候选块向量;更甚者,如果当前图像有多于两个同位图像索引,那么当前图像有多于两个同位图像,此时可以从这些同位图像中获取当前块的时域候选块向量。
示例性地,在已有的参考软件实现中,可以支持当前块的一个帧间帧有两个同位帧(即两个同位图像),那么不仅可以从其中一个同位图像中来获取当前块的时域候选块向量,也可以从这两个同位图像中来获取当前块的时域候选块向量,这里不作任何限定。
S1002,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量。
在本申请实施例中,时域候选块向量可以包括第一类时域候选块向量和/或第二类时域候选块向量。其中,第一类时域候选块向量与第二类时域候选块向量不同,第一类时域候选块向量表征基于同位图像中的参考位置来确定的时域块向量,第二类时域候选块向量表征基于同位图像的运动向量指示参考位置进行偏移所确定的偏移时域块向量。
在本申请实施例中,对于某一个同位图像来说,该同位图像中的参考位置可以是非基于块向量预测的块,那么该参考位置的运动信息中不包括块向量;更甚者,如果该同位图像中的所有参考位置都是非基于块向量预测的块,那么这些参考位置的运动信息中都不包括块向量,这时候根据该同位图像可以获得0个时域块向量。
也就是说,假设至少一个同位图像包括第一同位图像和第二同位图像,那么有可能获得第一同位图像的0个时域块向量以及第二同位图像的0个时域块向量,即根据这至少一个同位图像有可能获得0个时域候选块向量,这种情况下的候选合并列表仍是根据相关技术构建的。
考虑到本技术方案是为了解决候选合并列表无法填满的情况,将所获得的时域候选块向量添加到候选合并列表中,下面以根据至少一个同位图像能够获得当前块的至少一个时域候选块向量为例进行说明。
在一种可能的实现方式中,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量,可以包括:根据至少一个同位图像,确定X个第一类时域候选块向量;根据X个第一类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X为正整数。
在另一种可能的实现方式中,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量,可以包括:根据至少一个同位图像,确定Y个第二类时域候选块向量;根据Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,Y为正整数。
在又一种可能的实现方式中,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量,可以包括:根据至少一个同位图像,确定X个第一类时域候选块向量和Y个第二类时域候选块向量;根据X个第一类时域候选块向量和Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X、Y均为正整数。
也就是说,在本申请实施例中,对于当前块的一个或多个时域候选块向量来说,可以是根据至少一个同位图像所确定的X个第一类时域候选块向量和/或Y个第二类时域候选块向量来得到的。
在一些实施例中,根据至少一个同位图像,确定X个第一类时域候选块向量,可以包括:确定至少一个同位图像各自的K个时域块向量,K为大于或等于0的整数;根据至少一个同位图像各自的K个时域块向量,确定X个第一类时域候选块向量。
在本申请实施例中,在至少一个同位图像仅包括一个同位图像时,这时候可以设置K的取值与X的取值相等。
另外,在本申请实施例中,对于不同的同位图像,K的取值可以相同,或者也可以不同。示例性地,在至少一个同位图像包括有第一同位图像和第二同位图像时,可以获得第一同位图像的0个时域块向量,以及获得第二同位图像的非0个时域块向量;或者,也可以是获得第一同位图像和第二同位图像各自的非0个时域块向量。
在本申请实施例中,第一同位图像可以为至少一个同位图像中的任意一个。对于确定至少一个同位图像各自的一个或多个时域块向量来说,以第一同位图像为例,该方法可以包括:确定第一同位图像中的一个或多个参考位置;根据一个或多个参考位置,确定第一同位图像的K个时域块向量。
示例性地,对于第一同位图像来说,如果第一同位图像中的所有参考位置都是非基于块向量预测的块,那么这些参考位置的运动信息中都不包括块向量,这时候可以获得第一同位图像的0个时域块向量。
还需要说明的是,对于每个同位图像来说,可以有一个或多个参考位置,这些参考位置的定义如表3所示。
表3

在表3中,X0和Y0表示当前块右下角位置在当前图像中的横坐标和纵坐标,X1和Y1表示当前块中间位置在当前图像中的横坐标和纵坐标,W和H表示当前块的宽度和高度。
需要注意的是,表3中的这些参考位置大都是当前块的位置或者是当前块右侧、右下以及下方上的位置,由于这些位置在当前图像内还未完成编解码所以无法获取到所需信息,而时域上的参考图像(具体是指同位图像)已经完成编解码,这些信息可以保存下来并获取到。在一些实施例中,时域上的参考位置除上述的这些参考位置之外,也可以选取为当前块内,或是左上、上、右上、左以及左下等方向上的位置,这里不作任何限定。另外,还需要注意的是,对于某个同位图像来说,也有可能包括0个参考位置,这时候针对该同位图像将不再执行获取时域候选块向量的步骤。
在一些实施例中,根据一个或多个参考位置,确定第一同位图像的K个时域块向量,可以包括:确定当前位置索引对应的当前参考位置;在当前参考位置满足第一条件时,根据当前参考位置确定H个时域块向量,H为大于或等于0的整数;基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤,直至一个或多个参考位置遍历完成,以得到第一同位图像的K个时域块向量。
在本申请实施例中,根据当前参考位置确定H个时域块向量,例如可以是确定0个、1个、2个或者更多个时域块向量。示例性地,如果当前参考位置使用了非基于块向量的预测模式,那么这时候可以有0个时域块向量;如果当前参考位置使用了IBC加权预测模式,那么这时候可以有多个(两个)时域块向量;如果当前参考位置使用了IntraTMP或非加权的IBC预测模式,那么这时候可以有一个时域块向量。
在本申请实施例中,第一位置索引顺序可以是表3中的位置索引顺序,例如1、2、3、…10等。首先将位置索引1确定为当前位置索引对应的当前参考位置,在当前参考位置满足第一条件时,根据当前参考位置确定H个时域块向量;然后将位置索引2对应的参考位置确定为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤,再将位置索引3对应的参考位置确定为当前参考位置,以此类推,直至这10个参考位置遍历完成,以得到第一同位图像的K个时域块向量。
在本申请实施例中,如表3所示,每一个参考位置均可以包括主要位置和次要位置。在一些实施例中,参见图12,根据当前参考位置确定H个时域块向量,该方法可以包括:
S1201,判断当前参考位置中的主要位置是否满足第一条件。
S1202,在当前参考位置中的主要位置满足第一条件时,根据当前参考位置中的主要位置确定H个时域块向量。
S1203,在当前参考位置中的主要位置不满足第一条件时,判断当前参考位置中的次要位置是否满足第一条件。
S1204,在当前参考位置中的次要位置满足第一条件时,根据当前参考位置中的次要位置确定H个时域块向量。
S1205,在当前参考位置中的主要位置不满足第一条件且当前参考位置中的次要位置不满足第一条件时,跳过当前参考位置,基于第一位置索引顺序确定下一个位置索引对应的参考位置。
需要说明的是,在本申请实施例中,当前参考位置中的主要位置满足第一条件,可以包括:当前参考位置中的主要位置处于第一同位图像的范围之内。相应地,当前参考位置中的次要位置满足第一条件,可以包括:当前参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,该方法还可以包括:在当前参考位置不满足第一条件时,跳过当前参考位置,基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤。
还需要说明的是,在本申请实施例中,当前参考位置不满足第一条件,可以包括:当前参考位置中的主要位置不满足第一条件且当前参考位置中的次要位置不满足第一条件。
还需要说明的是,在本申请实施例中,对于第一条件来说,第一条件可以是判断主要位置或次要位置是否处于同位图像的范围之内,或者第一条件也可以是判断主要位置或次要位置是否处于同位的子图像、片、CTU等的范围之内,这里不作任何限定。
还需要说明的是,在本申请实施例中,对于变量H来说,在不同情况下H的取值可以相同,或者也可以不同。另外,对于当前参考位置中的主要位置来说,如果获取到0个时域块向量,那么也可以根据当前参考位置中的次要位置来进一步获取H个时域块向量;若次要位置也获取到0个时域块向量,则跳过当前参考位置,然后基于第一位置索引顺序确定下一个位置索引对应的参考位置。
也就是说,在本申请实施例中,对于每一个同位图像来说,该同位图像中的参考位置可以包括表3中的10个主要位置和10个次要位置,按照位置索引1~10的顺序依次添加主要位置。当主要位置不满足第一条件(主要位置不在同位图像的范围之内,或者也可以是其他条件,例如不处于同位的子图像、片、CTU等等的范围之内)时,则采用对应的次要位置替代主要位置来确定时域块向量;若次要位置也不满足第一条件,则跳过该位置索引,直接添加下一个位置索引的主要位置或次要位置,进而确定出一个或多个第一类时域候选块向量。
在本申请实施例中,除了根据表3中的参考位置来确定第一类时域候选块向量之外,还可以结合搜索到的运动向量来确定第二类时域候选块向量。在一些实施例中,根据至少一个同位图像,确定Y个第二类时域候选块向量,可以包括:确定至少一个同位图像各自的I个偏移时域块向量,I为大于或等于0的整数;根据至少一个同位图像各自的I个偏移时域块向量,确定Y个第二类时域候选块向量。
在本申请实施例中,在至少一个同位图像仅包括一个同位图像时,这时候可以设置I的取值与Y的取值相等。
另外,在本申请实施例中,对于不同的同位图像,I的取值可以相同,或者也可以不同。示例性地,假设有第一同位图像和第二同位图像,那么可以获得第一同位图像的0个偏移时域块向量,以及获得第二同位图像的非0个偏移时域块向量;或者,也可以是获得第一同位图像和第二同位图像各自的非0个偏移时域块向量。
在本申请实施例中,第一同位图像为至少一个同位图像中的任意一个。对于确定至少一个同位图像各自的I个偏移时域块向量来说,以第一同位图像为例,该方法可以包括:确定第一同位图像的第一运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;根据第一同位图像中的一个或多个偏移参考位置,确定第一同位图像的I个偏移时域块向量。
示例性地,对于第一同位图像来说,如果第一同位图像中的所有偏移参考位置都是非基于块向量预测的块,那么这些偏移参考位置的运动信息中都不包括块向量,这时候可以获得第一同位图像的0个偏移时域块向量。
在本申请实施例中,当前块所属帧即为当前图像。对于当前图像的第一同位图像来说,在一些实施例中,确定第一同位图像的第一运动向量,可以包括:确定当前块周围的多个候选位置各自的运动向量以及运动向量指向的参考图像索引;基于预设位置顺序确定多个候选位置中的当前候选位置,根据当前候选位置的运动向量指向的当前参考图像索引,在当前参考图像索引指示的参考图像为第一同位图像时,将当前候选位置的运动向量确定为第一同位图像的第一运动向量。
在本申请实施例中,预设位置顺序可以如图13所示的0、1、2、3、4的顺序,这五个位置为当前块的空间相邻块。这五个位置在当前图像中的坐标定义如表4所示。
表4
在表4中,X2和Y2表示当前块左上角位置在当前图像中的横坐标和纵坐标,W和H表示当前块的宽度和高度。
另外,在本申请实施例中,除了图13中的五个位置之外,获取同位图像中用于偏移的运动向量也可以通过当前块周围的其他位置获得,而且对于一个同位图像也可找到多个运动向量来指引偏移。
在一些实施例中,在当前参考图像索引指示的参考图像为第一同位图像时,该方法还可以包括:对当前候选位置的运动向量进行修正操作,将修正后的运动向量确定为第一同位图像的第一运动向量。
在本申请实施例中,以第一同位图像的第一运动向量为例,在当前参考图像索引指示的参考图像为第一同位图像时,可以将当前候选位置的运动向量直接确定为第一同位图像的第一运动向量,或者也可以将当前候选位置的运动向量进行修正操作后确定为第一同位图像的第一运动向量。在这里,修正操作可以为取整操作,其目的是避免找到子像素位置。
在一些实施例中,确定至少一个同位图像各自的I个偏移时域块向量,可以包括:在至少一个同位图像包括第一同位图像和第二同位图像时,确定第一同位图像的第一运动向量和第二同位图像的第二运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;以及根据第二运动向量对一个或多个初始参考位置进行偏移,得到第二同位图像中的一个或多个偏移参考位置;根据第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置,确定至少一个同位图像各自的I个偏移时域块向量。
需要说明的是,在本申请实施例中,假定当前图像有两个同位图像:第一同位图像Frame0和第二同位图像Frame1,这时候可以找到两个运动向量分别为第一运动向量MV0’和第二运动向量MV1’,那么首先对MV0’和MV1’进行取整(目的是避免找到子像素位置)获得MV0和MV1,从而可以确定出一个或多个偏移参考位置,然后根据这些偏移参考位置是否包含块向量来获取I个偏移时域块向量。另外,在本申请实施例中,对于一个同位图像来说,如果这一个同位图像可以找到多个运动向量对初始参考位置进行偏移,例如第一同位图像(Frame0)找到了运动向量MV00、MV01、…,则此时也应当有更多的偏移参考位置,这里不作任何限定。
还需要说明的是,对于这两个同位图像来说,每一个同位图像有一个或多个偏移参考位置,这些偏移参考位置的定义如表5所示。
表5

在表5中,X0和Y0表示当前块右下角位置在当前图像中的横坐标和纵坐标,X1和Y1表示当前块中间位置在当前图像中的横坐标和纵坐标,W和H表示当前块的宽度和高度。另外,MV0.X和MV0.Y分别为对应第一同位图像(Frame0)的整型运动向量的水平方向偏移和垂直方向偏移,MV1.X和MV1.Y分别为对应第二同位图像(Frame1)的整型运动向量的水平方向偏移和垂直方向偏移。
需要注意的是,在本申请实施例中,偏移时域参考位置除了表5中的这些参考位置之外,也可以选取其他参考位置,这里不作任何限定。另外,还需要注意的是,对于某个同位图像来说,也有可能包括0个偏移参考位置,这时候针对该同位图像将不再执行获取时域候选块向量的步骤。
还需要说明的是,在本申请实施例中,对于一个同位图像来说,如果这一个同位图像可以找到多个运动向量对初始参考位置进行偏移,例如第一同位图像(Frame0)找到了运动向量MV00、MV01、…,则此时也应当有更多的偏移参考位置。换句话说,针对一个同位图像中找到多个用于偏移的运动向量时,那么定义的偏移参考位置也会对应增加。
在一些实施例中,根据第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置,确定至少一个同位图像各自的I个偏移时域块向量,可以包括:确定当前位置索引对应的当前偏移参考位置;在当前偏移参考位置满足第二条件时,根据当前偏移参考位置确定J个偏移时域块向量,J为大于或等于0的整数;基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤,直至所有的偏移参考位置遍历完成,以得到至少一个同位图像各自的I个偏移时域块向量。
在本申请实施例中,第二位置索引顺序可以是表5中的位置索引顺序。如表5所示,该方法还可以包括:将第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置进行交替设置,确定第二位置索引顺序。
在本申请实施例中,根据当前偏移参考位置确定J个偏移时域块向量,例如可以是确定0个、1个、2个或者更多个偏移时域块向量。示例性地,如果当前偏移参考位置使用了非基于块向量的预测模式,那么这时候可以有0个偏移时域块向量;如果当前偏移参考位置使用了IBC加权预测模式,那么这时候可以有多个(两个)偏移时域块向量;如果当前偏移参考位置使用了IntraTMP或非加权的IBC预测模式,那么这时候可以有一个偏移时域块向量。
在本申请实施例中,如表5所示,每一个偏移参考位置均可以包括主要位置和次要位置。在一些实施例中,参见图14,根据当前偏移参考位置确定J个偏移时域块向量,可以包括:
S1401,判断当前偏移参考位置中的主要位置是否满足第二条件。
S1402,在当前偏移参考位置中的主要位置满足第二条件时,根据当前偏移参考位置中的主要位置确定J个偏移时域块向量。
S1403,在当前偏移参考位置中的主要位置不满足第二条件时,判断当前偏移参考位置中的次要位置是否满足第二条件。
S1404,在当前偏移参考位置中的次要位置满足第二条件时,根据当前偏移参考位置中的次要位置确定J个偏移时域块向量。
S1405,在当前偏移参考位置中的主要位置不满足第二条件且当前偏移参考位置中的次要位置不满足第二条件时,跳过当前偏移参考位置,基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置。
需要说明的是,在本申请实施例中,当前偏移参考位置中的主要位置满足第二条件,可以包括:当前偏移参考位置中的主要位置处于第一同位图像的范围之内。相应地,当前偏移参考位置中的次要位置满足第二条件,可以包括:当前偏移参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,该方法还可以包括:在当前偏移参考位置不满足第二条件时,跳过当前偏移参考位置,基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤。
还需要说明的是,在本申请实施例中,当前偏移参考位置不满足第二条件,可以包括:当前偏移参考位置中的主要位置不满足第二条件且当前偏移参考位置中的次要位置不满足第二条件。
还需要说明的是,在本申请实施例中,对于第二条件来说,第二条件可以是判断主要位置或次要位置是否处于同位图像的范围之内,或者第二条件也可以是判断主要位置或次要位置是否处于同位的子图像、片、CTU等的范围之内,这里不作任何限定。
还需要说明的是,在本申请实施例中,对于变量J来说,在不同情况下J的取值可以相同,或者也可以不同。另外,对于当前偏移参考位置中的主要位置来说,如果获取到0个偏移时域块向量,那么也可以根据当前偏移参考位置中的次要位置来进一步获取J个时域块向量;若次要位置也获取到0个偏移时域块向量,则跳过当前偏移参考位置,然后基于第一位置索引顺序确定下一个位置索引对应的偏移参考位置。
也就是说,在本申请实施例中,表5中的位置分别是按照第一同位图像(Frame0)和第二同位图像(Frame1)进行交替的对原本的10个参考位置进行偏移,这里可以按照表5中的1~20个位置的顺序,分别进行主要位置的添加,类似的主要位置若不符合第二条件,则使用次要位置,次要位置若也不符合第二条件则跳过当前位置索引,直接添加下一个位置索引的主要位置或次要位置。在这里,第二条件与前文描述的第一条件相同,能够判断是否根据主要位置或次要位置来确定对应的偏移时域块向量,进而确定出一个或多个第二类时域候选块向量。
这样,在确定出第一类时域候选块向量和第二类时域候选时域块向量之后,可以据此得到一个或多个时域候选块向量。具体地,可用从至少一个同位图像的参考位置和/或偏移参考位置来获取对应的运动信息,例如运动信息包括块向量、块的翻转类型、是否使用了光照补偿、是否使用了滤波等。然后根据至少一个同位图像中获取的运动信息来获取块向量。示例性地,如果当前运动信息中包含一个可用的块向量,那么获取这一个块向量作为时域候选块向量;如果当前运动信息中包含多个可用的块向量,那么获取超过一个块向量作为时域候选块向量。
也就是说,在本申请实施例中,运动信息包含几个块向量则可以获取几个时域候选块向量。示例性地,如果当参考位置使用的是基于非块向量的预测模式,那么参考位置可能存在0个块向量,这时候运动信息中保存的块向量也可能是0个;如果当参考位置使用的是IBC模式且为IBC加权预测模式,那么参考位置可能存在多个(两个)块向量,这时候运动信息中保存的块向量也可能是多个。否则,当参考位置使用的是IntraTMP或非加权的IBC预测模式,那么参考位置可能存在一个块向量,这时候运动信息中保存的块向量也可能是一个。
S1003,基于一个或多个时域候选块向量,构建候选合并列表。
需要说明的是,在本申请实施例中,在获取到一个或多个时域候选块向量之后,可以根据一个或多个时域候选块向量来构建候选合并列表,参见图15,该方法可以包括:
S1501,确定当前块的初始合并列表。
S1502,将一个或多个时域候选块向量添加到初始合并列表中,以得到候选合并列表。
在本申请实施例中,初始合并列表是根据相关技术所构建的合并列表,例如初始合并列表中包括的候选块向量可以是诸如相邻位置的块向量、非相邻位置的块向量、基于历史信息的块向量以及自动重定位的块向量等。其中,相邻位置与非相邻位置可以参见图4中的若干相邻和非相邻位置,这些位置上若存在块向量,则确定为相邻位置的块向量与非相邻位置的块向量。
可以理解的是,在初始合并列表处于未填满状态时,可以将一个或多个时域候选块向量添加到初始合并列表中。另外,在将时域候选块向量添加到初始合并列表时,还需要进行查重操作,避免将初始合并列表中的已有块向量重复添加到初始合并列表中。
在一种具体的实施例中,以一个或多个时域候选块向量中的当前时域候选块向量为例,该方法还可以包括:若初始合并列表中存在与当前时域候选块向量相同的候选项,则丢弃当前时域候选块向量;若初始合并列表中不存在与当前时域候选块向量相同的候选项,则将当前时域候选块向量添加到初始合并列表中。也就是说,在本申请实施例中,最终所得到的候选合并列表中不存在重复的块向量。
还可以理解的是,在本申请实施例中,对于第一类时域候选块向量和第二类时域候选块向量来说,可以先添加第一类时域候选块向量(按照第一位置索引顺序),再添加第二类时域候选块向量(按照第二位置索引顺序),直至填满初始合并列表时停止添加。
在一种具体的实施例中,一个或多个时域候选块向量可以包括X个第一类时域候选块向量和Y个第二类时域候选块向量,X、Y均为正整数。相应地,将一个或多个时域候选块向量添加到初始合并列表中,可以包括:将X个第一类时域候选块向量添加到初始合并列表中;在初始合并列表处于未填满状态时,继续将Y个第二类时域候选块向量添加到初始合并列表中,直至填满初始合并列表。
在一种可能的实现方式中,将一个或多个时域候选块向量添加到初始合并列表中,可以包括:将X个第一类时域候选块向量中的N个第一类时域候选块向量和Y个第二类时域候选块向量中的M个第二类时域候选块向量添加到初始合并列表中;其中,N为大于0且小于或等于第一阈值的整数,M为大于0且小于或等于第二阈值的整数。
需要说明的是,在本申请实施例中,向初始合并列表中添加第一类时域候选块向量和第二类时域候选块向量的个数可以分别或一并设定上限,其中,第一阈值表示添加第一类时域候选块向量的个数上限 值,第二阈值表示添加第二类时域候选块向量的个数上限值。示例性地,在初始合并列表中最多添加N个第一类时域候选块向量和M个第二类时域候选块向量。
在另一种可能的实现方式中,将一个或多个时域候选块向量添加到初始合并列表中,可以包括:将一个或多个时域候选块向量中的P个时域候选块向量添加到初始合并列表中;其中,P个时域候选块向量是由第一类时域候选块向量和第二类时域候选块向量组成,且P为大于0且小于或等于第三阈值的整数。
还需要说明的是,在本申请实施例中,向初始合并列表中添加时域候选块向量时设定总的上限值,其中,第三阈值表示添加第一类时域候选块向量和第二类时域候选块向量的总上限值。示例性地,在初始合并列表中最多添加P个时域候选块向量,而且P个时域候选块向量是由若干个第一类时域候选块向量和若干个第二类时域候选块向量组成。
还可以理解的是,在本申请实施例中,还可以设置执行本技术方案的判断条件,即是否将时域候选块向量添加到候选合并列表的判断条件。在一种可能的实现方式中,该方法还可以包括:确定当前块的预测模式;在当前块的预测模式满足预设条件时,执行确定当前块的至少一个同位图像的步骤。
在本申请实施例中,可以通过解码码流来确定当前块的预测模式。在一些实施例中,当前块的预测模式满足预设条件,可以是确定当前块使用Intra TMP模式且构建候选合并列表进行预测;或者,也可以是确定当前块使用IBC模式且构建候选合并列表进行预测。
也就是说,在本申请实施例中,在解码端确定当前块使用IBC模式且需要构建合并列表时,或者确定当前块使用intraTMP模式且需构建候选合并列表时,本技术方案会应用基于时域的候选块向量对构建的候选合并列表进行补充。
在另一种可能的实现方式中,该方法还可以包括:确定当前块所属的视频序列;在视频序列为屏幕内容类别时,执行确定当前块的至少一个同位图像的步骤。也就是说,在本申请实施例中,基于时域的候选块向量可以是只在视频序列为屏幕内容类别时对构建的候选合并列表进行补充。
在又一种可能的实现方式中,该方法还可以包括:解码码流,确定第一语法元素的取值;在第一语法元素指示当前块使用时域候选块向量作为构建候选合并列表的候选项时,执行确定当前块的至少一个同位图像的步骤。
在本申请实施例中,如果第一语法元素的取值为第一值,那么可以确定第一语法元素指示当前块使用时域候选块向量作为构建候选合并列表的候选项;如果第一语法元素的取值为第二值,那么可以确定第一语法元素指示当前块不使用时域候选块向量作为构建候选合并列表的候选项。
在本申请实施例中,第一值与第二值不同。其中,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为真(true),第二值可以设置为假(false);或者,第一值可以设置为假(false),第二值可以设置为真(true)。
示例性地,假定第一值为1,第二值为0,那么在解码获得第一语法元素的取值为1时,则确定当前块使用时域候选块向量作为构建候选合并列表的候选项;在解码获得第一语法元素的取值为0时,则确定当前块不使用时域候选块向量作为构建候选合并列表的候选项。
也就是说,在本申请实施例中,基于时域的候选块向量是否添加进候选合并列表可以受到一些语法元素的控制,这些语法元素可以是序列级的、帧级的、片级的或块级的等。当解码的第一语法元素使能时,这时候才在构建候选合并列表时添加基于时域的第一类时域候选块向量和第二类时域候选块向量。
还可以理解的是,在本申请实施例中,对于根据相关技术构建的初始合并列表来说,示例性地,IBC模式的初始合并列表可以包括:相邻块的块向量、非相邻块的块向量、基于历史信息的块向量和基于自动重新定位的块向量等;intraTMP模式的初始合并列表可以包括:相邻块的块向量和非相邻块的块向量。
这样,对于前述得到的第一类时域候选块向量和第二类时域候选块向量,应与已有类型的块向量按照一定顺序添加进候选合并列表中。
示例性地,对于IBC模式的候选合并列表来说,第一类时域候选块向量和第二类时域候选块向量应在基于自动重新定位的块向量前添加,且位于相邻块的块向量后,顺序可以是:
a.相邻块的块向量、非相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量、基于历史信息的块向量、基于自动重新定位的块向量等;
b.相邻块的块向量、第一类时域候选块向量、非相邻块的块向量、第二类时域候选块向量、基于历史信息的块向量、基于自动重新定位的块向量等;
c.相邻块的块向量、非相邻块的块向量、基于历史信息的块向量、第一类时域候选块向量、第二类时域候选块向量、基于自动重新定位的块向量等。
示例性地,对于IntraTMP模式的候选合并列表来说,第一类时域候选块向量和第二类时域候选块 向量应在位于相邻块向量后,顺序可以是:
a.相邻块的块向量、非相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量等;
b.相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量、非相邻块的块向量等;
c.相邻块的块向量、第一类时域候选块向量、非相邻块的块向量、第二类时域候选块向量等。
在一些实施例中,基于自动重新定位的块向量也会用来添加IntraTMP模式的候选合并列表中,此时应类似地,将基于自动重新定位的块向量在第一类时域候选块向量和第二类时域候选块向量后添加。
还可以理解的是,在本申请实施例中,在构建得到候选合并列表后,还可以根据候选合并列表进行预测,并进一步确定出当前块的重建块。
在一些实施例中,该方法还可以包括:根据候选合并列表确定当前块的一个或多个目标块向量,并根据当前块的一个或多个目标块向量,确定当前块的预测块。
在本申请实施例中,根据候选合并列表确定当前块的一个或多个目标块向量,例如可以是根据候选合并列表内各个候选的模板误差值对该候选合并列表重排序,然后结合解码码流获得的块向量索引,从而可以得到一个或多个目标块块向量。
在本申请实施例中,如果得到一个目标块向量,那么确定该目标块向量对应的参考块,根据该参考块确定当前块的预测块;或者,如果得到至少两个目标块向量,那么确定这至少两个目标块向量对应的至少两个参考块,然后对这至少两个参考块进行加权运算,确定当前块的预测块。
在一些实施例中,该方法还可以包括:解码码流,确定当前块的残差块;根据当前块的残差块和当前块的预测块,确定当前块的重建块。
在本申请实施例中,在解码获得当前块的残差块之后,可以对当前块的残差块和当前块的预测块进行加法运算,确定当前块的重建块,从而实现当前块的重建过程。
本申请实施例提供了一种解码方法,首先确定当前块的至少一个同位图像;然后根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;再基于所述一个或多个时域候选块向量,构建候选合并列表。也就是说,在构建候选合并列表时,考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,例如合并列表模式下IBC和/或IntraTMP的预测效果,同时不会带来额外的软硬件实现复杂度,进而提升编解码效率。
在本申请的另一实施例中,图16为本申请实施例提供的一种编码方法的流程示意图一。如图16所示,该方法可以包括:
S1601,确定当前块的至少一个同位图像。
需要说明的是,本申请实施例的编码方法应用于编码器。该编码方法具体可以是指一种候选合并列表的构建方法,更具体地,是一种基于时域块向量构建候选合并列表的方法。这样,基于图8所示编码器100的组成结构,本申请实施例的编码方法主要适用于帧间预测帧中的intraTMP模式或IBC模式。从而在构建候选合并列表时,能够根据当前块的同位图像来改善候选合并列表无法填满的情况。
还需要说明的是,在本申请实施例中,当前块的同位图像可以是一个,也可以是两个,甚至还可以是更多个。示例性地,如图11所示,当前块可以有两个同位图像,例如位于当前图像之前的前向同位图像(Frame0,参考图像0)和位于当前图像之后的后向同位图像(Frame1,参考图像1)。在这里,当前块为当前图像中的一个块,可以在Frame 0和Frame 1上分别搜索到当前块的参考位置。
在本申请实施例中,对于当前块来说,可以根据码流中的同位图像索引来确定对应的同位图像有一个或多个。在一些实施例中,该方法还可以包括:根据当前块的至少一个同位图像,确定当前块的同位图像索引;对当前块的同位图像索引进行编码处理,将所得到的编码比特写入码流。
需要说明的是,在本申请实施例中,同位图像是参考图像中的一个子集,获取时域的运动向量MV/块向量BV时只可以从同位图像中获取。
还需要说明的是,在本申请实施例中,对于每一个B帧,它可以有两个参考图像列表List0和List1,同位图像索引具体是指同位图像为List0或List1中的哪一个,所以同位图像索引为获取List0和List1的索引值。另外,后续也不排除一个图像可以有更多的同位图像,或者List0和List1里都有超过一个图像是同位图像。也就是说,同位图像索引用于指示同位图像在参考图像列表中的位置。
可以理解地,在本申请实施例中,当前图像包括当前块。对于当前图像来说,当前图像也可能没有同位图像,这时候就无法进一步获取时域候选块向量,这种情况下的候选合并列表仍然是根据相关技术构建的。在当前图像存在同位图像的情况下,这时候可以根据编码端写入码流中的同位图像索引来确定同位图像可以有一个或多个。在一种具体的实施例中,该方法还可以包括:若同位图像索引包括的索引数量为一个,则确定当前块的一个同位图像;若同位图像索引包括的索引数量为两个,则确定当前块的 两个同位图像。
也就是说,对于当前块所属的当前图像来说,如果当前图像没有同位图像索引,那么当前图像不存在同位图像,也就无法进一步获取当前块的时域候选块向量;如果当前图像仅有一个同位图像索引,那么当前图像仅有一个同位图像,此时可以从这一个同位图像中获取当前块的时域候选块向量;如果当前图像有两个同位图像索引,那么当前图像有两个同位图像,此时可以从这两个同位图像中获取当前块的时域候选块向量;更甚者,如果当前图像有多于两个同位图像索引,那么当前图像有多于两个同位图像,此时可以从这些同位图像中获取当前块的时域候选块向量。
示例性地,在已有的参考软件实现中,可以支持当前块的一个帧间帧有两个同位帧(即两个同位图像),那么不仅可以从其中一个同位图像中来获取当前块的时域候选块向量,也可以从这两个同位图像中来获取当前块的时域候选块向量,这里不作任何限定。
S1602,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量。
在本申请实施例中,时域候选块向量可以包括第一类时域候选块向量和/或第二类时域候选块向量。其中,第一类时域候选块向量与第二类时域候选块向量不同,第一类时域候选块向量表征基于同位图像中的参考位置来确定的时域块向量,第二类时域候选块向量表征基于同位图像的运动向量指示参考位置进行偏移所确定的偏移时域块向量。
在本申请实施例中,对于某一个同位图像来说,该同位图像中的参考位置可以是非基于块向量预测的块,那么该参考位置的运动信息中不包括块向量;更甚者,如果该同位图像中的所有参考位置都是非基于块向量预测的块,那么这些参考位置的运动信息中都不包括块向量,这时候根据该同位图像可以获得0个时域块向量。
也就是说,假设至少一个同位图像包括第一同位图像和第二同位图像,那么有可能获得第一同位图像的0个时域块向量以及第二同位图像的0个时域块向量,即根据这至少一个同位图像有可能获得0个时域候选块向量,这种情况下的候选合并列表仍是根据相关技术构建的。
考虑到本技术方案是为了解决候选合并列表无法填满的情况,将所获得的时域候选块向量添加到候选合并列表中,下面以根据至少一个同位图像能够获得当前块的至少一个时域候选块向量为例进行说明。
在一种可能的实现方式中,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量,可以包括:根据至少一个同位图像,确定X个第一类时域候选块向量;根据X个第一类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X为正整数。
在另一种可能的实现方式中,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量,可以包括:根据至少一个同位图像,确定Y个第二类时域候选块向量;根据Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,Y为正整数。
在又一种可能的实现方式中,根据至少一个同位图像,确定当前块的一个或多个时域候选块向量,可以包括:根据至少一个同位图像,确定X个第一类时域候选块向量和Y个第二类时域候选块向量;根据X个第一类时域候选块向量和Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X、Y均为正整数。
也就是说,在本申请实施例中,对于当前块的一个或多个时域候选块向量来说,可以是根据至少一个同位图像所确定的X个第一类时域候选块向量和/或Y个第二类时域候选块向量来得到的。
在一些实施例中,根据至少一个同位图像,确定X个第一类时域候选块向量,可以包括:确定至少一个同位图像各自的K个时域块向量,K为大于或等于0的整数;根据至少一个同位图像各自的K个时域块向量,确定X个第一类时域候选块向量。
在本申请实施例中,在至少一个同位图像仅包括一个同位图像时,这时候可以设置K的取值与X的取值相等。
另外,在本申请实施例中,对于不同的同位图像,K的取值可以相同,或者也可以不同。示例性地,假设有第一同位图像和第二同位图像,那么可以获得第一同位图像的0个时域块向量,以及获得第二同位图像的非0个时域块向量;或者,也可以是获得第一同位图像和第二同位图像各自的非0个时域块向量。
在本申请实施例中,第一同位图像为至少一个同位图像中的任意一个。对于确定至少一个同位图像各自的一个或多个时域块向量来说,以第一同位图像为例,该方法可以包括:确定第一同位图像中的一个或多个参考位置;根据一个或多个参考位置,确定第一同位图像的K个时域块向量。
示例性地,对于第一同位图像来说,如果第一同位图像中的所有参考位置都是非基于块向量预测的块,那么这些参考位置的运动信息中都不包括块向量,这时候可以获得第一同位图像的0个时域块向量。
需要说明的是,对于每个同位图像来说,可以有一个或多个参考位置,这些参考位置的定义如前述的表3所示。在表3中,X0和Y0表示当前块右下角位置在当前图像中的横坐标和纵坐标,X1和Y1 表示当前块中间位置在当前图像中的横坐标和纵坐标,W和H表示当前块的宽度和高度。
需要注意的是,表3中的这些参考位置大都是当前块的位置或者是当前块右侧、右下以及下方上的位置,由于这些位置在当前图像内还未完成编解码所以无法获取到所需信息,而时域上的参考图像(具体是同位图像)已经完成编解码,这些信息可以保存下来并获取到。在一些实施例中,时域上的参考位置除上述的这些参考位置之外,也可以选取为当前块内,或是左上、上、右上、左以及左下等方向上的位置,这里不作任何限定。另外,还需要注意的是,对于某个同位图像来说,也有可能包括0个参考位置,这时候针对该同位图像将不再执行获取时域候选块向量的步骤。
在一些实施例中,根据一个或多个参考位置,确定第一同位图像的K个时域块向量,可以包括:确定当前位置索引对应的当前参考位置;在当前参考位置满足第一条件时,根据当前参考位置确定H个时域块向量,H为大于或等于0的整数;基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤,直至一个或多个参考位置遍历完成,以得到第一同位图像的K个时域块向量。
在本申请实施例中,根据当前参考位置确定H个时域块向量,例如可以是确定0个、1个、2个或者更多个时域块向量。示例性地,如果当前参考位置使用了非基于块向量的预测模式,那么这时候可以有0个时域块向量;如果当前参考位置使用了IBC加权预测模式,那么这时候可以有多个(两个)时域块向量;如果当前参考位置使用了IntraTMP或非加权的IBC预测模式,那么这时候可以有一个时域块向量。
在本申请实施例中,第一位置索引顺序可以是表3中的位置索引顺序,例如1、2、3、…10等。首先将位置索引1确定为当前位置索引对应的当前参考位置,在当前参考位置满足第一条件时,根据当前参考位置确定H个时域块向量;然后将位置索引2对应的参考位置确定为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤,再将位置索引3对应的参考位置确定为当前参考位置,以此类推,直至这10个参考位置遍历完成,以得到第一同位图像的K个时域块向量。
在本申请实施例中,如表3所示,每一个参考位置均可以包括主要位置和次要位置。在一些实施例中,根据当前参考位置确定H个时域块向量,该方法可以包括:判断当前参考位置中的主要位置是否满足第一条件;在当前参考位置中的主要位置满足第一条件时,根据当前参考位置中的主要位置确定H个时域块向量;在当前参考位置中的主要位置不满足第一条件时,判断当前参考位置中的次要位置是否满足第一条件;在当前参考位置中的次要位置满足第一条件时,根据当前参考位置中的次要位置确定H个时域块向量;在当前参考位置中的主要位置不满足第一条件且当前参考位置中的次要位置不满足第一条件时,跳过当前参考位置,基于第一位置索引顺序确定下一个位置索引对应的参考位置。
需要说明的是,在本申请实施例中,当前参考位置中的主要位置满足第一条件,可以包括:当前参考位置中的主要位置处于第一同位图像的范围之内。相应地,当前参考位置中的次要位置满足第一条件,可以包括:当前参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,该方法还可以包括:在当前参考位置不满足第一条件时,跳过当前参考位置,基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤。
还需要说明的是,在本申请实施例中,当前参考位置不满足第一条件,可以包括:当前参考位置中的主要位置不满足第一条件且当前参考位置中的次要位置不满足第一条件。
还需要说明的是,在本申请实施例中,对于第一条件来说,第一条件可以是判断主要位置或次要位置是否处于同位图像的范围之内,或者第一条件也可以是判断主要位置或次要位置是否处于同位的子图像、片、CTU等的范围之内,这里不作任何限定。
还需要说明的是,在本申请实施例中,对于变量H来说,在不同情况下H的取值可以相同,或者也可以不同。另外,对于当前参考位置中的主要位置来说,如果获取到0个时域块向量,那么也可以根据当前参考位置中的次要位置来进一步获取H个时域块向量;若次要位置也获取到0个时域块向量,则跳过当前参考位置,然后基于第一位置索引顺序确定下一个位置索引对应的参考位置。
也就是说,在本申请实施例中,对于每一个同位图像来说,该同位图像中的参考位置可以包括表3中的10个主要位置和10个次要位置,按照位置索引1~10的顺序依次添加主要位置。当主要位置不满足第一条件(主要位置不在同位图像的范围之内,或者也可以是其他条件,例如不处于同位的子图像、片、CTU等等的范围之内)时,则采用对应的次要位置替代主要位置来确定时域块向量;若次要位置也不满足第一条件,则跳过该位置索引,直接添加下一个位置索引的主要位置或次要位置,进而确定出一个或多个第一类时域候选块向量。
在本申请实施例中,除了根据表3中的参考位置来确定第一类时域候选块向量之外,还可以结合搜索到的运动向量来确定第二类时域候选块向量。在一些实施例中,根据至少一个同位图像,确定Y个 第二类时域候选块向量,可以包括:确定至少一个同位图像各自的I个偏移时域块向量,I为大于或等于0的整数;根据至少一个同位图像各自的I个偏移时域块向量,确定Y个第二类时域候选块向量。
在本申请实施例中,在至少一个同位图像仅包括一个同位图像时,这时候可以设置I的取值与Y的取值相等。
另外,在本申请实施例中,对于不同的同位图像,I的取值可以相同,或者也可以不同。示例性地,假设有第一同位图像和第二同位图像,那么可以获得第一同位图像的0个偏移时域块向量,以及获得第二同位图像的非0个偏移时域块向量;或者,也可以是获得第一同位图像和第二同位图像各自的非0个偏移时域块向量。
在本申请实施例中,第一同位图像为至少一个同位图像中的任意一个。对于确定至少一个同位图像各自的I个偏移时域块向量来说,以第一同位图像为例,该方法可以包括:确定第一同位图像的第一运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;根据第一同位图像中的一个或多个偏移参考位置,确定第一同位图像的I个偏移时域块向量。
示例性地,对于第一同位图像来说,如果第一同位图像中的所有偏移参考位置都是非基于块向量预测的块,那么这些偏移参考位置的运动信息中都不包括块向量,这时候可以获得第一同位图像的0个偏移时域块向量。
在本申请实施例中,当前块所属帧即为当前图像。对于当前图像的第一同位图像来说,在一些实施例中,确定第一同位图像的第一运动向量,可以包括:确定当前块周围的多个候选位置各自的运动向量以及运动向量指向的参考图像索引;基于预设位置顺序确定多个候选位置中的当前候选位置,根据当前候选位置的运动向量指向的当前参考图像索引,在当前参考图像索引指示的参考图像为第一同位图像时,将当前候选位置的运动向量确定为第一同位图像的第一运动向量。
在本申请实施例中,预设位置顺序可以如图13所示的0、1、2、3、4的顺序,这五个位置为当前块的空间相邻块。这五个位置在当前图像中的坐标定义如前述的表4所示。在表4中,X2和Y2表示当前块左上角位置在当前图像中的横坐标和纵坐标,W和H表示当前块的宽度和高度。
另外,在本申请实施例中,除了图13中的五个位置之外,获取同位图像中用于偏移的运动向量也可以通过当前块周围的其他位置获得,而且对于一个同位图像也可找到多个运动向量来指引偏移。
在一些实施例中,在当前参考图像索引指示的参考图像为第一同位图像时,该方法还可以包括:对当前候选位置的运动向量进行修正操作,将修正后的运动向量确定为第一同位图像的第一运动向量。
在本申请实施例中,以第一同位图像的第一运动向量为例,在当前参考图像索引指示的参考图像为第一同位图像时,可以将当前候选位置的运动向量直接确定为第一同位图像的第一运动向量,或者也可以将当前候选位置的运动向量进行修正操作后确定为第一同位图像的第一运动向量。在这里,修正操作可以为取整操作,其目的是避免找到子像素位置。
在一些实施例中,确定至少一个同位图像各自的I个偏移时域块向量,可以包括:在至少一个同位图像包括第一同位图像和第二同位图像时,确定第一同位图像的第一运动向量和第二同位图像的第二运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;以及根据第二运动向量对一个或多个初始参考位置进行偏移,得到第二同位图像中的一个或多个偏移参考位置;根据第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置,确定至少一个同位图像各自的I个偏移时域块向量。
需要说明的是,在本申请实施例中,假定当前图像有两个同位图像:第一同位图像Frame0和第二同位图像Frame1,这时候可以找到两个运动向量分别为第一运动向量MV0’和第二运动向量MV1’,那么首先对MV0’和MV1’进行取整(目的是避免找到子像素位置)获得MV0和MV1,从而可以确定出一个或多个偏移参考位置,然后根据这些偏移参考位置是否包含块向量来获取I个偏移时域块向量。另外,在本申请实施例中,对于一个同位图像来说,如果这一个同位图像可以找到多个运动向量对初始参考位置进行偏移,例如第一同位图像(Frame0)找到了运动向量MV00、MV01、…,则此时也应当有更多的偏移参考位置,这里不作任何限定。
还需要说明的是,对于这两个同位图像来说,每一个同位图像有一个或多个偏移参考位置,这些偏移参考位置的定义如前述的表5所示。在表5中,X0和Y0表示当前块右下角位置在当前图像中的横坐标和纵坐标,X1和Y1表示当前块中间位置在当前图像中的横坐标和纵坐标,W和H表示当前块的宽度和高度。另外,MV0.X和MV0.Y分别为对应第一同位图像(Frame0)的整型运动向量的水平方向偏移和垂直方向偏移,MV1.X和MV1.Y分别为对应第二同位图像(Frame1)的整型运动向量的水平方向偏移和垂直方向偏移。
需要注意的是,在本申请实施例中,偏移时域参考位置除了表5中的这些参考位置之外,也可以选取其他参考位置,这里不作任何限定。另外,还需要注意的是,对于某个同位图像来说,也有可能包括0个偏移参考位置,这时候针对该同位图像将不再执行获取时域候选块向量的步骤。
还需要说明的是,在本申请实施例中,对于一个同位图像来说,如果这一个同位图像可以找到多个运动向量对初始参考位置进行偏移,例如第一同位图像(Frame0)找到了运动向量MV00、MV01、…,则此时也应当有更多的偏移参考位置。换句话说,针对一个同位图像中找到多个用于偏移的运动向量时,那么定义的偏移参考位置也会对应增加。
在一些实施例中,根据第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置,确定至少一个同位图像各自的I个偏移时域块向量,可以包括:确定当前位置索引对应的当前偏移参考位置;在当前偏移参考位置满足第二条件时,根据当前偏移参考位置确定J个偏移时域块向量,J为大于或等于0的整数;基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤,直至所有的偏移参考位置遍历完成,以得到至少一个同位图像各自的I个偏移时域块向量。
在本申请实施例中,第二位置索引顺序可以是表5中的位置索引顺序。如表5所示,该方法还可以包括:将第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置进行交替设置,确定第二位置索引顺序。
在本申请实施例中,根据当前偏移参考位置确定J个偏移时域块向量,例如可以是确定0个、1个、2个或者更多个偏移时域块向量。示例性地,如果当前偏移参考位置使用了非基于块向量的预测模式,那么这时候可以有0个偏移时域块向量;如果当前偏移参考位置使用了IBC加权预测模式,那么这时候可以有多个(两个)偏移时域块向量;如果当前偏移参考位置使用了IntraTMP或非加权的IBC预测模式,那么这时候可以有一个偏移时域块向量。
在本申请实施例中,如表5所示,每一个偏移参考位置均可以包括主要位置和次要位置。在一些实施例中,根据当前偏移参考位置确定J个偏移时域块向量,可以包括:判断当前偏移参考位置中的主要位置是否满足第二条件;在当前偏移参考位置中的主要位置满足第二条件时,根据当前偏移参考位置中的主要位置确定J个偏移时域块向量;在当前偏移参考位置中的主要位置不满足第二条件时,判断当前偏移参考位置中的次要位置是否满足第二条件;在当前偏移参考位置中的次要位置满足第二条件时,根据当前偏移参考位置中的次要位置确定J个偏移时域块向量;在当前偏移参考位置中的主要位置不满足第二条件且当前偏移参考位置中的次要位置不满足第二条件时,跳过当前偏移参考位置,基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置。
需要说明的是,在本申请实施例中,当前偏移参考位置中的主要位置满足第二条件,可以包括:当前偏移参考位置中的主要位置处于第一同位图像的范围之内。相应地,当前偏移参考位置中的次要位置满足第二条件,可以包括:当前偏移参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,该方法还可以包括:在当前偏移参考位置不满足第二条件时,跳过当前偏移参考位置,基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤。
还需要说明的是,在本申请实施例中,当前偏移参考位置不满足第二条件,可以包括:当前偏移参考位置中的主要位置不满足第二条件且当前偏移参考位置中的次要位置不满足第二条件。
还需要说明的是,在本申请实施例中,对于第二条件来说,第二条件可以是判断主要位置或次要位置是否处于同位图像的范围之内,或者第二条件也可以是判断主要位置或次要位置是否处于同位的子图像、片、CTU等的范围之内,这里不作任何限定。
还需要说明的是,在本申请实施例中,对于变量J来说,在不同情况下J的取值可以相同,或者也可以不同。另外,对于当前偏移参考位置中的主要位置来说,如果获取到0个偏移时域块向量,那么也可以根据当前偏移参考位置中的次要位置来进一步获取J个时域块向量;若次要位置也获取到0个偏移时域块向量,则跳过当前偏移参考位置,然后基于第一位置索引顺序确定下一个位置索引对应的偏移参考位置。
也就是说,在本申请实施例中,表5中的位置分别是按照第一同位图像(Frame0)和第二同位图像(Frame1)进行交替的对原本的10个参考位置进行偏移,这里可以按照表5中的1~20个位置的顺序,分别进行主要位置的添加,类似的主要位置若不符合第二条件,则使用次要位置,次要位置若也不符合第二条件则跳过当前位置索引,直接添加下一个位置索引的主要位置或次要位置。在这里,第二条件与前文描述的第一条件相同,能够判断是否根据主要位置或次要位置来确定对应的偏移时域块向量,进而确定出一个或多个第二类时域候选块向量。
这样,在确定出第一类时域候选块向量和第二类时域候选时域块向量之后,可以据此得到一个或多个时域候选块向量。具体地,可用从至少一个同位图像的参考位置和/或偏移参考位置来获取对应的运动信息,例如运动信息包括块向量、块的翻转类型、是否使用了光照补偿、是否使用了滤波等。然后根据至少一个同位图像中获取的运动信息来获取块向量。示例性地,如果当前运动信息中包含一个可用的块向量,那么获取这一个块向量作为时域候选块向量;如果当前运动信息中包含多个可用的块向量,那么获取超过一个块向量作为时域候选块向量。
也就是说,在本申请实施例中,运动信息包含几个块向量则可以获取几个时域候选块向量。示例性地,如果当参考位置使用的是基于非块向量的预测模式,那么参考位置可能存在0个块向量,这时候运动信息中保存的块向量也可能是0个;如果当参考位置使用的是IBC模式且为IBC加权预测模式,那么参考位置可能存在多个(两个)块向量,这时候运动信息中保存的块向量也可能是多个。否则,当参考位置使用的是IntraTMP或非加权的IBC预测模式,那么参考位置可能存在一个块向量,这时候运动信息中保存的块向量也可能是一个。
S1603,基于一个或多个时域候选块向量,构建候选合并列表。
需要说明的是,在本申请实施例中,基于一个或多个时域候选块向量来构建候选合并列表,该方法可以包括:确定当前块的初始合并列表;将一个或多个时域候选块向量添加到初始合并列表中,以得到候选合并列表。
在本申请实施例中,初始合并列表是根据相关技术所构建的合并列表,例如初始合并列表中包括的候选块向量可以是诸如相邻位置的块向量、非相邻位置的块向量、基于历史信息的块向量以及自动重定位的块向量等。其中,相邻位置与非相邻位置可以参见图4中的若干相邻和非相邻位置,这些位置上若存在块向量,则确定为相邻位置的块向量与非相邻位置的块向量。
可以理解的是,在初始合并列表处于未填满状态时,可以将一个或多个时域候选块向量添加到初始合并列表中。另外,在将时域候选块向量添加到初始合并列表时,还需要进行查重操作,避免将初始合并列表中的已有块向量重复添加到初始合并列表中。
在一种具体的实施例中,以一个或多个时域候选块向量中的当前时域候选块向量为例,该方法还可以包括:若初始合并列表中存在与当前时域候选块向量相同的候选项,则丢弃当前时域候选块向量;若初始合并列表中不存在与当前时域候选块向量相同的候选项,则将当前时域候选块向量添加到初始合并列表中。也就是说,在本申请实施例中,最终所得到的候选合并列表中不存在重复的块向量。
还可以理解的是,在本申请实施例中,对于第一类时域候选块向量和第二类时域候选块向量来说,可以先添加第一类时域候选块向量(按照第一位置索引顺序),再添加第二类时域候选块向量(按照第二位置索引顺序),直至填满初始合并列表时停止添加。
在一种具体的实施例中,一个或多个时域候选块向量可以包括X个第一类时域候选块向量和Y个第二类时域候选块向量,X、Y均为正整数。相应地,将一个或多个时域候选块向量添加到初始合并列表中,可以包括:将X个第一类时域候选块向量添加到初始合并列表中;在初始合并列表处于未填满状态时,继续将Y个第二类时域候选块向量添加到初始合并列表中,直至填满初始合并列表。
在一种可能的实现方式中,将一个或多个时域候选块向量添加到初始合并列表中,可以包括:将X个第一类时域候选块向量中的N个第一类时域候选块向量和Y个第二类时域候选块向量中的M个第二类时域候选块向量添加到初始合并列表中;其中,N为大于0且小于或等于第一阈值的整数,M为大于0且小于或等于第二阈值的整数。
需要说明的是,在本申请实施例中,向初始合并列表中添加第一类时域候选块向量和第二类时域候选块向量的个数可以分别或一并设定上限,其中,第一阈值表示添加第一类时域候选块向量的个数上限值,第二阈值表示添加第二类时域候选块向量的个数上限值。示例性地,在初始合并列表中最多添加N个第一类时域候选块向量和M个第二类时域候选块向量。
在另一种可能的实现方式中,将一个或多个时域候选块向量添加到初始合并列表中,可以包括:将一个或多个时域候选块向量中的P个时域候选块向量添加到初始合并列表中;其中,P个时域候选块向量是由第一类时域候选块向量和第二类时域候选块向量组成,且P为大于0且小于或等于第三阈值的整数。
还需要说明的是,在本申请实施例中,向初始合并列表中添加时域候选块向量时设定总的上限值,其中,第三阈值表示添加第一类时域候选块向量和第二类时域候选块向量的总上限值。示例性地,在初始合并列表中最多添加P个时域候选块向量,而且P个时域候选块向量是由若干个第一类时域候选块向量和若干个第二类时域候选块向量组成。
还可以理解的是,在本申请实施例中,还可以设置执行本技术方案的判断条件,即是否将时域候选块向量添加到候选合并列表的判断条件。在一种可能的实现方式中,该方法还可以包括:确定当前块的 预测模式;在当前块的预测模式满足预设条件时,执行确定当前块的至少一个同位图像的步骤。
在本申请实施例中,编码端在确定当前块的预测模式之后,可以将当前块的预测模式编码到码流中,以使得后续在解码端仅通过解码码流就可以确定当前块的预测模式。在一些实施例中,当前块的预测模式满足预设条件,可以是确定当前块使用Intra TMP模式且构建候选合并列表进行预测;或者,也可以是确定当前块使用IBC模式且构建候选合并列表进行预测。
也就是说,在本申请实施例中,在编码端确定当前块使用IBC模式且需要构建合并列表时,或者确定当前块使用intraTMP模式且需构建候选合并列表时,本技术方案会应用基于时域的候选块向量对构建的候选合并列表进行补充。
在另一种可能的实现方式中,该方法还可以包括:确定当前块所属的视频序列;在视频序列为屏幕内容类别时,执行确定当前块的至少一个同位图像的步骤。也就是说,在本申请实施例中,基于时域的候选块向量可以是只在视频序列为屏幕内容类别时对构建的候选合并列表进行补充。
在又一种可能的实现方式中,该方法还可以包括:在当前块使用时域候选块向量作为构建候选合并列表的候选项时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,该方法还可以包括:确定第一语法元素的取值;对第一语法元素的取值进行编码处理,将所得到的编码比特写入码流。
在本申请实施例中,第一语法元素可以用于指示当前块是否使用时域候选块向量作为构建候选合并列表的候选项。其中,如果当前块使用时域候选块向量作为构建候选合并列表的候选项,那么可以确定第一语法元素的取值为第一值;如果当前块不使用时域候选块向量作为构建候选合并列表的候选项,那么可以确定第一语法元素的取值为第二值。
在本申请实施例中,第一值与第二值不同。其中,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为真(true),第二值可以设置为假(false);或者,第一值可以设置为假(false),第二值可以设置为真(true)。
示例性地,假定第一值为1,第二值为0,那么在当前块使用时域候选块向量作为构建候选合并列表的候选项,那么可以将第一语法元素的取值为1编码到码流中;在当前块不使用时域候选块向量作为构建候选合并列表的候选项,那么可以将第一语法元素的取值为0编码到码流中。
也就是说,在本申请实施例中,基于时域的候选块向量是否添加进候选合并列表可以受到一些语法元素的控制,这些语法元素可以是序列级的、帧级的、片级的或块级的等。如此,后续解码端在解码出的第一语法元素使能时,这时候才在构建候选合并列表时添加基于时域的第一类时域候选块向量和第二类时域候选块向量,否则将不会添加基于时域的第一类时域候选块向量和第二类时域候选块向量。
还可以理解的是,在本申请实施例中,对于根据相关技术构建的初始合并列表来说,示例性地,IBC模式的初始合并列表可以包括:相邻块的块向量、非相邻块的块向量、基于历史信息的块向量和基于自动重新定位的块向量等;intraTMP模式的初始合并列表可以包括:相邻块的块向量和非相邻块的块向量。
这样,对于前述得到的第一类时域候选块向量和第二类时域候选块向量,应与已有类型的块向量按照一定顺序添加进候选合并列表中。
示例性地,对于IBC模式的候选合并列表来说,第一类时域候选块向量和第二类时域候选块向量应在基于自动重新定位的块向量前添加,且位于相邻块的块向量后,顺序可以是:
a.相邻块的块向量、非相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量、基于历史信息的块向量、基于自动重新定位的块向量等;
b.相邻块的块向量、第一类时域候选块向量、非相邻块的块向量、第二类时域候选块向量、基于历史信息的块向量、基于自动重新定位的块向量等;
c.相邻块的块向量、非相邻块的块向量、基于历史信息的块向量、第一类时域候选块向量、第二类时域候选块向量、基于自动重新定位的块向量等。
示例性地,对于IntraTMP模式的候选合并列表来说,第一类时域候选块向量和第二类时域候选块向量应在位于相邻块向量后,顺序可以是:
a.相邻块的块向量、非相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量等;
b.相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量、非相邻块的块向量等;
c.相邻块的块向量、第一类时域候选块向量、非相邻块的块向量、第二类时域候选块向量等。
在一些实施例中,基于自动重新定位的块向量也会用来添加IntraTMP模式的候选合并列表中,此时应类似地,将基于自动重新定位的块向量在第一类时域候选块向量和第二类时域候选块向量后添加。
还可以理解的是,在本申请实施例中,在构建得到候选合并列表之后,参见图16,该方法还包括:
S1604,根据候选合并列表进行预测,确定当前块的预测块。
需要说明的是,在本申请实施例中,根据候选合并列表进行预测,确定当前块的预测块,可以包括:根据候选合并列表确定当前块的一个或多个目标块向量,并根据当前块的一个或多个目标块向量,确定当前块的预测块。
也就是说,在本申请实施例中,根据候选合并列表确定当前块的一个或多个目标块向量,例如可以是根据候选合并列表内各个候选的模板误差值来确定一个或多个目标块块向量。进一步地,还可以根据候选合并列表内各个候选的模板误差值对该候选合并列表重排序,然后确定这一个或多个目标块块向量对应的块向量索引并将其写入码流,以使得后续解码端在得到重排序的候选合并列表之后,结合码流获得的块向量索引就可以得到一个或多个目标块块向量。
还需要说明的是,在本申请实施例中,如果得到一个目标块向量,那么确定该目标块向量对应的参考块,根据该参考块确定当前块的预测块;或者,如果得到至少两个目标块向量,那么确定这至少两个目标块向量对应的至少两个参考块,然后对这至少两个参考块进行加权运算,确定当前块的预测块。
在一些实施例中,在确定当前块的预测块之后,参见图17,该方法还可以包括:
S1701,根据当前块的预测块,确定当前块的残差块。
S1702,对当前块的残差块进行编码处理,将所得到的编码比特写入码流。
在本申请实施例中,确定当前块的残差块,可以包括:确定当前块的初始块;根据当前块的初始块和当前块的预测块,确定当前块的残差块。具体地,可以是对当前块的初始块和当前块的预测块进行减法运算,确定当前块的残差块。
在本申请实施例中,还可以对当前块的残差块进行变换与量化处理,然后将其编码到码流中。这样在将当前块的残差块编码到码流之后,可以方便解码端实现当前块的重建过程。
还可以理解的是,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的。其中,待编码信息包括下述至少一项:当前块的残差值、当前块的同位图像索引和第一语法元素的取值;其中,第一语法元素用于指示当前块是否使用时域候选块向量作为构建候选合并列表的候选项。
本申请实施例提供了一种编码方法,首先确定当前块的至少一个同位图像;然后根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;再基于所述一个或多个时域候选块向量,构建候选合并列表。也就是说,在构建候选合并列表时,考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,例如合并列表模式下IBC和/或IntraTMP的预测效果,同时不会带来额外的软硬件实现复杂度,进而提升编解码效率。
在本申请的又一实施例中,基于前述实施例所述的编解码方法,本申请实施例的技术方案所处于整个编解码框架中的位置为帧间预测帧中的intraTMP模式或IBC模式。
在一些实施例中,在编码端,当编码器在对当前块使用IBC模式且需要构建候选合并列表时,或在对当前块使用intraTMP模式且需构建候选合并列表时,本技术方案会应用基于时域的候选块向量对构建的候选合并列表进行补充,即用于填充IBC merge list或IntraTmp merge list。
在一些实施例中,在解码端,当解码器确定当前块使用IBC模式且需要构建候选合并列表时,或确定当前块使用intraTMP模式且需构建候选合并列表时,本方案会应用基于时域的块向量对构建的候选合并列表进行补充,即用于填充IBC merge list或IntraTmp merge list。
在一种可能的实现方式中,每帧图像/每个编码单元在编码和解码后都会在运动信息缓存中存储这个图像/块的运动信息,运动信息包括以下部分:
①当参考位置为帧间预测块时,运动信息应包括运动向量等信息;
②当参考位置为IBC或intraTMP预测块时,运动信息应包括:块向量、块的翻转类型、是否使用了光照补偿、是否使用了滤波等。此外,由于当参考位置使用的是IBC模式时,IBC可能是加权模式,此时可能存在多个(两个)块向量,所以运动信息中保存的块向量也可能是多个。
在另一种可能的实现方式中,如图11所示,本技术方案获取时域块向量的步骤大致可以分为:
步骤一,根据同位图像的索引找到存储同位图像运动信息的缓存;
步骤二,根据参考位置信息从运动信息的缓存中获取到运动信息;
步骤三,判断运动信息是否包括块向量,若包含且是可用的块向量,则获取块向量。
具体地,获取时域的块向量可以包含以下特征:
特征A、时域的块向量可以由同位图像中(collocated picture)获取,对于一个帧间编码的帧,根据编入码流或从码流中解析出的同位图像的索引可以确定同位图像可以有一个或多个(对应步骤一中的同位图像):
①如果当前图像没有同位图像,则不进一步获取时域的块向量;
②如果当前图像仅有一个同位图像,则进一步从这一个同位图像中获取块向量;
③如果当前图像有多于一个同位图像,则进一步从这些同位图像中的一帧或多帧获取块向量。
示例性地,在参考软件实现中支持1帧帧间帧有2个同位帧,可以只从其中的一个同位帧获取块向量,或者也可以从2个同位帧中获取。
在本申请实施例中,对于帧间编码的帧,获取对应的同位图像,根据码流中解析出的语法元素确定同位图像的当前图像的同位图像的个数为一个或是两个:(1)若是一个,则从一个同位图像中去获取时域块向量;(2)若是两个,则从两个中去获取时域块向量。也就是说,本技术方案可以从大于或等于一个同位帧中根据参考位置查找块向量。
特征B、在同位图像中一个或多个参考位置获取块向量,例如前述表3中定义的参考位置(对应步骤二的同位图像中的参考位置):
在表3中,X0和Y0代表当前块右下角位置在当前图像中的横坐标和纵坐标,X1和Y1代表当前块中间位置在当前图像中的横坐标和纵坐标,W和H代表当前块的宽度和高度。也就是说,本技术方案根据表3中的顺序和方式在同位帧的主要/次要位置查找块向量。
需要注意的是,这些时域上的参考位置大都是当前块的位置或者是当前块右侧、右下以及下方上的位置,这是由于这些位置在当前图像内还未完成编解码所以无法获取到所需信息,而对于时域上的参考图像,同位图像已经完成了编解码,这些信息可以保存下来并获取到。在一些实施例中,时域上的位置也可以选取为当前块内,或是左上、上、右上、左以及左下等方向上的位置。
在本申请实施例中,同位图像中的参考位置可以包括表3中的10个主要位置和10个次要位置,按照位置索引1~10依次添加主要位置。当主要位置不满足条件(主要位置不在同位图像的范围内,这里的条件也可以是别的条件例如不处于同位的子图像,片,CTU等的范围内)时,则采用对应的次要位置替代主要位置;若次要位置也不满足条件,则跳过该位置索引,直接添加下一个位置索引的主要或次要位置。
进一步地,除了时域参考位置上的块向量(可以称为“时域块向量”),本技术方案还可以根据搜索到的运动向量来指引参考位置进行偏移,从而获取时域偏移参考位置上的块向量(可以称为“偏移时域块向量”):
首先,根据索引0-4的顺序分别找到前述图13中当前块周围5个位置的运动向量和运动向量所指向的参考图像索引——这5个位置在当前图像中的坐标如前述表4所示。
在一些实施例中,获取同位图像中偏移运动向量也可以通过当前块周围别的位置获得,对于一个同位图像也可找到多个偏移运动向量来指引偏移。
其次,当访问的位置为帧间编码块则进一步获取其运动向量MV和MV指向的参考图像索引,若指向的参考图像为同位图像,则该MV则被记录下用来对参考位置做偏移。对于当前图像的所有同位图像,分别按照顺序找到1个对应同位图像的MV。
再次,根据找到的同位图像的MV来对参考位置进行偏移。例如当前图像有两个同位图像Frame0和Frame1,且找到的两个运动向量分别为MV0’和MV1’,那么首先将MV0’和MV1’取整(目的是避免找到子像素位置上)获得MV0和MV1。接着再按照前述表5的顺序在对应的同位图像中找到表5中的参考位置是否包含块向量。
在表5中,MV0.X和MV0.Y分别为对应同位图像0(Frame0)的整型运动向量的水平方向偏移和垂直方向偏移,MV1.X和MV1.Y分别为对应同位图像1(Frame1)的整型运动向量的水平方向偏移和垂直方向偏移,不难发现表5中的参考位置分别是按照同位图像0和同位图像1进行交替的对原本的10个参考位置进行偏移,这里按照表5中的1-20个位置的顺序,分别进行主要位置的添加,类似的主要位置若不符合条件,则使用次要位置,次要位置若也不符合条件则跳过当前位置顺序。所述条件与前文的描述相同。
在一些实施例中,对于一个同位图像找到多个偏移向量对参考位置进行偏移时,例如同位图像0找到了偏移向量MV00、MV01…..,则此时也应当有更多的偏移的参考位置。也就是说,本技术方案是针对一个同位图像中找到多个偏移向量时,此时定义的偏移参考位置也可以增加。
特征C、当从同位图像中获取的运动信息中包含一个或多个块向量时(对应步骤三的获取块向量):
①如果当前运动信息中包含一个可用的块向量,则获取这个块向量;
②如果当前运动信息中包含多个可用块向量,则可以获取超过一个块向量。
也就是说,在本申请实施例中,运动信息可以包含几个块向量则获取几个块向量。具体地,运动信息中包括多个块向量,那么大于或等于一个块向量可以做为时域块向量被添加。
在参考软件中,当一个块使用了IBC加权预测时,这个块将会有两个块向量被保存下来作为运动信息;当一个块使用了IntraTMP或非加权的IBC预测模式时,将会有一个块向量被保存下来作为运动 信息。在本申请实施例中,如果同位图像的参考位置的运动信息中包括了一个块向量,那么可以添加这个块向量进入候选合并列表;若有两个块向量,则添加两个进入候选合并列表(Merge list)。
进一步地,除了上述描述的获取时域块向量的特征之外,还可以包括以下几个特征:
①在将块向量添加进候选合并列表时,需要经过查重,避免将候选合并列表中已有的块向量重复添加进合并列表;
②先添加时域块向量(同位图像参考位置顺序上的),再添加偏移时域块向量(同位图像偏移参考位置上的),当填充的块向量到达候选合并列表设定上限时停止添加;
③时域块向量和偏移时域块向量的个数可以分别或一并设定上限,例如最多添加N个时域块向量、M个偏移时域块向量、或共最多添加P个时域和偏移的时域块向量;
④时域块向量和偏移时域块向量可以只在视频序列为屏幕内容类型时添加,时域和偏移的时域块向量是否添加进候选合并列表可以受到一些语法元素的控制,这些语法元素可以是序列级的、帧级的、片级的或块级的等。当编码和解码的语法元素使能时,才可以在构建候选合并列表时添加时域和偏移的时域块向量。
在相关技术中,初始合并列表包括:
(1)IBC模式的初始合并列表:相邻块的块向量、非相邻块的块向量、基于历史信息的块向量和基于自动重新定位的块向量等;
(2)intraTMP模式的初始合并列表:相邻块的块向量和非相邻块的块向量。
在本申请实施例中,对于前述的时域块向量和偏移时域块向量,应与已有类型的块向量按照一定顺序添加到初始合并列表中,以得到候选合并列表。
示例性地,对于IBC模式的候选合并列表,时域和偏移的时域块向量应在基于自动重新定位的块向量前添加,且位于相邻块的块向量后,顺序可以是:
a.相邻块的块向量、非相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量、基于历史信息的块向量、基于自动重新定位的块向量等;
b.相邻块的块向量、第一类时域候选块向量、非相邻块的块向量、第二类时域候选块向量、基于历史信息的块向量、基于自动重新定位的块向量等;
c.相邻块的块向量、非相邻块的块向量、基于历史信息的块向量、第一类时域候选块向量、第二类时域候选块向量、基于自动重新定位的块向量等。
示例性地,对于IntraTMP模式的候选合并列表,时域和偏移的时域块向量应在位于相邻块的块向量后,顺序可以是:
a.相邻块的块向量、非相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量等;
b.相邻块的块向量、第一类时域候选块向量、第二类时域候选块向量、非相邻块的块向量等;
c.相邻块的块向量、第一类时域候选块向量、非相邻块的块向量、第二类时域候选块向量等。
在一些实施例中,基于自动重新定位的块向量也会用来添加IntraTMP的候选合并列表,此时应类似地,将基于自动重新定位的块向量在时域和偏移的时域块向量后添加。
在本申请实施例中,使用时域块向量和偏移时域块向量作为新类型的块向量候选,能够有效地减少合并列表不能被填满的情况,可以提高合并列表模式下的IBC和IntraTMP预测效果,同时不带来额外的软件和硬件实现复杂度。示例性地,在ECM参考软件上,对IBC的Merge列表使用最多8个时域块向量和偏移时域块向量,按照相邻块的块向量、非相邻块的块向量、时域块向量、偏移时域块向量、基于历史信息的块向量、基于自动重新定位的块向量等的循序进行列表构建,可得到如下测试结果。
表6
根据表6可以看出,由于时域块向量仅在当前图像为帧间编码帧时才存在,故上述表6为在随机访问(Random Access,RA)配置下的结果,可见所述方法给Class F类和TGM类视频序列带来了Y/U/V三通道的编码性能提升,且编码时间(EncT)/解码时间(DecT)以及编码内存开销(EncVmPeak)/解码内存开销(DecVmPeak)并未带来编解码方面复杂度以及内存开销上的变化,提升了编解码效率。
本申请实施例提供了一种基于时域候选块向量来构建候选合并列表方法,通过上述实施例对前述实施例的具体实现进行详细阐述,从中可以看出,根据前述实施例的技术方案,这里提出了将时域块向量和偏移时域块向量作为填充候选合并列表的候选;对于时域和偏移的时域候选块向量,可以从大于或等 于一个同位图像中获取;对于基于时域找到的运动信息中包括多个块向量时,大于或等于一个块向量可以被获取;对于时域块向量和偏移时域块向量的数量,填充候选合并列表时可以分别或是一并设定上限个数;对于时域块向量和偏移时域块向量,是否作为候选来添加候选合并列表则可以基于编码/解码语法元素来确定;另外,对于时域块向量和偏移时域块向量,是否作为候选来添加候选合并列表也可以基于带编解码的视频序列、码流是否为屏幕内容类别来确定。如此,由于考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,例如合并列表模式下IBC和/或IntraTMP的预测效果,同时不会带来额外的软硬件实现复杂度,进而提升编解码效率。
在本申请的再一实施例中,基于前述实施例相同的发明构思,图18为本申请实施例提供的一种编码器的组成结构示意图。如图18所示,该编码器180可以包括第一确定单元1801和第一构建单元1802,其中:
第一确定单元1801,配置为确定当前块的至少一个同位图像;以及根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;
第一构建单元1802,配置为基于一个或多个时域候选块向量,构建候选合并列表。
在一些实施例中,第一确定单元1801,还配置为根据至少一个同位图像,确定X个第一类时域候选块向量;以及根据X个第一类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X为正整数。
在一些实施例中,第一确定单元1801,还配置为根据至少一个同位图像,确定Y个第二类时域候选块向量;以及根据Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,Y为正整数。
在一些实施例中,第一确定单元1801,还配置为根据至少一个同位图像,确定X个第一类时域候选块向量和Y个第二类时域候选块向量;以及根据X个第一类时域候选块向量和Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X、Y均为正整数。
在一些实施例中,第一确定单元1801,还配置为确定至少一个同位图像各自的K个时域块向量,K为大于或等于0的整数;以及根据至少一个同位图像各自的K个时域块向量,确定X个第一类时域候选块向量。
在一些实施例中,第一确定单元1801,还配置为确定第一同位图像中的一个或多个参考位置;以及根据一个或多个参考位置,确定第一同位图像的K个时域块向量;其中,第一同位图像为至少一个同位图像中的任意一个。
在一些实施例中,第一确定单元1801,还配置为确定当前位置索引对应的当前参考位置;在当前参考位置满足第一条件时,根据当前参考位置确定H个时域块向量,H为大于或等于0的整数;以及基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤,直至一个或多个参考位置遍历完成,以得到第一同位图像的K个时域块向量。
在一些实施例中,参见图18,编码器180还包括第一判断单元1803,配置为判断当前参考位置中的主要位置是否满足第一条件;第一确定单元1801,还配置为在当前参考位置中的主要位置满足第一条件时,根据当前参考位置中的主要位置确定H个时域块向量;第一判断单元1803,还配置为在当前参考位置中的主要位置不满足第一条件时,判断当前参考位置中的次要位置是否满足第一条件;第一确定单元1801,还配置为在当前参考位置中的次要位置满足第一条件时,根据当前参考位置中的次要位置确定H个时域块向量。
在一些实施例中,当前参考位置中的主要位置满足第一条件,包括:当前参考位置中的主要位置处于第一同位图像的范围之内;以及当前参考位置中的次要位置满足第一条件,包括:当前参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,第一确定单元1801,还配置为在当前参考位置不满足第一条件时,跳过当前参考位置,基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤;其中,当前参考位置不满足第一条件,包括:当前参考位置中的主要位置不满足第一条件且当前参考位置中的次要位置不满足第一条件。
在一些实施例中,第一确定单元1801,还配置为确定至少一个同位图像各自的I个偏移时域块向量,I为大于或等于0的整数;以及根据至少一个同位图像各自的I个偏移时域块向量,确定Y个第二类时域候选块向量。
在一些实施例中,第一确定单元1801,还配置为确定第一同位图像的第一运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;以及根据第一同位图像中的一个或多个偏移参考位置,确定第一同位图像的I个偏移时域块向量;其中,第一同位图像为至少一个同位图像中的任意一个。
在一些实施例中,第一确定单元1801,还配置为确定当前块周围的多个候选位置各自的运动向量以及运动向量指向的参考图像索引;以及基于预设位置顺序确定多个候选位置中的当前候选位置,根据当前候选位置的运动向量指向的当前参考图像索引,在当前参考图像索引指示的参考图像为第一同位图像时,将当前候选位置的运动向量确定为第一同位图像的第一运动向量。
在一些实施例中,第一确定单元1801,还配置为对当前候选位置的运动向量进行修正操作,将修正后的运动向量确定为第一同位图像的第一运动向量。
在一些实施例中,第一确定单元1801,还配置为在至少一个同位图像包括第一同位图像和第二同位图像时,确定第一同位图像的第一运动向量和第二同位图像的第二运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;以及根据第二运动向量对一个或多个初始参考位置进行偏移,得到第二同位图像中的一个或多个偏移参考位置;根据第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置,确定至少一个同位图像各自的I个偏移时域块向量。
在一些实施例中,第一确定单元1801,还配置为确定当前位置索引对应的当前偏移参考位置;在当前偏移参考位置满足第二条件时,根据当前偏移参考位置确定J个偏移时域块向量,J为大于或等于0的整数;以及基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤,直至所有的偏移参考位置遍历完成,以得到至少一个同位图像各自的I个偏移时域块向量。
在一些实施例中,第一确定单元1801,还配置为将第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置进行交替设置,确定第二位置索引顺序。
在一些实施例中,第一判断单元1803,还配置为判断当前偏移参考位置中的主要位置是否满足第二条件;第一确定单元1801,还配置为在当前偏移参考位置中的主要位置满足第二条件时,根据当前偏移参考位置中的主要位置确定J个偏移时域块向量;第一判断单元1803,还配置为在当前偏移参考位置中的主要位置不满足第二条件时,判断当前偏移参考位置中的次要位置是否满足第二条件;第一确定单元1801,还配置为在当前偏移参考位置中的次要位置满足第二条件时,根据当前偏移参考位置中的次要位置确定J个偏移时域块向量。
在一些实施例中,当前偏移参考位置中的主要位置满足第二条件,包括:当前偏移参考位置中的主要位置处于第一同位图像的范围之内;以及当前偏移参考位置中的次要位置满足第二条件,包括:当前偏移参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,第一确定单元1801,还配置为在当前偏移参考位置不满足第二条件时,跳过当前偏移参考位置,基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤;其中,当前偏移参考位置不满足第二条件,包括:当前偏移参考位置中的主要位置不满足第二条件且当前偏移参考位置中的次要位置不满足第二条件。
在一些实施例中,第一确定单元1801,还配置为确定当前块的初始合并列表;将一个或多个时域候选块向量添加到初始合并列表中,以得到候选合并列表。
在一些实施例中,第一确定单元1801,还配置为若初始合并列表中存在与当前时域候选块向量相同的候选项,则丢弃当前时域候选块向量;以及若初始合并列表中不存在与当前时域候选块向量相同的候选项,则将当前时域候选块向量添加到初始合并列表中。
在一些实施例中,一个或多个时域候选块向量包括X个第一类时域候选块向量和Y个第二类时域候选块向量,X、Y均为正整数;第一确定单元1801,还配置为将X个第一类时域候选块向量添加到初始合并列表中;以及在初始合并列表处于未填满状态时,继续将Y个第二类时域候选块向量添加到初始合并列表中,直至填满初始合并列表。
在一些实施例中,第一确定单元1801,还配置为将X个第一类时域候选块向量中的N个第一类时域候选块向量和Y个第二类时域候选块向量中的M个第二类时域候选块向量添加到初始合并列表中;其中,N为大于0且小于或等于第一阈值的整数,M为大于0且小于或等于第二阈值的整数。
在一些实施例中,第一确定单元1801,还配置为将一个或多个时域候选块向量中的P个时域候选块向量添加到初始合并列表中;其中,P个时域候选块向量是由第一类时域候选块向量和第二类时域候选块向量组成,且P为大于0且小于或等于第三阈值的整数。
在一些实施例中,第一确定单元1801,还配置为确定当前块的预测模式;以及在当前块的预测模式满足预设条件时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,第一构建单元1802,还配置为确定当前块使用帧内模板匹配预测模式且构建候选合并列表进行预测;或者,确定当前块使用帧内块复制模式且构建候选合并列表进行预测。
在一些实施例中,第一确定单元1801,还配置为确定当前块所属的视频序列;以及在视频序列为屏幕内容类别时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,第一确定单元1801,还配置为在当前块使用时域候选块向量作为构建候选合并列表的候选项时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,参见图18,编码器180还包括编码单元1804,其中:第一确定单元1801,还配置为确定第一语法元素的取值;其中,第一语法元素用于指示当前块是否使用时域候选块向量作为构建候选合并列表的候选项;编码单元1804,配置为对第一语法元素的取值进行编码处理,将所得到的编码比特写入码流。
在一些实施例中,第一确定单元1801,还配置为根据当前块的至少一个同位图像,确定当前块的同位图像索引;编码单元1804,还配置为对当前块的同位图像索引进行编码处理,将所得到的编码比特写入码流。
在一些实施例中,第一确定单元1801,还配置为根据候选合并列表确定当前块的一个或多个目标块向量;根据当前块的一个或多个目标块向量,确定当前块的预测块;以及根据当前块的预测块,确定当前块的残差块。
在一些实施例中,编码单元1804,还配置为对当前块的残差块进行编码处理,将所得到的编码比特写入码流。
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
在本申请的再一实施例中,图19为本申请实施例提供的一种编码器的具体硬件结构示意图。如图19所示,编码器180可以包括:第一通信接口1901、第一存储器1902和第一处理器1903;各个组件通过第一总线系统1904耦合在一起。可理解,第一总线系统1904用于实现这些组件之间的连接通信。第一总线系统1904除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图19中将各种总线都标为第一总线系统1904。其中,
第一通信接口1901,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第一存储器1902,用于存储能够在第一处理器1903上运行的计算机程序;
第一处理器1903,用于在运行所述计算机程序时,执行:
确定当前块的至少一个同位图像;根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;基于一个或多个时域候选块向量,构建候选合并列表。
可以理解,本申请实施例中的第一存储器1902可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器1902旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器1903可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1903中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1903可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理 器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1902,第一处理器1903读取第一存储器1902中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
可选地,作为另一个实施例,第一处理器1903还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
本实施例提供了一种编码器,在该编码器中,在构建候选合并列表时考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,例如合并列表模式下IBC和/或IntraTMP的预测效果,同时不会带来额外的软硬件实现复杂度,进而提升编解码效率。
在本申请的再一实施例中,基于前述实施例相同的发明构思,图20为本申请实施例提供的一种解码器的组成结构示意图。如图20所示,该解码器200可以包括第二确定单元2001和第二构建单元2002,其中:
第二确定单元2001,配置为确定当前块的至少一个同位图像;以及根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;
第二构建单元2002,配置为基于一个或多个时域候选块向量,构建候选合并列表。
在一些实施例中,参见图20,解码器200还包括解码单元2003,配置为解码码流,确定当前块的同位图像索引;第二确定单元2001,还配置为根据同位图像索引,确定当前块的至少一个同位图像。
在一些实施例中,第二确定单元2001,还配置为若同位图像索引包括的索引数量为一个,则确定当前块的一个同位图像;以及若同位图像索引包括的索引数量为两个,则确定当前块的两个同位图像。
在一些实施例中,第二确定单元2001,还配置为根据至少一个同位图像,确定X个第一类时域候选块向量;以及根据X个第一类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X为正整数。
在一些实施例中,第二确定单元2001,还配置为根据至少一个同位图像,确定Y个第二类时域候选块向量;以及根据Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,Y为正整数。
在一些实施例中,第二确定单元2001,还配置为根据至少一个同位图像,确定X个第一类时域候选块向量和Y个第二类时域候选块向量;以及根据X个第一类时域候选块向量和Y个第二类时域候选块向量,确定当前块的一个或多个时域候选块向量;其中,X、Y均为正整数。
在一些实施例中,第二确定单元2001,还配置为确定至少一个同位图像各自的K个时域块向量,K为大于或等于0的整数;以及根据至少一个同位图像各自的K个时域块向量,确定X个第一类时域候选块向量。
在一些实施例中,第二确定单元2001,还配置为确定第一同位图像中的一个或多个参考位置;以及根据一个或多个参考位置,确定第一同位图像的K个时域块向量;其中,第一同位图像为至少一个同位图像中的任意一个。
在一些实施例中,第二确定单元2001,还配置为确定当前位置索引对应的当前参考位置;在当前参考位置满足第一条件时,根据当前参考位置确定H个时域块向量,H为大于或等于0的整数;以及基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤,直至一个或多个参考位置遍历完成,以得到第一同位图像的K个时域块向量。
在一些实施例中,参考位置包括主要位置和次要位置;参见图20,解码器200还包括第二判断单元2004,配置为判断当前参考位置中的主要位置是否满足第一条件;第二确定单元2001,还配置为在当前参考位置中的主要位置满足第一条件时,根据当前参考位置中的主要位置确定H个时域块向量;第二判断单元2004,还配置为在当前参考位置中的主要位置不满足第一条件时,判断当前参考位置中的次要位置是否满足第一条件;第二确定单元2001,还配置为在当前参考位置中的次要位置满足第一条件时,根据当前参考位置中的次要位置确定H个时域块向量。
在一些实施例中,当前参考位置中的主要位置满足第一条件,包括:当前参考位置中的主要位置处于第一同位图像的范围之内;以及当前参考位置中的次要位置满足第一条件,包括:当前参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,第二确定单元2001,还配置为在当前参考位置不满足第一条件时,跳过当前参考位置,基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将下一个位置索引对应的参考位置作为当前参考位置,继续执行判断当前参考位置是否满足第一条件的步骤;其中,当前参考位置不满足第一条件,包括:当前参考位置中的主要位置不满足第一条件且当前参考位置中的次要位置不满足第一条件。
在一些实施例中,第二确定单元2001,还配置为确定至少一个同位图像各自的I个偏移时域块向量,I为大于或等于0的整数;以及根据至少一个同位图像各自的I个偏移时域块向量,确定Y个第二类时域候选块向量。
在一些实施例中,第二确定单元2001,还配置为确定第一同位图像的第一运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;以及根据第一同位图像中的一个或多个偏移参考位置,确定第一同位图像的I个偏移时域块向量;其中,第一同位图像为至少一个同位图像中的任意一个。
在一些实施例中,第二确定单元2001,还配置为确定当前块周围的多个候选位置各自的运动向量以及运动向量指向的参考图像索引;以及基于预设位置顺序确定多个候选位置中的当前候选位置,根据当前候选位置的运动向量指向的当前参考图像索引,在当前参考图像索引指示的参考图像为第一同位图像时,将当前候选位置的运动向量确定为第一同位图像的第一运动向量。
在一些实施例中,第二确定单元2001,还配置为对当前候选位置的运动向量进行修正操作,将修正后的运动向量确定为第一同位图像的第一运动向量。
在一些实施例中,第二确定单元2001,还配置为在至少一个同位图像包括第一同位图像和第二同位图像时,确定第一同位图像的第一运动向量和第二同位图像的第二运动向量,以及确定当前块的一个或多个初始参考位置;根据第一运动向量对一个或多个初始参考位置进行偏移,得到第一同位图像中的一个或多个偏移参考位置;以及根据第二运动向量对一个或多个初始参考位置进行偏移,得到第二同位图像中的一个或多个偏移参考位置;以及根据第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置,确定至少一个同位图像各自的I个偏移时域块向量。
在一些实施例中,第二确定单元2001,还配置为确定当前位置索引对应的当前偏移参考位置;在当前偏移参考位置满足第二条件时,根据当前偏移参考位置确定J个偏移时域块向量,J为大于或等于0的整数;以及基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤,直至所有的偏移参考位置遍历完成,以得到至少一个同位图像各自的I个偏移时域块向量。
在一些实施例中,第二确定单元2001,还配置为将第一同位图像中的一个或多个偏移参考位置以及第二同位图像中的一个或多个偏移参考位置进行交替设置,确定第二位置索引顺序。
在一些实施例中,偏移参考位置包括主要位置和次要位置;第二判断单元2004,还配置为判断当前偏移参考位置中的主要位置是否满足第二条件;第二确定单元2001,还配置为在当前偏移参考位置中的主要位置满足第二条件时,根据当前偏移参考位置中的主要位置确定J个偏移时域块向量;第二判断单元2004,还配置为在当前偏移参考位置中的主要位置不满足第二条件时,判断当前偏移参考位置中的次要位置是否满足第二条件;第二确定单元2001,还配置为在当前偏移参考位置中的次要位置满足第二条件时,根据当前偏移参考位置中的次要位置确定J个偏移时域块向量。
在一些实施例中,当前偏移参考位置中的主要位置满足第二条件,包括:当前偏移参考位置中的主要位置处于第一同位图像的范围之内;以及当前偏移参考位置中的次要位置满足第二条件,包括:当前偏移参考位置中的次要位置处于第一同位图像的范围之内。
在一些实施例中,第二确定单元2001,还配置为在当前偏移参考位置不满足第二条件时,跳过当前偏移参考位置,基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断当前偏移参考位置是否满足第二条件的步骤;其中,当前偏移参考位置不满足第二条件,包括:当前偏移参考位置中的主要位置不满足第二条件且当前偏移参考位置中的次要位置不满足第二条件。
在一些实施例中,第二确定单元2001,还配置为确定当前块的初始合并列表;以及将一个或多个时域候选块向量添加到初始合并列表中,以得到候选合并列表。
在一些实施例中,第二确定单元2001,还配置为若初始合并列表中存在与当前时域候选块向量相同的候选项,则丢弃当前时域候选块向量;以及若初始合并列表中不存在与当前时域候选块向量相同的 候选项,则将当前时域候选块向量添加到初始合并列表中。
在一些实施例中,一个或多个时域候选块向量包括X个第一类时域候选块向量和Y个第二类时域候选块向量,X、Y均为正整数;第二确定单元2001,还配置为将X个第一类时域候选块向量添加到初始合并列表中;在初始合并列表处于未填满状态时,继续将Y个第二类时域候选块向量添加到初始合并列表中,直至填满初始合并列表。
在一些实施例中,第二确定单元2001,还配置为将X个第一类时域候选块向量中的N个第一类时域候选块向量和Y个第二类时域候选块向量中的M个第二类时域候选块向量添加到初始合并列表中;其中,N为大于0且小于或等于第一阈值的整数,M为大于0且小于或等于第二阈值的整数。
在一些实施例中,第二确定单元2001,还配置为将一个或多个时域候选块向量中的P个时域候选块向量添加到初始合并列表中;其中,P个时域候选块向量是由第一类时域候选块向量和第二类时域候选块向量组成,且P为大于0且小于或等于第三阈值的整数。
在一些实施例中,第二确定单元2001,还配置为确定当前块的预测模式;以及在当前块的预测模式满足预设条件时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,第二构建单元2002,还配置为确定当前块使用帧内模板匹配预测模式且构建候选合并列表进行预测;或者,确定当前块使用帧内块复制模式且构建候选合并列表进行预测。
在一些实施例中,第二确定单元2001,还配置为确定当前块所属的视频序列;以及在视频序列为屏幕内容类别时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,解码单元2003,还配置为解码码流,确定第一语法元素的取值;第二确定单元2001,还配置为在第一语法元素指示当前块使用时域候选块向量作为构建候选合并列表的候选项时,执行确定当前块的至少一个同位图像的步骤。
在一些实施例中,第二确定单元2001,还配置为根据候选合并列表确定当前块的一个或多个目标块向量,并根据当前块的一个或多个目标块向量,确定当前块的预测块;解码单元2003,还配置为解码码流,确定当前块的残差块;第二确定单元2001,还配置为根据当前块的残差块和当前块的预测块,确定当前块的重建块。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
在本申请的再一实施例中,图21为本申请实施例提供的一种解码器的具体硬件结构示意图。如图21所示,解码器200可以包括:第二通信接口2101、第二存储器2102和第二处理器2103;各个组件通过第二总线系统2104耦合在一起。可理解,第二总线系统2104用于实现这些组件之间的连接通信。第二总线系统2104除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图21中将各种总线都标为第二总线系统2104。其中,
第二通信接口2101,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第二存储器2102,用于存储能够在第二处理器2103上运行的计算机程序;
第二处理器2103,用于在运行所述计算机程序时,执行:
确定当前块的至少一个同位图像;根据至少一个同位图像,确定当前块的一个或多个时域候选块向量;基于一个或多个时域候选块向量,构建候选合并列表。
可选地,作为另一个实施例,第二处理器2103还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
可以理解,第二存储器2102与第一存储器1902的硬件功能类似,第二处理器2103与第一处理器1903的硬件功能类似;这里不再详述。
本实施例提供了一种解码器,在该解码器中,在构建候选合并列表时考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,例如合并列表模式下IBC和/或IntraTMP的预测效果,同时不会带来额外的软硬件实现复杂度,进而提升编解码效率。
在本申请的再一实施例中,图22为本申请实施例提供的一种编解码系统的组成结构示意图。如图22所示,编解码系统220可以包括编码器2201和解码器2202。
在本申请实施例中,编码器2201可以为前述实施例中任一项所述的编码器,解码器2202可以为前述实施例中任一项所述的解码器。
在一些实施例中,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序。该计 算机程序被处理器(例如第一处理器或第二处理器)执行时实现如前述实施例中任一项所述的方法。
在一些实施例中,本申请实施例还提供了一种计算机程序产品,包括计算机程序或指令。该计算机程序或指令被处理器(例如第一处理器或第二处理器)执行时实现如前述实施例中任一项所述的方法。
在一些实施例中,本申请实施例还提供了一种计算机程序,该计算机程序被处理器(例如第一处理器或第二处理器)执行时实现如前述实施例中任一项所述的方法。
本领域普通技术人员可以意识到,结合本申请所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例中,无论是编码端还是解码端,无论是编码端还是解码端,首先确定当前块的至少一个同位图像;然后根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;再基于所述一个或多个时域候选块向量,构建候选合并列表。也就是说,本申请实施例提出的编解码方法,在构建候选合并列表时,考虑了将一个或多个时域候选块向量作为候选合并列表中的候选项,不仅能够有效地减少候选合并列表无法填满的情况,而且还可以提高候选合并列表下的预测准确性,同时不会带来额外的软硬件实现复杂度,进而能够提升编解码效率,还提升了编解码性能。

Claims (72)

  1. 一种解码方法,应用于解码器,所述方法包括:
    确定当前块的至少一个同位图像;
    根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;
    基于所述一个或多个时域候选块向量,构建候选合并列表。
  2. 根据权利要求1所述的方法,其中,所述确定当前块的至少一个同位图像,包括:
    解码码流,确定所述当前块的同位图像索引;
    根据所述同位图像索引,确定所述当前块的至少一个同位图像。
  3. 根据权利要求2所述的方法,其中,所述根据所述同位图像索引,确定所述当前块的至少一个同位图像,包括:
    若所述同位图像索引包括的索引数量为一个,则确定所述当前块的一个同位图像;
    若所述同位图像索引包括的索引数量为两个,则确定所述当前块的两个同位图像。
  4. 根据权利要求1所述的方法,其中,所述根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量,包括:
    根据所述至少一个同位图像,确定X个第一类时域候选块向量;
    根据所述X个第一类时域候选块向量,确定所述当前块的一个或多个时域候选块向量;其中,X为正整数。
  5. 根据权利要求1所述的方法,其中,所述根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量,包括:
    根据所述至少一个同位图像,确定Y个第二类时域候选块向量;
    根据所述Y个第二类时域候选块向量,确定所述当前块的一个或多个时域候选块向量;其中,Y为正整数。
  6. 根据权利要求1所述的方法,其中,所述根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量,包括:
    根据所述至少一个同位图像,确定X个第一类时域候选块向量和Y个第二类时域候选块向量;
    根据所述X个第一类时域候选块向量和所述Y个第二类时域候选块向量,确定所述当前块的一个或多个时域候选块向量;其中,X、Y均为正整数。
  7. 根据权利要求4或6所述的方法,其中,所述根据所述至少一个同位图像,确定X个第一类时域候选块向量,包括:
    确定所述至少一个同位图像各自的K个时域块向量,K为大于或等于0的整数;
    根据所述至少一个同位图像各自的K个时域块向量,确定所述X个第一类时域候选块向量。
  8. 根据权利要求7所述的方法,其中,所述确定所述至少一个同位图像各自的K个时域块向量,包括:
    确定第一同位图像中的一个或多个参考位置;
    根据所述一个或多个参考位置,确定所述第一同位图像的K个时域块向量;
    其中,所述第一同位图像为所述至少一个同位图像中的任意一个。
  9. 根据权利要求8所述的方法,其中,所述根据所述一个或多个参考位置,确定所述第一同位图像的K个时域块向量,包括:
    确定当前位置索引对应的当前参考位置;
    在所述当前参考位置满足第一条件时,根据所述当前参考位置确定H个时域块向量,H为大于或等于0的整数;
    基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将所述下一个位置索引对应的参考位置作为当前参考位置,继续执行判断所述当前参考位置是否满足第一条件的步骤,直至所述一个或多个参考位置遍历完成,以得到所述第一同位图像的K个时域块向量。
  10. 根据权利要求9所述的方法,其中,所述参考位置包括主要位置和次要位置;所述在所述当前参考位置满足第一条件时,根据所述当前参考位置确定H个时域块向量,包括:
    判断所述当前参考位置中的主要位置是否满足第一条件;
    在所述当前参考位置中的主要位置满足第一条件时,根据所述当前参考位置中的主要位置确定所述H个时域块向量;
    在所述当前参考位置中的主要位置不满足第一条件时,判断所述当前参考位置中的次要位置是否满 足第一条件;
    在所述当前参考位置中的次要位置满足第一条件时,根据所述当前参考位置中的次要位置确定所述H个时域块向量。
  11. 根据权利要求10所述的方法,其中,所述当前参考位置中的主要位置满足第一条件,包括:所述当前参考位置中的主要位置处于所述第一同位图像的范围之内;
    所述当前参考位置中的次要位置满足第一条件,包括:所述当前参考位置中的次要位置处于所述第一同位图像的范围之内。
  12. 根据权利要求10所述的方法,其中,所述方法还包括:
    在所述当前参考位置不满足第一条件时,跳过所述当前参考位置,基于所述第一位置索引顺序确定下一个位置索引对应的参考位置,并将所述下一个位置索引对应的参考位置作为当前参考位置,继续执行判断所述当前参考位置是否满足第一条件的步骤;
    其中,所述当前参考位置不满足第一条件,包括:所述当前参考位置中的主要位置不满足第一条件且所述当前参考位置中的次要位置不满足第一条件。
  13. 根据权利要求5或6所述的方法,其中,所述根据所述至少一个同位图像,确定Y个第二类时域候选块向量,包括:
    确定所述至少一个同位图像各自的I个偏移时域块向量,I为大于或等于0的整数;
    根据所述至少一个同位图像各自的I个偏移时域块向量,确定所述Y个第二类时域候选块向量。
  14. 根据权利要求13所述的方法,其中,所述确定所述至少一个同位图像各自的I个偏移时域块向量,包括:
    确定第一同位图像的第一运动向量,以及确定所述当前块的一个或多个初始参考位置;
    根据所述第一运动向量对所述一个或多个初始参考位置进行偏移,得到所述第一同位图像中的一个或多个偏移参考位置;
    根据所述第一同位图像中的一个或多个偏移参考位置,确定所述第一同位图像的I个偏移时域块向量;其中,所述第一同位图像为所述至少一个同位图像中的任意一个。
  15. 根据权利要求14所述的方法,其中,所述确定第一同位图像的第一运动向量,包括:
    确定所述当前块周围的多个候选位置各自的运动向量以及所述运动向量指向的参考图像索引;
    基于预设位置顺序确定所述多个候选位置中的当前候选位置,根据所述当前候选位置的运动向量指向的当前参考图像索引,在所述当前参考图像索引指示的参考图像为所述第一同位图像时,将所述当前候选位置的运动向量确定为所述第一同位图像的第一运动向量。
  16. 根据权利要求15所述的方法,其中,所述方法还包括:
    对所述当前候选位置的运动向量进行修正操作,将修正后的运动向量确定为所述第一同位图像的第一运动向量。
  17. 根据权利要求13所述的方法,其中,所述确定所述至少一个同位图像各自的I个偏移时域块向量,包括:
    在所述至少一个同位图像包括第一同位图像和第二同位图像时,确定所述第一同位图像的第一运动向量和所述第二同位图像的第二运动向量,以及确定所述当前块的一个或多个初始参考位置;
    根据所述第一运动向量对所述一个或多个初始参考位置进行偏移,得到所述第一同位图像中的一个或多个偏移参考位置;以及根据所述第二运动向量对所述一个或多个初始参考位置进行偏移,得到所述第二同位图像中的一个或多个偏移参考位置;
    根据所述第一同位图像中的一个或多个偏移参考位置以及所述第二同位图像中的一个或多个偏移参考位置,确定所述至少一个同位图像各自的I个偏移时域块向量。
  18. 根据权利要求17所述的方法,其中,所述根据所述第一同位图像中的一个或多个偏移参考位置以及所述第二同位图像中的一个或多个偏移参考位置,确定所述至少一个同位图像各自的I个偏移时域块向量,包括:
    确定当前位置索引对应的当前偏移参考位置;
    在所述当前偏移参考位置满足第二条件时,根据所述当前偏移参考位置确定J个偏移时域块向量,J为大于或等于0的整数;
    基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将所述下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断所述当前偏移参考位置是否满足第二条件的步骤,直至所有的偏移参考位置遍历完成,以得到所述至少一个同位图像各自的I个偏移时域块向量。
  19. 根据权利要求18所述的方法,其中,所述方法还包括:
    将所述第一同位图像中的一个或多个偏移参考位置以及所述第二同位图像中的一个或多个偏移参 考位置进行交替设置,确定所述第二位置索引顺序。
  20. 根据权利要求18所述的方法,其中,所述偏移参考位置包括主要位置和次要位置;所述在所述当前偏移参考位置满足第二条件时,根据所述当前偏移参考位置确定J个偏移时域块向量,包括:
    判断所述当前偏移参考位置中的主要位置是否满足第二条件;
    在所述当前偏移参考位置中的主要位置满足第二条件时,根据所述当前偏移参考位置中的主要位置确定所述J个偏移时域块向量;
    在所述当前偏移参考位置中的主要位置不满足第二条件时,判断所述当前偏移参考位置中的次要位置是否满足第二条件;
    在所述当前偏移参考位置中的次要位置满足第二条件时,根据所述当前偏移参考位置中的次要位置确定所述J个偏移时域块向量。
  21. 根据权利要求20所述的方法,其中,所述当前偏移参考位置中的主要位置满足第二条件,包括:所述当前偏移参考位置中的主要位置处于所述第一同位图像的范围之内;
    所述当前偏移参考位置中的次要位置满足第二条件,包括:所述当前偏移参考位置中的次要位置处于所述第一同位图像的范围之内。
  22. 根据权利要求20所述的方法,其中,所述方法还包括:
    在所述当前偏移参考位置不满足第二条件时,跳过所述当前偏移参考位置,基于所述第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将所述下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断所述当前偏移参考位置是否满足第二条件的步骤;
    其中,所述当前偏移参考位置不满足第二条件,包括:所述当前偏移参考位置中的主要位置不满足第二条件且所述当前偏移参考位置中的次要位置不满足第二条件。
  23. 根据权利要求1所述的方法,其中,所述基于所述一个或多个时域候选块向量,构建候选合并列表,包括:
    确定所述当前块的初始合并列表;
    将所述一个或多个时域候选块向量添加到所述初始合并列表中,以得到所述候选合并列表。
  24. 根据权利要求23所述的方法,其中,基于所述一个或多个时域候选块向量中的当前时域候选块向量,所述方法还包括:
    若所述初始合并列表中存在与所述当前时域候选块向量相同的候选项,则丢弃所述当前时域候选块向量;
    若所述初始合并列表中不存在与所述当前时域候选块向量相同的候选项,则将所述当前时域候选块向量添加到所述初始合并列表中。
  25. 根据权利要求23所述的方法,其中,所述一个或多个时域候选块向量包括X个第一类时域候选块向量和Y个第二类时域候选块向量,X、Y均为正整数;
    所述将所述一个或多个时域候选块向量添加到所述初始合并列表中,包括:
    将所述X个第一类时域候选块向量添加到所述初始合并列表中;
    在所述初始合并列表处于未填满状态时,继续将所述Y个第二类时域候选块向量添加到所述初始合并列表中,直至填满所述初始合并列表。
  26. 根据权利要求25所述的方法,其中,所述将所述一个或多个时域候选块向量添加到所述初始合并列表中,包括:
    将所述X个第一类时域候选块向量中的N个第一类时域候选块向量和所述Y个第二类时域候选块向量中的M个第二类时域候选块向量添加到所述初始合并列表中;其中,N为大于0且小于或等于第一阈值的整数,M为大于0且小于或等于第二阈值的整数。
  27. 根据权利要求25所述的方法,其中,所述将所述一个或多个时域候选块向量添加到所述初始合并列表中,包括:
    将所述一个或多个时域候选块向量中的P个时域候选块向量添加到所述初始合并列表中;其中,所述P个时域候选块向量是由第一类时域候选块向量和第二类时域候选块向量组成,且P为大于0且小于或等于第三阈值的整数。
  28. 根据权利要求1至27中任一项所述的方法,其中,所述方法还包括:
    确定所述当前块的预测模式;
    在所述当前块的预测模式满足预设条件时,执行所述确定当前块的至少一个同位图像的步骤。
  29. 根据权利要求28所述的方法,其中,所述当前块的预测模式满足预设条件,包括:
    确定所述当前块使用帧内模板匹配预测模式且构建所述候选合并列表进行预测;或者,
    确定所述当前块使用帧内块复制模式且构建所述候选合并列表进行预测。
  30. 根据权利要求1至27中任一项所述的方法,其中,所述方法还包括:
    确定所述当前块所属的视频序列;
    在所述视频序列为屏幕内容类别时,执行所述确定当前块的至少一个同位图像的步骤。
  31. 根据权利要求1至27中任一项所述的方法,其中,所述方法还包括:
    解码码流,确定第一语法元素的取值;
    在所述第一语法元素指示所述当前块使用时域候选块向量作为构建所述候选合并列表的候选项时,执行所述确定当前块的至少一个同位图像的步骤。
  32. 根据权利要求1至27中任一项所述的方法,其中,所述方法还包括:
    根据所述候选合并列表确定所述当前块的一个或多个目标块向量,并根据所述当前块的一个或多个目标块向量,确定所述当前块的预测块;
    解码码流,确定所述当前块的残差块;
    根据所述当前块的残差块和所述当前块的预测块,确定所述当前块的重建块。
  33. 一种编码方法,应用于编码器,所述方法包括:
    确定当前块的至少一个同位图像;
    根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;
    基于所述一个或多个时域候选块向量,构建候选合并列表。
  34. 根据权利要求33所述的方法,其中,所述根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量,包括:
    根据所述至少一个同位图像,确定X个第一类时域候选块向量;
    根据所述X个第一类时域候选块向量,确定所述当前块的一个或多个时域候选块向量;其中,X为正整数。
  35. 根据权利要求33所述的方法,其中,所述根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量,包括:
    根据所述至少一个同位图像,确定Y个第二类时域候选块向量;
    根据所述Y个第二类时域候选块向量,确定所述当前块的一个或多个时域候选块向量;其中,Y为正整数。
  36. 根据权利要求33所述的方法,其中,所述根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量,包括:
    根据所述至少一个同位图像,确定X个第一类时域候选块向量和Y个第二类时域候选块向量;
    根据所述X个第一类时域候选块向量和所述Y个第二类时域候选块向量,确定所述当前块的一个或多个时域候选块向量;其中,X、Y均为正整数。
  37. 根据权利要求34或36所述的方法,其中,所述根据所述至少一个同位图像,确定X个第一类时域候选块向量,包括:
    确定所述至少一个同位图像各自的K个时域块向量,K为大于或等于0的整数;
    根据所述至少一个同位图像各自的K个时域块向量,确定所述X个第一类时域候选块向量。
  38. 根据权利要求37所述的方法,其中,所述确定所述至少一个同位图像各自的K个时域块向量,包括:
    确定第一同位图像中的一个或多个参考位置;
    根据所述一个或多个参考位置,确定所述第一同位图像的K个时域块向量;
    其中,所述第一同位图像为所述至少一个同位图像中的任意一个。
  39. 根据权利要求38所述的方法,其中,所述根据所述一个或多个参考位置,确定所述第一同位图像的K个时域块向量,包括:
    确定当前位置索引对应的当前参考位置;
    在所述当前参考位置满足第一条件时,根据所述当前参考位置确定H个时域块向量,H为大于或等于0的整数;
    基于第一位置索引顺序确定下一个位置索引对应的参考位置,并将所述下一个位置索引对应的参考位置作为当前参考位置,继续执行判断所述当前参考位置是否满足第一条件的步骤,直至所述一个或多个参考位置遍历完成,以得到所述第一同位图像的K个时域块向量。
  40. 根据权利要求39所述的方法,其中,所述参考位置包括主要位置和次要位置;所述在所述当前参考位置满足第一条件时,根据所述当前参考位置确定H个时域块向量,包括:
    判断所述当前参考位置中的主要位置是否满足第一条件;
    在所述当前参考位置中的主要位置满足第一条件时,根据所述当前参考位置中的主要位置确定所述 H个时域块向量;
    在所述当前参考位置中的主要位置不满足第一条件时,判断所述当前参考位置中的次要位置是否满足第一条件;
    在所述当前参考位置中的次要位置满足第一条件时,根据所述当前参考位置中的次要位置确定所述H个时域块向量。
  41. 根据权利要求40所述的方法,其中,所述当前参考位置中的主要位置满足第一条件,包括:所述当前参考位置中的主要位置处于所述第一同位图像的范围之内;
    所述当前参考位置中的次要位置满足第一条件,包括:所述当前参考位置中的次要位置处于所述第一同位图像的范围之内。
  42. 根据权利要求40所述的方法,其中,所述方法还包括:
    在所述当前参考位置不满足第一条件时,跳过所述当前参考位置,基于所述第一位置索引顺序确定下一个位置索引对应的参考位置,并将所述下一个位置索引对应的参考位置作为当前参考位置,继续执行判断所述当前参考位置是否满足第一条件的步骤;
    其中,所述当前参考位置不满足第一条件,包括:所述当前参考位置中的主要位置不满足第一条件且所述当前参考位置中的次要位置不满足第一条件。
  43. 根据权利要求35或36所述的方法,其中,所述根据所述至少一个同位图像,确定Y个第二类时域候选块向量,包括:
    确定所述至少一个同位图像各自的I个偏移时域块向量,I为大于或等于0的整数;
    根据所述至少一个同位图像各自的I个偏移时域块向量,确定所述Y个第二类时域候选块向量。
  44. 根据权利要求43所述的方法,其中,所述确定所述至少一个同位图像各自的I个偏移时域块向量,包括:
    确定第一同位图像的第一运动向量,以及确定所述当前块的一个或多个初始参考位置;
    根据所述第一运动向量对所述一个或多个初始参考位置进行偏移,得到所述第一同位图像中的一个或多个偏移参考位置;
    根据所述第一同位图像中的一个或多个偏移参考位置,确定所述第一同位图像的I个偏移时域块向量;其中,所述第一同位图像为所述至少一个同位图像中的任意一个。
  45. 根据权利要求44所述的方法,其中,所述确定第一同位图像的第一运动向量,包括:
    确定所述当前块周围的多个候选位置各自的运动向量以及所述运动向量指向的参考图像索引;
    基于预设位置顺序确定所述多个候选位置中的当前候选位置,根据所述当前候选位置的运动向量指向的当前参考图像索引,在所述当前参考图像索引指示的参考图像为所述第一同位图像时,将所述当前候选位置的运动向量确定为所述第一同位图像的第一运动向量。
  46. 根据权利要求45所述的方法,其中,所述方法还包括:
    对所述当前候选位置的运动向量进行修正操作,将修正后的运动向量确定为所述第一同位图像的第一运动向量。
  47. 根据权利要求43所述的方法,其中,所述确定所述至少一个同位图像各自的I个偏移时域块向量,包括:
    在所述至少一个同位图像包括第一同位图像和第二同位图像时,确定所述第一同位图像的第一运动向量和所述第二同位图像的第二运动向量,以及确定所述当前块的一个或多个初始参考位置;
    根据所述第一运动向量对所述一个或多个初始参考位置进行偏移,得到所述第一同位图像中的一个或多个偏移参考位置;以及根据所述第二运动向量对所述一个或多个初始参考位置进行偏移,得到所述第二同位图像中的一个或多个偏移参考位置;
    根据所述第一同位图像中的一个或多个偏移参考位置以及所述第二同位图像中的一个或多个偏移参考位置,确定所述至少一个同位图像各自的I个偏移时域块向量。
  48. 根据权利要求47所述的方法,其中,所述根据所述第一同位图像中的一个或多个偏移参考位置以及所述第二同位图像中的一个或多个偏移参考位置,确定所述至少一个同位图像各自的I个偏移时域块向量,包括:
    确定当前位置索引对应的当前偏移参考位置;
    在所述当前偏移参考位置满足第二条件时,根据所述当前偏移参考位置确定J个偏移时域块向量,J为大于或等于0的整数;
    基于第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将所述下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断所述当前偏移参考位置是否满足第二条件的步骤,直至所有的偏移参考位置遍历完成,以得到所述至少一个同位图像各自的I个偏移时域块向量。
  49. 根据权利要求48所述的方法,其中,所述方法还包括:
    将所述第一同位图像中的一个或多个偏移参考位置以及所述第二同位图像中的一个或多个偏移参考位置进行交替设置,确定所述第二位置索引顺序。
  50. 根据权利要求48所述的方法,其中,所述偏移参考位置包括主要位置和次要位置;所述在所述当前偏移参考位置满足第二条件时,根据所述当前偏移参考位置确定J个偏移时域块向量,包括:
    判断所述当前偏移参考位置中的主要位置是否满足第二条件;
    在所述当前偏移参考位置中的主要位置满足第二条件时,根据所述当前偏移参考位置中的主要位置确定所述J个偏移时域块向量;
    在所述当前偏移参考位置中的主要位置不满足第二条件时,判断所述当前偏移参考位置中的次要位置是否满足第二条件;
    在所述当前偏移参考位置中的次要位置满足第二条件时,根据所述当前偏移参考位置中的次要位置确定所述J个偏移时域块向量。
  51. 根据权利要求50所述的方法,其中,所述当前偏移参考位置中的主要位置满足第二条件,包括:所述当前偏移参考位置中的主要位置处于所述第一同位图像的范围之内;
    所述当前偏移参考位置中的次要位置满足第二条件,包括:所述当前偏移参考位置中的次要位置处于所述第一同位图像的范围之内。
  52. 根据权利要求50所述的方法,其中,所述方法还包括:
    在所述当前偏移参考位置不满足第二条件时,跳过所述当前偏移参考位置,基于所述第二位置索引顺序确定下一个位置索引对应的偏移参考位置,并将所述下一个位置索引对应的偏移参考位置作为当前偏移参考位置,继续执行判断所述当前偏移参考位置是否满足第二条件的步骤;
    其中,所述当前偏移参考位置不满足第二条件,包括:所述当前偏移参考位置中的主要位置不满足第二条件且所述当前偏移参考位置中的次要位置不满足第二条件。
  53. 根据权利要求33所述的方法,其中,所述基于所述一个或多个时域候选块向量,构建候选合并列表,包括:
    确定所述当前块的初始合并列表;
    将所述一个或多个时域候选块向量添加到所述初始合并列表中,以得到所述候选合并列表。
  54. 根据权利要求53所述的方法,其中,基于所述一个或多个时域候选块向量中的当前时域候选块向量,所述方法还包括:
    若所述初始合并列表中存在与所述当前时域候选块向量相同的候选项,则丢弃所述当前时域候选块向量;
    若所述初始合并列表中不存在与所述当前时域候选块向量相同的候选项,则将所述当前时域候选块向量添加到所述初始合并列表中。
  55. 根据权利要求53所述的方法,其中,所述一个或多个时域候选块向量包括X个第一类时域候选块向量和Y个第二类时域候选块向量,X、Y均为正整数;
    所述将所述一个或多个时域候选块向量添加到所述初始合并列表中,包括:
    将所述X个第一类时域候选块向量添加到所述初始合并列表中;
    在所述初始合并列表处于未填满状态时,继续将所述Y个第二类时域候选块向量添加到所述初始合并列表中,直至填满所述初始合并列表。
  56. 根据权利要求55所述的方法,其中,所述将所述一个或多个时域候选块向量添加到所述初始合并列表中,包括:
    将所述X个第一类时域候选块向量中的N个第一类时域候选块向量和所述Y个第二类时域候选块向量中的M个第二类时域候选块向量添加到所述初始合并列表中;其中,N为大于0且小于或等于第一阈值的整数,M为大于0且小于或等于第二阈值的整数。
  57. 根据权利要求55所述的方法,其中,所述将所述一个或多个时域候选块向量添加到所述初始合并列表中,包括:
    将所述一个或多个时域候选块向量中的P个时域候选块向量添加到所述初始合并列表中;其中,所述P个时域候选块向量是由第一类时域候选块向量和第二类时域候选块向量组成,且P为大于0且小于或等于第三阈值的整数。
  58. 根据权利要求33至57中任一项所述的方法,其中,所述方法还包括:
    确定所述当前块的预测模式;
    在所述当前块的预测模式满足预设条件时,执行所述确定当前块的至少一个同位图像的步骤。
  59. 根据权利要求58所述的方法,其中,所述当前块的预测模式满足预设条件,包括:
    确定所述当前块使用帧内模板匹配预测模式且构建所述候选合并列表进行预测;或者,
    确定所述当前块使用帧内块复制模式且构建所述候选合并列表进行预测。
  60. 根据权利要求33至57中任一项所述的方法,其中,所述方法还包括:
    确定所述当前块所属的视频序列;
    在所述视频序列为屏幕内容类别时,执行所述确定当前块的至少一个同位图像的步骤。
  61. 根据权利要求33至57中任一项所述的方法,其中,所述方法还包括:
    在所述当前块使用时域候选块向量作为构建所述候选合并列表的候选项时,执行所述确定当前块的至少一个同位图像的步骤。
  62. 根据权利要求61所述的方法,其中,所述方法还包括:
    确定第一语法元素的取值;其中,所述第一语法元素用于指示所述当前块是否使用时域候选块向量作为构建所述候选合并列表的候选项;
    对所述第一语法元素的取值进行编码处理,将所得到的编码比特写入码流。
  63. 根据权利要求33至57中任一项所述的方法,其中,所述方法还包括:
    根据所述当前块的至少一个同位图像,确定所述当前块的同位图像索引;
    对所述当前块的同位图像索引进行编码处理,将所得到的编码比特写入码流。
  64. 根据权利要求33至57中任一项所述的方法,其中,所述方法还包括:
    根据所述候选合并列表确定所述当前块的一个或多个目标块向量;
    根据所述当前块的一个或多个目标块向量,确定所述当前块的预测块;
    根据所述当前块的预测块,确定所述当前块的残差块。
  65. 根据权利要求64所述的方法,其中,所述方法还包括:
    对所述当前块的残差块进行编码处理,将所得到的编码比特写入码流。
  66. 一种码流,其中,所述码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少一项:当前块的残差值、所述当前块的同位图像索引和第一语法元素的取值;
    其中,所述第一语法元素用于指示所述当前块是否使用时域候选块向量作为构建所述候选合并列表的候选项。
  67. 一种编码器,包括第一确定单元和第一构建单元,其中:
    所述第一确定单元,配置为确定当前块的至少一个同位图像;以及根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;
    所述第一构建单元,配置为基于所述一个或多个时域候选块向量,构建候选合并列表。
  68. 一种编码器,包括第一存储器和第一处理器,其中:
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求33至65中任一项所述的方法。
  69. 一种解码器,包括第二确定单元和第二构建单元,其中:
    所述第二确定单元,配置为确定当前块的至少一个同位图像;以及根据所述至少一个同位图像,确定所述当前块的一个或多个时域候选块向量;
    所述第二构建单元,配置为基于所述一个或多个时域候选块向量,构建候选合并列表。
  70. 一种解码器,所述解码器包括第二存储器和第二处理器,其中:
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至32中任一项所述的方法。
  71. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至32中任一项所述的方法、或者实现如权利要求33至65中任一项所述的方法。
  72. 一种计算机程序产品,包括计算机程序或指令,其中,所述计算机程序或指令被处理器执行时实现如权利要求1至32中任一项所述的方法、或者实现如权利要求33至65中任一项所述的方法。
PCT/CN2024/083659 2024-03-25 2024-03-25 编解码方法、码流、编码器、解码器以及存储介质 Pending WO2025199705A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2024/083659 WO2025199705A1 (zh) 2024-03-25 2024-03-25 编解码方法、码流、编码器、解码器以及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2024/083659 WO2025199705A1 (zh) 2024-03-25 2024-03-25 编解码方法、码流、编码器、解码器以及存储介质

Publications (2)

Publication Number Publication Date
WO2025199705A1 true WO2025199705A1 (zh) 2025-10-02
WO2025199705A9 WO2025199705A9 (zh) 2025-11-20

Family

ID=97216967

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/083659 Pending WO2025199705A1 (zh) 2024-03-25 2024-03-25 编解码方法、码流、编码器、解码器以及存储介质

Country Status (1)

Country Link
WO (1) WO2025199705A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015194913A1 (ko) * 2014-06-20 2015-12-23 성균관대학교 산학협력단 영상의 부호화/복호화 방법 및 이를 이용하는 장치
CN113455003A (zh) * 2019-02-22 2021-09-28 联发科技股份有限公司 帧内块复制合并列表简化
CN113596475A (zh) * 2021-06-24 2021-11-02 浙江大华技术股份有限公司 图像/视频编码方法、装置、系统及计算机可读存储介质
CN113747172A (zh) * 2020-05-29 2021-12-03 Oppo广东移动通信有限公司 帧间预测方法、编码器、解码器以及计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015194913A1 (ko) * 2014-06-20 2015-12-23 성균관대학교 산학협력단 영상의 부호화/복호화 방법 및 이를 이용하는 장치
CN113455003A (zh) * 2019-02-22 2021-09-28 联发科技股份有限公司 帧内块复制合并列表简化
CN113747172A (zh) * 2020-05-29 2021-12-03 Oppo广东移动通信有限公司 帧间预测方法、编码器、解码器以及计算机存储介质
CN114651443A (zh) * 2020-05-29 2022-06-21 Oppo广东移动通信有限公司 帧间预测方法、编码器、解码器以及计算机存储介质
CN113596475A (zh) * 2021-06-24 2021-11-02 浙江大华技术股份有限公司 图像/视频编码方法、装置、系统及计算机可读存储介质

Also Published As

Publication number Publication date
WO2025199705A9 (zh) 2025-11-20

Similar Documents

Publication Publication Date Title
RU2705428C2 (ru) Вывод информации движения для подблоков при видеокодировании
RU2683165C1 (ru) Внутреннее предсказание блочного копирования с асимметричными разделами и схемами поиска на стороне кодера, диапазоны поиска и подходы к разделению
JP2022521979A (ja) デコーダ側動きベクトル改良に対する制約
JP7318007B2 (ja) インター予測方法および装置
TWI790662B (zh) 一種編解碼方法、裝置及其設備
KR102621958B1 (ko) 후보 모션 벡터 리스트 획득 방법, 장치, 인코더 및 디코더
TW202025752A (zh) 用於仿射模式之以歷史為基礎之運動向量預測
CN111131830B (zh) 重叠块运动补偿的改进
TW202025767A (zh) 具有適應性方向性資訊集合之最終動作向量表示
TW202044839A (zh) 用於視訊寫碼之區塊內複製合併資料語法
TW202038611A (zh) 用於視訊寫碼之三角運動資訊
TW201742465A (zh) 用於視訊寫碼之仿射運動預測
TW202025727A (zh) 向量預測器清單之產生
US12170759B2 (en) Chroma from luma prediction model selection
TW202110188A (zh) 使用空間鄰居的重疊塊運動補償
JP2023521609A (ja) ビデオコーディングのための方法、コンピュータプログラム及び装置
TW202038614A (zh) 用於視訊寫碼之空間時間運動向量預測圖案
KR102817818B1 (ko) 픽처 예측 방법 및 장치, 및 컴퓨터 판독 가능형 저장 매체
CN105850132A (zh) 颜色指数预测的方法和装置
CN118511508A (zh) 用于视频处理的方法、装置和介质
CN113727119B (zh) 帧间预测方法、编码器、解码器以及计算机存储介质
KR20260037124A (ko) 방향성 샘플별 융합을 이용한 템플릿 기반 인트라 모드 도출
TW202425644A (zh) 視訊編解碼方法、裝置、設備、系統、及儲存媒介
WO2025199705A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
TW202404369A (zh) 視訊編、解碼方法及裝置、碼流、解碼器、編碼器、電子設備、儲存媒介

Legal Events

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

Ref document number: 24931287

Country of ref document: EP

Kind code of ref document: A1