Method for encoding/decoding video signals and apparatus therefor
A method for decoding a video signal based on reduced transform includes the steps of: obtaining, from the video signal, a transform index indicating transform kernels applied to horizontal and vertical directions of a current block; determining a region in which a transform is applied to the current block based on the transform kernels indicated by the transform index and a size of the current block; deriving, as zero, coefficients of a remaining region other than the region to which the transform is applied within the current block; and performing an inverse transform on the region to which the transform is applied using the transform kernels indicated by the transform index.
1. An apparatus configured to decode an image signal, the apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
derive transform kernels being applied to a current block, wherein the transform kernels include a horizontal transform kernel and a vertical transform kernel,
determine a non-zero region to which an inverse transform is applied within the current block based on the transform kernels and a width and/or a height of the current block, and
perform the inverse transform on the non-zero region based on the transform kernels,
wherein a width of the non-zero region is determined as a smaller value between the width of the current block and a predefined width, the predefined width being determined based on whether the horizontal transform kernel corresponds to a predefined transform kernel, and
wherein a height of the non-zero region is determined as a smaller value between the height of the current block and a predefined height, the predefined height being determined based on whether the vertical transform kernel corresponds to the predefined transform kernel.
2. The apparatus of claim 1 , wherein the width of the non-zero region is determined as a smaller value between the width of the current block and 32 based on the horizontal transform kernel belonging to a first transform kernel group,
wherein the height of the non-zero region is determined as a smaller value between the height of the current block and 32 based on the vertical transform kernel belonging to the first transform kernel group,
wherein the width of the non-zero region is determined as a smaller value between the width of the current block and 16 based on the horizontal transform kernel belonging to a second transform kernel group, and
wherein the height of the non-zero region is determined as a smaller value between the height of the current block and 16 based on the vertical transform kernel belonging to the second transform kernel group.
3. The apparatus of claim 2 , wherein the first transform kernel group includes DCT2, and the second transform kernel group includes at least one of DST7 or DCT8.
4. The apparatus of claim 1 , wherein the predefined transform kernel includes DCT2.
5. The apparatus of claim 1 , wherein the predefined width and/or the predefined height is 16 or 32.
6. An apparatus configured to encode an image signal, the apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
derive transform kernels being applied to a current block, wherein the transform kernels include a horizontal transform kernel and a vertical transform kernel,
determine a non-zero region for a transform based on the transform kernels and a width and/or a height of the current block, and
perform the transform on the current block based on the transform kernels,
wherein a width of the non-zero region is determined as a smaller value between the width of the current block and a predefined width, the predefined width being determined based on whether the horizontal transform kernel corresponds to a predefined transform kernel, and
wherein a height of the non-zero region is determined as a smaller value between the height of the current block and a predefined height, the predefined height being determined based on whether the vertical transform kernel corresponds to the predefined transform kernel.
7. The apparatus of claim 6 , wherein the width of the non-zero region is determined as a smaller value between the width of the current block and 32 based on the horizontal transform kernel belonging to a first transform kernel group,
wherein the height of the non-zero region is determined as a smaller value between the height of the current block and 32 based on the vertical transform kernel belonging to the first transform kernel group,
wherein the width of the non-zero region is determined as a smaller value between the width of the current block and 16 based on the horizontal transform kernel belonging to a second transform kernel group, and
wherein the height of the non-zero region is determined as a smaller value between the height of the current block and 16 based on the vertical transform kernel belonging to the second transform kernel group.
8. The apparatus of claim 7 , wherein the first transform kernel group includes DCT2, and the second transform kernel group includes at least one of DST7 or DCT8.
9. The apparatus of claim 6 , wherein the predefined transform kernel includes DCT2.
10. The apparatus of claim 6 , wherein the predefined width and/or the predefined height is 16 or 32.
11. An apparatus configured to transmit data for an image, the apparatus comprising:
at least one processor configured to obtain a bitstream for the image, wherein the bitstream is generated by: deriving transform kernels being applied to a current block, wherein the transform kernels include a horizontal transform kernel and a vertical transform kernel, determining a non-zero region for a transform based on the transform kernels and a width and/or a height of the current block, and performing the transform on the current block based on the transform kernels; and
a transmitter configured to transmit the data including the bitstream,
wherein a width of the non-zero region is determined as a smaller value between the width of the current block and a predefined width, the predefined width being determined based on whether the horizontal transform kernel corresponds to a predefined transform kernel, and
wherein a height of the non-zero region is determined as a smaller value between the height of the current block and a predefined height, the predefined height being determined based on whether the vertical transform kernel corresponds to the predefined transform kernel.
12. The apparatus of claim 11 , wherein the width of the non-zero region is determined as a smaller value between the width of the current block and 32 based on the horizontal transform kernel belonging to a first transform kernel group,
wherein the height of the non-zero region is determined as a smaller value between the height of the current block and 32 based on the vertical transform kernel belonging to the first transform kernel group,
wherein the width of the non-zero region is determined as a smaller value between the width of the current block and 16 based on the horizontal transform kernel belonging to a second transform kernel group, and
wherein the height of the non-zero region is determined as a smaller value between the height of the current block and 16 based on the vertical transform kernel belonging to the second transform kernel group.
13. The apparatus of claim 12 , wherein the first transform kernel group includes DCT2, and the second transform kernel group includes at least one of DST7 or DCT8.
14. The apparatus of claim 11 , wherein the predefined transform kernel includes DCT2.
15. The apparatus of claim 11 , wherein the predefined width and/or the predefined height is 16 or 32.