Coding method and device thereof, and decoding method and device thereof
By adaptively applying the filter to the reference sample points based on the inter prediction mode in video encoding, the problem of low utilization efficiency of inter prediction resource in the prior art is solved, and lower power consumption and battery use are achieved.
Patent Information
- Application Number
- CN202211184262.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-01-15
- Filing Date
- 2019-01-07
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2039-01-07
AI Technical Summary
Existing video encoding technologies are difficult to efficiently utilize resources in inter-frame prediction, resulting in increased power consumption and battery usage.
During inter prediction, the filter is adaptively applied to the reference sample point based on the current block to improve resource utilization efficiency.
Reduces memory bandwidth requirements, reduces power consumption and battery usage, and improves inter-frame prediction efficiency.
Smart Images

Figure CN115460402B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with the application date of January 7, 2019, application number "201980008315.1", and title "Encoding method and device thereof and decoding method and device thereof". Technical Field
[0002] The present disclosure relates to a video encoding method and a video decoding method, and more particularly, to a method of applying an interpolation filter to a reference sample for inter-frame prediction. Background Art
[0003] With the development and supply of hardware capable of reproducing and storing high-resolution or high-quality image content, the demand for codecs capable of effectively encoding or decoding such high-resolution or high-quality image content has increased. The encoded image content can be reproduced by being decoded. Recently, methods for effectively compressing such high-resolution or high-quality image content have been implemented.
[0004] In order to compress an image, various data units may be used, and there may be an inclusion relationship between the data units. The data units may be divided according to various methods to determine the size of the data units used for image compression, and the image may be encoded or decoded by determining the optimal data unit according to the characteristics of the image.
[0005] Image data can be compressed by removing spatial and temporal redundancy between pixels. Because adjacent pixels generally have common characteristics, encoding information is transmitted in data units of multiple pixels to remove redundancy between adjacent pixels.
[0006] Instead of directly transmitting the pixel values of the pixels included in the data unit, the method required to obtain the pixel values is transmitted. A prediction method for predicting a pixel value similar to the original value is determined for each data unit, and encoding information about the prediction method is transmitted from the encoder to the decoder. In addition, because the predicted value is not exactly the same as the original value, residual data about the difference between the original value and the predicted value is transmitted from the encoder to the decoder.
[0007] Prediction methods include intra prediction and inter prediction. Intra prediction is a method of predicting pixels of a block based on neighboring pixels. Inter prediction is a method of predicting pixels by referring to pixels of another picture to which the picture including the block refers. Therefore, spatial redundancy is removed via intra prediction, and temporal redundancy is removed via inter prediction. Summary of the invention
[0008] Technical issues
[0009] The present disclosure proposes a video encoding method and a video encoding device, and a video decoding method and a video decoding device, in which a filter is adaptively applied to a reference sample based on an inter-frame prediction mode of a current block.
[0010] The technical problems to be achieved by the present embodiment are not limited to the above-mentioned technical problems, and a person of ordinary skill in the art will clearly understand other technical problems not mentioned from the following description.
[0011] Solution to the problem
[0012] According to various embodiments of the present disclosure, a video decoding method includes: when a current block is inter-frame predicted, determining an inter-frame prediction mode of the current block; based on the inter-frame prediction mode of the current block, determining at least one reference sample point position to be referenced by the current block; based on the inter-frame prediction mode of the current block, determining filter information to be applied to at least one reconstructed reference sample point corresponding to the at least one reference sample point position; based on the filter information, performing filtering on the at least one reconstructed reference sample point; and decoding the current block by using the prediction sample point generated by filtering.
[0013] According to various embodiments of the present disclosure, a video decoding device includes: at least one processor; and a memory, wherein the memory stores at least one instruction configured to be executable by the at least one processor, and the at least one instruction is configured to cause the at least one processor to perform the following operations when executed: when a current block is inter-frame predicted, determine the inter-frame prediction mode of the current block; based on the inter-frame prediction mode of the current block, determine at least one reference sample point position to be referenced by the current block; based on the inter-frame prediction mode of the current block, determine filter information to be applied to at least one reconstructed reference sample point corresponding to the at least one reference sample point position; based on the filter information, perform filtering on the at least one reconstructed reference sample point; and decode the current block by using the prediction sample point generated by filtering.
[0014] According to various embodiments of the present disclosure, a video encoding method includes: when a current block is inter-predicted, determining an inter-prediction mode of the current block; based on the inter-prediction mode of the current block, determining at least one reference sample position to be referenced by the current block; based on the inter-prediction mode of the current block, determining filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position; performing filtering on the at least one reconstructed reference sample based on the filter information; and encoding the current block by using the prediction samples generated by filtering.
[0015] According to various embodiments of the present disclosure, a video encoding device includes: at least one processor; and a memory, wherein the memory stores at least one instruction configured to be executable by the at least one processor, and the at least one instruction is configured to cause the at least one processor to perform the following operations when executed: when a current block is inter-frame predicted, determine the inter-frame prediction mode of the current block; based on the inter-frame prediction mode of the current block, determine at least one reference sample point position to be referenced by the current block; based on the inter-frame prediction mode of the current block, determine filter information to be applied to at least one reconstructed reference sample point corresponding to the at least one reference sample point position; based on the filter information, perform filtering on the at least one reconstructed reference sample point; and encode the current block by using the prediction sample point generated by filtering.
[0016] According to various embodiments of the present disclosure, a non-transitory computer-readable recording medium has recorded thereon a program for executing the video encoding method.
[0017] According to various embodiments of the present disclosure, a non-transitory computer-readable recording medium has recorded thereon a program for executing the video decoding method.
[0018] Disclosure of beneficial effects
[0019] According to various embodiments, the video encoding method and the video encoding device and the video decoding method and the video decoding device can improve the efficiency of resources used in inter-frame prediction by adaptively applying a filter to a reference sample based on the inter-frame prediction mode of the current block during inter-frame prediction. For example, power consumption and battery use can be reduced by adjusting the memory bandwidth used for inter-frame prediction to an appropriate level.
[0020] Effects obtainable in the present disclosure are not limited to the above-mentioned effects, and other effects not mentioned may be clearly understood by those of ordinary skill in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1a is a block diagram of an image decoding apparatus according to various embodiments.
[0022] Figure 1b is a block diagram of an image decoding apparatus according to various embodiments.
[0023] Figure 2 is a block diagram of an image decoding apparatus according to various embodiments.
[0024] Figure 3 is a flowchart of an image decoding method according to various embodiments.
[0025] Figure 4a is a block diagram of an image encoding apparatus according to various embodiments.
[0026] Figure 4b is a block diagram of an image encoding apparatus according to various embodiments.
[0027] Figure 5 is a block diagram of an image encoding apparatus according to various embodiments.
[0028] Figure 6 is a flowchart of an image encoding method according to various embodiments.
[0029] Figure 7 A process of determining at least one coding unit by splitting a current coding unit, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0030] Figure 8 A process of determining at least one coding unit by splitting a non-square coding unit, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0031] Fig. 9 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0032] Fig.10 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0033] Fig.11 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to various embodiments is illustrated.
[0034] Fig.12 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a predetermined order, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0035] Fig.13 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0036] Fig.14 It is shown that shapes into which the second coding unit may be split are restricted when a second coding unit having a non-square shape determined when an image decoding apparatus splits a first coding unit satisfies a predetermined condition according to various embodiments.
[0037] Fig.15A process of splitting a square coding unit when division shape pattern information cannot indicate that the square coding unit is to be split into four square coding units, performed by an image decoding apparatus according to various embodiments, is illustrated.
[0038] Fig.16 It is shown that a processing order among a plurality of coding units may be changed depending on a process of dividing the coding units according to various embodiments.
[0039] Fig.17 A process of determining a depth of a coding unit when a shape and a size of a coding unit are changed when a coding unit is recursively split so that a plurality of coding units are determined according to various embodiments is illustrated.
[0040] Fig.18 Depths that may be determined based on shapes and sizes of coding units and partial indices (PIDs) for distinguishing coding units according to various embodiments are illustrated.
[0041] Fig.19 It is shown that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to various embodiments.
[0042] Fig. 20 A processing block serving as a unit for determining an order of reference coding units included in a picture according to various embodiments is illustrated.
[0043] Fig.21a and Figure 21b is a diagram for describing a method of performing filtering on reference samples for motion compensation during inter prediction according to various embodiments.
[0044] Fig.22a Reference samples required for inter prediction of a current block according to various embodiments are shown.
[0045] Figure 22b Reference samples required for inter prediction of a current block when the current block refers to a plurality of reference blocks according to various embodiments are shown.
[0046] Fig.23 Required memory bandwidth for inter prediction of a current block according to various embodiments is shown.
[0047] Fig.24 Reference samples required for inter prediction of a current block when different filters are used in vertical and horizontal directions according to various embodiments are shown.
[0048] Fig.25a A prediction method of an overlapped block motion compensation (OBMC) mode without using sub-blocks according to various embodiments is shown.
[0049] Fig.25bReference samples required for inter prediction of a current block in an OBMC mode without using sub-blocks according to various embodiments are shown.
[0050] Fig.25c Required memory bandwidth for inter prediction of a current block in OBMC mode without using sub-blocks according to various embodiments is shown.
[0051] Fig.26a A prediction method of the OBMC mode using sub-blocks according to various embodiments is shown.
[0052] Figure 26b Reference samples required for inter prediction of a current block in an OBMC mode using sub-blocks according to various embodiments are shown.
[0053] Fig.26c Required memory bandwidth for inter prediction of a current block in OBMC mode using sub-blocks according to various embodiments is shown.
[0054] Fig.27a A prediction method for a decoder-side motion vector correction (DMVR) mode according to various embodiments is shown.
[0055] Figure 27b Reference samples required for inter prediction of a current block in DMVR mode according to various embodiments are shown.
[0056] Fig.27c Required memory bandwidth for inter prediction of a current block in DMVR mode according to various embodiments is shown.
[0057] Fig.28a Reference samples required for inter prediction of a current block in a DMVR mode using multiple motion vector candidates according to various embodiments are shown.
[0058] Fig.28b Required memory bandwidth for inter prediction of a current block in DMVR mode using multiple motion vector candidates according to various embodiments is shown.
[0059] Fig.28c Reference samples required for inter prediction of a current block in a DMVR mode with limited search range according to various embodiments are shown.
[0060] Fig.28d Required memory bandwidth for inter prediction of a current block in a DMVR mode with limited search range according to various embodiments is shown.
[0061] Fig.29a The prediction mode of the affine mode according to various embodiments is shown.
[0062] Fig.29bRequired memory bandwidth for inter prediction of a current block in affine mode according to various embodiments is shown.
[0063] Fig.29c Reference samples required for inter prediction of a current block in affine mode according to various embodiments are shown.
[0064] Fig.29d Required memory bandwidth for inter prediction of a current block in affine mode according to various embodiments is shown.
[0065] Fig.30 The prediction mode of the bidirectional optical flow (BIO) mode according to various embodiments is shown. DETAILED DESCRIPTION
[0066] By referring to the embodiments and the accompanying drawings, the advantages and features of one or more embodiments and the methods for implementing the one or more embodiments may be more easily understood. In this regard, the embodiments of the present disclosure may have different forms and should not be construed as being limited to the descriptions set forth herein. On the contrary, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the concepts of the proposed embodiments of the present disclosure to those of ordinary skill in the art.
[0067] Terms used in the specification will be briefly defined, and embodiments will be described in detail.
[0068] All terms used herein, including descriptive or technical terms, should be interpreted as having meanings that are obvious to those of ordinary skill in the art. However, these terms may have different meanings according to the intentions of those of ordinary skill in the art, precedents, or the emergence of new technologies. In addition, some terms may be arbitrarily selected by the applicant, and in this case, the meaning of the selected terms will be described in detail in the detailed description of the present disclosure. Therefore, the terms used herein must be defined based on the meaning of the terms together with the description in the entire specification.
[0069] In the following description, a singular form includes a plural form unless the context clearly indicates otherwise.
[0070] When a component “includes” or “comprises” an element, unless there is a specific description contrary thereto, the component may further include other elements, not excluding other elements.
[0071] The terms such as "unit" used in the specification indicate a software component or a hardware component, such as a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC), and the "unit" performs a specific function. However, a "unit" is not limited to software or hardware. A "unit" may be formed in an addressable storage medium, or may be formed to operate one or more processors. Therefore, for example, the term "unit" may refer to a component (such as a software component, an object-oriented software component, a class component, and a task component), and may include a process, a function, a property, a procedure, a subroutine, a fragment of a program code, a driver, a firmware, a microcode, a circuit, data, a database, a data structure, a table, an array, or a variable. The functions provided by components and "units" may be associated with a smaller number of components and "units", or may be divided into additional components and "units".
[0072] According to an embodiment of the present disclosure, a "unit" may include a processor and a memory. The term "processor" should be broadly interpreted to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, etc. In some cases, a "processor" may refer to an application-specific semiconductor (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. The term "processor" may refer to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or a combination of any other such configurations.
[0073] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage devices, registers, etc. When a processor is able to read information from and / or write information to a memory, the memory is said to be in electronic communication with the processor. Memory that is integrated into a processor is in electronic communication with the processor.
[0074] Hereinafter, an “image” may be a static image such as a still image of a video, or may be a dynamic image such as a moving image, that is, a video itself.
[0075] Hereinafter, the "current block" may refer to one of a coding unit, a prediction unit, and a transformation unit that is currently encoded or decoded. In addition, the "lower layer block" may refer to a data unit divided from the "current block". The "upper layer block" may refer to a data unit including the "current block".
[0076] Hereinafter, "sample" means data assigned to a sampling position of an image, that is, data to be processed. For example, a pixel value of an image in a spatial domain and a transform coefficient on a transform domain may be a sample. A unit including at least one such sample may be defined as a block.
[0077] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement the embodiments. In the accompanying drawings, parts irrelevant to the description are omitted to clearly describe the present disclosure.
[0078] In the following, reference will be made to Figures 1a to 6 An image encoding device and an image decoding device, as well as an image encoding method and an image decoding method that adaptively perform inter-frame prediction based on an inter-frame prediction mode of a current block according to various embodiments are described. Figures 7 to 20 A video encoding device and a video decoding device based on a tree-structured coding unit according to various embodiments, as well as a video encoding method and a video decoding method are described. Figures 21a to 30 Description can be applied according to Figures 1a to 20 Various embodiments of the image encoding method, image decoding method, video encoding method and video decoding method of the embodiments.
[0079] Figure 1a is a block diagram of an image decoding apparatus 100 according to various embodiments.
[0080] The image decoding apparatus 100 may include a receiver 105, an inter-frame predictor 110, and a decoder 115. The receiver 105, the inter-frame predictor 110, and the decoder 115 may include at least one processor. In addition, the receiver 105, the inter-frame predictor 110, and the decoder 115 may include a memory storing instructions to be executed by the at least one processor.
[0081] The receiver 105 may receive a bitstream. The bitstream includes information of an image encoded by the image encoding device 400 described later. In addition, the bitstream may be transmitted from the image encoding device 400. The image encoding device 400 and the image decoding device 100 may be connected via a wired or wireless manner, and the receiver 105 may receive the bitstream via a wired or wireless manner. The receiver 105 may receive the bitstream from a storage medium such as an optical medium or a hard disk.
[0082] The receiver 105 may obtain information about the prediction mode of the current block from the bitstream. The information about the prediction mode of the current block may include information indicating an intra-frame mode or an inter-frame prediction mode. When the prediction mode of the current block is an inter-frame prediction mode, the receiver 105 may obtain information about the inter-frame prediction mode of the current block from the bitstream. The information about the inter-frame prediction mode of the current block may be information about an inter-frame prediction mode applied to the current block among multiple inter-frame prediction modes. For example, the inter-frame prediction mode of the current block may be at least one of a merge mode, an advanced motion vector prediction (AMVP) mode, an inter-frame skip mode, an overlapped block motion compensation (OBMC) mode, a decoder-side motion vector correction (DMVR) mode, an affine mode, and a bidirectional optical flow (BIO) mode.
[0083] When the prediction mode of the current block is the inter prediction mode, the inter predictor 110 may be activated. The inter predictor 110 may determine the inter prediction mode of the current block based on information about the inter prediction mode of the current block obtained from a bitstream.
[0084] The inter-frame predictor 110 may determine at least one reference sample position to be referenced by the current block based on the inter-frame prediction mode of the current block. The inter-frame predictor 110 may obtain at least one motion vector and at least one reference picture index of the current block based on the inter-frame prediction mode of the current block, and may determine the position indicated by the motion vector within the reference picture indicated by the reference picture index as the reference sample position. According to various embodiments, the reference sample position may be determined as a coordinate obtained by adding the motion vector component of the current block to the upper left coordinates of the current block. The reference sample position may indicate the upper left position of the reference block referenced by the current block within the reference picture.
[0085] According to various embodiments, for further accurate prediction, the reference sample point position may indicate a sub-pixel located between integer pixels. For example, the reference sample point position may indicate a sub-pixel of a 1 / 4 pixel unit. However, the reference sample point position is not limited thereto, and the sub-pixel unit may be a 1 / 8 pixel unit or smaller.
[0086] According to various embodiments, the number of reference sample positions equal to the number of motion vectors used in the inter prediction mode of the current block may be determined. For example, when the current block is unidirectionally predicted, one reference sample position may be determined, and when the current block is bidirectionally predicted, two reference sample positions may be determined.
[0087] The inter-frame predictor 110 may determine filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position based on the inter-frame prediction mode of the current block. The inter-frame predictor 110 may apply an interpolation filter to the reference samples at integer pixel positions and determine information about the interpolation filter to generate reference samples at sub-pixel positions between the reference samples at integer pixel positions.
[0088] According to various embodiments, the inter-frame predictor 110 may determine at least one reconstructed reference sample to which the filter is to be applied based on the reference sample position within the reconstructed reference picture. According to some embodiments, the at least one reconstructed reference sample may include samples located within a specific range based on the reference sample position. According to some embodiments, the at least one reconstructed reference sample may include samples in a reference block referenced by the current block and neighboring samples adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may also include reference samples referenced by neighboring blocks adjacent to the current block. According to some embodiments, the at least one reconstructed reference sample may also include neighboring samples adjacent to the reference block referenced by neighboring blocks of the current block.
[0089] According to some embodiments, the inter-frame predictor 110 may determine reference samples at integer pixel positions based on the reference sample positions being within a specific range as at least one reconstructed reference sample to which the interpolation filter is to be applied. According to some embodiments, the at least one reconstructed reference sample may include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions included in a reference block referenced by the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate neighboring reference samples at sub-pixel positions adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions referenced by neighboring blocks adjacent to the current block.
[0090] According to various embodiments, the filter information may include at least one of a direction and a size of the filter. According to various embodiments, the inter-frame predictor 110 may determine to use a separable 2-dimensional (2D) filter. According to an embodiment, the inter-frame predictor 110 may determine to apply each of a horizontal direction filter and a vertical direction filter.
[0091] According to various embodiments, the inter-frame predictor 110 may determine the size of the filter by determining the number of taps of the filter to be a specific value. The number of taps of the filter may represent the number of reference samples at integer pixel positions required to generate reference samples at sub-pixel positions. Here, the specific value may be determined according to the inter-frame prediction mode of the current block.
[0092] According to various embodiments, the inter predictor 110 may determine the filter information based on the size of the current block. According to some embodiments, the inter predictor 110 may determine the size of the filter based on the size of the current block.
[0093] According to an embodiment, the inter-frame predictor 110 may determine to use the first filter when the size of the current block is equal to or greater than a specific reference value, otherwise it may determine to use the second filter. According to an embodiment, the size of the first filter may be greater than the size of the second filter. According to an embodiment, the specific reference value may be determined according to the inter-frame prediction mode of the current block. According to an embodiment, the inter-frame predictor 110 may compare the size of the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0094] According to an embodiment, the inter-frame predictor 110 may determine horizontal direction filter information based on the horizontal width of the current block, and may determine vertical direction filter information based on the vertical height of the current block. According to an embodiment, when the current block is non-square, the inter-frame predictor 110 may determine the horizontal direction filter and the vertical direction filter as filters of different sizes.
[0095] According to an embodiment, the inter-frame predictor 110 may determine the horizontal direction filter information and the vertical direction filter information based on the ratio of the horizontal width to the vertical height of the current block. For example, when the horizontal direction filter information of the current block is determined, the inter-frame predictor 110 may determine the vertical direction filter information based on the horizontal direction filter information and the ratio of the horizontal width to the vertical height of the current block. For another example, when the vertical direction filter information of the current block is determined, the inter-frame predictor 110 may determine the horizontal direction filter information based on the vertical direction filter information and the ratio of the horizontal width to the vertical height of the current block. According to an embodiment, the inter-frame predictor 110 may determine the size of the horizontal direction filter and the size of the vertical direction filter to be proportional to the horizontal width and the vertical height of the current block.
[0096] According to various embodiments, the inter-frame predictor 110 may determine filter information based on whether the current block is a luminance block or a chrominance block. According to an embodiment, the inter-frame predictor 110 may determine to use a first filter when the current block is a luminance block, and determine to use a second filter when the current block is a chrominance block. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0097] According to various embodiments, the inter-frame predictor 110 may determine the filter information based on whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction. According to an embodiment, the inter-frame predictor 110 may determine to use the first filter when the current block is unidirectionally predicted, and determine to use the second filter when the current block is bidirectionally predicted. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0098] According to various embodiments, the inter-frame predictor 110 may determine filter information based on the number of reference blocks referenced by the current block. According to an embodiment, the image decoding apparatus 100 may determine to use a filter with a first number of taps when the number of reference blocks referenced by the current block is less than or equal to a specific reference value, and otherwise determine to use a filter with a second number of taps less than the first number of taps. According to an embodiment, the inter-frame predictor 110 may compare the number of reference blocks referenced by the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0099] According to various embodiments, the inter-frame predictor 110 may determine the maximum size of the filter based on the inter-frame prediction mode of the current block. For example, when the inter-frame prediction mode of the current block is the OBMC mode, the inter-frame predictor 110 may determine the size of the filter to be less than or equal to 2 taps. For example, when the inter-frame prediction mode of the current block is the DMVR mode, the inter-frame predictor 110 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the affine mode, the inter-frame predictor 110 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the BIO mode, the inter-frame predictor 110 may determine the size of the filter to be less than or equal to 8 taps.
[0100] According to various embodiments, the inter-frame predictor 110 may determine filtering information so that the memory bandwidth required for inter-frame prediction of the current block is within a specific range. The memory bandwidth may be defined as the number of reference samples to be extracted from the memory for predicting the current sample. The memory bandwidth may be determined based on the size of the current block and the number of reconstructed reference samples required for inter-frame prediction of the current block.
[0101] According to various embodiments, the inter-frame predictor 110 may determine not to perform filtering on the at least one reconstructed reference sample based on at least one of the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction.
[0102] The inter-frame predictor 110 may perform filtering on the at least one reconstructed reference sample based on the filter information. According to various embodiments, the inter-frame predictor 110 may generate reference samples at sub-pixel positions by applying an interpolation filter to reconstructed reference samples at integer-pixel positions based on the filter information. According to various embodiments, the inter-frame predictor 110 may generate prediction samples corresponding to samples of the current block by using reference samples at integer-pixel positions and reference samples at sub-pixel positions.
[0103] The decoder 115 may decode the current block by using the prediction samples generated through filtering. According to various embodiments, the decoder 115 may reconstruct the current block based on the prediction samples of the current block and the residual block of the current block.
[0104] Figure 1b is a block diagram of an image decoding apparatus 100 according to various embodiments. The image decoding apparatus 100 may be Figure 1a An image decoding device 100 is provided.
[0105] The image decoding apparatus 100 according to various embodiments may include a memory 120 and at least one processor 125 accessing the memory 120. The operation of the image decoding apparatus 100 according to various embodiments may be performed by a separate processor or by control of a central processor. In addition, the memory 120 of the image decoding apparatus 100 may store data received from an external source and data generated by the processor 125.
[0106] The memory 120 of the image decoding apparatus 100 according to various embodiments may include at least one instruction configured to be executable by at least one processor 125. The at least one instruction may be configured to cause the at least one processor 125 to perform the following operations when executed: when the current block is inter-predicted, determine the inter-prediction mode of the current block; based on the inter-prediction mode of the current block, determine at least one reference sample position to be referenced by the current block; based on the inter-prediction mode of the current block, determine filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position; perform filtering on the at least one reconstructed reference sample based on the filtering information; and decode the current block by using the prediction sample generated through filtering.
[0107] Figure 2 is a block diagram of an image decoder 200 according to various embodiments.
[0108] The image decoder 200 according to various embodiments may execute Figure 1a or Figure 1b The image decoding apparatus 100 performs operations to decode image data.
[0109] Reference Figure 2, the entropy decoder 215 parses the encoded image data to be decoded and the encoding information required for decoding from the bit stream 205. The encoded image data is a quantized transform coefficient, and the inverse quantizer 220 and the inverse transformer 225 reconstruct residual data from the quantized transform coefficient.
[0110] The intra-frame predictor 240 performs intra-frame prediction on each block. The inter-frame predictor 235 performs inter-frame prediction on each block using a reference picture obtained by the reconstructed picture buffer 230. The inter-frame predictor 235 may be used together with Figure 1a Corresponding to the inter-frame predictor 110.
[0111] The data of the spatial domain of the block of the current image may be reconstructed in response to the prediction data and the residual data generated by the intra predictor 240 or the inter predictor 235 for each block being added, and the deblocking unit 245 and the sample adaptive offset (SAO) performer 250 may output a filtered reconstructed image by performing loop filtering on the reconstructed data of the spatial domain. In addition, the reconstructed image stored in the reconstructed picture buffer 230 may be output as a reference image.
[0112] In order for the image decoding apparatus 100 to decode image data, step-by-step operations of the image decoder 200 according to various embodiments may be performed block by block.
[0113] Figure 3 is a flowchart of an image decoding method 300 according to various embodiments.
[0114] In operation S310, the image decoding apparatus 100 may determine an inter prediction mode of a current block. The image decoding apparatus 100 may receive a bitstream and obtain information about the inter prediction mode of the current block from the bitstream. The information about the inter prediction mode of the current block may be information about an inter prediction mode applied to the current block among a plurality of inter prediction modes. For example, the inter prediction mode may be at least one of a merge mode, an advanced motion vector prediction (AMVP) mode, an inter skip mode, an overlapped block motion compensation (OBMC) mode, a decoder-side motion vector correction (DMVR) mode, an affine mode, and a bidirectional optical flow (BIO) mode.
[0115] In operation S320, the image decoding apparatus 100 may determine at least one reference sample position to be referenced by the current block based on the inter prediction mode of the current block. The image decoding apparatus 100 may obtain at least one motion vector and at least one reference picture index of the current block based on the inter prediction mode of the current block, and determine the position indicated by the motion vector within the reference picture indicated by the reference picture index as the reference sample position.
[0116] According to various embodiments, for further accurate prediction, the reference sample position may indicate a sub-pixel located between integer pixels. According to various embodiments, the number of reference sample positions used in the inter prediction mode of the current block equal to the number of motion vectors may be determined.
[0117] In operation S330, the image decoding apparatus 100 may determine filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position based on the inter prediction mode of the current block. The image decoding apparatus 100 may apply an interpolation filter to the reference samples at integer pixel positions and determine information about the interpolation filter to generate reference samples at sub-pixel positions between the reference samples at the integer pixel positions.
[0118] According to various embodiments, the image decoding apparatus 100 may determine at least one reconstructed reference sample to which a filter is to be applied based on the position of the reference sample within the reconstructed reference picture. According to some embodiments, the at least one reconstructed reference sample may include samples located within a specific range based on the position of the reference sample. According to some embodiments, the at least one reconstructed reference sample may include samples in a reference block referenced by the current block and neighboring samples adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may also include reference samples referenced by neighboring blocks adjacent to the current block. According to some embodiments, the at least one reconstructed reference sample may also include neighboring samples adjacent to the reference block referenced by neighboring blocks of the current block.
[0119] According to some embodiments, the image decoding apparatus 100 may determine reference samples at integer pixel positions based on reference sample positions being within a specific range as at least one reconstructed reference sample to which an interpolation filter is to be applied. According to some embodiments, the at least one reconstructed reference sample may include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions included in a reference block referenced by the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate neighboring reference samples at sub-pixel positions adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions referenced by neighboring blocks adjacent to the current block.
[0120] According to various embodiments, the filter information may include at least one of a direction and a size of the filter. According to various embodiments, the image decoding apparatus 100 may determine to use a separable 2D filter. According to an embodiment, the image decoding apparatus 100 may determine to apply each of a horizontal direction filter and a vertical direction filter.
[0121] According to various embodiments, the image decoding apparatus 100 may determine the size of the filter by determining the number of taps of the filter to be a specific value. Here, the specific value may be determined according to the inter prediction mode of the current block.
[0122] According to various embodiments, the image decoding apparatus 100 may determine filter information based on the size of the current block. According to an embodiment, the image decoding apparatus 100 may determine to use the first filter when the size of the current block is equal to or greater than a specific reference value, and otherwise determine to use the second filter. According to an embodiment, the size of the first filter may be greater than the size of the second filter. According to an embodiment, the specific reference value may be determined according to the inter-frame prediction mode of the current block. According to an embodiment, the image decoding apparatus 100 may compare the size of the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0123] According to an embodiment, the image decoding apparatus 100 may determine horizontal direction filter information based on the horizontal width of the current block, and determine vertical direction filter information based on the vertical height of the current block. According to an embodiment, when the current block is non-square, the image decoding apparatus 100 may determine the horizontal direction filter and the vertical direction filter as filters of different sizes.
[0124] According to an embodiment, the image decoding device 100 may determine the horizontal direction filter information and the vertical direction filter information based on the ratio of the horizontal width to the vertical height of the current block. For example, when the horizontal direction filter information of the current block is determined, the image decoding device 100 may determine the vertical direction filter information based on the horizontal direction filter information and the ratio of the horizontal width to the vertical height of the current block. For another example, when the vertical direction filter information of the current block is determined, the image decoding device 100 may determine the horizontal direction filter information based on the vertical direction filter information and the ratio of the horizontal width to the vertical height of the current block. According to an embodiment, the image decoding device 100 may determine the size of the horizontal direction filter and the size of the vertical direction filter to be proportional to the horizontal width and the vertical height of the current block.
[0125] According to various embodiments, the image decoding apparatus 100 may determine filter information based on whether the current block is a luminance block or a chrominance block. According to an embodiment, the image decoding apparatus 100 may determine to use a first filter when the current block is a luminance block, and determine to use a second filter when the current block is a chrominance block. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0126] According to various embodiments, the image decoding apparatus 100 may determine the filter information based on whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction. According to an embodiment, the image decoding apparatus 100 may determine to use the first filter when the current block is unidirectionally predicted, and determine to use the second filter when the current block is bidirectionally predicted. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0127] According to various embodiments, the image decoding apparatus 100 may determine filter information based on the number of reference blocks referenced by the current block. According to an embodiment, the image decoding apparatus 100 may compare the number of reference blocks referenced by the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0128] According to various embodiments, the image decoding device 100 may determine the maximum size of the filter based on the inter-frame prediction mode of the current block. For example, when the inter-frame prediction mode of the current block is the OBMC mode, the image decoding device 100 may determine the size of the filter to be less than or equal to 2 taps. For example, when the inter-frame prediction mode of the current block is the DMVR mode, the image decoding device 100 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the affine mode, the image decoding device 100 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the BIO mode, the image decoding device 100 may determine the size of the filter to be less than or equal to 8 taps.
[0129] According to various embodiments, the image decoding apparatus 100 may determine filter information so that the memory bandwidth required for inter prediction of the current block is within a specific range. The memory bandwidth may be defined as the number of reference samples to be extracted from the memory for processing the current sample. The memory bandwidth may be determined based on the size of the current block and the number of reconstructed reference samples required for inter prediction of the current block.
[0130] According to various embodiments, the image decoding device 100 may determine not to perform filtering on the at least one reconstructed reference sample based on at least one of the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction.
[0131] In operation S340, the image decoding apparatus 100 may perform filtering on the at least one reconstructed reference sample based on the filter information. According to various embodiments, the image decoding apparatus 100 may generate reference samples at sub-pixel positions by applying an interpolation filter to reconstructed reference samples at integer pixel positions based on the filter information. According to various embodiments, the image decoding apparatus 100 may generate prediction samples corresponding to samples of the current block by using reference samples at integer pixel positions and reference samples at sub-pixel positions.
[0132] In operation S350, the image decoding apparatus 100 may decode the current block by using the prediction samples generated through filtering. According to various embodiments, the image decoding apparatus 100 may reconstruct the current block based on the prediction samples of the current block and the residual block of the current block.
[0133] Figure 4a is a block diagram of an image encoding apparatus 400 according to various embodiments.
[0134] The image encoding apparatus 400 may include an inter-frame predictor 405 and an encoder 410. The inter-frame predictor 405 and the encoder 410 may include at least one processor. In addition, the inter-frame predictor 405 and the encoder 410 may include a memory storing instructions to be executed by the at least one processor.
[0135] When the prediction mode of the current block is an inter prediction mode, the inter predictor 405 may determine an inter prediction mode applied to the current block from among a plurality of inter prediction modes. According to various embodiments, the inter predictor 405 may determine the inter prediction mode applied to the current block according to the encoding efficiency of the inter prediction mode applicable to the current block. For example, the inter prediction mode applicable to the current block may be a merge mode, an AMVP mode, an inter skip mode, an OBMC mode, a DMVR mode, an affine mode, and a BIO mode.
[0136] According to various embodiments, the inter predictor 405 may determine the number of reference blocks to be referenced by the current block. For example, the inter predictor 405 may determine whether the current block is to be unidirectionally predicted or bidirectionally predicted.
[0137] The inter-frame predictor 405 may determine at least one reference sample position to be referred to by the current block based on the inter-frame prediction mode of the current block. According to various embodiments, the inter-frame predictor 405 may determine a reference block that is a block most similar to the current block from at least one reference picture based on the inter-frame prediction mode of the current block, and perform motion prediction to determine a motion vector indicating a position difference between the current block and the reference block.
[0138] Here, for further accurate motion prediction, reference samples at sub-pixel positions between reference samples at integer pixel positions of the reference picture may be generated, and a sub-pixel unit motion vector indicating the reference samples at the sub-pixel positions may be determined. For example, the reference samples at the sub-pixel positions may be generated in 1 / 4 pixel units. However, the reference samples are not limited thereto, and the reference samples at the sub-pixel positions may be generated in 1 / 8 pixel units or smaller units.
[0139] According to various embodiments, the inter-frame predictor 405 may determine the position indicated by the motion vector in the reference picture as the reference sample position. According to various embodiments, the reference sample position may indicate the upper left position of the reference block referenced by the current block within the reference picture. The reference sample position may be determined as the coordinates obtained by adding the motion vector component of the current block to the upper left coordinates of the current block.
[0140] According to various embodiments, the number of reference sample positions equal to the number of motion vectors used in the inter prediction mode of the current block may be determined. For example, when the current block is unidirectionally predicted, one reference sample position may be determined. For example, when the current block is bidirectionally predicted, two reference sample positions may be determined.
[0141] The inter-frame predictor 405 may determine filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position based on the inter-frame prediction mode of the current block. The inter-frame predictor 405 may apply an interpolation filter to the reference samples at integer pixel positions and determine information about the interpolation filter to generate reference samples at sub-pixel positions between the reference samples at the integer pixel positions.
[0142] According to various embodiments, the inter-frame predictor 405 may determine at least one reconstructed reference sample to which the filter is to be applied based on the reference sample position within the reconstructed reference picture. According to some embodiments, the at least one reconstructed reference sample may include samples located within a specific range based on the reference sample position. According to some embodiments, the at least one reconstructed reference sample may include samples in a reference block referenced by the current block and neighboring samples adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may also include reference samples referenced by neighboring blocks adjacent to the current block. According to some embodiments, the at least one reconstructed reference sample may also include neighboring samples adjacent to the reference block referenced by neighboring blocks of the current block.
[0143] According to some embodiments, the inter-frame predictor 405 may determine reference samples at integer pixel positions based on the reference sample positions being within a specific range as at least one reconstructed reference sample to which the interpolation filter is to be applied. According to some embodiments, the at least one reconstructed reference sample may include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions included in a reference block referenced by the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate neighboring reference samples at sub-pixel positions adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions referenced by neighboring blocks adjacent to the current block.
[0144] According to various embodiments, the filter information may include at least one of a direction and a size of the filter. According to various embodiments, the inter-frame predictor 405 may determine to use a separable 2D filter. According to an embodiment, the inter-frame predictor 405 may determine to apply each of a horizontal direction filter and a vertical direction filter.
[0145] According to various embodiments, the inter-frame predictor 405 may determine the size of the filter by determining the number of taps of the filter to be a specific value. The number of taps of the filter may represent the number of reference samples at integer pixel positions required to generate reference samples at sub-pixel positions. Here, the specific value may be determined according to the inter-frame prediction mode of the current block.
[0146] According to various embodiments, the inter predictor 405 may determine the filter information based on the size of the current block. According to some embodiments, the inter predictor 405 may determine the size of the filter based on the size of the current block.
[0147] According to an embodiment, the inter-frame predictor 405 may determine to use the first filter when the size of the current block is equal to or greater than a specific reference value, otherwise determine to use the second filter. According to an embodiment, the size of the first filter may be greater than the size of the second filter. According to an embodiment, the specific reference value may be determined according to the inter-frame prediction mode of the current block. According to an embodiment, the inter-frame predictor 405 may compare the size of the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on the result of the comparison.
[0148] According to an embodiment, the inter-frame predictor 405 may determine the horizontal direction filter information based on the horizontal width of the current block, and determine the vertical direction filter information based on the vertical height of the current block. According to an embodiment, when the current block is non-square, the inter-frame predictor 405 may determine the horizontal direction filter and the vertical direction filter as filters of different sizes. According to an embodiment, when the current block is non-square, the inter-frame predictor 405 may determine the number of taps of the horizontal direction filter and the number of taps of the vertical direction filter to be different from each other.
[0149] According to an embodiment, the inter-frame predictor 405 may determine the horizontal direction filter information and the vertical direction filter information based on the ratio of the horizontal width to the vertical height of the current block. For example, when the horizontal direction filter information of the current block is determined, the inter-frame predictor 405 may determine the vertical direction filter information based on the horizontal direction filter information and the ratio of the horizontal width to the vertical height of the current block. For another example, when the vertical direction filter information of the current block is determined, the inter-frame predictor 405 may determine the horizontal direction filter information based on the vertical direction filter information and the ratio of the horizontal width to the vertical height of the current block. According to an embodiment, the inter-frame predictor 405 may determine the size of the horizontal direction filter and the size of the vertical direction filter to be proportional to the horizontal width and the vertical height of the current block.
[0150] According to various embodiments, the inter-frame predictor 405 may determine filter information based on whether the current block is a luminance block or a chrominance block. According to an embodiment, the inter-frame predictor 405 may determine to use a first filter when the current block is a luminance block, and determine to use a second filter when the current block is a chrominance block. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0151] According to various embodiments, the inter-frame predictor 405 may determine the filter information based on whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction. According to an embodiment, the inter-frame predictor 405 may determine to use a first filter when the current block is unidirectionally predicted, and determine to use a second filter when the current block is bidirectionally predicted. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0152] According to various embodiments, the inter-frame predictor 405 may determine the filter information based on the number of reference blocks referenced by the current block. According to an embodiment, the inter-frame predictor 405 may compare the number of reference blocks referenced by the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0153] According to various embodiments, the inter-frame predictor 405 may determine the maximum size of the filter based on the inter-frame prediction mode of the current block. For example, when the inter-frame prediction mode of the current block is the OBMC mode, the inter-frame predictor 405 may determine the size of the filter to be less than or equal to 2 taps. For example, when the inter-frame prediction mode of the current block is the DMVR mode, the inter-frame predictor 405 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the affine mode, the inter-frame predictor 405 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the BIO mode, the inter-frame predictor 405 may determine the size of the filter to be less than or equal to 8 taps.
[0154] According to various embodiments, the inter-frame predictor 405 may determine filter information so that the memory bandwidth required for inter-frame prediction of the current block is within a specific range. The memory bandwidth may be defined as the number of reference samples to be extracted from the memory for encoding the current sample. The memory bandwidth may be determined based on the size of the current block and the number of reconstructed reference samples required for inter-frame prediction of the current block.
[0155] According to various embodiments, the inter-frame predictor 405 may determine not to perform filtering on the at least one reconstructed reference sample based on at least one of the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction.
[0156] The inter predictor 405 may perform filtering on the at least one reconstructed reference sample based on the filter information. According to various embodiments, the inter predictor 405 may generate reference samples at sub-pixel positions by applying an interpolation filter to the reconstructed reference samples at integer-pixel positions based on the filter information.
[0157] According to various embodiments, the inter-frame predictor 405 may determine at least one reference block most similar to the current block by using reference samples at integer pixel positions and reference samples at sub-pixel positions based on the inter-frame prediction mode of the current block. According to various embodiments, the inter-frame predictor 405 may determine the position difference between the current block and the reference block as a motion vector.
[0158] According to various embodiments, the inter predictor 405 may generate prediction samples corresponding to samples of the current block from samples of the reference block.
[0159] The encoder 410 may encode the current block by using the prediction samples generated through filtering. According to various embodiments, the encoder 410 may obtain a residual value between a sample value of the current block and a prediction sample value of the current block, and encode the residual value.
[0160] According to various embodiments, the encoder 410 may encode information related to at least one motion vector of the current block. According to various embodiments, the encoder 410 may encode at least one reference picture index of the current block. According to various embodiments, the encoder 410 may encode information about the inter-prediction mode of the current block.
[0161] Figure 4b 400 is a block diagram of an image encoding apparatus 400 according to various embodiments. The image encoding apparatus 400 may be Figure 4a An image encoding device 400 is provided.
[0162] The image encoding apparatus 400 according to various embodiments may include a memory 420 and at least one processor 425 accessing the memory 420. The operation of the image encoding apparatus 400 according to various embodiments may be performed by a separate processor or by control of a central processor. In addition, the memory 420 of the image encoding apparatus 400 may store data received from an external source and data generated by the processor 425.
[0163] The memory 420 of the image encoding apparatus 400 according to various embodiments may include at least one instruction configured to be executable by at least one processor 425. The at least one instruction may be configured to cause the at least one processor 425 to perform the following operations when executed: when the current block is inter-predicted, determine the inter-prediction mode of the current block; based on the inter-prediction mode of the current block, determine at least one reference sample position to be referenced by the current block; based on the inter-prediction mode of the current block, determine filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position; perform filtering on the at least one reconstructed reference sample based on the filter information; and encode the current block by using the prediction samples generated through filtering.
[0164] Figure 5 is a block diagram of an image encoder 500 according to various embodiments.
[0165] According to various embodiments, the image encoder 500 may execute Figure 4a or Figure 4b The image encoding device 400 processes operations to encode image data.
[0166] The intra predictor 520 performs intra prediction for each block in the current image 505 , and the inter predictor 515 performs inter prediction by using the current image 505 and a reference image obtained from the reconstructed picture buffer 510 for each block. Figure 5 The inter-frame predictor 520 can be used with Figure 4a The inter-frame predictor 405 corresponds to .
[0167] Residual data is generated by subtracting prediction data of each block output from the intra predictor 520 or the inter predictor 515 from data of the encoded block of the current image 505, and the transformer 525 and the quantizer 530 can output quantized transform coefficients for each block by performing transform and quantization on the residual data.
[0168] The inverse quantizer 545 and the inverse transformer 550 can reconstruct the residual data of the spatial domain by performing inverse quantization and inverse transformation on the quantized transform coefficients. The reconstructed residual data of the spatial domain is reconstructed into data of the spatial domain of the block of the current image 505 by adding the prediction data about each block output from the intra-frame predictor 520 or the inter-frame predictor 515. The deblocking unit 555 and the SAO executor 560 perform in-loop filtering on the reconstructed data of the spatial domain and generate a filtered reconstructed image. The generated reconstructed image is stored in the reconstructed picture buffer 510. The reconstructed image stored in the reconstructed picture buffer 510 can be used as a reference image for inter-frame prediction of another image. The entropy encoder 535 can entropy encode the quantized transform coefficients, and the entropy encoded coefficients can be output as a bitstream 540.
[0169] In order for the image encoding apparatus 400 to encode image data, stepwise operations of the image encoder 500 according to various embodiments may be performed block by block.
[0170] Figure 6 is a flowchart of an image encoding method 600 according to various embodiments.
[0171] In operation S610, the image encoding apparatus 400 may determine an inter prediction mode of a current block. According to various embodiments, the image encoding apparatus 400 may determine an inter prediction mode of a current block according to encoding efficiency of the inter prediction mode applicable to the current block. For example, the inter prediction mode applicable to the current block may be a merge mode, an AMVP mode, an inter skip mode, an OBMC mode, a DMVR mode, an affine mode, and a BIO mode.
[0172] According to various embodiments, the image encoding apparatus 400 may determine the number of reference blocks to be referred to by the current block. For example, the image encoding apparatus 400 may determine whether the current block is to be unidirectionally predicted or bidirectionally predicted.
[0173] In operation S620, the image encoding apparatus 400 may determine at least one reference sample position to be referred to by the current block based on the inter prediction mode of the current block. According to various embodiments, the image encoding apparatus 400 may determine a reference block that is the most similar block to the current block from at least one reference picture based on the inter prediction mode of the current block, and perform motion prediction to determine a motion vector indicating a position difference between the current block and the reference block.
[0174] Here, for further accurate motion prediction, reference samples at sub-pixel positions between reference samples at integer pixel positions of a reference picture may be generated, and a sub-pixel unit motion vector indicating the determined reference samples may be determined.
[0175] According to various embodiments, the image encoding apparatus 400 may determine the position indicated by the motion vector in the reference picture as the reference sample position. According to various embodiments, the number of reference sample positions equal to the number of motion vectors used in the inter prediction mode of the current block may be determined.
[0176] In operation S630, the image encoding apparatus 400 may determine filter information to be applied to at least one reconstructed reference sample corresponding to the at least one reference sample position based on the inter prediction mode of the current block. The image encoding apparatus 400 may apply an interpolation filter to the reference samples at integer pixel positions and determine information about the interpolation filter to generate reference samples at sub-pixel positions between the reference samples at the integer pixel positions.
[0177] According to various embodiments, the image encoding apparatus 400 may determine at least one reconstructed reference sample to which a filter is to be applied based on the position of the reference sample within the reconstructed reference picture. According to some embodiments, the at least one reconstructed reference sample may include samples located within a specific range based on the position of the reference sample. According to some embodiments, the at least one reconstructed reference sample may include samples in a reference block referenced by the current block and neighboring samples adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may also include reference samples referenced by neighboring blocks adjacent to the current block. According to some embodiments, the at least one reconstructed reference sample may also include neighboring samples adjacent to the reference block referenced by neighboring blocks of the current block.
[0178] According to some embodiments, the image encoding apparatus 400 may determine reference samples at integer pixel positions based on the reference sample positions being within a specific range as at least one reconstructed reference sample to which an interpolation filter is to be applied. According to some embodiments, the at least one reconstructed reference sample may include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions included in a reference block referenced by the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate neighboring reference samples at sub-pixel positions adjacent to the reference block of the current block. According to some embodiments, the at least one reconstructed reference sample may further include reference samples at integer pixel positions required to generate reference samples at sub-pixel positions referenced by neighboring blocks adjacent to the current block.
[0179] According to various embodiments, the filter information may include at least one of a direction and a size of the filter. According to various embodiments, the image encoding apparatus 400 may determine to use a separable 2D filter. According to an embodiment, the image encoding apparatus 400 may determine to apply each of a horizontal direction filter and a vertical direction filter.
[0180] According to various embodiments, the image encoding apparatus 400 may determine the size of the filter by determining the number of taps of the filter to be a specific value. Here, the specific value may be determined according to the inter prediction mode of the current block.
[0181] According to various embodiments, the image encoding apparatus 400 may determine filter information based on the size of the current block. According to an embodiment, the image encoding apparatus 400 may determine to use a first filter when the size of the current block is equal to or greater than a specific reference value, and otherwise determine to use a second filter. According to an embodiment, the size of the first filter may be greater than the size of the second filter. According to an embodiment, the image encoding apparatus 400 may compare the size of the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0182] According to an embodiment, the image encoding apparatus 400 may determine the horizontal direction filter information based on the horizontal width of the current block, and determine the vertical direction filter information based on the vertical height of the current block. According to an embodiment, when the current block is non-square, the image encoding apparatus 400 may determine the horizontal direction filter and the vertical direction filter as filters of different sizes. According to an embodiment, when the current block is non-square, the image encoding apparatus 400 may determine the number of taps of the horizontal direction filter and the number of taps of the vertical direction filter to be different from each other.
[0183] According to an embodiment, the image encoding device 400 may determine the horizontal direction filter information and the vertical direction filter information based on the ratio of the horizontal width to the vertical height of the current block. For example, when the horizontal direction filter information of the current block is determined, the image encoding device 400 may determine the vertical direction filter information based on the horizontal direction filter information and the ratio of the horizontal width to the vertical height of the current block. For another example, when the vertical direction filter information of the current block is determined, the image encoding device 400 may determine the horizontal direction filter information based on the vertical direction filter information and the ratio of the horizontal width to the vertical height of the current block. According to an embodiment, the image encoding device 400 may determine the size of the horizontal direction filter and the size of the vertical direction filter to be proportional to the horizontal width and the vertical height of the current block.
[0184] According to various embodiments, the image encoding apparatus 400 may determine filter information based on whether the current block is a luminance block or a chrominance block. According to an embodiment, the image encoding apparatus 400 may determine to use a first filter when the current block is a luminance block, and determine to use a second filter when the current block is a chrominance block. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0185] According to various embodiments, the image encoding apparatus 400 may determine filter information based on whether inter prediction of the current block is unidirectional prediction or bidirectional prediction. According to an embodiment, the image encoding apparatus 400 may determine to use a first filter when the current block is unidirectionally predicted, and determine to use a second filter when the current block is bidirectionally predicted. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0186] According to various embodiments, the image encoding apparatus 400 may determine filter information based on the number of reference blocks referenced by the current block. According to an embodiment, the image encoding apparatus 400 may compare the number of reference blocks referenced by the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0187] According to various embodiments, the image encoding device 400 may determine the maximum size of the filter based on the inter-frame prediction mode of the current block. For example, when the inter-frame prediction mode of the current block is the OBMC mode, the image encoding device 400 may determine the size of the filter to be less than or equal to 2 taps. For example, when the inter-frame prediction mode of the current block is the DMVR mode, the image encoding device 400 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the affine mode, the image encoding device 400 may determine the size of the filter to be less than or equal to 4 taps. For example, when the inter-frame prediction mode of the current block is the BIO mode, the image encoding device 400 may determine the size of the filter to be less than or equal to 8 taps.
[0188] According to various embodiments, the image encoding apparatus 400 may determine filter information so that the memory bandwidth required for inter prediction of the current block is within a specific range. The memory bandwidth may be defined as the number of reference samples to be extracted from the memory for processing the current sample. The memory bandwidth may be determined based on the size of the current block and the number of reconstructed reference samples required for inter prediction of the current block.
[0189] According to various embodiments, the image encoding device 400 may determine not to perform filtering on the at least one reconstructed reference sample based on at least one of the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction.
[0190] In operation S640, the image encoding apparatus 400 may perform filtering on the at least one reconstructed reference sample based on the filter information. According to various embodiments, the image encoding apparatus 400 may generate reference samples at sub-pixel positions by applying an interpolation filter to reconstructed reference samples at integer pixel positions based on the filter information.
[0191] According to various embodiments, the image encoding apparatus 400 may determine at least one reference block most similar to the current block by using reference samples at integer pixel positions and reference samples at sub-pixel positions based on the inter-prediction mode of the current block. According to various embodiments, the image encoding apparatus 400 may determine the position difference between the current block and the reference block as a motion vector. According to various embodiments, the image encoding apparatus 400 may generate prediction samples corresponding to samples of the current block from samples of the reference block.
[0192] In operation S650, the image encoding apparatus 400 may encode the current block by using the prediction samples generated by filtering. According to various embodiments, the image encoding apparatus 400 may obtain a residual value between a sample value of the current block and a prediction sample value of the current block, and encode the residual value. According to various embodiments, the image encoding apparatus 400 may encode information related to at least one motion vector of the current block. According to various embodiments, the image encoding apparatus 400 may encode at least one reference picture index of the current block. According to various embodiments, the image encoding apparatus 400 may encode information about an inter-prediction mode of the current block.
[0193] Hereinafter, the division of coding units will be described in detail according to various embodiments of the present disclosure.
[0194] First, a picture may be divided into one or more slices. A slice may be a sequence of one or more maximum coding units (coding tree units (CTUs)). Conceptually, compared to the maximum coding unit (CTU), there is a maximum coding block (coding tree block (CTB)).
[0195] A maximum coding unit (CTB) represents an N×N block including N×N samples (N is an integer). Each color component may be divided into one or more maximum coding blocks.
[0196] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture encoded in a color plane separated according to color components, the maximum coding unit includes a syntax structure for encoding the picture and samples of the picture.
[0197] One maximum coding block (CTB) may be divided into M×N coding blocks (M and N are integers) including M×N samples.
[0198] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for encoding the luma samples and the chroma samples. When the picture is a monochrome picture, the coding unit includes a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture coded in color planes separated according to color components, the coding unit includes a syntax structure for encoding the picture and the samples of the picture.
[0199] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block containing corresponding samples and a syntax structure corresponding to the (maximum) coding block. However, because a person of ordinary skill in the art understands that a (maximum) coding unit or a (maximum) coding block refers to a block of a predetermined size including a predetermined number of samples, unless otherwise described, the maximum coding block and the maximum coding unit or the coding block and the coding unit are mentioned in the following description without distinguishing between the maximum coding block and the maximum coding unit or the coding block and the coding unit.
[0200] The image may be divided into maximum coding units. The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the embodiment is not limited thereto.
[0201] For example, information about the maximum size of the luma coding block may be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block may be one of 16×16, 32×32, 64×64, 128×128, and 256×256.
[0202] For example, information about the luminance block size difference and the maximum size of the luminance coding block that can be divided into two can be obtained from the bitstream. The information about the luminance block size difference may refer to the size difference between the luminance maximum coding unit and the maximum luminance coding block that can be divided into two. Therefore, when the information about the maximum size of the luminance coding block that can be divided into two obtained from the bitstream and the information about the luminance block size difference are combined with each other, the size of the luminance maximum coding unit can be determined. The size of the chrominance maximum coding unit can be determined by using the size of the luminance maximum coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chrominance block may be half the size of the luminance block, and the size of the chrominance maximum coding unit may be half the size of the luminance maximum coding unit.
[0203] According to an embodiment, since information about the maximum size of a brightness coding block that can be divided into two is obtained from a bitstream, the maximum size of a brightness coding block that can be divided into two can be variably determined. In contrast, the maximum size of a brightness coding block that can be divided into three can be fixed. For example, the maximum size of a brightness coding block that can be divided into three in an I slice can be 32×32, and the maximum size of a brightness coding block that can be divided into three in a P slice or a B slice can be 64×64.
[0204] In addition, the maximum coding unit may be hierarchically split into coding units based on the split shape pattern information obtained from the bitstream. At least one of information indicating whether four splits are performed, information indicating whether multi-splits are performed, split direction information, and split type information may be obtained from the bitstream as the split shape pattern information.
[0205] For example, the information indicating whether four-split is performed may indicate whether the current coding unit is four-split (QUAD_SPLIT).
[0206] When the current coding unit is not divided into four, the information indicating whether multi-split is performed may indicate whether the current coding unit is no longer split (NO_SPLIT) or is divided into two / three.
[0207] When the current coding unit is two-partitioned or three-partitioned, the split direction information indicates that the current coding unit is split in one direction of a horizontal direction and a vertical direction.
[0208] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit is split into two or three.
[0209] The split mode of the current coding unit may be determined according to the split direction information and the split type information. The split mode when the current coding unit is split into two in the horizontal direction may be determined as a two-horizontal split mode (SPLIT_BT_HOR), the split mode when the current coding unit is split into three in the horizontal direction may be determined as a three-horizontal split mode (SPLIT_TT_HOR), the split mode when the current coding unit is split into two in the vertical direction may be determined as a two-vertical split mode (SPLIT_BT_VER), and the split mode when the current coding unit is split into three in the vertical direction may be determined as a three-vertical split mode SPLIT_TT_VER.
[0210] The image decoding device 100 may obtain the division shape pattern information from a binary bit string from the bit stream. The form of the bit stream received by the image decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binary bit string is information in binary numbers. The binary bit string may include at least one bit. The image decoding device 100 may obtain the division shape pattern information corresponding to the binary bit string based on the division rule. The image decoding device 100 may determine whether to divide the coding unit into four, whether to not divide the coding unit, the division direction, and the division type based on a binary bit string.
[0211] The coding unit may be smaller than or equal to the maximum coding unit. For example, since the maximum coding unit is a coding unit having a maximum size, the maximum coding unit is one of the coding units. When the division shape pattern information about the maximum coding unit indicates that division is not performed, the coding unit determined in the maximum coding unit has the same size as the size of the maximum coding unit. When the division shape pattern information about the maximum coding unit indicates that division is performed, the maximum coding unit may be divided into coding units. In addition, when the division shape pattern information about the coding unit indicates that division is performed, the coding unit may be divided into smaller coding units. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. Reference will be made to Figures 7 to 20 The division of coding units is described in detail.
[0212] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be the same as or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be the same as or smaller than the coding unit.
[0213] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.
[0214] In another embodiment, prediction may be performed by using a coding unit as a prediction unit. In addition, transformation may be performed by using a coding unit as a transformation block.
[0215] Will refer to Figures 7 to 20 The division of the coding unit is described in detail. The current block and the neighboring block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction block, and the transformation block. In addition, the current block of the current coding unit is a block currently being decoded or encoded or a block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be adjacent to the current block in space or time. The neighboring block may be located at one of the lower left, left side, upper left, upper, upper right, right side, and lower right side of the current block.
[0216] Figure 7 A process of determining at least one coding unit by splitting a current coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0217] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. Here, N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, an aspect ratio, or a size of a coding unit.
[0218] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same (ie, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a square. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.
[0219] When the width and height of the coding unit are different from each other (that is, when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is in the horizontal direction or the vertical direction based on the width length and height length of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the width length, height length, or area of the coding unit.
[0220] According to an embodiment, the image decoding apparatus 100 may determine the shape of the coding unit by using the block shape information, and may determine the division method of the coding unit by using the division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined based on the block shape indicated by the block shape information used by the image decoding apparatus 100.
[0221] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 400 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the maximum coding unit as four divisions. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit as "no division is performed". In particular, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed division shape pattern information to be four divisions. Four divisions are division shape patterns in which both the width and height of the coding unit are equally divided into two. The image decoding device 100 may obtain a coding unit of a size of 128×128 from a maximum coding unit of a size of 256×256 based on the division shape pattern information. In addition, the image decoding device 100 may determine the size of the minimum coding unit to be 4×4. The image decoding apparatus 100 may obtain division shape pattern information indicating “no division is performed” with respect to the minimum coding unit.
[0222] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to not divide the square coding unit, whether to divide the square coding unit vertically, whether to divide the square coding unit horizontally, or whether to divide the square coding unit into four coding units based on the division shape mode information. Figure 7 , when the block shape information of the current coding unit 700 indicates a square shape, the decoder 115 may determine that the coding unit 710a having the same size as the current coding unit 700 is not divided based on the division shape pattern information indicating that division is not performed, or may determine the coding units 710b, 710c, 710d, 710e or 710f divided based on the division shape pattern information indicating a predetermined division method.
[0223] Reference Figure 7According to an embodiment, the image decoding apparatus 100 may determine two coding units 710b obtained by dividing the current coding unit 700 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding apparatus 100 may determine two coding units 710c obtained by dividing the current coding unit 700 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding apparatus 100 may determine four coding units 710d obtained by dividing the current coding unit 700 in the vertical direction and the horizontal direction based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment, the image decoding apparatus 100 may determine three coding units 710e obtained by dividing the current coding unit 700 in the vertical direction based on the division shape pattern information indicating that three divisions are performed in the vertical direction. The image decoding apparatus 100 may determine three coding units 710f obtained by dividing the current coding unit 700 in the horizontal direction based on the division shape pattern information indicating that three divisions are performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. A predetermined division method for dividing the square coding unit will be described in detail below with respect to various embodiments.
[0224] Figure 8 A process of determining at least one coding unit by splitting a non-square coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0225] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 may determine whether to not split the non-square current coding unit or whether to split the non-square current coding unit by using a predetermined splitting method based on the splitting shape pattern information. Figure 8 , when the block shape information of the current coding unit 800 or 850 indicates a non-square shape, the image decoding apparatus 100 may determine that the coding unit 810 or 860 having the same size as the current coding unit 800 or 850 is not split based on the split shape pattern information indicating that splitting is not performed, or determine the coding units 820a and 820b, 830a to 830c, 870a and 870b, or 880a to 880c split based on the split shape pattern information indicating a predetermined splitting method. A predetermined splitting method for splitting a non-square coding unit will be described in detail below with respect to various embodiments.
[0226] According to an embodiment, the image decoding apparatus 100 may determine a split method of a coding unit by using split shape pattern information, and in this case, the split shape pattern information may indicate the number of one or more coding units generated by splitting the coding unit. Figure 8 When the division shape pattern information indicates that the current coding unit 800 or 850 is divided into two coding units, the image decoding device 100 can determine the two coding units 820a and 820b or 870a and 870b included in the current coding unit 800 or 850 by dividing the current coding unit 800 or 850 based on the division shape pattern information.
[0227] According to an embodiment, when the image decoding apparatus 100 divides the non-square current coding unit 800 or 850 based on the division shape pattern information, the image decoding apparatus 100 may divide the current coding unit in consideration of the position of the long side of the non-square current coding unit 800 or 850. For example, the image decoding apparatus 100 may determine a plurality of coding units by dividing the long side of the current coding unit 800 or 850 in consideration of the shape of the current coding unit 800 or 850.
[0228] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (three-divided) into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 800 or 850. For example, when the division shape pattern information indicates that the current coding unit 800 or 850 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 800 or 850 into three coding units 830a, 830b, and 830c or 880a, 880b, and 880c.
[0229] According to an embodiment, the aspect ratio of the current coding unit 800 or 850 may be 4:1 or 1:4. When the aspect ratio is 4:1, since the width length is longer than the height length, the block shape information may be in the horizontal direction. When the aspect ratio is 1:4, since the width length is shorter than the height length, the block shape information may be in the vertical direction. The image decoding apparatus 100 may determine that the current coding unit is divided into an odd number of blocks based on the division shape mode information. In addition, the image decoding apparatus 100 may determine the division direction of the current coding unit 800 or 850 based on the block shape information of the current coding unit 800 or 850. For example, when the current coding unit 800 is in the vertical direction, the image decoding apparatus 100 may determine the coding units 830a to 830c by dividing the current coding unit 800 in the horizontal direction. In addition, when the current coding unit 850 is in the horizontal direction, the image decoding apparatus 100 may determine the coding units 880a to 880c by dividing the current coding unit 850 in the vertical direction.
[0230] According to an embodiment, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 800 or 850, and not all of the determined coding units may have the same size. For example, the size of a predetermined coding unit 830b or 880b among the determined odd number of coding units 830a, 830b, and 830c or 880a, 880b, and 880c may be different from the sizes of other coding units 830a and 830c or 880a and 880c. That is, the coding units determined by dividing the current coding unit 800 or 850 may have a variety of sizes, and in some cases, all of the odd number of coding units 830a, 830b, and 830c or 880a, 880b, and 880c may have different sizes.
[0231] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 800 or 850, and further, may apply a predetermined restriction to at least one of the odd number of coding units generated by dividing the current coding unit 800 or 850. Figure 8 , the image decoding apparatus 100 may set a decoding process of a coding unit 830b or 880b located at the center among three coding units 830a, 830b, and 830c or 880a, 880b, and 880c generated when the current coding unit 800 or 850 is divided to be different from a decoding process of other coding units 830a and 830c or 880a or 880c. For example, unlike other coding units 830a and 830c or 880a and 880c, the image decoding apparatus 100 may limit the coding unit 830b or 880b at the center position to be no longer divided or to be divided only a predetermined number of times.
[0232] Fig. 9 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0233] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the square first coding unit 900 into coding units or not to divide the square first coding unit 900 based on at least one of the block shape information and the division shape mode information. According to an embodiment, when the division shape mode information indicates that the first coding unit 900 is divided in the horizontal direction, the image decoding apparatus 100 may determine the second coding unit 910 by dividing the first coding unit 900 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after the coding unit is divided. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It will be understood that the structures of the first coding unit, the second coding unit, and the third coding unit follow the above description.
[0234] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 910 into coding units or not to split the determined second coding unit 410 based on the division shape pattern information. Fig. 9 , the image decoding apparatus 100 may split the non-square second coding unit 910 determined by splitting the first coding unit 900 into one or more third coding units 920a, or 920b, 920c, and 920d based on the split shape pattern information, or may not split the non-square second coding unit 910. The image decoding apparatus 100 may obtain the split shape pattern information, and may obtain a plurality of second coding units (e.g., 910) of various shapes by splitting the first coding unit 900 based on the obtained split shape pattern information, and may split the second coding unit 910 by using the split method of the first coding unit 900 based on the split shape pattern information. According to an embodiment, when the first coding unit 900 is split into the second coding unit 910 based on the split shape pattern information of the first coding unit 900, the second coding unit 910 may also be split into the third coding unit 920a, or 920b, 920c, and 920d based on the split shape pattern information of the second coding unit 910. That is, the coding unit may be recursively split based on the split shape pattern information of each coding unit. Thus, a square coding unit may be determined by splitting a non-square coding unit, and a non-square coding unit may be determined by recursively splitting a square coding unit.
[0235] Reference Fig. 9, a predetermined coding unit (e.g., a coding unit located at a central position or a square coding unit) among the odd number of third coding units 920b, 920c, and 920d determined by dividing the non-square second coding unit 910 may be recursively divided. According to an embodiment, the square third coding unit 920c among the odd number of third coding units 920b, 920c, and 920d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 930b or 930d among a plurality of fourth coding units 930a, 930b, 930c, and 930d may be divided into a plurality of coding units again. For example, a non-square fourth coding unit 930b or 930d may be divided into an odd number of coding units again. A method for recursively dividing coding units will be described below with respect to various embodiments.
[0236] According to an embodiment, the image decoding apparatus 100 may divide each of the third coding unit 920a, or 920b, 920c, and 920d into coding units based on the division shape pattern information. In addition, the image decoding apparatus 100 may determine not to divide the second coding unit 910 based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may divide the non-square second coding unit 910 into an odd number of third coding units 920b, 920c, and 920d. The image decoding apparatus 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 920b, 920c, and 920d. For example, the image decoding apparatus 100 may limit the third coding unit 920c at the center position among the odd number of third coding units 920b, 920c, and 920d to no longer be divided or to be divided a settable number of times.
[0237] Reference Fig. 9 , the image decoding device 100 may limit the third coding unit 920c at the center position among the odd third coding units 920b, 920c, and 920d included in the non-square second coding unit 910 to no longer be divided, to be divided by using a predetermined division method (for example, only divided into four coding units or divided by using the division method of the second coding unit 910), or to be divided only a predetermined number of times (for example, only divided n times (where n>0)). However, the limitation on the third coding unit 920c at the center position is not limited to the above example, and may include various limitations for decoding the third coding unit 920c at the center position differently from the other third coding units 920b and 920d.
[0238] According to an embodiment, the image decoding apparatus 100 may obtain split shape pattern information used to split the current coding unit from a predetermined position in the current coding unit.
[0239] Fig.10 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0240] Reference Fig.10 , the division shape mode information of the current coding unit 1000 may be obtained from a sample at a predetermined position (e.g., a sample 1040 at a center position) among a plurality of samples included in the current coding unit 1000. However, the predetermined position in the current coding unit 1000 where at least one piece of division shape mode information may be obtained is not limited to Fig.10 , and may include various positions (e.g., top, bottom, left, right, top left, bottom left, top right, and bottom right positions) included in the current coding unit 1000. The image decoding apparatus 100 may obtain the division shape pattern information from the predetermined position, and may determine whether to divide the current coding unit into coding units of various shapes and various sizes or not.
[0241] According to an embodiment, when the current coding unit is split into a predetermined number of coding units, the image decoding apparatus 100 may select one of the coding units. As will be described below with respect to various embodiments, various methods may be used to select one of a plurality of coding units.
[0242] According to an embodiment, the image decoding apparatus 100 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a predetermined position.
[0243] According to an embodiment, the image decoding apparatus 100 may use information indicating the positions of odd-numbered coding units to determine a coding unit at a center position among the odd-numbered coding units. Fig.10 , the image decoding apparatus 100 may determine odd-numbered coding units 1020a, 1020b, and 1020c by dividing the current coding unit 1000. The image decoding apparatus 150 may determine a middle coding unit 1020b by using information about the positions of the odd-numbered coding units 1020a, 1020b, and 1020c. For example, the image decoding apparatus 100 may determine the coding unit 1020b at the center position by determining the positions of the coding units 1020a, 1020b, and 1020c based on information indicating the positions of predetermined samples included in the coding units 1020a, 1020b, and 1020c. In detail, the image decoding apparatus 100 may determine the coding unit 1020b at the center position by determining the positions of the coding units 1020a, 1020b, and 1020c based on information indicating the positions of the upper left samples 1030a, 1030b, and 1030c of the coding units 1020a, 1020b, and 1020c.
[0244] According to an embodiment, the information indicating the positions of the upper left sample points 1030a, 1030b, and 1030c respectively included in the coding units 1020a, 1020b, and 1020c may include information about the positions or coordinates of the coding units 1020a, 1020b, and 1020c in the picture. According to an embodiment, the information indicating the positions of the upper left sample points 1030a, 1030b, and 1030c respectively included in the coding units 1020a, 1020b, and 1020c may include information indicating the width or height of the coding units 1020a, 1020b, and 1020c included in the current coding unit 1000, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 1020a, 1020b, and 1020c in the picture. That is, the image decoding device 100 can determine the coding unit 1020b at the center position by directly using information about the positions or coordinates of the coding units 1020a, 1020b and 1020c in the picture or by using information about the width or height of the coding unit corresponding to the difference between the coordinates.
[0245] According to an embodiment, the information indicating the position of the upper left sample point 1030a of the upper coding unit 1020a may include the coordinates (xa, ya), the information indicating the position of the upper left sample point 1030b of the middle coding unit 1020b may include the coordinates (xb, yb), and the information indicating the position of the upper left sample point 1030c of the lower coding unit 1020c may include the coordinates (xc, yc). The image decoding apparatus 100 may determine the middle coding unit 1020b by using the coordinates of the upper left sample points 1030a, 1030b, and 1030c respectively included in the coding units 1020a, 1020b, and 1020c. For example, when the coordinates of the upper left sample points 1030a, 1030b, and 1030c are sorted in ascending order or descending order, the coding unit 1020b including the coordinates (xb, yb) of the sample point 1030b at the center position may be determined as the coding unit at the center position among the coding units 1020a, 1020b, and 1020c determined by splitting the current coding unit 1000. However, the coordinates indicating the positions of the upper left sample points 1030a, 1030b, and 1030c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample point 1030b of the middle coding unit 1020b relative to the position of the upper left sample point 1030a of the upper coding unit 1020a and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 1030c of the lower coding unit 1020c relative to the position of the upper left sample point 1030a of the upper coding unit 1020a may be used. The method of determining the coding unit at a predetermined position by using the coordinates of the sample points included in the coding unit as information indicating the positions of the sample points is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the sample points.
[0246] According to an embodiment, the image decoding apparatus 100 may divide the current coding unit 1000 into a plurality of coding units 1020a, 1020b, and 1020c, and may select one of the coding units 1020a, 1020b, and 1020c based on a predetermined criterion. For example, the image decoding apparatus 100 may select the coding unit 1020b having a size different from that of the other coding units from among the coding units 1020a, 1020b, and 1020c.
[0247] According to an embodiment, the image decoding apparatus 100 may determine the width or height of each of the coding units 1020a, 1020b, and 1020c by using the coordinates (xa, ya), which are information indicating the position of the upper left sample point 1030a of the upper coding unit 1020a, the coordinates (xb, yb), which are information indicating the position of the upper left sample point 1030b of the middle coding unit 1020b, and the coordinates (xc, yc), which are information indicating the position of the upper left sample point 1030c of the lower coding unit 1020c. The image decoding apparatus 100 may determine the size of each of the coding units 1020a, 1020b, and 1020c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 1020a, 1020b, and 1020c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper coding unit 1020a as the width of the current coding unit 1000. The image decoding apparatus 100 may determine the height of the upper coding unit 1020a as yb-ya. According to an embodiment, the image decoding apparatus 100 may determine the width of the intermediate coding unit 1020b as the width of the current coding unit 1000. The image decoding apparatus 100 may determine the height of the intermediate coding unit 1020b as yc-yb. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower coding unit 1020c by using the width or height of the current coding unit 1000 or the width or height of the upper coding unit 1020a and the intermediate coding unit 1020b. The image decoding apparatus 100 may determine a coding unit having a size different from sizes of other coding units based on the determined widths and heights of the coding units 1020a to 1020c. Referring to Fig.10 , the image decoding apparatus 100 may determine the middle coding unit 1020b having a size different from the sizes of the upper coding unit 1020a and the lower coding unit 1020c as the coding unit at the predetermined position. However, the above-described method of determining a coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining a coding unit at a predetermined position by using the size of a coding unit determined based on the coordinates of a sample point, and therefore, various methods of determining a coding unit at a predetermined position by comparing the size of a coding unit determined based on the coordinates of a predetermined sample point may be used.
[0248] However, the position of the sample considered in determining the position of the coding unit is not limited to the above-mentioned upper left position, and information on arbitrary positions of the samples included in the coding unit may be used.
[0249] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a predetermined position from an odd number of coding units determined by dividing the current coding unit, taking into account the shape of the current coding unit. For example, when the current coding unit has a non-square shape with a width greater than a height, the image decoding apparatus 100 may determine a coding unit at a predetermined position along the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the horizontal direction and impose restrictions on the coding unit. When the current coding unit has a non-square shape with a height greater than a width, the image decoding apparatus 100 may determine a coding unit at a predetermined position along the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the vertical direction and may impose restrictions on the coding unit.
[0250] According to an embodiment, the image decoding apparatus 100 may use information indicating respective positions of even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (dividing) the current coding unit, and may determine the coding unit at the predetermined position by using information about the positions of the even-numbered coding units. The operations related thereto may be the same as those already described above with respect to Fig.10 The operation of determining a coding unit at a predetermined position (eg, a center position) among odd-numbered coding units corresponds to the operation described in detail, and thus a detailed description thereof is not provided here.
[0251] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, a coding unit at a predetermined position among the plurality of coding units may be determined using predetermined information about the coding unit at a predetermined position in a splitting operation. For example, the image decoding apparatus 100 may determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit using at least one of block shape information and split shape pattern information stored in samples included in an intermediate coding unit in a splitting operation.
[0252] Reference Fig.10, the image decoding apparatus 100 may divide the current coding unit 500 into a plurality of coding units 1020a, 1020b, and 1020c based on the division shape pattern information, and may determine the coding unit 1020b at the center position among the plurality of coding units 1020a, 1020b, and 1020c. In addition, the image decoding apparatus 100 may determine the coding unit 1020b at the center position in consideration of the position where the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 1000 may be obtained from the sample point 1040 at the center position of the current coding unit 1000, and when the current coding unit 1000 is divided into a plurality of coding units 1020a, 1020b, and 1020c based on the division shape pattern information, the coding unit 1020b including the sample point 1040 may be determined as the coding unit at the center position. However, information for determining the coding unit at the center position is not limited to the division shape pattern information, and the coding unit at the center position may be determined using various types of information.
[0253] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample point included in a coding unit to be determined. Fig.10 , the image decoding apparatus 100 may determine a coding unit at a predetermined position (e.g., a coding unit at a center position of the divided coding units) among a plurality of coding units 1020a, 1020b, and 1020c determined by dividing the current coding unit 1000, using division shape pattern information obtained from a sample at a predetermined position in the current coding unit 1000 (e.g., a sample at a center position of the divided coding unit 1000). That is, the image decoding apparatus 100 may determine the sample at the predetermined position by considering the block shape of the current coding unit 1000, determine the coding unit 1020b including the sample for which the predetermined information (e.g., the division shape pattern information) may be obtained from among the plurality of coding units 1020a, 1020b, and 1020c determined by dividing the current coding unit 1000, and may impose a predetermined restriction on the coding unit 1020b. Referring to Fig.10 According to an embodiment, in a decoding operation, the image decoding apparatus 100 may determine a sample 1040 at a center position of a current coding unit 1000 as a sample from which predetermined information may be obtained, and may impose a predetermined restriction on a coding unit 1020b including the sample 1040. However, the position of the sample from which the predetermined information may be obtained is not limited to the above-mentioned position, and may include any position included in the coding unit 1020b to be determined as a sample to be restricted.
[0254] According to an embodiment, the position of the sample at which the predetermined information can be obtained may be determined based on the shape of the current coding unit 1000. According to an embodiment, the block shape information may indicate whether the current coding unit has a square shape or a non-square shape, and the position of the sample at which the predetermined information can be obtained may be determined based on the shape. For example, the image decoding apparatus 100 may determine a sample located on a boundary for dividing at least one of the width and the height of the current coding unit in half as a sample at which the predetermined information can be obtained by using at least one of the information about the width of the current coding unit and the information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding apparatus 100 may determine one of the samples adjacent to the boundary for dividing the long side of the current coding unit in half as a sample at which the predetermined information can be obtained.
[0255] According to an embodiment, when a current coding unit is divided into a plurality of coding units, the image decoding device 100 may use the division shape pattern information to determine a coding unit at a predetermined position in the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain the division shape pattern information from a sample at a predetermined position in a coding unit, and divide the plurality of coding units by using the division shape pattern information obtained from a sample at a predetermined position in each of the plurality of coding units, wherein the plurality of coding units are generated by dividing the current coding unit. That is, the coding unit may be recursively divided based on the division shape pattern information obtained from the sample at the predetermined position in each coding unit. As has been described above, Fig. 9 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.
[0256] According to an embodiment, the image decoding apparatus 100 may determine one or more coding units by splitting a current coding unit, and may determine an order in which to decode the one or more coding units based on a predetermined block (for example, the current coding unit).
[0257] Fig.11 An order in which a plurality of coding units are processed when the image decoding apparatus 100 determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.
[0258] According to an embodiment, the image decoding device 100 may determine the second coding units 1110a and 1110b by dividing the first coding unit 1100 in a vertical direction, determine the second coding units 1130a and 1130b by dividing the first coding unit 1100 in a horizontal direction, or determine the second coding units 1150a to 1150d by dividing the first coding unit 1100 in both vertical and horizontal directions based on the division shape pattern information.
[0259] Reference Fig.11 , the image decoding apparatus 100 may determine to process the second coding units 1110a and 1110b determined by dividing the first coding unit 1100 in the vertical direction in a horizontal direction order 1110c. The image decoding apparatus 100 may determine to process the second coding units 1130a and 1130b determined by dividing the first coding unit 1100 in the horizontal direction in a vertical direction order 1130c. The image decoding apparatus 100 may determine to process the second coding units 1150a to 1150d determined by dividing the first coding unit 1100 in the vertical direction and in the horizontal direction in a predetermined order (e.g., a raster scan order or a zigzag scan order 1150e) in which the coding units in one row are processed and then the coding units in the next row are processed.
[0260] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Fig.11 , the image decoding apparatus 100 may determine a plurality of coding units 1110a and 1110b, 1130a and 1130b, or 1150a to 1150d by dividing the first coding unit 1100, and recursively divide each of the determined plurality of coding units 1110a and 1110b, 1130a and 1130b, or 1150a to 1150d. A division method of the plurality of coding units 1110a and 1110b, 1130a and 1130b, or 1150a to 1150d may correspond to a division method of the first coding unit 1100. In this way, each of the plurality of coding units 1110a and 1110b, 1130a and 1130b, or 1150a to 1150d may be independently divided into a plurality of coding units. Referring to Fig.11 , the image decoding apparatus 100 may determine the second coding units 1110a and 1110b by dividing the first coding unit 1100 in a vertical direction, and may determine whether to independently divide or not divide each of the second coding units 1110a and 1110b.
[0261] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1120a and 1120b by splitting the left second coding unit 1110a in a horizontal direction, and may not split the right second coding unit 1110b.
[0262] According to an embodiment, the processing order of the coding units may be determined based on the operation of dividing the coding units. In other words, the processing order of the coding units after the division may be determined based on the processing order of the coding units immediately before the division. The image decoding apparatus 100 may determine the processing order of the third coding units 1120a and 1120b determined by dividing the left second coding unit 1110a independently of the right second coding unit 1110b. Since the third coding units 1120a and 1120b are determined by dividing the left second coding unit 1110a in the horizontal direction, the third coding units 1120a and 1120b may be processed in a vertical direction order 1120c. Since the left second coding unit 1110a and the right second coding unit 1110b are processed in a horizontal direction order 1110c, the right second coding unit 1110b may be processed after the third coding units 1120a and 1120b included in the left second coding unit 1110a are processed in a vertical direction order 1120c. The operation of determining the processing order of coding units based on the coding units before splitting is not limited to the above example, and coding units split and determined to be various shapes may be independently processed in a predetermined order using various methods.
[0263] Fig.12 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a predetermined order, performed by the image decoding apparatus 100 according to an embodiment is illustrated.
[0264] According to an embodiment, the image decoding apparatus 100 may determine whether the current coding unit is split into an odd number of coding units based on the obtained division shape pattern information. Fig.12 , the square first coding unit 1200 may be divided into non-square second coding units 1210a and 1210b, and the second coding units 1210a and 1210b may be independently divided into third coding units 1220a and 1220b and 1220c to 1220e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 1220a and 1220b by dividing the left second coding unit 1210a in a horizontal direction, and may divide the right second coding unit 1210b into an odd number of third coding units 1220c to 1220e.
[0265] According to an embodiment, the image decoding apparatus 100 may determine whether any coding unit is split into an odd number of coding units by determining whether the third coding units 1220a and 1220b and 1220c to 1220e can be processed in a predetermined order. Fig.12, the image decoding apparatus 100 may determine the third coding units 1220a and 1220b and 1220c to 1220e by recursively dividing the first coding unit 1200. The image decoding apparatus 100 may determine whether any one of the following coding units is divided into an odd number of coding units: the first coding unit 1200, the second coding units 1210a and 1210b, and the third coding units 1220a and 1220b and 1220c to 1220e based on at least one of the block shape information and the division shape pattern information. For example, the second coding unit 1210b located on the right side of the second coding units 1220a and 1220b may be divided into an odd number of third coding units 1220c, 1220d, and 1220e. The processing order of the multiple coding units included in the first coding unit 1200 can be a predetermined order (for example, a zigzag scanning order 1230), and the image decoding device 100 can determine whether the third coding units 1220c, 1220d and 1220e determined by dividing the right second coding unit 1210b into an odd number of coding units meet the conditions for processing in a predetermined order.
[0266] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 1220a and 1220b and 1220c to 1220e included in the first coding unit 1200 satisfy a condition for processing in a predetermined order, and the condition relates to whether at least one of the width and height of the second coding units 1210a and 1210b will be divided in half along the boundary of the third coding units 1220a and 1220b and 1220c to 1220e. For example, the third coding units 1220a and 1220b determined when the height of the left second coding unit 1210a of a non-square shape is divided in half may satisfy the condition. Because the boundary of the third coding units 1220c to 1220e determined when the right second coding unit 1210b is divided into three coding units fails to divide the width or height of the right second coding unit 1210b in half, it may be determined that the third coding units 1220c to 1220e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous, and may determine that the right second coding unit 1210b is to be divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit. The restriction or the predetermined position has been described above with respect to various embodiments, so a detailed description thereof will not be provided here.
[0267] Fig.13A process of determining at least one coding unit by splitting the first coding unit 1300 , performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0268] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1300 based on the division shape pattern information obtained by the receiver (not shown). The square first coding unit 1300 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig.13 , when the division shape pattern information indicates that the first coding unit 1300 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 1300 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 1300 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 1300 into an odd number of coding units (for example, second coding units 1310a, 1310b, and 1310c determined by dividing the square first coding unit 1300 in a vertical direction, or second coding units 1320a, 1320b, and 1320c determined by dividing the square first coding unit 1300 in a horizontal direction).
[0269] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 1310a, 1310b, 1310c, 1320a, 1320b, and 1320c included in the first coding unit 1300 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 1300 is divided in half along a boundary of the second coding units 1310a, 1310b, 1310c, 1320a, 1320b, and 1320c. Fig.13, because the boundary of the second coding units 1310a, 1310b, and 1310c determined by dividing the square first coding unit 1300 in the vertical direction does not divide the width of the first coding unit 1300 in half, it can be determined that the first coding unit 1300 does not satisfy the condition for processing in a predetermined order. In addition, because the boundary of the second coding units 1320a, 1320b, and 1320c determined by dividing the square first coding unit 1300 in the horizontal direction does not divide the height of the first coding unit 1300 in half, it can be determined that the first coding unit 1300 does not satisfy the condition for processing in a predetermined order. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is not continuous, and may determine that the first coding unit 1300 is to be divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding units. The restriction or the predetermined position has been described above with respect to various embodiments, and thus a detailed description thereof will not be provided here.
[0270] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.
[0271] Reference Fig.13 , the image decoding apparatus 100 may divide the square first coding unit 1300 or the non-square first coding unit 1330 or 1350 into coding units of various shapes.
[0272] Fig.14 It is shown that shapes into which the second coding unit may be split are restricted when a second coding unit having a non-square shape determined when the image decoding apparatus 100 splits the first coding unit 1400 satisfies a predetermined condition according to an embodiment.
[0273] According to an embodiment, the image decoding apparatus 100 may determine to divide the square first coding unit 1400 into non-square second coding units 1410a and 1410b or 1420a and 1420b based on the division shape pattern information obtained by the receiver (not shown). The second coding units 1410a and 1410b or 1420a and 1420b may be independently divided. In this way, the image decoding apparatus 100 may determine to divide each of the second coding units 1410a and 1410b or 1420a and 1420b into a plurality of coding units or not to divide each of the second coding units 1410a and 1410b or 1420a and 1420b based on the division shape pattern information of each of the second coding units 1410a and 1410b or 1420a and 1420b. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1412a and 1412b by splitting the non-square left second coding unit 1410a determined by splitting the first coding unit 1400 in the vertical direction in the horizontal direction. However, when the left second coding unit 1410a is split in the horizontal direction, the image decoding apparatus 100 may limit the right second coding unit 1410b to not be split in the horizontal direction in which the left second coding unit 1410a is split. When the third coding units 1414a and 1414b are determined by splitting the right second coding unit 1410b in the same direction, since the left second coding unit 1410a and the right second coding unit 1410b are independently split in the horizontal direction, the third coding units 1412a and 1412b or 1414a and 1414b may be determined. However, this case has the same effect as the case where the image decoding apparatus 100 divides the first coding unit 1400 into four square second coding units 1430a, 1430b, 1430c, and 1430d based on the division shape pattern information, and may be inefficient in terms of image decoding.
[0274] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1422a and 1422b or 1424a and 1424b by vertically splitting the non-square second coding unit 1420a or 1420b determined by horizontally splitting the first coding unit 1400. However, when the second coding unit (e.g., the upper second coding unit 1420a) is split in the vertical direction, the image decoding apparatus 100 may limit another second coding unit (e.g., the lower second coding unit 1420b) to not be split in the vertical direction in which the upper second coding unit 1420a is split for the above-mentioned reason.
[0275] Fig.15A process of splitting a square coding unit when division shape pattern information fails to indicate that the square coding unit is split into four square coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0276] According to an embodiment, the image decoding apparatus 100 may determine the second coding units 1510a and 1510b or 1520a and 1520b, etc. by dividing the first coding unit 1500 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding apparatus 100 may not divide the square first coding unit 1500 into four square second coding units 1530a, 1530b, 1530c, and 1530d. The image decoding apparatus 100 may determine the non-square second coding units 1510a and 1510b or 1520a and 1520b, etc. based on the division shape pattern information.
[0277] According to an embodiment, the image decoding apparatus 100 may independently divide the non-square second coding units 1510a and 1510b or 1520a and 1520b, etc. Each of the second coding units 1510a and 1510b or 1520a and 1520b, etc. may be recursively divided in a predetermined order, and the division method may correspond to the method of dividing the first coding unit 1500 based on the division shape pattern information.
[0278] For example, the image decoding apparatus 100 may determine square third coding units 1512a and 1512b by dividing the left second coding unit 1510a in the horizontal direction, and may determine square third coding units 1514a and 1514b by dividing the right second coding unit 1510b in the horizontal direction. In addition, the image decoding apparatus 100 may determine square third coding units 1516a, 1516b, 1516c, and 1516d by dividing both the left second coding unit 1510a and the right second coding unit 1510b in the horizontal direction. In this case, coding units having the same shape as the four square second coding units 1530a, 1530b, 1530c, and 1530d divided from the first coding unit 1500 may be determined.
[0279] As another example, the image decoding apparatus 100 may determine the third coding units 1522a and 1522b of the square shape by dividing the upper second coding unit 1520a in the vertical direction, and may determine the third coding units 1524a and 1524b of the square shape by dividing the lower second coding unit 1520b in the vertical direction. In addition, the image decoding apparatus 100 may determine the third coding units 1526a, 1526b, 1526c, and 1526d of the square shape by dividing both the upper second coding unit 1020a and the lower second coding unit 1520b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1530a, 1530b, 1530c, and 1530d divided from the first coding unit 1500 may be determined.
[0280] Fig.16 It is shown that a processing order among a plurality of coding units may be changed according to a process of splitting the coding units according to an embodiment.
[0281] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1600 based on the division shape pattern information. When the block shape indicates a square shape and the division shape information indicates that the first coding unit 1600 is divided in at least one of the horizontal direction and the vertical direction, the image decoding apparatus 100 may determine the second coding units 1610a and 1610b or 1620a and 1620b by dividing the first coding unit 1600. Fig.16 , the non-square second coding units 1610a and 1610b or 1620a and 1620b determined by dividing the first coding unit 1600 only in the horizontal direction or the vertical direction may be independently divided based on the division shape pattern information of each coding unit. For example, the image decoding device 100 may determine the third coding units 1616a, 1616b, 1616c, and 1616d by dividing the second coding units 1610a and 1610b generated by dividing the first coding unit 1600 in the vertical direction in the horizontal direction, and may determine the third coding units 1626a, 1626b, 1626c, and 1626d by dividing the second coding units 1620a and 1620b generated by dividing the first coding unit 1600 in the horizontal direction in the vertical direction. As has been described above, Fig.15 An operation of dividing the second coding units 1610a and 1610b or 1620a and 1620b is described, and thus a detailed description thereof will not be provided here.
[0282] According to an embodiment, the image decoding apparatus 100 may process the coding units in a predetermined order. Fig.16The operation of processing the encoding units in a predetermined order is described, and thus a detailed description thereof will not be provided here. Fig.16 , the image decoding apparatus 100 may determine four square third coding units 1616a, 1616b, 1616c, and 1616d and 1626a, 1626b, 1626c, and 1626d by dividing the square first coding unit 1600. According to an embodiment, the image decoding apparatus 100 may determine the processing order of the third coding units 1616a, 1616b, 1616c, and 1616d and 1626a, 1626b, 1626c, and 1626d based on the division method of the first coding unit 1600.
[0283] According to an embodiment, the image decoding device 100 may determine third coding units 1616a, 1616b, 1616c, and 1616d by dividing the second coding units 1610a and 1610b generated by dividing the first coding unit 1600 in the vertical direction in the horizontal direction, and may process the third coding units 1616a, 1616b, 1616c, and 1616d in the following processing order 1617: first, the third coding units 1616a and 1616c included in the left second coding unit 1610a are processed in the vertical direction, and then the third coding units 1616b and 1616d included in the right second coding unit 1610b are processed in the vertical direction.
[0284] According to an embodiment, the image decoding device 100 may determine third coding units 1626a, 1626b, 1626c, and 1626d by dividing the second coding units 1620a and 1620b generated by dividing the first coding unit 1600 in the horizontal direction in the vertical direction, and may process the third coding units 1626a, 1626b, 1626c, and 1626d in the following processing order 1627: first, the third coding units 1626a and 1626b included in the upper second coding unit 1620a are processed in the horizontal direction, and then the third coding units 1626c and 1626d included in the lower second coding unit 1620b are processed in the horizontal direction.
[0285] Reference Fig.16, square third coding units 1616a, 1616b, 1616c and 1616d and 1626a, 1626b, 1626c and 1626d may be determined by dividing the second coding units 1610a and 1610b and 1620a and 1620b, respectively. Although the second coding units 1610a and 1610b determined by splitting the first coding unit 1600 in the vertical direction are different from the second coding units 1620a and 1620b determined by splitting the first coding unit 1600 in the horizontal direction, the third coding units 1616a, 1616b, 1616c, and 1616d and the third coding units 1626a, 1626b, 1626c, and 1626d split from the second coding units 1610a and 1610b and the second coding units 1620a and 1620b ultimately show the same shape of coding units split from the first coding unit 1600. In this way, by recursively splitting the coding units in different ways based on the split shape pattern information, even if the coding units are ultimately determined to be the same shape, the image decoding apparatus 100 may process a plurality of coding units in different orders.
[0286] Fig.17 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split such that a plurality of coding units are determined according to an embodiment is illustrated.
[0287] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n (n>0) times the length of the long side of the current coding unit after being divided, the image decoding device 100 may determine that the depth of the current coding unit is increased by n compared to the depth of the coding unit before being divided. In the following description, a coding unit with an increased depth is represented as a coding unit of a deeper depth.
[0288] Reference Fig.17According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1702 and a third coding unit 1704 of a deeper depth by dividing a square first coding unit 1700 based on block shape information indicating a square shape (for example, the block shape information may be represented as "0: SQUARE"). Assuming that the size of the square first coding unit 1700 is 2N×2N, the second coding unit 1702 determined by dividing the width and height of the first coding unit 1700 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1704 determined by dividing the width and height of the second coding unit 1702 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1704 are 1 / 4 of the width and height of the first coding unit 1700. When the depth of the first coding unit 1700 is D, the depth of the second coding unit 1702 whose width and height are 1 / 2 of the width and height of the first coding unit 1700 may be D+1, and the depth of the third coding unit 1704 whose width and height are 1 / 4 of the width and height of the first coding unit 1700 may be D+2.
[0289] According to an embodiment, the image decoding device 100 can determine the second coding unit 1712 or 1722 and the third coding unit 1714 or 1724 of a deeper depth by dividing the non-square first coding unit 1710 or 1720 based on block shape information indicating a non-square shape (for example, the block shape information may be represented as "1: NS_VER" indicating a non-square shape in which the height is longer than the width, or may be represented as "2: NS_HOR" indicating a non-square shape in which the width is longer than the height).
[0290] The image decoding apparatus 100 may determine the second coding unit 1702, 1712, or 1722 by dividing at least one of the width and the height of the first coding unit 1710 having a size of N×2N. That is, the image decoding apparatus 100 may determine the second coding unit 1702 having a size of N×N or the second coding unit 1722 having a size of N×N / 2 by dividing the first coding unit 1710 in a horizontal direction, or may determine the second coding unit 1712 having a size of N / 2×N by dividing the first coding unit 1710 in horizontal and vertical directions.
[0291] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1702, 1712, or 1722 by dividing at least one of the width and the height of the first coding unit 1720 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1702 having a size of N×N or the second coding unit 1712 having a size of N / 2×N by dividing the first coding unit 1720 in a vertical direction, or may determine the second coding unit 1722 having a size of N×N / 2 by dividing the first coding unit 1720 in horizontal and vertical directions.
[0292] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1704, 1714, or 1724 by dividing at least one of the width and the height of the second coding unit 1702 having a size of N×N. That is, the image decoding apparatus 100 may determine the third coding unit 1704 having a size of N / 2×N / 2, the third coding unit 1714 having a size of N / 4×N / 2, or the third coding unit 1724 having a size of N / 2×N / 4 by dividing the second coding unit 1702 in the vertical direction and the horizontal direction.
[0293] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1704, 1714, or 1724 by dividing at least one of the width and the height of the second coding unit 1712 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine the third coding unit 1704 having a size of N / 2×N / 2 or the third coding unit 1724 having a size of N / 2×N / 4 by dividing the second coding unit 1712 in a horizontal direction, or may determine the third coding unit 1714 having a size of N / 4×N / 2 by dividing the second coding unit 1712 in a vertical direction and a horizontal direction.
[0294] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1704, 1714, or 1724 by dividing at least one of the width and the height of the second coding unit 1722 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine the third coding unit 704 having a size of N / 2×N / 2 or the third coding unit 1714 having a size of N / 4×N / 2 by dividing the second coding unit 1722 in a vertical direction, or may determine the third coding unit 1724 having a size of N / 2×N / 4 by dividing the second coding unit 1722 in a vertical direction and a horizontal direction.
[0295] According to an embodiment, the image decoding apparatus 100 may split the square coding unit 1700, 1702, or 1704 in a horizontal direction or a vertical direction. For example, the image decoding apparatus 100 may determine the first coding unit 1710 having a size of N×2N by splitting the first coding unit 1700 having a size of 2N×2N in a vertical direction, or may determine the first coding unit 1720 having a size of 2N×N by splitting the first coding unit 1700 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1700 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1700.
[0296] According to an embodiment, the width and height of the third coding unit 1714 or 1724 may be 1 / 4 of the width and height of the first coding unit 1710 or 1720. When the depth of the first coding unit 1710 or 1720 is D, the depth of the second coding unit 1712 or 1722 whose width and height are 1 / 2 of the width and height of the first coding unit 1710 or 1720 may be D+1, and the depth of the third coding unit 1714 or 1724 whose width and height are 1 / 4 of the width and height of the first coding unit 1710 or 1720 may be D+2.
[0297] Fig.18 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0298] According to an embodiment, the image decoding apparatus 100 may determine second coding units of various shapes by dividing the square first coding unit 1800. Fig.18 , the image decoding apparatus 100 may determine the second coding units 1802a and 1802b, the second coding units 1804a and 1804b, and the second coding units 1806a, 1806b, 1806c, and 1806d by dividing the first coding unit 1800 in at least one of the vertical direction and the horizontal direction based on the division shape pattern information. That is, the image decoding apparatus 100 may determine the second coding units 1802a and 1802b, the second coding units 1804a and 1804b, and the second coding units 1806a, 1806b, 1806c, and 1806d based on the division shape pattern information of the first coding unit 1800.
[0299] According to an embodiment, the depths of the second coding units 1802a and 1802b, the second coding units 1804a and 1804b, and the second coding units 1806a, 1806b, 1806c, and 1806d determined based on the division shape pattern information of the square first coding unit 1800 may be determined based on the lengths of their long sides. For example, since the length of the side of the square first coding unit 1800 is equal to the length of the long side of the non-square second coding units 1802a and 1802b and 1804a and 1804b, the first coding unit 1800 and the non-square second coding units 1802a and 1802b and 1804a and 1804b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1800 into four square second coding units 1806a, 1806b, 1806c and 1806d based on the division shape pattern information, because the length of the side of the square second coding units 1806a, 1806b, 1806c and 1806d is 1 / 2 of the length of the side of the first coding unit 1800, the depth of the second coding units 1806a, 1806b, 1806c and 1806d can be D+1, which is 1 deeper than the depth D of the first coding unit 1800.
[0300] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1812a and 1812b and 1814a, 1814b, and 1814c by horizontally dividing the first coding unit 1810 whose height is longer than the width based on the division shape pattern information. According to an embodiment, the image decoding apparatus 150 may determine a plurality of second coding units 1822a and 1822b and 1824a, 1824b, and 1824c by vertically dividing the first coding unit 1820 whose width is longer than the height based on the division shape pattern information.
[0301] According to an embodiment, the depths of the second coding units 1812a and 1812b and the second coding units 1814a, 1814b, and 1814c, or the second coding units 1822a and 1822b and the second coding units 1824a, 1824b, and 1824c determined based on the division shape pattern information of the non-square first coding unit 1810 or 1820 may be determined based on the lengths of their long sides. For example, since the lengths of the sides of the square second coding units 1812a and 1812b are 1 / 2 of the lengths of the long sides of the first coding unit 1810 having a non-square shape having a height longer than a width, the depths of the square second coding units 1812a and 1812b are D+1 which is 1 deeper than the depth D of the non-square first coding unit 1810.
[0302] In addition, the image decoding apparatus 100 may divide the non-square first coding unit 1810 into an odd number of second coding units 1814a, 1814b, and 1814c based on the division shape pattern information. The odd number of second coding units 1814a, 1814b, and 1814c may include the non-square second coding units 1814a and 1814c and the square second coding unit 1814b. In this case, since the length of the long side of the non-square second coding units 1814a and 1814c and the length of the side of the square second coding unit 1814b are 1 / 2 of the length of the long side of the first coding unit 1810, the depth of the second coding units 1814a, 1814b, and 1814c may be D+1 which is 1 deeper than the depth D of the non-square first coding unit 1810. The image decoding apparatus 100 may determine the depths of the coding units split from the first coding unit 1820 having a non-square shape having a width longer than a height by using the above-described method of determining the depths of the coding units split from the first coding unit 1810 .
[0303] According to an embodiment, when the odd-numbered divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the divided coding units based on a size ratio between the coding units. Figure 8 , the width of the coding unit 1814b at the center position among the odd-numbered divided coding units 1814a, 1814b, and 1814c may be equal to the width of the other coding units 1814a and 1814c and its height may be twice the height of the other coding units 1814a and 1814c. That is, in this case, the coding unit 1814b at the center position may include two other coding units 1814a or 1814c. Therefore, when the PID of the coding unit 1814b at the center position is 1 based on the scanning order, the PID of the coding unit 1814c located at a position adjacent to the coding unit 1814b may increase by 2 and thus may be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding apparatus 100 may determine whether the odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in the PID for identifying the divided coding units.
[0304] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.18, the image decoding apparatus 100 may determine even-numbered coding units 1812a and 1812b or odd-numbered coding units 1814a, 1814b, and 1814c by dividing the first coding unit 1810 having a rectangular shape whose height is longer than its width. The image decoding apparatus 100 may use the PID to identify each coding unit. According to an embodiment, the PID may be obtained from a sample point at a predetermined position of each coding unit (e.g., an upper left sample point).
[0305] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a predetermined position among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape pattern information of the first coding unit 1810 having a rectangular shape having a height longer than a width indicates that the coding unit is divided into three coding units, the image decoding apparatus 100 may divide the first coding unit 1810 into three coding units 1814a, 1814b, and 1814c. The image decoding apparatus 100 may assign a PID to each of the three coding units 1814a, 1814b, and 1814c. The image decoding apparatus 100 may compare the PIDs of the odd-numbered divided coding units to determine a coding unit at a center position among the odd-numbered divided coding units. The image decoding apparatus 100 may determine the coding unit 1814b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at a center position among the coding units determined by dividing the first coding unit 1810. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. Fig.18, the width of the coding unit 1814b generated by dividing the first coding unit 1810 may be equal to the width of the other coding units 1814a and 1814c, and the height thereof may be twice the height of the other coding units 1814a and 1814c. In this case, when the PID of the coding unit 1814b at the center position is 1, the PID of the coding unit 1814c located at the adjacent position to the coding unit 1814b may increase by 2 and thus may be 3. When the PID is not uniformly increased as described above, the image decoding apparatus 100 may determine that the coding unit is divided into a plurality of coding units, wherein the plurality of coding units include coding units having sizes different from those of the other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may divide the current coding unit in such a manner that a coding unit at a predetermined position (e.g., a coding unit at a center position) among the odd number of coding units has a size different from that of the other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID of the coding unit at the predetermined position and the size or position are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0306] According to an embodiment, the image decoding apparatus 100 may use a predetermined data unit in which recursive splitting of a coding unit starts.
[0307] Fig.19 It is illustrated that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.
[0308] According to an embodiment, a predetermined data unit may be defined as a data unit for recursively dividing a coding unit starting by using division shape pattern information. That is, the predetermined data unit may correspond to a coding unit for determining a highest depth of a plurality of coding units divided from a current picture. In the following description, for ease of explanation, a predetermined data unit is referred to as a reference data unit.
[0309] According to an embodiment, the reference data unit may have a predetermined size and a predetermined size shape. According to an embodiment, the reference coding unit may include M×N samples. Here, M and N may be equal to each other and may be an integer represented as a power of 2. That is, the reference data unit may have a square shape or a non-square shape and may be divided into an integer number of coding units.
[0310] According to an embodiment, the image decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information of each reference data unit. The operation of dividing the reference data unit may correspond to the division operation using a quadtree structure.
[0311] According to an embodiment, the image decoding apparatus 100 may predetermine a minimum size allowed for a reference data unit included in the current picture. Therefore, the image decoding apparatus 100 may determine various reference data units having a size equal to or larger than the minimum size, and may determine one or more coding units by using the division shape pattern information with reference to the determined reference data unit.
[0312] Reference Fig.19 , the image decoding apparatus 100 may use the square reference coding unit 1900 or the non-square reference coding unit 1902. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that can include one or more reference coding units.
[0313] According to an embodiment, a receiver (not shown) of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information for each of various data units from a bitstream. Fig.15 The operation of dividing the current coding unit 1500 describes the operation of dividing the square reference coding unit 1900 into one or more coding units, and the above has been about Fig.16 The operation of splitting the current coding unit 1600 describes an operation of splitting the non-square reference coding unit 1902 into one or more coding units. Therefore, a detailed description thereof will not be provided here.
[0314] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of the reference coding unit using a PID for identifying the size and shape of the reference coding unit according to some data units predetermined based on a predetermined condition. That is, a receiver (not shown) may obtain only a PID for identifying the size and shape of the reference coding unit for each slice, slice segment, or maximum coding unit from a bitstream, wherein the slice, slice segment, or maximum coding unit is a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that satisfies a predetermined condition. The image decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using a PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the size and shape of the reference coding unit included in the data unit serving as the unit for obtaining the PID by selecting at least one of the size and shape of the reference coding unit predetermined based on the PID.
[0315] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and the reference coding unit may be divided based on at least one of the block shape information and the division shape mode information.
[0316] Fig. 20 A processing block serving as a criterion for determining an order of reference coding units included in the picture 2000 according to an embodiment is illustrated.
[0317] According to an embodiment, the image decoding device 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference coding units divided from a picture, and one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of one or more reference coding units determined in each processing block may correspond to one of various types of orders for determining reference coding units, and may vary according to the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders (e.g., raster scanning order, zigzag scanning, N-shaped scanning, upper right diagonal scanning, horizontal scanning, and vertical scanning), but is not limited to the scanning order mentioned above.
[0318] According to an embodiment, the image decoding apparatus 100 may obtain processing block size information and may determine the size of one or more processing blocks included in the picture. The image decoding apparatus 100 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in the picture. The size of the processing block may be a predetermined size of a data unit indicated by the processing block size information.
[0319] According to an embodiment, a receiver (not shown) of the image decoding apparatus 100 may obtain processing block size information from a bitstream according to each specific data unit. For example, the processing block size information may be obtained from a bitstream according to a data unit such as an image, a sequence, a picture, a slice, or a slice segment. That is, the receiver (not shown) may obtain processing block size information from a bitstream according to each of the various data units, and the image decoding apparatus 100 may determine the size of one or more processing blocks divided from the picture by using the obtained processing block size information. The size of the processing block may be an integer multiple of the size of the reference coding unit.
[0320] According to an embodiment, the image decoding apparatus 100 may determine the sizes of the processing blocks 2002 and 2012 included in the picture 2000. For example, the image decoding apparatus 100 may determine the sizes of the processing blocks based on processing block size information obtained from a bitstream. Fig. 20 According to an embodiment, the image decoding apparatus 100 may determine the width of the processing blocks 2002 and 2012 to be four times the width of the reference coding unit, and may determine the height of the processing blocks 2002 and 2012 to be four times the height of the reference coding unit. The image decoding apparatus 100 may determine the determination order of one or more reference coding units in one or more processing blocks.
[0321] According to an embodiment, the image decoding apparatus 100 may determine the processing blocks 2002 and 2012 included in the picture 2000 based on the size of the processing blocks, and may determine a determination order of one or more reference coding units in the processing blocks 2002 and 2012. According to an embodiment, determining the reference coding unit may include determining the size of the reference coding unit.
[0322] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order for one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.
[0323] According to an embodiment, the image decoding apparatus 100 may obtain the determination order information of the reference coding unit from the bitstream according to each specific data unit. For example, a receiver (not shown) may obtain the determination order information of the reference coding unit from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, or a processing block). Since the determination order information of the reference coding unit indicates the order of the reference coding unit in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.
[0324] According to an embodiment, the image decoding apparatus 100 may determine one or more reference coding units based on the determined order.
[0325] According to an embodiment, a receiver (not shown) may obtain determination order information of reference coding units from a bitstream as information related to the processing blocks 2002 and 2012, and the image decoding apparatus 100 may determine the determination order of one or more reference coding units included in the processing blocks 2002 and 2012, and determine one or more reference coding units included in the picture 2000 based on the determination order. Fig. 20 , the image decoding apparatus 100 may respectively determine determination orders 2004 and 2014 of one or more reference coding units in the processing blocks 2002 and 2012. For example, when determination order information of the reference coding units is obtained for each processing block, different types of determination order information of the reference coding units may be obtained for the processing blocks 2002 and 2012. When the determination order 2004 of the reference coding units in the processing block 2002 is a raster scan order, the reference coding units included in the processing block 2002 may be determined according to the raster scan order. On the contrary, when the determination order 2014 of the reference coding units in another processing block 2012 is a reverse raster scan order, the reference coding units included in the processing block 2012 may be determined according to the reverse raster scan order.
[0326] According to an embodiment, the image decoding apparatus 100 may decode the determined one or more reference coding units. The image decoding apparatus 100 may decode the image based on the reference coding units determined as described above. The method of decoding the reference coding units may include various image decoding methods.
[0327] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The division shape pattern information may be included in the bitstream associated with various data units. For example, the image decoding device 100 may use the division shape pattern information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.
[0328] Hereinafter, a method for determining a division rule according to an embodiment of the present disclosure will be described in detail.
[0329] The image decoding apparatus 100 may determine a division rule of an image. The division rule may be predetermined between the image decoding apparatus 100 and the image encoding apparatus 400. The image decoding apparatus 100 may determine a division rule of an image based on information obtained from a bitstream. The image decoding apparatus 100 may determine a division rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. The image decoding apparatus 100 may determine a division rule differently according to a frame, a slice, a temporal layer, a maximum coding unit, or a coding unit.
[0330] The image decoding device 100 may determine the division rule based on the block shape information of the coding unit. The block shape may include the size, shape, aspect ratio, and direction of the coding unit. The image encoding device 400 and the image decoding device 100 may determine the division rule based on the block shape information of the coding unit. However, the embodiment is not limited thereto. The image decoding device 100 may determine the division rule based on information obtained from the bit stream received from the image encoding device 400.
[0331] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same, the image decoding apparatus 100 may determine the shape of the coding unit as a square. In addition, when the lengths of the width and height of the coding unit are different, the image decoding apparatus 100 may determine the shape of the coding unit as a non-square.
[0332] The size of the coding unit may include various sizes such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, and up to 256×256. The size of the coding unit may be classified based on the length of the long side, the length of the short side, or the area of the coding unit. The image decoding apparatus 100 may apply the same division rule to the coding units classified into the same group. For example, the image decoding apparatus 100 may classify coding units having the same long side length as having the same size. In addition, the image decoding apparatus 100 may apply the same division rule to coding units having the same long side length.
[0333] The aspect ratio of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, or 16:1. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate that the width of the coding unit is longer than its height. The vertical direction may indicate that the width of the coding unit is shorter than its height.
[0334] The image decoding apparatus 100 may adaptively determine the division rule based on the size of the coding unit. The image decoding apparatus 100 may determine the allowable division shape mode differently based on the size of the coding unit. For example, the image decoding apparatus 100 may determine whether the division is allowed based on the size of the coding unit. The image decoding apparatus 100 may determine the division direction according to the size of the coding unit. The image decoding apparatus 100 may determine the allowable division type according to the size of the coding unit.
[0335] The division rule determined based on the size of the coding unit may be a division rule determined in advance between the image encoding apparatus 400 and the image decoding apparatus 100. Also, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.
[0336] The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit. The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit in an image.
[0337] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated via different division paths do not have the same block shape. However, the embodiment is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths may have different decoding processing orders. Fig.16 The decoding process order is described, so its details are not provided again.
[0338] In the following, reference will be made to Figures 21a to 30Detailed Description An image encoding apparatus and an image decoding apparatus and an image encoding method and an image decoding method for adaptively applying a filter to a reference sample based on an inter prediction mode of a current block according to various embodiments are described in detail.
[0339] Fig.21a and Figure 21b is a diagram for describing a method of performing filtering on reference samples for motion compensation during inter prediction according to various embodiments.
[0340] Fig.21a Reference samples at integer-pixel positions and reference samples at sub-pixel positions are shown according to various embodiments.
[0341] An interpolation filter may be applied to reference samples at integer pixel positions to generate reference samples at sub-pixel positions between integer pixels. The interpolation filter may be applied to neighboring samples at integer pixel positions adjacent to the reference samples at the sub-pixel positions to be generated. For example, the application of the interpolation filter is a process of sequentially multiplying coefficients of the interpolation filter with sample values at integer pixel positions and generating values obtained by adding the multiplication result values (or values obtained by scaling the added values) as interpolation sample values. Samples at integer pixel positions to which the interpolation filter is applied are samples arranged in a line around the reference samples at the sub-pixel positions to be generated, and the interpolation filter may be applied to samples equal in number to the number of coefficients of the interpolation filter.
[0342] exist Fig.21a Among the reference samples shown in , samples indicated by capital letters of the alphabet such as A, B, C, D, E, F, G, H, I, J, K, and L are samples at integer pixel positions. Samples indicated by lower case letters of the alphabet such as a, b, c, e, f, and g are samples at sub-pixel positions. Fig.21a , only sub-pixels of 1 / 4 pixel units are shown, but samples at sub-pixel positions are not limited thereto, and samples at sub-pixel positions may be generated in 1 / 8 pixel units, 1 / 16 pixel units, or smaller units.
[0343] For example, refer to Fig.21a2100, samples a, b, and c at the sub-pixel position may be generated by applying an interpolation filter to eight reference samples (such as A, B, C, D, E, F, G, and H) at integer pixel positions adjacent to the sub-pixel position. In other words, the interpolation filter used to generate the samples at the sub-pixel position may be an 8-tap filter. Here, the reference samples at the integer pixel positions to which the interpolation filter is to be applied may be selected in an adjacent order from the left and right sides of the sub-pixel position. However, a filter coefficient set of the interpolation filter used to generate the sample a at the sub-pixel position, a filter coefficient set of the interpolation filter used to generate the sample b at the sub-pixel position, and a filter coefficient set of the interpolation filter used to generate the sample c at the sub-pixel position may be different from each other.
[0344] For example, refer to Fig.21a 2110, samples e, g, and f at the sub-pixel position may be generated by applying an interpolation filter to four reference samples at integer pixel positions adjacent to the sub-pixel position, such as I, J, K, and L. In other words, the interpolation filter used to generate the samples at the sub-pixel position may be a 4-tap filter. A filter coefficient set of the interpolation filter used to generate the sample e at the sub-pixel position, a filter coefficient set of the interpolation filter used to generate the sample f at the sub-pixel position, and a filter coefficient set of the interpolation filter used to generate the sample g at the sub-pixel position may be different from each other.
[0345] According to various embodiments, an interpolation filter used by the image encoding apparatus 400 and the image decoding apparatus 100 to generate a reference sample for motion compensation (prediction) may be determined based on an inter prediction mode of a current block. According to various embodiments, a direction or size of the interpolation filter may be determined based on an inter prediction mode of a current block.
[0346] According to various embodiments, the interpolation filter used by the image encoding device 400 and the image decoding device 100 to generate reference samples for motion compensation (prediction) can also be determined based on the size of the current block, whether the current block is a luminance block or a chrominance block, and / or whether the inter-frame prediction mode of the current block is unidirectional prediction or bidirectional prediction.
[0347] exist Fig.21a , only an example of using neighboring reference samples at integer pixel positions in the horizontal direction is shown, but similarly, samples at sub-pixel positions may be generated by applying interpolation filters to neighboring reference samples at integer pixel positions in the vertical direction.
[0348] Figure 21b An example of reference samples required for inter prediction of the current block is shown.
[0349] The image decoding apparatus 100 may determine a reference block 2180 from the position of a reference sample indicated by a motion vector of the current block in the reference picture 2150 indicated by the reference picture index of the current block. For example, the reference block may be determined so that the motion vector of the current block indicates a sample located at the upper left boundary in the reference block.
[0350] According to various embodiments, when the reference sample indicated by the motion vector of the current block is a sample at a sub-pixel position, the reference block 2180 may include as many reference samples at sub-pixel positions as the current block. The neighboring reference samples at integer pixel positions may be as follows: Fig.21a , is used to generate reference samples at each sub-pixel position included in the reference block 2180. Therefore, the reference samples required to generate the reference block 2180 corresponding to the current block may include samples at integer pixel positions in the reference block 2180 and samples 2170 at integer pixel positions adjacent to the reference block 2180.
[0351] Figure 21b An example is shown in which the size of the current block is 8×8 and an 8-tap filter in the horizontal direction and the vertical direction is used as an interpolation filter. In this case, the reference block 2180 determined based on the motion vector of the current block may include reference samples at 8×8=64 sub-pixel positions. Eight left neighboring reference samples and right neighboring reference samples or upper neighboring reference samples and lower neighboring reference samples at integer pixel positions may be selected for each sub-pixel position, and the reference samples at the sub-pixel position may be generated by applying the interpolation filter to the reference samples at the selected integer pixel positions. For example, in order to generate reference samples at 64 sub-pixel positions, the interpolation filter may be applied to the reference samples at the integer pixel positions in the reference block, and to the reference samples at the integer pixel positions in 3 columns adjacent to the left side of the reference block, 4 columns adjacent to the right side of the reference block, 3 rows adjacent to the top of the reference block, and 4 rows adjacent to the bottom of the reference block. In this case, the number of reconstructed reference samples read from the reference picture for inter-frame prediction of the 8×8 current block is as many as (8+7)×(8+7)=225.
[0352] Fig.22a Reference samples required for inter prediction of a current block according to various embodiments are shown. Fig.22a Can be a reference Fig.21a and Figure 21b A more general example of the described embodiments.
[0353] In the current block 2210, the horizontal width is referred to as W, and the vertical height is referred to as H. The position indicated by the motion vector in the reference picture indicated by the reference picture index of the current block 2210 may be determined as a reference sample position 2230. The reference sample position 2230 may be determined as a coordinate obtained by adding the motion vector component of the current block 2210 to the upper left coordinate of the current block 2210. The reference sample position 2230 may indicate an upper left position of a reference block 2240 to be referenced by the current block 2210 during inter prediction.
[0354] The interpolation filter is configured by a separable 2-dimensional (2D) filter (i.e., a horizontal filter and a vertical filter), and it is assumed that the size of the filter is T, that is, a T-tap filter is used. In this case, in order to generate a reference sample at a sub-pixel position in the reference block 2240, T neighboring reference samples at integer pixel positions are required vertically and horizontally, respectively. Therefore, the number of reconstructed reference samples 2220 to be read from the reconstructed reference picture to generate all reference samples included in the reference block 2240 may be as many as (W+T-1)×(H+T-1).
[0355] As a result, the average number of reference samples to be read from the reconstructed reference picture stored in the memory to predict the current sample can be expressed as Equation 1.
[0356] [Equation 1]
[0357]
[0358] According to various embodiments, Equation 1 may be defined as the memory bandwidth. According to Equation 1, the memory bandwidth increases as the size (W and H) of the current block decreases, and the memory bandwidth increases as the size of the interpolation filter (i.e., the number of taps T) increases. Therefore, in order to keep the memory bandwidth within a certain level, when the size of the current block decreases, the number of taps of the filter may need to be reduced.
[0359] According to various embodiments, the image decoding device 100 may determine the filter information so that the memory bandwidth is within a specific range. According to various embodiments, the image decoding device 100 may adjust the memory bandwidth by determining the size of the filter according to the size of the current block. According to an embodiment, the image decoding device 100 may determine to use a filter with a first number of taps when the size of the current block is equal to or greater than a specific reference value, otherwise determine to use a filter with a second number of taps that is smaller than the first number of taps. According to an embodiment, the specific reference value may be determined according to the inter-frame prediction mode of the current block. According to an embodiment, the image encoding device 400 or the image decoding device 100 may compare the size of the current block with a plurality of reference values, and determine the filter to be used among a plurality of filters based on the result of the comparison.
[0360] Figure 22b Reference samples required for inter prediction of a current block when the current block refers to a plurality of reference blocks according to various embodiments are shown.
[0361] Figure 22b An embodiment is shown, in which the horizontal width of the current block 2210 is referred to as W and its vertical height is referred to as H, and the separable 2D T-tap filter is as follows Fig.22a is used as an interpolation filter, but with Fig.22a Differently, the current block 2210 is bidirectionally predicted.
[0362] When the current block is bidirectionally predicted, two motion vectors are determined for inter-frame prediction of the current block. Therefore, two reference sample positions indicated by the motion vectors and two reference blocks corresponding to the reference sample positions can be determined. The two reference sample positions can indicate positions in the same reference picture or positions in different reference pictures. In this case, the maximum number of reconstructed reference samples 2220 and 2250 required to generate reference samples of the reference block is 2×(W+T-1)×(H+T-1), where the maximum number is twice that of unidirectional prediction.
[0363] When the current block refers to N reference blocks, the average number of reference samples to be read from at least one reconstructed reference picture stored in the memory to predict the current sample may be calculated as in Equation 2.
[0364] [Equation 2]
[0365]
[0366] According to various embodiments, Equation 2 may be defined as the memory bandwidth. According to Equation 2, the memory bandwidth increases as the number of reference blocks used for prediction increases, and the memory bandwidth increases as the size of the interpolation filter (i.e., the number of taps T) increases. Therefore, in order to keep the memory bandwidth within a certain level, when the number of reference blocks increases, it may be necessary to reduce the number of taps of the filter.
[0367] According to various embodiments, the image decoding apparatus 100 may determine the filter information so that the memory bandwidth is within a specific range. According to various embodiments, the image decoding apparatus 100 may determine the size of the filter based on whether the inter-frame prediction of the current block is unidirectional prediction or bidirectional prediction, thereby adjusting the memory bandwidth. According to an embodiment, the image decoding apparatus 100 may determine to use a first filter when the current block is unidirectionally predicted, and determine to use a second filter when the current block is bidirectionally predicted. According to an embodiment, the size of the first filter may be twice the size of the second filter.
[0368] According to various embodiments, the image decoding apparatus 100 may adjust the memory bandwidth by determining the size of the filter based on the number of reference blocks referenced by the current block. According to an embodiment, the image decoding apparatus 100 may determine to use a filter with a first number of taps when the number of reference blocks referenced by the current block is less than or equal to a specific reference value, and otherwise determine to use a filter with a second number of taps smaller than the first number of taps. According to an embodiment, the image decoding apparatus 100 may compare the number of reference blocks referenced by the current block with a plurality of reference values, and determine a filter to be used among a plurality of filters based on a result of the comparison.
[0369] Fig.23 Required memory bandwidth for inter prediction of a current block according to various embodiments is shown.
[0370] Fig.23 Table 2300 shows the Fig.22a or Figure 22b When the horizontal width is referred to as W and the vertical height is referred to as H and a separable 2D T-tap filter is used as an interpolation filter, the memory bandwidth calculated according to Equation 1 and Equation 2. For the case 2310 of a luma block sampled at 4:2:0 and the case 2320 of a chroma block, various examples according to the size of the current block and the number of taps are provided.
[0371] In the HEVC / H.265 standard, inter prediction is not allowed for 4×4 size blocks for luma blocks. When the size of the current block is 4×8 or 8×4, only unidirectional prediction is allowed. When the size of the current block is equal to or greater than 8×8, bidirectional prediction is allowed. Therefore, refer to Fig.23 , in the case allowed in HEVC, when the size of the current block is 8×8 and an 8-tap filter is used for bidirectional prediction, the maximum memory bandwidth is required, and the memory bandwidth at this time is calculated to be about 7.03 according to Equation 2. Such a value may be defined as the HEVC limit.
[0372] According to various embodiments, the image decoding apparatus 100 may determine the size of the filter so that the memory bandwidth calculated according to Equation 1 or Equation 2 does not exceed a specific reference value. According to an embodiment, when the memory bandwidth according to the combination of the size of the current block, the number of taps of the filter, and unidirectional / bidirectional prediction is less than the specific reference value, the image decoding apparatus 100 may determine that the combination can be used for inter prediction.
[0373] For example, the specific reference value may be the same as the HEVC limit. Fig.23 Values of memory bandwidth that are greater than the HEVC limit are indicated in bold in the tables and other figures.
[0374] In the case of the luminance block 2310, according to an embodiment in which the specific reference value is set as the HEVC limit, when the size of the current block is 4×4, the size of the filter in unidirectional and bidirectional prediction may be determined to be 4 taps or less. According to another embodiment, when the size of the current block is 4×4, an 8-tap filter may be allowed in unidirectional prediction.
[0375] In the case of the chroma block 2320, since the number of samples included in the chroma block is 1 / 4 of the number of samples of the luminance block having the same size when the chroma block is sampled at 4:2:0, the memory bandwidth is equal to a value obtained by dividing the result of Equation 1 or Equation 2 by 4. According to an embodiment in which the specific reference value is set as the HEVC limit, when the size of the current chroma block is 2×2, the size of the filter may be determined to be 8 taps or less in unidirectional prediction, and the size of the filter may be determined to be 4 taps or less in bidirectional prediction.
[0376] Fig.24 Reference samples required for inter prediction of a current block when filters of different sizes are used in vertical and horizontal directions according to various embodiments are shown.
[0377] like Figures 22a to 23 As assumed in , the horizontal width is referred to as W and the vertical height is referred to as H in the current block 2410, and the interpolation filter for obtaining the reference sample point is configured by a separable 2D filter (i.e., a horizontal filter and a vertical filter). However, unlike the previous embodiment, it is assumed that a T1 tap filter is applied in the horizontal direction and a T2 tap filter is applied in the vertical direction.
[0378] In this case, T1 horizontal neighboring reference samples at integer pixel positions and T2 vertical neighboring reference samples at integer pixel positions are required for each sub-pixel position to generate the reference sample at the sub-pixel position. Therefore, the total number of reconstructed reference samples 2420 to be read from the reconstructed reference picture to generate all reference samples included in the reference block (shown in dotted lines) corresponding to the current block 2410 is (W+T1-1)×(H+T2-1).
[0379] Therefore, the average number of reference samples to be read from the reconstructed reference picture stored in the memory to predict the current sample (ie, the memory bandwidth) may be defined as in Equation 3.
[0380] [Equation 3]
[0381]
[0382] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0383] According to an embodiment, the image decoding apparatus 100 may independently determine the size of the horizontal filter and the size of the vertical filter so that the memory bandwidth calculated by Equation 3 is within a specific range. According to an embodiment, the number of taps T1 of the horizontal direction filter may be determined based on the horizontal width W, and the number of taps T2 of the vertical direction filter may be determined based on the vertical height H. According to an embodiment, when the current block is non-square, the image decoding apparatus 100 may determine the horizontal direction filter and the vertical direction filter as filters of different sizes.
[0384] According to an embodiment, the image decoding device 100 may determine the horizontal direction filter information and the vertical direction filter information based on the ratio of the horizontal width to the vertical height of the current block. For example, when the horizontal direction filter information of the current block is determined, the image decoding device 100 may determine the vertical direction filter information based on the horizontal direction filter information and the ratio of the horizontal width to the vertical height of the current block. For another example, when the vertical direction filter information of the current block is determined, the image decoding device 100 may determine the horizontal direction filter information based on the vertical direction filter information and the ratio of the horizontal width to the vertical height of the current block. According to an embodiment, the image decoding device 100 may determine the size of the horizontal direction filter and the size of the vertical direction filter to be proportional to the horizontal width and vertical height of the current block. For example, T1 and T2 may be determined so that the ratio T1:T2 of the number of taps of the horizontal direction filter and the number of taps of the vertical direction filter matches the ratio W:H of the horizontal width to the vertical height.
[0385] Fig.25a A prediction method of the OBMC mode without using sub-blocks according to various embodiments is shown.
[0386] In the OBMC mode without using sub-blocks, the motion vectors of the blocks 2520, 2522, 2524, and 2528 adjacent to the current block 2510 may be used for motion prediction of the current block 2510. Specifically, the motion vector of the block 2522 adjacent to the top of the current block 2510 may be used to predict the sample point Y adjacent to the upper boundary of the current block 2510. 0 and Y 1 , and the motion vector of the block 2528 adjacent to the bottom of the current block 2510 can be used to predict the sample point Y adjacent to the lower boundary of the current block 2510 2 and Y 3 Similarly, the motion vector of the block 2520 adjacent to the left side of the current block 2510 can be used to predict the sample point Y adjacent to the left boundary of the current block 2510. 0 and Y 2, and the motion vector of the block 2524 adjacent to the right side of the current block 2510 can be used to predict the sample point Y adjacent to the right boundary of the current block 2510 1 and Y 3 .
[0387] However, when the current block 2510 is decoded according to the encoding order of the raster scan, the block 2528 adjacent to the bottom of the current block 2510 is not decoded, and in this case, the motion vector of the current block 2510 can be used instead of the motion vector of the block 2528 adjacent to the bottom of the current block 2510.
[0388] A plurality of prediction values are obtained by using the motion vector of the current block and the motion vectors of the blocks adjacent to the current block. According to an embodiment, reference samples corresponding to four lower rows R4 and R5 of a block 2522 adjacent to the top of the current block 2510, four right columns R6 and R7 of a block 2520 adjacent to the left of the current block 2510, and four left columns R8 and R9 of a block 2524 adjacent to the right of the current block 2510 may be obtained. The final prediction value of the current block may be obtained by performing weighted averaging on the plurality of prediction values.
[0389] Fig.25b Reference samples required for inter prediction of a current block in an OBMC mode without using sub-blocks according to various embodiments are shown.
[0390] like Fig.25a As shown in , in the OBMC mode without using sub-blocks, reference samples corresponding to samples of 4 pixels adjacent to each of the upper side, the left side, and the right side of the current block 2530 may be further used in addition to the reference samples of the reference block 2544 corresponding to the current block 2530. Therefore, the OBMC mode without using sub-blocks may be referred to as performing motion compensation on the block 2542 in which the current block is extended by 4 pixels along each of the upper side, the left side, and the right side.
[0391] Here, when the horizontal width of the current block 2530 is referred to as W and the vertical height thereof is referred to as H, and a separable 2D T-tap filter is used as an interpolation filter, the total number of reconstructed reference samples 2540 to be read from the reconstructed reference picture for inter-frame prediction of the current block 2530 is (W+8+T-1)×(H+4+T-1). Therefore, in the OBMC mode not using sub-blocks, the average number of reference samples (i.e., memory bandwidth) to be read from the reconstructed reference picture stored in the memory to predict the current sample can be calculated as Equation 4.
[0392] [Equation 4]
[0393]
[0394] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0395] Fig.25c Required memory bandwidth for inter prediction of a current block in OBMC mode without using sub-blocks according to various embodiments is shown. Fig.25c Show according to Fig.25a or Fig.25b 4 when the horizontal width of the current block is referred to as W and its vertical height is referred to as H and a separable 2D T-tap filter is used as an interpolation filter. Various examples of the case 2560 of a luma block and the case 2570 of a chroma block sampled at 4:2:0 are provided.
[0396] According to various embodiments, the image decoding apparatus 100 may determine the size of the filter so that the memory bandwidth calculated according to Equation 4 does not exceed a specific reference value. According to an embodiment, the specific reference value may be determined based on the above-mentioned HEVC limit.
[0397] In the case of luminance block 2560, according to an embodiment in which the specific reference value is set to the HEVC limit, when the size of the current block is 8×8, the size of the filter in bidirectional prediction can be determined to be 2 taps or less, and the size of the filter in unidirectional prediction can be determined to be 8 taps or less. When the size of the current block is 4×4, even when a 2-tap filter is used, the memory bandwidth exceeds the HEVC limit, so it can be determined that the OBMC mode that does not use sub-blocks is not used for 4×4 blocks. However, according to another embodiment, when a 2-tap filter is used for unidirectional prediction of a 4×4 block, the increase in memory bandwidth is small compared to the HEVC limit, and a 2-tap filter can be allowed.
[0398] In the case of the chroma block 2570, since the number of samples included in the chroma block is 1 / 4 of the number of samples of the luminance block having the same size when the chroma block is sampled at 4:2:0, the memory bandwidth is equal to a value obtained by dividing the result of Equation 4 by 4. According to an embodiment in which the specific reference value is set as an HEVC limit, when the size of the current block is 2×2, the size of the filter may be determined to be 2 taps or less. According to another embodiment, when the size of the current block is 2×2, a 4-tap filter may be allowed in unidirectional prediction.
[0399] Fig.26a A prediction method of the OBMC mode using sub-blocks according to various embodiments is shown.
[0400] In the OBMC mode using sub-blocks, the current blocks 2610 and 2620 predicted by the inter-frame may be divided into sub-blocks of 4×4 size, and motion compensation may be performed in units of sub-blocks. The motion vector of the sub-block adjacent to the current sub-block may be used for motion prediction of the current sub-block. According to an embodiment, a plurality of prediction values are obtained by using the motion vector of the current block and the motion vector of the sub-block adjacent to the current sub-block. Then, the final prediction value of the current sub-block may be obtained by performing weighted averaging on the plurality of prediction values.
[0401] According to various embodiments, motion compensation of a sub-block unit may be performed at a boundary of the current block 2610. According to an embodiment, a motion vector of the current block 2610 and a motion vector of a sub-block 2612 adjacent to the upper side of the current sub-block 2611 may be used for motion prediction of a sub-block 2611 located at an upper boundary of the current block 2610. According to an embodiment, a motion vector of the current block 2610 and a motion vector of a sub-block 2617 adjacent to the left side of the current sub-block 2616 may be used for motion prediction of a sub-block 2616 located at a left boundary of the current block 2610. According to an embodiment, a motion vector of the current block 2610, a motion vector of a sub-block 2615 adjacent to the left side of the current sub-block 2613, and a motion vector of a sub-block 2614 adjacent to the upper side of the current sub-block 2613 may all be used for motion prediction of a sub-block 2613 adjacent to both the left boundary and the upper boundary of the current block 2610.
[0402] According to various embodiments, motion compensation of the sub-block unit may be performed at a location other than a boundary of the current block 2620. According to an embodiment, the motion vector of the current block 2620 and the motion vectors of the sub-blocks 2625, 2626, 2627, and 2628 adjacent to the upper, lower, left, and right sides of the current sub-block 2622 may all be used for motion prediction of the current sub-block 2622.
[0403] Figure 26b Reference samples required for inter prediction of a current block in an OBMC mode using sub-blocks according to various embodiments are shown.
[0404] like Fig.26a As shown in , in the OBMC mode using sub-blocks, in addition to using the reference samples of the reference block 2644 corresponding to the current block 2630, motion prediction may be performed by using reference samples corresponding to sub-blocks of a 4×4 size adjacent to the upper, lower, left, and right sides of the current block 2630. Therefore, the OBMC mode using sub-blocks may be regarded as performing motion compensation on a block 2642 in which the current block is extended by 4 pixels at each of the upper, lower, left, and right sides.
[0405] Here, when the horizontal width of the current block 2630 is referred to as W and the vertical height thereof is referred to as H, and a separable 2D T-tap filter is used as an interpolation filter, the total number of reconstructed reference samples 2640 to be read from the reconstructed reference picture for inter-frame prediction of the current block 2630 is (W+8+T-1)×(H+8+T-1). Therefore, in the OBMC mode using sub-blocks, the average number of reference samples (i.e., memory bandwidth) to be read from the reconstructed reference picture stored in the memory to predict the current sample can be calculated as in Equation 5.
[0406] [Equation 5]
[0407]
[0408] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0409] Fig.26c Required memory bandwidth for inter prediction of a current block in OBMC mode using sub-blocks according to various embodiments is shown. Fig.26c Show according to Fig.26a or Figure 26b 5 when the horizontal width of the current block is referred to as W and its vertical height is referred to as H and a separable 2D T-tap filter is used as an interpolation filter. Various examples of the case 2660 of a luma block and the case 2670 of a chroma block sampled at 4:2:0 are provided.
[0410] According to various embodiments, the image decoding apparatus 100 may determine the size of the filter so that the memory bandwidth calculated according to Equation 5 does not exceed a specific reference value. According to an embodiment, the specific reference value may be determined based on the above-mentioned HEVC limit.
[0411] In the case of the luma block 2660, when the size of the current block is 4×4, the memory bandwidth exceeds the HEVC limit even when a 2-tap filter is used. Therefore, according to an embodiment in which the specific reference value is set to the HEVC limit, the OBMC mode using the sub-block may be determined not to be used for the 4×4 block. According to another embodiment, when the size of the current block is 4×4, the size of the filter may be determined to be 2 taps or less.
[0412] In the case of the chroma block 2670, since the number of samples included in the chroma block is 1 / 4 of the number of samples of the luminance block having the same size when the chroma block is sampled at 4:2:0, the memory bandwidth is equal to the value obtained by dividing the result of Equation 5 by 4. According to another embodiment, when the size of the current block is 2×2, the size of the filter may be determined to be 2 taps or less. According to another embodiment, when the size of the current block is 2×2, even when a 2-tap filter is used, the memory bandwidth exceeds the HEVC limit, and thus it may be determined that the OBMC mode using sub-blocks is not used for the 2×2 block.
[0413] Figures 27a to 28d A prediction method of a DMVR mode according to various embodiments is shown.
[0414] In DMVR mode, the motion vectors used for inter prediction may be adjusted via template matching. Fig.27a A method of adjusting motion vectors in bidirectional prediction is shown.
[0415] In bidirectional prediction, two original prediction blocks 2721 and 2726 are obtained by two original motion vectors MV0 and MV1 of the current block 2715. The template 2730 can be generated by performing weighted averaging on the original prediction blocks 2721 and 2726 (step 1). The image decoding device 100 performs template matching to search for updated prediction blocks 2722 and 2727 with the smallest difference from the template 2730 in the reference pictures 2720 and 2725 (step 2). The updated motion vectors MV0' and MV1' indicating the updated prediction blocks 2722 and 2727 can be determined via template matching. The final prediction value of the current block 2715 is obtained from the updated prediction blocks 2722 and 2727.
[0416] According to various embodiments, the number of motion vector candidates used to search for updated prediction blocks 2722 and 2727 in the reference pictures 2720 and 2725 may be limited during template matching. For example, the image decoding device 100 may determine a maximum of M motion vector candidates. The image decoding apparatus 100 may compare the template 2730 with a plurality of prediction block candidates indicated by the motion vector candidates in the reference picture, and determine the prediction block candidate having the smallest difference as the updated prediction blocks 2722 and 2727.
[0417] According to various embodiments, the search area for searching for the updated prediction blocks 2722 and 2727 in the reference pictures 2720 and 2725 may be limited. For example, the image decoding apparatus 100 may search for the updated prediction blocks 2722 and 2727 in areas where the original prediction blocks 2721 and 2726 are extended by L pixels in the upper, lower, left, and right sides, respectively.
[0418] According to an embodiment, the image decoding apparatus 100 may search for an updated prediction block in an area where the original prediction block is extended by 1 pixel along the upper side, the lower side, the left side, and the right side, respectively. According to an embodiment, the image decoding apparatus 100 may determine the original motion vector and 8 motion vectors obtained by moving the original motion vector by 1 pixel along the upper side, the lower side, the left side, the right side, the upper left side, the lower left side, the upper right side, and the lower right side, respectively, as motion vector candidates. The image decoding apparatus 100 may compare the template 2730 with the prediction block candidate indicated by the motion vector candidate, and determine the prediction block candidate with the smallest difference as the updated prediction blocks 2722 and 2727.
[0419] exist Fig.27a Only bidirectional prediction is shown in FIG. 1 , but the embodiment is not limited thereto, and a person skilled in the art will appreciate that the DMVR mode may be used by applying the above method even for unidirectional prediction or multi-prediction using three or more references.
[0420] Figure 27b Reference samples required for inter prediction of a current block in DMVR mode according to various embodiments are shown.
[0421] like Figure 27b As shown in , the original prediction block 2754 is determined based on the motion vector from the reference picture indicated by the reference picture index of the current block 2740. According to an embodiment, the search area for template matching may be limited to an area 2752 of the original prediction block 2754 extending by 1 pixel along each of the upper side, the lower side, the left side, and the right side.
[0422] Here, when the horizontal width of the current block 2740 is referred to as W and the vertical height thereof is referred to as H, and a separable 2D T-tap filter is used as an interpolation filter, the total number of reconstructed reference samples 2750 to be read from the reconstructed reference picture for inter-frame prediction of the current block 2740 is (W+2+T-1)×(H+2+T-1). Therefore, the average number of reference samples to be read from the reconstructed reference picture stored in the memory to predict the current sample (i.e., the memory bandwidth) can be expressed as Equation 6.
[0423] [Equation 6]
[0424]
[0425] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0426] Fig.27c Required memory bandwidth for inter prediction of a current block in DMVR mode according to various embodiments is shown. Fig.27c Show according to Fig.27a and Figure 27b When the horizontal width of the current block is W, the vertical height thereof is H, a separable 2D T-tap filter is used as an interpolation filter, and the search area for template matching is an area where the original prediction block is extended by 1 pixel along the upper side, the lower side, the left side, and the right side, respectively, the memory bandwidth calculated according to Equation 6. Various examples of the case 2770 of the luma block and the case 2780 of the chroma block sampled at 4:2:0 are provided.
[0427] According to various embodiments, the image decoding apparatus 100 may determine the size of the filter so that the memory bandwidth calculated according to Equation 6 does not exceed a specific reference value. According to an embodiment, the specific reference value may be determined based on the above-mentioned HEVC limit.
[0428] In the case of luminance block 2770, according to an embodiment in which the specific reference value is set as an HEVC limit, when the size of the current block is 8×8, the size of the filter may be determined as 4 taps or less in bidirectional prediction, and the size of the filter may be determined as 8 taps or less in unidirectional prediction. According to an embodiment in which the specific reference value is set as an HEVC limit, when the size of the current block is 4×4, the size of the filter may be determined as 2 taps or less in bidirectional prediction, and the size of the filter may be determined as 4 taps or less in unidirectional prediction. According to another embodiment, an 8-tap filter may be allowed in bidirectional prediction of an 8×8 block.
[0429] In the case of the chroma block 2780, since the number of samples included in the chroma block is 1 / 4 of the number of samples of the luminance block having the same size when the chroma block is sampled at 4:2:0, the memory bandwidth is equal to the value obtained by dividing the result of Equation 6 by 4. According to an embodiment in which the specific reference value is set as the HEVC limit, when the size of the current block is 2×2, the size of the filter may be determined to be 4 taps or less. According to an embodiment, when the size of the current block is 2×2, an 8-tap filter may be allowed in unidirectional prediction.
[0430] Fig.28a Reference samples required for inter prediction of a current block in a DMVR mode using multiple motion vector candidates according to various embodiments are shown.
[0431] As described above, according to various embodiments, the number of motion vector candidates used to search for updated prediction blocks in reference pictures during template matching in the DMVR mode may be limited. According to an embodiment, the image decoding apparatus 100 may determine a maximum of M motion vector candidates, and in this case, may determine M prediction block candidates (shown in dotted lines) indicated by the motion vector candidates.
[0432] The horizontal width of the current block 2810 is referred to as W and its vertical height is referred to as H, and it is assumed that a separable 2D T-tap filter is used as an interpolation filter. In this case, the number of reconstructed reference samples 2820, 2821, and 2830 required to generate the reference samples of each of the prediction block candidates is as shown in FIG. Fig.22a The maximum number of reconstructed reference samples 2820, 2821, and 2830 to be read from the reconstructed reference picture for inter prediction of the current block 2810 may be indicated as M×(W+T-1)×(H+T-1). As a result, the average number of reference samples to be read from the reconstructed reference picture stored in the memory to predict the current sample (i.e., the memory bandwidth) may be expressed as in Equation 7.
[0433] [Equation 7]
[0434]
[0435] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0436] According to Equation 7, the memory bandwidth increases as the number of motion vector candidates increases, and the memory bandwidth increases as the size of the interpolation filter (i.e., the number of taps T) increases. Therefore, in order to keep the memory bandwidth at a uniform level, it may be necessary to reduce the number of taps of the filter when the number of motion vector candidates increases.
[0437] Fig.28b Required memory bandwidth for inter prediction of a current block in DMVR mode using multiple motion vector candidates according to various embodiments is shown. Fig.28b Show according to Fig.27a and Figure 27b 7 when the horizontal width of the current block is W, its vertical height is H, a separable 2D T-tap filter is used as an interpolation filter, and the number of motion vector candidates during template matching is limited to at most M, the memory bandwidth calculated according to Equation 7. Table 2850 provides various examples of the case of a luma block.
[0438] According to various embodiments, the image decoding apparatus 100 may determine the size of the filter so that the memory bandwidth calculated according to Equation 7 does not exceed a specific reference value. According to an embodiment, the specific reference value may be determined based on the above-mentioned HEVC limit.
[0439] When the number of motion vector candidates is limited to a maximum of 3, according to an embodiment in which the specific reference value is set to the HEVC limit, when the size of the current block is 8×8 or less, the size of the filter during unidirectional prediction may be determined to be 2 taps or less. However, during bidirectional prediction, even when a 2-tap filter is used, the memory bandwidth exceeds the HEVC limit. Therefore, according to an embodiment in which the specific reference value is set to the HEVC limit, the DMVR mode using multiple motion vector candidates may be determined not to be used in bidirectional prediction. According to another embodiment, when the size of the current block is 8×8 or less, a 2-tap filter may be allowed in bidirectional prediction.
[0440] When the number of motion vector candidates is limited to a maximum of 4, according to an embodiment in which the specific reference value is set to the HEVC limit, when the size of the current block is 8×8 or less, the size of the filter during unidirectional prediction may be determined to be 2 taps or less. However, during bidirectional prediction, even when a 2-tap filter is used, the memory bandwidth exceeds the HEVC limit. Therefore, according to an embodiment in which the specific reference value is set to the HEVC limit, the DMVR mode using multiple motion vector candidates may be determined not to be used in bidirectional prediction. According to another embodiment, when the size of the current block is 8×8 or less, a 2-tap filter may be allowed in bidirectional prediction.
[0441] When the number of motion vector candidates is 5 or more, according to an embodiment, when the size of the current block is 4×4, even when a 2-tap filter is used in unidirectional prediction, the memory bandwidth exceeds the HEVC limit, so the DMVR mode may be determined not to be used for 4×4 blocks. According to another embodiment, when 5 or more motion vector candidates are allowed, a 2-tap filter may be determined to be used for 4×4 blocks.
[0442] Fig.28c Reference samples required for inter prediction of a current block in a DMVR mode with limited search range according to various embodiments are shown.
[0443] As described above, according to various embodiments, the search area for searching for an updated prediction block in a reference picture during template matching in DMVR mode may be limited. According to an embodiment, the search area for template matching may be limited to an area 2862 extending L pixels along each of the upper, lower, left, and right sides of the original prediction block 2864.
[0444] Here, when the horizontal width of the current block 2810 is referred to as W and the vertical height thereof is referred to as H, and a separable 2D T-tap filter is used as an interpolation filter, the total number of reconstructed reference samples 2860 to be read from the reconstructed reference picture for inter-frame prediction of the current block 2810 is (W+2L+T-1)×(H+2L+T-1). Therefore, the average number of reference samples to be read from the reconstructed reference picture stored in the memory to predict the current sample (i.e., the memory bandwidth) can be expressed as Equation 8.
[0445] [Equation 8]
[0446]
[0447] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0448] According to Equation 8, the memory bandwidth increases as the search area for searching for updated prediction blocks increases, and the memory bandwidth increases as the size of the interpolation filter (i.e., the number of taps T) increases. Therefore, in order to keep the memory bandwidth at a uniform level, it may be necessary to reduce the number of taps of the filter when the search area increases.
[0449] Fig.28d Required memory bandwidth for inter prediction of a current block in a DMVR mode with limited search range according to various embodiments is shown. Fig.28d Show according to Fig.27a and Fig.28c The memory bandwidth calculated according to Equation 7 when the horizontal width of the current block is W, its vertical height is H, a separable 2D T-tap filter is used as an interpolation filter, and the search area during template matching is limited to an area where the original prediction block extends by L pixels along the top, bottom, left, and right sides, respectively.
[0450] Table 2870 provides various examples of the case of the luma block. Although the case of the chroma block is not shown, since when the chroma block is sampled at 4:2:0, the number of samples included in the chroma block is 1 / 4 of the number of samples of the luma block having the same size, the memory bandwidth is equal to the value obtained by dividing the result of Equation 8 by 4.
[0451] When the search area is limited to an area where the original prediction block extends by 2 pixels along the upper side, the lower side, the left side, and the right side, respectively, according to an embodiment in which the specific reference value is set as an HEVC limit, when the size of the current block is 4×4, the size of the filter during unidirectional prediction may be determined to be 4 taps or less, and the size of the filter during bidirectional prediction may be determined to be 2 taps or less. According to an embodiment in which the specific reference value is set as an HEVC limit, when the size of the current block is 8×8, the size of the filter in unidirectional prediction may be determined to be 8 taps or less, and the size of the filter in bidirectional prediction may be determined to be 4 taps or less.
[0452] When the search area is limited to an area where the original prediction block extends by 3 pixels along the upper side, the lower side, the left side, and the right side, respectively, according to an embodiment in which the specific reference value is set as an HEVC limit, when the size of the current block is 4×4, the size of the filter during unidirectional prediction may be determined to be 2 taps or less. According to an embodiment, when the size of the current block is 8×8, the size of the filter during unidirectional prediction may be determined to be 4 taps or less. According to another embodiment, a 4-tap filter may be allowed in unidirectional prediction of a 4×4 block.
[0453] However, during bidirectional prediction, the memory bandwidth exceeds the HEVC limit even when a 2-tap filter is used. Therefore, according to an embodiment in which the specific reference value is set to the HEVC limit, a DMVR mode in which the search area is an area in which the original prediction block is extended by 3 pixels or more along the upper side, the lower side, the left side, and the right side, respectively, may be determined to be not used in bidirectional prediction. According to another embodiment, in a DMVR mode in which the search area is an area in which the original prediction block is extended by 3 pixels or more along the upper side, the lower side, the left side, and the right side, respectively, a 2-tap filter may be allowed during bidirectional prediction.
[0454] When the search area is an area where the original prediction block extends by 4 pixels or more along the upper side, the lower side, the left side, and the right side, respectively, according to an embodiment in which the specific reference value is set as an HEVC limit, the size of the filter may be determined to be 2 taps or less during unidirectional prediction. According to another embodiment, a 4-tap filter may be allowed in unidirectional prediction of an 8×8 block.
[0455] Fig.29a The prediction mode of the affine mode according to various embodiments is shown.
[0456] Four vertices 2902, 2904, 2906, and 2908 of the current block 2900 correspond to motion vectors 2912, 2914, 2916, and 2918, respectively. When the current block 2900 is affine transformed by the motion vectors 2912, 2914, 2916, and 2918, an affine transformed block 2910 is generated. Samples located at the current block 2900 may be matched with samples of the affine transformed block 2910.
[0457] For example, a sample 2924 obtained by affine transforming a sample 2922 located on a line connecting the vertex 2906 and a sample 2920 located at the upper center of the block 2900 is located on a line connecting a sample 2926 indicated by a motion vector 2916 of the vertex 2906 in the affine transformed block 2910 and a sample 2928 indicated by a motion vector of the sample 2920 in the affine transformed block 2910. The position of the affine transformed sample 2924 may be determined by a motion vector 2930 obtained by performing linear interpolation on the motion vectors 2912, 2914, 2916, and 2918 according to the position of the sample 2922. Similarly, other samples of the current block 2900 may be affine transformed to match the samples of the affine transformed block 2910. As shown in FIG. Fig.29a As described above, inter-frame prediction can be performed on all samples of a block by using a motion vector generated for an affine transformation.
[0458] Fig.29b Required memory bandwidth for inter prediction of a current block in affine mode according to various embodiments is shown.
[0459] As reference Fig.29a As described above, since the affine transformation sample is generated by using the motion vector of the current block, it can be used in the same manner as the reference Fig.22a The maximum number of reconstruction reference samples required to generate the affine transformation samples of the affine transformation block is indicated in the same manner as described above. Therefore, the average number of reference samples to be read from at least one reconstructed reference picture stored in the memory (i.e., the memory bandwidth) is the same as Equation 2.
[0460] Fig.29b Table 2940 shows that according to Fig.29a and Fig.22a When the horizontal width is referred to as W and the vertical height is referred to as H, and a separable 2D T-tap filter is used as an interpolation filter, the memory bandwidth calculated according to Equation 1 and Equation 2. Various examples according to the number of taps are provided for the case of a 4×4 luma block sampled at 4:2:0 and the case of a 2×2 chroma block.
[0461] In the case of a luma block, according to an embodiment in which a specific reference value is set as an HEVC limit, when the size of the current block is 4×4, the size of the filter may be determined to be 4 taps or less in unidirectional and bidirectional prediction. According to another embodiment, when the size of the current block is 4×4, an 8-tap filter may be allowed in unidirectional prediction.
[0462] In the case of a chroma block, since the number of samples included in the chroma block is 1 / 4 of the number of samples of a luminance block having the same size when the chroma block is sampled at 4:2:0, the memory bandwidth is equal to a value obtained by dividing the result of Equation 1 or Equation 2 by 4. According to an embodiment in which the specific reference value is set as the HEVC limit, when the size of the current chroma block is 2×2, the size of the filter may be determined to be 8 taps or less in unidirectional prediction, and the size of the filter may be determined to be 4 taps or less in bidirectional prediction.
[0463] Fig.29c Reference samples required for inter prediction of a current block in affine mode according to various embodiments are shown.
[0464] like Fig.29a As shown in , an affine transformation block is determined based on the motion vector of the current block 2950. Since the affine transformation includes not only translation and rotation but also enlargement / contraction, the size of the reference sample 2964 corresponding to the affine transformation block in the reference picture may be larger than the size of the current block 2950. The size of the reference sample 2964 corresponding to the affine transformation block may indicate an enlargement / contraction ratio in the affine transformation compared to the size of the current block 2950. For example, in the affine mode inter prediction of the current block of 4×4 size, when the size of the reference sample 2964 corresponding to the affine transformation block is 8×8, the affine transformation block may be obtained by enlarging the current block to twice.
[0465] According to an embodiment, a maximum enlargement / contraction ratio of the affine transformation may be limited to be less than or equal to a specific value. According to an embodiment, a size of the reference sample 2964 corresponding to the affine transformation block may be limited to a size less than or equal to a size in which the horizontal width and the vertical height of the current block 2950 are respectively extended by 2L pixels. According to an embodiment, the reference sample 2964 corresponding to the affine transformation block may be searched in an area in which the block 2966 indicated by the motion vector of the current block 2950 is respectively extended by L pixels along the upper side, the lower side, the left side, and the right side. For example, when a maximum of 1.5 times enlargement / contraction is possible in the affine transformation during the affine mode inter-frame prediction of the current block of 4×4 size, since the size of the reference sample 2964 corresponding to the affine transformation block is 6×6 at most, L may be limited to 1.
[0466] According to an embodiment, a P-tap warping filter may be additionally applied to the reference samples of the reference picture to generate each affine transformation sample of the affine transformation block.
[0467] Fig.29c It is shown that when the horizontal width of the current block 2950 is referred to as W, the vertical height thereof is referred to as H, the affine transformation block is determined in the area 2964 extending L pixels respectively along the upper side, the lower side, the left side, and the right side of the block 2966 indicated by the motion vector of the current block 2950, a separable 2D T-tap filter is used as an interpolation filter, and a P-tap warp filter is additionally applied, the reconstructed reference samples 2960 for inter-frame prediction of the current block 2950 to be read from the reconstructed reference picture. In this case, the total number of the reconstructed reference samples 2960 is (W+2L+P-1+T-1)×(H+2L+P-1+T-1). Therefore, the average number of reference samples to be read from the reconstructed reference picture stored in the memory to predict the current sample (i.e., the memory bandwidth) can be expressed as Equation 9.
[0468] [Equation 9]
[0469]
[0470] Here, N represents the number of reference blocks to be referred to for inter prediction of the current block. N is 1 during unidirectional prediction, and N is 2 during bidirectional prediction.
[0471] Fig.29d Required memory bandwidth for inter prediction of a current block in affine mode according to various embodiments is shown. Fig.29d The memory bandwidth calculated according to Equation 9 is shown when the horizontal width of the current block is referred to as W, the vertical height thereof is referred to as H, the affine transformation block is determined in an area 2964 extending L pixels respectively along the upper side, the lower side, the left side, and the right side of the block 2966 indicated by the motion vector of the current block, a separable 2D T-tap filter is used as an interpolation filter, and a P-tap warp filter is additionally applied.
[0472] Table 2970 provides various examples of the case of the luma block. Although the case of the chroma block is not shown, since when the chroma block is sampled at 4:2:0, the number of samples included in the chroma block is 1 / 4 of the number of samples of the luma block having the same size, the memory bandwidth is equal to the value obtained by dividing the result of Equation 9 by 4.
[0473] According to an embodiment in which a specific reference value is set as an HEVC limit, when the size of the current block is 8×8, bidirectional prediction may use an affine mode in which a 5-tap warp filter is used and up to 1.5 times of magnification (ie, L=1) is possible. Alternatively, an affine mode may be used in which a 3-tap warp filter is used and up to 2 times of magnification (ie, L=2) is possible.
[0474] According to an embodiment in which the specific reference value is set to the HEVC limit, when the size of the current block is 4×4, the unidirectional prediction may use the following affine mode: in the affine mode, a 5-tap warp filter is used and up to 1.5 times magnification (i.e., L=1) is possible, or in the affine mode, a 3-tap warp filter is used and up to 2 times magnification (i.e., L=2) is possible. However, in the combination of bidirectional prediction shown, since all memory bandwidths exceed the HEVC limit, it may be determined that the affine mode using the warp filter is not used in the bidirectional prediction. According to another embodiment, when the size of the current block is 4×4, the bidirectional prediction may use the following affine mode: in the affine mode, a 3-tap warp filter is used and up to 1.25 times magnification (i.e., L=0.5) is possible.
[0475] Fig.30 A prediction pattern of a BIO pattern according to various embodiments is shown.
[0476] In BIO mode, the motion vector of the current block may be adjusted for each sample point 3015 of the current picture. Fig.30 A method of adjusting motion vectors in bidirectional prediction is shown.
[0477] The motion vector (MVx 0 MVy 0 ) and (MVx 1 MVy 1 ) determines a reference block corresponding to the current block, and can determine reference samples 3022 and 3032 of the reference block corresponding to the current sample 3015 in the reference block. The motion vector (v) of the current sample 3015 is estimated based on the spatial / temporal change amount of the values of the reference samples 3022 and 3032. x ,v y ). The final prediction samples 3026 and 3036 are obtained by using the motion vector of the current block and the motion vector of the current sample.
[0478] The spatial change amount of the values of the reference samples 3022 and 3032 may be calculated based on the difference between the values of the reference samples 3022 and 3032 and the values of the samples adjacent to the reference samples 3022 and 3032. According to an embodiment, an interpolation filter may be applied to samples at integer pixel positions adjacent to the reference samples to obtain the values of samples at sub-pixel positions adjacent to the reference samples. According to an embodiment, the interpolation filtering for calculating the spatial change amount of the values of the reference samples and the interpolation filtering for motion compensation may be performed simultaneously.
[0479] When the size of the interpolation filter used to calculate the spatial change of the value of the reference sample is not larger than the size of the interpolation filter used for motion compensation, the number of reconstructed reference samples required to generate all the reference samples in the reference block in BIO mode can be the same as the number of reconstructed reference samples in the reference block. Fig.22a and Figure 22b The quantities described are the same. Therefore, in this case, the BIO mode does not require additional memory bandwidth, and the required memory bandwidth can be calculated according to Equation 2.
[0480] The memory bandwidth required for inter-frame prediction in BIO mode can be referred to Fig.23 However, in this case, the tap number T of the filter may represent a larger size of the size of the interpolation filter used to calculate the spatial change amount of the value of the reference sample point and the size of the interpolation filter used for motion compensation.
[0481] In the above reference Figures 21a to 30 In the described embodiment, the image decoding device 100 determines the filter information, but the embodiment is not limited thereto. According to various embodiments, filter information according to the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the current block is unidirectionally predicted or bidirectionally predicted may be predetermined and stored in the memories 120 and 420 of the image encoding device 400 and the image decoding device 100. According to various embodiments, the image encoding device 400 may determine the filter information based on the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the current block is unidirectionally predicted or bidirectionally predicted, and send the filter information to the image decoding device 100 by including the filter information in the bitstream. The image decoding device 100 may extract the filter information from the bitstream. According to various embodiments, the image encoding device 400 and the image decoding device 100 may determine the filter information according to the inter-frame prediction mode of the current block, the size of the current block, whether the current block is a luminance block or a chrominance block, and whether the current block is unidirectionally predicted or bidirectionally predicted.
[0482] According to reference 1 to Fig.30The video encoding technology based on the coding unit of the tree structure is described, and the image data in the spatial domain is encoded for each coding unit in the coding unit of the tree structure, and when decoding is performed for each maximum coding unit according to the video decoding technology based on the coding unit of the tree structure, the image data in the spatial domain is reconstructed, so that the picture and the video as a picture sequence can be reconstructed. The reconstructed video can be reproduced by a reproduction device, stored in a storage medium, or transmitted via a network.
[0483] In addition, the above-described embodiments of the present disclosure can be written as programs executable on computers, and can be implemented in general-purpose digital computers that operate the programs using a computer-readable recording medium.
[0484] Although the present disclosure has been described in conjunction with the specific best embodiments of the present disclosure, other inventions applying substitutions, modifications and variations to the present disclosure will be apparent to those of ordinary skill in the art in view of the above description. In other words, the claims are intended to cover all such substitutions, modifications and variations of the present disclosure. Therefore, all that is described in this specification and the drawings should be interpreted in an illustrative and non-restrictive sense.
Claims
1. A video decoding method, comprising: When the inter prediction mode of a subblock included in the current block is an affine mode: determining a first interpolation filter among a plurality of interpolation filters corresponding to the size of the sub-block, wherein the number of filter coefficients of the first interpolation filter is eight; Applying a first interpolation filter to reconstruct reference samples to generate prediction samples of the sub-block; and Decoding the current block using the prediction samples of the sub-block; When the inter prediction mode of the current block is the decoder-side motion vector correction DMVR mode: determining a second interpolation filter among a plurality of interpolation filters corresponding to the DMVR mode, wherein the number of filter coefficients of the second interpolation filter is two; Applying a second interpolation filter to the reconstructed reference samples to generate prediction samples of the current block; and The current block is decoded using the prediction samples of the current block.
2. A method for sending a bit stream, the method comprising: When the inter prediction mode of the subblock of the current block is affine mode: determining a first interpolation filter among a plurality of interpolation filters corresponding to the size of the sub-block, wherein the number of filter coefficients of the first interpolation filter is eight; Applying a first interpolation filter to reconstruct reference samples to generate prediction samples of the sub-block; and outputting the bitstream generated by encoding the current block using the prediction samples of the sub-block; When the inter prediction mode of the current block is the decoder-side motion vector correction DMVR mode: determining a second interpolation filter among a plurality of interpolation filters corresponding to the DMVR mode, wherein the number of filter coefficients of the second interpolation filter is two; Applying a second interpolation filter to the reconstructed reference samples to generate prediction samples of the current block; and The bitstream generated by encoding the current block by using the prediction samples of the current block is output.
3. A video encoding device, comprising: at least one processor; as well as Memory, wherein the memory stores at least one instruction configured to be executable by the at least one processor, and The at least one instruction is configured to, when executed, cause the at least one processor to: When the inter prediction mode of the subblock of the current block is affine mode: determining a first interpolation filter among a plurality of interpolation filters corresponding to the size of the sub-block, wherein the number of filter coefficients of the first interpolation filter is eight, applying a first interpolation filter to the reconstructed reference samples to generate prediction samples of the sub-block, and outputting a bitstream generated by encoding the current block using the prediction samples of the sub-block, When the inter prediction mode of the current block is the decoder-side motion vector correction DMVR mode: determining a second interpolation filter among a plurality of interpolation filters corresponding to the DMVR mode, wherein the number of filter coefficients of the second interpolation filter is two; Applying a second interpolation filter to the reconstructed reference samples to generate prediction samples of the current block; and A bitstream generated by encoding the current block using the prediction samples of the current block is output.
Citation Information
Patent Citations
Adaptively performing smoothing operations
CN103299624A
Method and apparatus for encoding image, and method and apparatus for decoding image
CN104067613A