Method and apparatus for image encoding, and method and apparatus for image decoding
Provided is an image decoding method including determining a current chroma block having a rectangular shape corresponding to a current luma block included in one of a plurality of luma blocks, determining a piece of motion information for the current chroma block and a chroma block adjacent to the current chroma block by using motion information of the current chroma block and the adjacent chroma block, and performing inter prediction on the current chroma block and the adjacent chroma block by using the piece of motion information for the current chroma block and the adjacent chroma block to generate prediction blocks of the current chroma block and the adjacent chroma block.
1. An image decoding method comprising:
obtaining a first motion vector for a first N×N luma sub-block in a coding unit;
obtaining a second motion vector for a second N×N luma sub-block in the coding unit, wherein the second N×N luma sub-block is on the right side of the first N×N luma sub-block;
determining a chroma motion vector using an averaged motion vector determined by averaging the first motion vector and the second motion vector; and
obtaining predicted samples for a N×N chroma sub-block, using the chroma motion vector and a reference picture, wherein the N×N chroma sub-block includes a first N/2×N chroma sub-block corresponding to the first N×N luma sub-block and a second N/2×N chroma sub-block corresponding to the second N×N luma sub-block.
2. An image decoding apparatus comprising at least one processor configured to:
obtain a first motion vector for a first N×N luma sub-block in a coding unit;
obtain a second motion vector for a second N×N luma sub-block in the coding unit, wherein the second N×N luma sub-block is on the right side of the first N×N luma sub-block;
determine a chroma motion vector using an motion vector determined by averaging the first motion vector and the second motion vector;
obtain predicted samples for a N×N chroma sub-block, using the chroma motion vector and a reference picture, wherein the N×N chroma sub-block includes a first N/2×N chroma sub-block corresponding to the first N×N luma sub-block and a second N/2×N chroma sub-block corresponding to the second N×N luma sub-block.
3. An image encoding method comprising:
obtaining a first motion vector for a first N×N luma sub-block in a coding unit;
obtaining a second motion vector for a second N×N luma sub-block in the coding unit, wherein the second N×N luma sub-block is on the right side of the first N×N luma sub-block;
determining a chroma motion vector using an motion vector determined by averaging the first motion vector and the second motion vector;
obtaining predicted samples for a N×N chroma sub-block, using the chroma motion vector and a reference picture, wherein the N×N chroma sub-block includes a first N/2×N chroma sub-block corresponding to the first N×N luma sub-block and a second N/2×N chroma sub-block corresponding to the second N×N luma sub-block.