主权项 |
1. A method for encoding a video signal having a plurality of frames with at least one frame with a plurality of blocks having pixels, the method comprising:
identifying a first color of pixels using a processor; assigning pixels in a source block in the at least one frame having the first color to a first source segment and assigning pixels in the source block having a color different than the first color to a second source segment; and determining a set of motion vectors derived from the first source segment, wherein determining the set of motion vectors derived from the first source segment includes:
determining a plurality of errors between the first source segment in the source block and a corresponding plurality of blocks in a reference frame search window,selecting from among the corresponding plurality of blocks in the reference frame search window a first best-matching block based on the determined plurality of errors between the first source segment and the corresponding plurality of blocks in the reference frame search window,selecting a first motion vector of the set of motion vectors for the first source segment using the source block and the first best-matching block,assigning pixels in the first best-matching block having the first color to a masked portion of a first segment mask and assigning pixels in the first best-matching block having a color different than the first color to an unmasked portion of the first segment mask,assigning pixels in the source block within the unmasked portion of the first segment mask to a third source segment,determining a plurality of errors between the third source segment and a corresponding plurality of blocks in a first supplemental reference frame search window,selecting from among the corresponding plurality of blocks in the first supplemental reference frame search window a second best-matching block based on the determined plurality of errors between the third source segment and the corresponding plurality of blocks in the first supplemental reference frame search window, and selecting a second motion vector of the set of motion vectors for the first source segment using the source block and the second best-matching block; and determining a set of motion vectors derived from the second source segment, wherein determining the set of motion vectors derived from the second source segment includes:
determining a plurality of errors between the second source segment in the source block and a corresponding plurality of blocks in the reference frame search window,selecting from among the corresponding plurality of blocks in the reference frame search window a third best-matching block based on the determined plurality of errors between the second source segment and the corresponding plurality of blocks in the reference frame search window,selecting a first motion vector of the set of motion vectors for the second source segment using the source block and the third best-matching block,assigning pixels in the third best-matching block having the first color to a masked portion of a second segment mask and assigning pixels in the third best-matching block having a color different than the first color to an unmasked portion of the second segment mask,assigning pixels in the source block within the masked portion of the second segment mask to a fourth source segment,determining a plurality of errors between the fourth source segment and a corresponding plurality of blocks in a second supplemental reference frame search window,selecting from among the corresponding plurality of blocks in the second supplemental reference frame search window a fourth best-matching block based on the determined plurality of errors between the fourth source segment and the corresponding plurality of blocks in the second supplemental reference frame search window, and selecting a second motion vector of the set of motion vectors for the second source segment using the source block and the fourth best-matching block. |