Image encoding / decoding method and apparatus, and recording medium storing bitstream thereon

Through the intra prediction method based on DIMD, combined with the weighted sum prediction samples, the accuracy and efficiency problems of intra prediction in the prior art are solved, and more efficient image encoding is achieved.

CN120153655APending Publication Date: 2025-06-13LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380079751.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-11-18
Filing Date
2023-11-17
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The prior art has problems of accuracy and efficiency in intra prediction of high resolution and high quality images.

Method used

Using a DIMD-based intra prediction method, the accuracy and efficiency of intra prediction are improved by derive the intra prediction mode of the current block and combining the weighted sum between the first prediction sample and the second prediction sample.

Benefits of technology

By modifying the prediction samples based on DIMD, the accuracy of intra prediction is improved, and the efficiency of intra prediction is improved by defining the types of multiple plane modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120153655A_ABST
    Figure CN120153655A_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and apparatus according to the present disclosure can derive an intra prediction mode of a current block, derive a first prediction sample of the current block based on the intra prediction mode, derive a second prediction sample of the current block based on a predetermined planar mode, and deriving a prediction sample of the current block based on a weighted sum between the first prediction sample and the second prediction sample.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an image encoding / decoding method and apparatus, and a recording medium storing a bitstream. Background Art

[0002] Recently, the demand for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images has been continuously increasing in various application fields, and thus, efficient image compression techniques are being discussed.

[0003] There are various techniques such as an inter prediction technique that predicts a pixel value included in a current picture from a picture before or after the current picture using a video compression technique, an intra prediction technique that predicts a pixel value included in the current picture by using pixel information in the current picture, an entropy coding technique that assigns a short symbol to a value with a high occurrence frequency and a long symbol to a value with a low occurrence frequency, etc., and these image compression techniques can be used to effectively compress image data and transmit or store it. Summary of the Invention

[0004] Technical Problem

[0005] The present disclosure provides an intra prediction method and apparatus based on DIMD.

[0006] The present disclosure provides a method and apparatus for modifying a prediction sample based on DIMD.

[0007] Technical Solution

[0008] An image decoding method and apparatus according to the present disclosure may derive an intra prediction mode of a current block, derive a first prediction sample of the current block based on the intra prediction mode, derive a second prediction sample of the current block based on a predetermined plane mode, and derive a prediction sample of the current block based on a weighted sum between the first prediction sample and the second prediction sample.

[0009] In the image decoding method and apparatus according to the present disclosure, the intra prediction mode may include a first DIMD mode derived by decoder-side intra mode derivation (DIMD). Here, DIMD may be a method for deriving one or more intra prediction modes based on gradients between samples belonging to a neighboring region of the current block.

[0010] In the image decoding method and apparatus according to the present disclosure, the predetermined plane mode may be any one of a non-directional plane mode, a horizontal plane mode, or a vertical plane mode.

[0011] In the image decoding method and apparatus according to the present disclosure, the neighboring region may include a plurality of sub-regions, and the plurality of sub-regions may include at least two of a left neighboring region, an upper neighboring region, or an upper left neighboring region.

[0012] In the image decoding method and apparatus according to the present disclosure, the magnitude of the gradient for the intra prediction mode can be calculated for each of a plurality of sub-regions.

[0013] In the image decoding method and apparatus according to the present disclosure, the predetermined plane mode can be determined based on the position of the sub-region to which the magnitude of the maximum gradient among the magnitudes of the gradients of the plurality of sub-regions belongs.

[0014] In the image decoding method and apparatus according to the present disclosure, the predetermined plane mode can be determined based on a comparison between any one of the magnitudes of the gradients for the plurality of sub-regions and another one of the magnitudes of the gradients of the plurality of sub-regions.

[0015] In the image decoding method and apparatus according to the present disclosure, the predetermined plane mode can be determined based on a comparison between the magnitude of the gradient for the DIMD mode and the magnitude of the gradient for the second DIMD mode derived based on the DIMD.

[0016] In the image decoding method and apparatus according to the present disclosure, the predetermined plane mode can be determined based on the directionality of the first DIMD mode.

[0017] In the image decoding method and apparatus according to the present disclosure, the predetermined plane mode can be determined based on the difference between the first DIMD mode and the second DIMD mode derived based on the DIMD.

[0018] In the image decoding method and apparatus according to the present disclosure, the predefined intra prediction modes can be divided into a plurality of groups, and the directionality of the first DIMD mode can be determined based on the group to which the first DIMD mode belongs among the plurality of groups.

[0019] The image encoding method and apparatus according to the present disclosure can derive the intra prediction mode of the current block, derive the first prediction sample of the current block based on the intra prediction mode, derive the second prediction sample of the current block based on the predetermined plane mode, and derive the prediction sample of the current block based on the weighted sum between the first prediction sample and the second prediction sample.

[0020] There is provided a computer-readable digital storage medium storing encoded video / image information that causes an image decoding method to be performed by a decoding apparatus according to the present disclosure.

[0021] There is provided a computer-readable digital storage medium storing video / image information generated according to an image encoding method according to the present disclosure.

[0022] There is provided a method and apparatus for transmitting video / image information generated according to an image encoding method according to the present disclosure.

[0023] Advantageous Effects

[0024] According to the present disclosure, the accuracy of intra prediction can be improved by modifying DIMD-based prediction samples based on a predetermined plane pattern.

[0025] According to the present disclosure, the efficiency of intra prediction can be improved by defining types of multiple plane patterns and adaptively using the same.

[0026] According to the present disclosure, the accuracy of intra prediction can be improved by adaptively determining the type of a plane pattern by considering the directionality of a DIMD-based intra prediction mode.

[0027] According to the present disclosure, the efficiency of intra prediction can be improved by modifying DIMD-based prediction samples under specific conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 Shows a video / image compilation system according to the present disclosure.

[0029] Figure 2 Shows a schematic block diagram of an encoding device to which embodiments of the present disclosure are applicable and which performs encoding of a video / image signal.

[0030] Figure 3 Shows a schematic block diagram of a decoding device to which embodiments of the present disclosure are applicable and which performs decoding of a video / image signal.

[0031] Figure 4 Is according to an embodiment of the present disclosure and shows an intra prediction method performed by a decoding device.

[0032] Figure 5 Shows a schematic configuration of an intra predictor 331 that performs an intra prediction method according to the present disclosure.

[0033] Figure 6 Is according to an embodiment of the present disclosure and shows an intra prediction method performed by an encoding device.

[0034] Figure 7 Shows a schematic configuration of an intra predictor 222 that performs an intra prediction method according to the present disclosure.

[0035] Figure 8 Shows an example of a content streaming system to which embodiments of the present disclosure can be applied. DETAILED DESCRIPTION

[0036] Since the present disclosure can make various changes and has several embodiments, specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, it is not intended to limit the present disclosure to the specific embodiments, and it should be understood to include all changes, equivalents, and alternatives included in the spirit and technical scope of the present disclosure. When describing each drawing, like reference numerals are used for like components.

[0037] Terms such as first, second, etc. may be used to describe various components, but the components should not be limited by these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the rights of the present disclosure, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes any one or more combinations of a plurality of related recited items.

[0038] When a component is referred to as being "connected" or "linked" to another component, it should be understood that it can be directly connected or linked to the other component, but there may also be another component in the middle. On the other hand, when a component is referred to as being "directly connected" or "directly linked" to another component, it should be understood that there is no other component in the middle.

[0039] The terms used in this application are only used to describe specific embodiments and are not intended to limit the present disclosure. Unless the context clearly indicates otherwise, singular expressions include plural expressions. In this application, it should be understood that terms such as "including" or "having" are intended to designate the presence of the features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, but do not preclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof in advance.

[0040] The present disclosure relates to video / image compilation. For example, the methods / embodiments disclosed herein can be applied to the methods disclosed in the general video coding (VVC) standard. Additionally, the methods / embodiments disclosed herein can be applied to the methods disclosed in the basic video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the second-generation audio video coding standard (AVS2), or the next-generation video / image coding standard (such as H.267 or H.268, etc.).

[0041] This specification presents various embodiments of video / image compilation, and unless otherwise stated, these embodiments can be combined with each other for implementation.

[0042] Here, video can refer to a collection of a series of images over time. A picture generally refers to a unit representing an image within a specific time period, and a slice / tile is a unit that forms part of a picture during compilation. A slice / tile can include at least one Compilation Tree Unit (CTU). A picture can be composed of at least one slice / tile. A tile is a rectangular area composed of multiple CTUs within a specific tile column and a specific tile row of a picture. A tile column is a rectangular area of CTUs having the same height as the picture and a width assigned by the syntax requirements of the picture parameter set. A tile row is a rectangular area of CTUs having a height assigned by the picture parameter set and the same width as the picture. The CTUs within a tile can be arranged continuously according to the CTU raster scan, while the tiles within a picture can be arranged continuously according to the tile raster scan. A slice can include an integer number of complete tiles or an integer number of consecutive complete CTU rows within the tiles of a picture that can be exclusively included in a single NAL unit. At the same time, a picture can be divided into at least two sub - pictures. A sub - picture can be a rectangular area of at least one slice within the picture.

[0043] A pixel, pel, or picture element can refer to the smallest unit that constitutes a picture (or image). Additionally, "sample" can be used as a term corresponding to a pixel. A sample generally can represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chrominance component.

[0044] A unit can represent the basic unit of image processing. A unit can include at least one of a specific area of a picture and information related to the corresponding area. A unit can include a luminance block and two chrominance (e.g., cb, cr) blocks. In some cases, a unit can be used interchangeably with terms such as block or region. Generally, an MxN block can include a collection (or array) of transform coefficients or samples (or sample arrays) composed of M columns and N rows.

[0045] Here, "A or B" can refer to "only A", "only B", or "both A and B". In other words, here, "A or B" can be interpreted as "A and / or B". For example, here, "A, B, or C" can refer to "only A", "only B", "only C", or "any combination of A, B, and C".

[0046] The slashes ( / ) or commas used in this article can refer to "and / or". For example, "A / B" can refer to "A and / or B". Thus, "A / B" can refer to "only A", "only B", or "both A and B". For example, "A, B, C" can refer to "A, B, or C".

[0047] Here, "at least one of A and B" may refer to "only A", "only B", or "both A and B". Additionally, in this document, expressions such as "at least one of A or B" or "at least one of A and / or B" can be interpreted in the same manner as "at least one of A and B".

[0048] Furthermore, here, "at least one of A, B, and C" may refer to "only A", "only B", "only C", or "any combination of A, B, and C". Additionally, "at least one of A, B, or C" or "at least one of A, B, and / or C" may refer to "at least one of A, B, and C".

[0049] Moreover, the parentheses used in this document may refer to "for example". Specifically, when it is indicated as "prediction (intra prediction)", "intra prediction" can be presented as an example of "prediction". In other words, "prediction" here is not limited to "intra prediction", and "intra prediction" can be presented as an example of "prediction". Additionally, even when it is indicated as "prediction (i.e., intra prediction)", "intra prediction" can be presented as an example of "prediction".

[0050] Here, the technical features separately described in one drawing can be implemented individually or simultaneously.

[0051] Figure 1 A video / image compilation system according to the present disclosure is shown.

[0052] Refer to Figure 1 , the video / image compilation system may include a first device (source device) and a second device (receiving device).

[0053] The source device may send the encoded video / image information or data to the receiving device in the form of a file or stream via a digital storage medium or a network. The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. A transmitter may be included in the encoding device. A receiver may be included in the decoding device. The renderer may include a display unit, and the display unit may be composed of a separate device or an external component.

[0054] The video source can obtain video / images through processes such as capturing, synthesizing, or generating video / images. The video source can include devices for capturing video / images and devices for generating video / images. Devices for capturing video / images can include at least one camera, video / image archives including previously captured video / images, etc. Devices for generating video / images can include computers, tablets, smartphones, etc., and can (electronically) generate video / images. For example, virtual video / images can be generated by a computer, etc., and in this case, the process of capturing video / images can be replaced by the process of generating relevant data.

[0055] The encoding device can encode the input video / images. The encoding device can perform a series of processes such as prediction, transformation, quantization, etc. for compression and compilation efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0056] The sending unit can send the encoded video / image information or data output in the form of a bitstream to the receiving unit of the receiving device in the form of a file or streaming through a digital storage medium or a network. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The sending unit can include elements for generating a media file in a predetermined file format and can include elements for transmission through a broadcast / communication network. The receiving unit can receive / extract the bitstream and send it to the decoding device.

[0057] The decoding device can decode the video / images by performing a series of processes such as inverse quantization, inverse transformation, prediction, etc. corresponding to the operations of the encoding device.

[0058] The renderer can render the decoded video / images. The rendered video / images can be displayed through the display unit.

[0059] Figure 2 A rough block diagram of an encoding device that can apply embodiments of the present disclosure and perform encoding of video / image signals is shown.

[0060] Reference Figure 2, the encoding device 200 may be composed of an image splitter 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter-frame predictor 221 and an intra-frame predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, an inverse quantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstruction block generator. According to an embodiment, the above-mentioned image splitter 210, predictor 220, residual processor 230, entropy encoder 240, adder 250, and filter 260 may be configured by at least one hardware component (e.g., an encoder chipset or a processor). Additionally, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory 270 as an internal / external component.

[0061] The image splitter 210 may partition an input image (or picture, frame) input to the encoding device 200 into at least one processing unit. As an example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit may be recursively partitioned from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quadtree binary tree ternary tree (QTBTTT) structure.

[0062] For example, one coding unit may be partitioned into multiple coding units with a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quadtree structure may be applied first, and later the binary tree structure and / or the ternary structure may be applied. Alternatively, the binary tree structure may be applied before the quadtree structure. The coding process according to this specification may be performed based on the final coding unit that is no longer partitioned. In this case, based on the coding efficiency according to the image characteristics, etc., the largest coding unit may be directly used as the final coding unit, or if necessary, the coding unit may be recursively partitioned into coding units with a deeper depth, and the coding unit with the optimal size may be used as the final coding unit. Here, the coding process may include processes such as prediction, transformation, and reconstruction described later.

[0063] As another example, the processing unit may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may be respectively divided or partitioned from the above-mentioned final coding unit. The prediction unit may be a unit for sample prediction, and the transformation unit may be a unit for deriving transformation coefficients and / or a unit for deriving a residual signal from the transformation coefficients.

[0064] In some cases, a unit may be used interchangeably with terms such as a block or a region. In general, an MxN block may represent a set of transform coefficients or samples consisting of M columns and N rows. Samples may generally represent pixels or pixel values, and may represent only the pixels / pixel values of the luminance component, or only the pixels / pixel values of the chrominance component. Samples may be used as a term corresponding to pixels or pels in a picture (or image).

[0065] The encoding device 200 may subtract a prediction signal (prediction block, prediction sample array) output from the inter-frame predictor 221 or the intra-frame predictor 222 from an input image signal (original block, original sample array) to generate a residual signal (residual signal, residual sample array), and the generated residual signal is sent to the transformer 232. In this case, the unit that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) within the encoding device 200 may be referred to as the subtractor 231.

[0066] The predictor 220 may perform prediction on a block to be processed (hereinafter, referred to as the current block), and generate a prediction block including predictions of the prediction samples for the current block. The predictor 220 may determine whether to apply intra-frame prediction or inter-frame prediction in units of the current block or CU. The predictor 220 may generate various information about the prediction, such as prediction mode information, etc., and send it to the entropy encoder 240, as described later in the description of each prediction mode. The information about the prediction may be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0067] The intra-frame predictor 222 may predict the current block by referring to samples within the current picture. Depending on the prediction mode, the samples referred to may be located near the current block or may be located at a certain distance from the current block. In intra-frame prediction, the prediction mode may include at least one non-directional mode or multiple directional modes. The non-directional mode may include at least one of the DC mode or the planar mode. Depending on the level of detail of the prediction direction, the directional mode may include 33 directional modes or 65 directional modes. However, this is only an example, and more or fewer directional modes may be used depending on the configuration. The intra-frame predictor 222 may determine the prediction mode applied to the current block by using the prediction mode applied to neighboring blocks.

[0068] The inter - frame predictor 221 can derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter - frame prediction mode, the motion information can be predicted in units of blocks, sub - blocks, or samples based on the correlation of the motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include inter - frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter - frame prediction, neighboring blocks can include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block can be the same or different. The temporal neighboring block can be referred to as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block can be referred to as a collocated picture (colPic). For example, the inter - frame predictor 221 can configure a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter - frame prediction can be performed based on various prediction modes. For example, for the skip mode and the merge mode, the inter - frame predictor 221 can use the motion information of neighboring blocks as the motion information of the current block. For the skip mode, different from the merge mode, the residual signal may not be sent. For the motion vector prediction (MVP) mode, the motion vectors of surrounding blocks are used as the motion vector predictor, and the motion vector difference is signaled to indicate the motion vector of the current block.

[0069] The predictor 220 can generate a prediction signal based on various prediction methods described later. For example, the predictor can not only apply intra - frame prediction or inter - frame prediction to predict a block, but also apply intra - frame prediction and inter - frame prediction simultaneously. It can be referred to as the combined inter - frame and intra - frame prediction (CIIP) mode. Additionally, the predictor can be based on the intra - block copy (IBC) prediction mode or can be based on the palette mode for prediction of a block. The IBC prediction mode or the palette mode can be used for content image / video compilation such as games, such as screen content compilation (SCC), etc. IBC basically performs prediction within the current picture, but it can be performed similar to inter - frame prediction because it derives a reference block within the current picture. In other words, IBC can use at least one of the inter - frame prediction techniques described herein. The palette mode can be considered an example of intra - frame compilation or intra - frame prediction. When the palette mode is applied, the sample values within the picture can be signaled based on information about the palette table and the palette index. The prediction signal generated by the predictor 220 can be used to generate a reconstructed signal or a residual signal.

[0070] The transformer 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loève transform (KLT), a graph-based transform (GBT), or a conditional non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on generating a prediction signal by using all previously reconstructed pixels. Additionally, the transform process may be applied to square pixel blocks of the same size or may be applied to non-square blocks of variable size.

[0071] The quantizer 233 may quantize the transform coefficients and send them to the entropy encoder 240, and the entropy encoder 240 may encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in block form into a one-dimensional vector form based on the coefficient scan order, and may generate information about the quantized transform coefficients based on the quantized transform coefficients in one-dimensional vector form.

[0072] The entropy encoder 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 240 may encode information necessary for video / video image reconstruction (e.g., values of syntax elements, etc.) in addition to the transform coefficients quantized together or individually.

[0073] Encoded information (e.g., encoded video / image information) can be sent or stored in the form of a bitstream in units of Network Abstraction Layer (NAL) units. The video / image information can further include information on various parameter sets such as Adaptation Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). Additionally, the video / image information can further include general constraint information. Here, the information and / or syntax elements sent / signaled from the encoding device to the decoding device can be included in the video / image information. The video / image information can be encoded through the above encoding process and included in the bitstream. The bitstream can be sent over a network or can be stored in a digital storage medium. Here, the network can include a broadcast network and / or a communication network, etc., and the digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmission unit (not shown) for sending and / or the storage unit (not shown) for storing the signal output from the entropy encoder 240 can be configured as internal / external elements of the encoding device 200, or the transmission unit can also be included in the entropy encoder 240.

[0074] The quantized transform coefficients output from the quantizer 233 can be used to generate a prediction signal. For example, the inverse quantization and inverse transformation can be applied to the quantized transform coefficients by the inverse quantizer 234 and the inverse transform 235 to reconstruct the residual signal (residual block or residual samples). The adder 250 can add the reconstructed residual signal to the prediction signal output from the inter-predictor 221 or the intra-predictor 222 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). When there is no residual for the block to be processed, such as when the skip mode is applied, the predicted block can be used as the reconstructed block. The adder 250 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-prediction of the next block to be processed within the current picture and can also be used for inter-prediction of the next picture through filtering described later. Meanwhile, the Luminance Mapping with Chroma Scaling (LMCS) can be applied during the picture encoding and / or reconstruction process.

[0075] The filter 260 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 260 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture and can store the modified reconstructed picture in the memory 270, specifically in the DPB of the memory 270. The various filtering methods can include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filter 260 can generate various information about the filtering and send it to the entropy encoder 240. The information about the filtering can be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0076] The modified reconstructed picture sent to the memory 270 can be used as a reference picture in the inter-frame predictor 221. When inter-frame prediction is applied thereto, the encoding device can avoid prediction mismatches in the encoding device 200 and the decoding device, and can also improve the encoding efficiency.

[0077] The DPB of the memory 270 can store the modified reconstructed picture to use it as a reference picture in the inter-frame predictor 221. The memory 270 can store the motion information of the blocks from which the motion information in the current picture is derived (or encoded) and / or the motion information of the blocks in the pre-reconstructed picture. The stored motion information can be sent to the inter-frame predictor 221 to be used as the motion information of spatially adjacent blocks or temporally adjacent blocks. The memory 270 can store the reconstructed samples of the reconstructed blocks in the current picture and send them to the intra-frame predictor 222.

[0078] Figure 3 A rough block diagram of a decoding device that can apply embodiments of the present disclosure and perform decoding of video / image signals is shown.

[0079] Reference Figure 3 , the decoding device 300 can be configured by including an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 can include an inter-frame predictor 332 and an intra-frame predictor 331. The residual processor 320 can include an inverse quantizer 321 and an inverse transformer 321.

[0080] According to an embodiment, the above entropy decoder 310, residual processor 320, predictor 330, adder 340, and filter 350 can be configured by one hardware component (e.g., a decoder chipset or a processor). Additionally, the memory 360 can include a decoded picture buffer (DPB) and can be configured by a digital storage medium. The hardware component can further include the memory 360 as an internal / external component.

[0081] When a bitstream including video / image information is input, the decoding device 300 can reconstruct an image in response to the process of processing the video / image information in the Figure 2 encoding device. For example, the decoding device 300 can derive units / blocks based on the relevant information of block segmentation obtained from the bitstream. The decoding device 300 can perform decoding by using the processing units applied in the encoding device. Therefore, the decoded processing units can be compilation units, and the compilation units can be segmented from the compilation tree units or the largest compilation units according to a quadtree structure, a binary tree structure, and / or a ternary tree structure. At least one transform unit can be derived from the compilation unit. And, the reconstructed image signal decoded and output by the decoding device 300 can be played by a playback device.

[0082] The decoding device 300 can receive a signal output from the Figure 2 encoding device in the form of a bitstream, and the received signal can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive information (e.g., video / image information) necessary for image reconstruction (or picture reconstruction). The video / image information can further include information about various parameter sets such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). Additionally, the video / image information can further include general constraint information. The decoding device can further decode the picture based on the information about the parameter sets and / or the general constraint information. The information sent / received by signal and / or the syntax elements described later in this document can be decoded through the decoding process and obtained from the bitstream. For example, the entropy decoder 310 can decode the information in the bitstream based on coding methods such as exponential Golomb coding, CAVLC, CABAC, etc., and output the values of the syntax elements necessary for image reconstruction and the quantization values of the transform coefficients of the residuals. More specifically, the CABAC entropy decoding method can receive the bins corresponding to each syntax element from the bitstream, determine the context model by using the information of the syntax element to be decoded, the surrounding blocks, and the decoding information of the block to be decoded, or the information of the symbols / bins decoded in the previous step, perform arithmetic decoding on the bins by predicting the occurrence probability of the bins according to the determined context model, and generate symbols corresponding to the values of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method can update the context model by using the information of the decoded symbols / bins about the context model for the next symbol / bin. Among the information decoded in the entropy decoder 310, the information about prediction is provided to the predictors (inter-frame predictor 332 and intra-frame predictor 331), and the residual values, i.e., the quantized transform coefficients and the related parameter information, for which entropy decoding is performed in the entropy decoder 310 can be input to the residual processor 320. The residual processor 320 can derive a residual signal (residual block, residual sample, residual sample array). Additionally, the information about filtering among the information decoded in the entropy decoder 310 can be provided to the filter 350. Meanwhile, a receiving unit (not shown) that receives the signal output from the encoding device can be further configured as an internal / external element of the decoding device 300 or the receiving unit can be a component of the entropy decoder 310.

[0083] Meanwhile, the decoding device according to this specification may be referred to as a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include an entropy decoder 310, and the sample decoder may include at least one of an inverse quantizer 321, an inverse transformer 322, an adder 340, a filter 350, a memory 360, an inter-frame predictor 332, and an intra-frame predictor 331.

[0084] The inverse quantizer 321 may inverse-quantize the quantized transform coefficients and output the transform coefficients. The inverse quantizer 321 may rearrange the quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement may be performed based on the coefficient scan order executed in the encoding device. The inverse quantizer 321 may perform inverse quantization on the quantized transform coefficients by using a quantization parameter (e.g., quantization step information) and obtain the transform coefficients.

[0085] The inverse transformer 322 inverse-transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0086] The predictor 320 may perform prediction on a current block and generate a prediction block including prediction samples for the current block. The predictor 320 may determine whether to apply intra-frame prediction or inter-frame prediction to the current block based on the information about prediction output from the entropy decoder 310, and determine a specific intra-frame / inter-frame prediction mode.

[0087] The predictor 320 may generate a prediction signal based on various prediction methods described later. For example, the predictor 320 may not only apply intra-frame prediction or inter-frame prediction to predict a block, but also apply intra-frame prediction and inter-frame prediction simultaneously. It may be referred to as a combined inter-frame and intra-frame prediction (CIIP) mode. Additionally, the predictor may be based on an intra-block copy (IBC) prediction mode or may be based on a palette mode for prediction of a block. The IBC prediction mode or the palette mode may be used for content image / video compilation such as games, such as screen content compilation (SCC), etc. IBC basically performs prediction within the current picture, but it may be performed similar to inter-frame prediction because it derives a reference block within the current picture. In other words, IBC may use at least one of the inter-frame prediction techniques described herein. The palette mode may be considered an example of intra-frame compilation or intra-frame prediction. When the palette mode is applied, information about the palette table and palette index may be included in the video / image information and signaled.

[0088] The intra predictor 331 can predict the current block by referring to samples within the current picture. Depending on the prediction mode, the samples referred to can be located near the current block or at a certain distance away from the current block. In intra prediction, the prediction mode can include at least one non - directional mode and multiple directional modes. The intra predictor 331 can determine the prediction mode applied to the current block by using the prediction mode applied to neighboring blocks.

[0089] The inter predictor 332 can derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter - prediction mode, the motion information can be predicted in units of blocks, sub - blocks, or samples based on the correlation of the motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include inter - prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter - prediction, neighboring blocks can include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter predictor 332 can configure a motion information candidate list based on neighboring blocks and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter - prediction can be performed based on various prediction modes, and information regarding the prediction can include information indicating the inter - prediction mode for the current block.

[0090] The adder 340 can add the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including the inter predictor 332 and / or the intra predictor 331) to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). When there is no residual for the block to be processed, such as when the skip mode is applied, the prediction block can be used as the reconstructed block.

[0091] The adder 340 can be referred to as a reconstructor or a reconstructed - block generator. The generated reconstructed signal can be used for intra - prediction of the next block to be processed in the current picture, can be output through filtering described later, or can be used for inter - prediction of the next picture. Meanwhile, a luminance mapping with chroma scaling (LMCS) can be applied during the picture decoding process.

[0092] The filter 350 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 350 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture and send the modified reconstructed picture to the memory 360, specifically to the DPB of the memory 360. Various filtering methods can include de - blocking filtering, sample - adaptive offset, adaptive loop filter, bilateral filter, etc.

[0093] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter - frame predictor 332. The memory 360 can store the motion information of the blocks from which the motion information in its current picture is derived (or decoded) and / or the motion information of the blocks in the pre - reconstructed picture. The stored motion information can be sent to the inter - frame predictor 332 to be used as the motion information of spatially adjacent blocks or temporally adjacent blocks. The memory 360 can store the reconstructed samples of the reconstructed blocks in the current picture and send them to the intra - frame predictor 331.

[0094] Here, the embodiments described in the filter 260, inter - frame predictor 221, and intra - frame predictor 222 of the encoding device 200 can also be equally or correspondingly applied to the filter 350, inter - frame predictor 332, and intra - frame predictor 331 of the decoding device 300, respectively.

[0095] Figure 4 is according to an embodiment of the present disclosure and shows an intra - frame prediction method performed by a decoding device.

[0096] Reference Figure 4 , the intra - frame prediction mode S400 of the current block can be derived based on decoder - side intra - mode derivation (DIMD).

[0097] The gradient can be derived based on at least two samples belonging to the neighboring region of the current block. Here, the gradient can include at least one of a horizontal gradient or a vertical gradient. N intra - frame prediction modes can be derived based on at least one of the derived gradient or the magnitude of the gradient. Here, the magnitude of the gradient can be determined based on the sum of the horizontal gradient and the vertical gradient.

[0098] As an example, the gradient can be calculated in units of a window with a predetermined size. The angle indicating the directionality of the samples within the window can be calculated based on the calculated gradient. The calculated angle can correspond to any one of the above - mentioned predefined intra - frame prediction modes. The magnitude of the gradient can be stored / updated for the intra - frame prediction mode corresponding to the calculated angle. Through this process, for each window, the intra - frame prediction mode corresponding to the calculated gradient can be determined, and the magnitude of the gradient can be stored / updated for the determined intra - frame prediction mode. Among the stored / updated magnitudes of the gradient, the top T intra - frame prediction modes with the largest magnitude can be selected. Here, N can be an integer of 1, 2, 3, or larger. The selected intra - frame prediction modes can be set as the intra - frame prediction mode of the current block.

[0099] The neighboring region for calculating the slope may include at least one of a left region, an upper region, an upper-left region, a lower-left region, or an upper-right region adjacent to the current block, which is a previously reconstructed region of the current block. The neighboring region may include at least one of a neighboring sample line adjacent to the current block, a first non-neighboring sample line that is 1 sample away from the current block, or a second non-neighboring sample line that is 2 samples away from the current block. However, it is not limited thereto, and may further include a non-neighboring sample line that is M samples away from the current block, and M may be an integer greater than or equal to 3.

[0100] The neighboring region may be a region predefined in the same way in the encoding device and the decoding device to calculate the slope. Alternatively, the neighboring region may be variably determined based on information specifying the position of the neighboring region. In this case, the information specifying the position of the neighboring region may be signaled through the bitstream. Alternatively, the position of the neighboring region may be determined based on at least one of whether the current block is located at the boundary of the coding tree unit, the size of the current block (e.g., width, height, ratio of width and height, product of width and height), the partition type of the current block, the prediction mode of the neighboring region, or the availability of the neighboring region.

[0101] As an example, based on the current block being located at the upper boundary of the coding tree unit, at least one of the upper region, the upper-left region, or the upper-right region of the current block may not be referred to for calculating the gradient. When the width of the current block is greater than the height, the upper region or the left region (e.g., the upper region) may be referred to for calculating the gradient, and the other (e.g., the left region) may not be referred to for calculating the gradient. Conversely, based on the width of the current block being less than the height, the upper region or the left region (e.g., the left region) may be referred to for calculating the gradient, and the other region (e.g., the upper region) may not be referred to for calculating the gradient. Based on generating the current block through block partitioning in the horizontal direction, the upper region may not be referred to for calculating the gradient. Conversely, based on generating the current block through block partitioning in the vertical direction, the left region may not be referred to for calculating the gradient. Based on encoding the neighboring region of the current block in the inter-frame mode, the neighboring region may not be referred to for calculating the gradient. However, it is not limited thereto, and the neighboring region may be referred to for calculating the gradient regardless of the prediction mode of the neighboring region.

[0102] Reference Figure 4 , the predicted sample S410 of the current block may be derived based on the intra-frame prediction mode of the current block.

[0103] Through the above method, one or more intra-frame prediction modes may be derived based on the DIMD for the current block. Hereinafter, the intra-frame prediction mode derived based on the DIMD is referred to as the DIMD mode.

[0104] When a DIMD mode is used for a current block, intra prediction can be performed based on the corresponding DIMD mode to derive prediction samples of the current block.

[0105] When multiple DIMD modes are used for a current block, prediction samples can be derived for each of the multiple DIMD modes, and prediction samples of the current block can be derived based on a weighted sum between the derived prediction samples. As an example, when N DIMD modes are used, prediction samples of the current block can be derived as in Equation 1 below.

[0106] [Equation 1]

[0107]

[0108] In Equation 1, pred can represent prediction samples of the current block. pred 1 can mean prediction samples derived based on a first DIMD mode, pred 2 can mean prediction samples derived based on a second DIMD mode, and pred N can mean prediction samples derived based on an Nth DIMD mode. Here, the first DIMD mode can mean the first DIMD mode in descending order of the magnitude of the gradient among the top N DIMD modes having the largest gradient magnitude. Similarly, the second DIMD mode can mean the second DIMD mode in descending order of the magnitude of the gradient among the top N DIMD modes having the largest gradient magnitude, and the Nth DIMD mode can mean the Nth DIMD mode in descending order of the magnitude of the gradient among the top N DIMD modes having the largest gradient magnitude. w 1 to w n are weight coefficients applied to pred 1 to pred n respectively, and can be determined based on the magnitude of the gradient for the N DIMD modes.

[0109] Reference Figure 4 , prediction samples S420 of the current block can be modified based on a predetermined plane mode.

[0110] Prediction samples derived based on one or more DIMD modes described above can be modified based on prediction samples according to a predetermined plane mode, and the modified prediction samples can be set as prediction samples of the current block.

[0111] Specifically, prediction samples of the current block can be derived based on a weighted sum between prediction samples derived based on one or more DIMD modes described above and prediction samples derived based on a predetermined plane mode. Here, the predetermined plane mode can be any one of a non - directional plane mode, a horizontal plane mode, or a vertical plane mode.

[0112] Prediction samples according to the non - directional plane mode can be derived as a weighted sum of prediction samples interpolated in the horizontal direction and prediction samples interpolated in the vertical direction. Here, prediction samples interpolated in the horizontal direction can be derived based on the left neighboring samples and the upper - right neighboring samples of the current block. Prediction samples interpolated in the vertical direction can be derived based on the upper neighboring samples and the lower - left neighboring samples of the current block. As an example, prediction samples according to the non - directional plane mode can be derived as in Equation 2 below.

[0113] [Equation 2]

[0114]

[0115] In Equation 2, predH and predV can respectively denote prediction samples interpolated in the horizontal direction and prediction samples interpolated in the vertical direction. W and H can respectively denote the width and height of the current block. rec(x, - 1) can denote the upper neighboring sample of the current block, and rec(-1, H) can denote the lower - left neighboring sample of the current block. rec(-1, y) can denote the left neighboring sample of the current block, and rec(W, - 1) can denote the upper - right neighboring sample of the current block. Planar can denote prediction samples according to the non - directional plane mode.

[0116] Prediction samples according to the horizontal plane mode can be derived based on prediction samples interpolated in the horizontal direction. Here, prediction samples interpolated in the horizontal direction can be derived based on the weighted sum of the left neighboring samples and the upper - right neighboring samples of the current block. As an example, prediction samples according to the horizontal plane mode can be derived as in Equation 3 or Equation 4 below.

[0117] [Equation 3]

[0118]

[0119] [Equation 4]

[0120]

[0121] In Equation 3, predH can denote prediction samples interpolated in the horizontal direction. W and H can respectively denote the width and height of the current block. rec(-1, y) can denote the left neighboring sample of the current block, and rec(W, - 1) can denote the upper - right neighboring sample of the current block. Planar Hor can denote the final prediction samples according to the horizontal plane mode. This can also be equivalently applied to Equation 4.

[0122] Prediction samples according to the vertical plane mode can be derived based on prediction samples interpolated in the vertical direction. Here, prediction samples interpolated in the vertical direction can be derived based on a weighted sum of the upper neighboring sample and the lower-left neighboring sample of the current block. As an example, prediction samples according to the vertical plane mode can be derived as in Equation 5 or Equation 6 below.

[0123] [Equation 5]

[0124]

[0125] [Equation 6]

[0126]

[0127] In Equation 5, predV can mean the prediction sample interpolated in the vertical direction. W and H can respectively mean the width and height of the current block. rec(x, -1) can mean the upper neighboring sample of the current block, and rec(-1, H) can mean the lower-left neighboring sample of the current block. Planar Ver can mean the final prediction sample according to the vertical plane mode. This can also be equivalently applied to Equation 6.

[0128] Based on whether the neighboring region of the current block is available, the modification based on a predetermined plane mode can be adaptively performed. As an example, when both the left neighboring region and the upper neighboring region of the current block are available, the weighted sum of the prediction samples according to the predetermined plane mode can be performed. On the other hand, when at least one of the left neighboring region or the upper neighboring region of the current block is unavailable, the weighted sum of the prediction samples according to the predetermined plane mode may not be performed. In this case, the prediction sample of the current block can be derived based on the prediction sample according to the DIMD mode rather than the prediction sample according to the predetermined plane mode. This method can improve the prediction efficiency by weighting the samples of the neighboring region that has a high contribution to the prediction of the current block.

[0129] Alternatively, the modification based on a predetermined plane mode can be adaptively performed based on a predetermined flag. Here, the flag can indicate whether to modify the prediction sample according to the DIMD mode. Alternatively, the flag can indicate whether to modify the pre-derived prediction sample of the current block by using the prediction sample according to the predetermined plane mode. Alternatively, the flag can indicate whether to apply the weighted sum of the DIMD mode and the predetermined plane mode. The flag can be signaled through the bitstream and can be derived based on the coding parameters of the current block. Here, the coding parameters can include at least one of the size of the current block, whether the intra prediction mode is a directional mode, the angle of the intra prediction mode, whether to apply the DIMD mode, or the component type.

[0130] In the following, a method for determining the type of a plane pattern for a weighted sum of prediction samples having a DIMD-based pattern will be described.

[0131] Example 1

[0132] A predetermined plane pattern may be determined based on the magnitude of the gradient in a predetermined neighboring region of the first DIMD pattern for the current block.

[0133] Specifically, a neighboring region adjacent to the current block may be divided into a plurality of sub-regions, and the magnitude of the gradient of the first DIMD pattern for the current block may be calculated / confirmed in each sub-region.

[0134] The neighboring region may be divided into a left neighboring region and an upper neighboring region. Alternatively, the neighboring region may be divided into a left neighboring region, an upper neighboring region, and an upper-left neighboring region. Alternatively, the neighboring region may be divided into at least two of a left neighboring region, an upper neighboring region, an upper-left neighboring region, a lower-left neighboring region, or an upper-right neighboring region.

[0135] According to the size of the current block or the ratio of the width to the height of the current block, the upper-left neighboring region may be included in the upper neighboring region or the left neighboring region. Alternatively, according to the size of the current block or the ratio of the width and height of the current block, the upper-left neighboring region may be excluded from the plurality of sub-regions. As an example, when the size of the current block is greater than 8x8 and the width of the current block is greater than the height, the upper-left neighboring region may be included in the left neighboring region. When the size of the current block is greater than 8×8 and the width of the current block is less than the height, the upper-left neighboring region may be included in the upper neighboring region.

[0136] When the magnitude of the gradient in the left neighboring region is greater than the magnitude of the gradient in the upper neighboring region, the current block may be determined to be a block that is greatly influenced by the samples in the left neighboring region. In this way, when the current block is determined to be a block that is greatly influenced by the samples in the left neighboring region, the predetermined plane pattern may be determined to be a horizontal plane pattern. In other words, the prediction sample of the current block may be derived based on the weighted sum between the prediction samples derived based on the DIMD pattern and the prediction samples derived based on the horizontal plane pattern.

[0137] As an example, when N DIMD patterns are derived for the current block, the prediction sample of the current block may be derived as in Equation 7 below.

[0138] [Equation 7]

[0139]

[0140] In Equation 7, pred may refer to the prediction sample of the current block. pred 1 to pred Nmay respectively refer to prediction samples derived based on the first DIMD mode to the Nth DIMD mode. w 1 to w N are weights respectively applied to pred 1 to pred N and may be determined based on the magnitudes of the gradients for the N DIMD modes used for pre - calculation. Planar Hor may refer to a prediction sample derived based on a horizontal plane mode, and w (N+1) may be a weight applied to the prediction sample according to the horizontal plane mode. w (N+1) may be determined based on at least one of the gradients for the N DIMD modes. Alternatively, it may be determined based on information for deriving weights according to the horizontal plane mode, and w (N+1) may be signaled by a bitstream with the corresponding information. Alternatively, it may be determined based on weights predefined in the encoding device and the decoding device. (N+1) . Here, as described above, N is an integer of 1, 2, 3, or greater.

[0141] Alternatively, when applying the weighted sum of prediction samples according to the horizontal plane mode to the current block, even when N DIMD modes are derived for the current block, the application of the weighted sum of prediction samples according to the Nth DIMD mode may be restricted. In this case, the prediction sample of the current block may be derived as in Equation 8 below.

[0142] [Equation 8]

[0143]

[0144] Referring to Equation 8, the prediction sample (pred) of the current block may be derived based on the weighted sum between the prediction samples (pred 1 to pred (N-1) ) derived respectively based on the first DIMD mode to the (N - 1)th DIMD mode excluding the Nth DIMD mode and the prediction sample (Planar Hor ) derived based on the horizontal plane mode. In other words, when the weighted sum of prediction samples according to the horizontal plane mode is applied to the current block, the prediction sample according to the Nth DIMD mode may be replaced by the prediction sample according to the horizontal plane mode.

[0145] Here, w 1 to w N-1 are weights respectively applied to pred 1 to pred (N-1)The weight, and can be determined based on the magnitudes of the gradients for the pre-computed (N - 1) DIMD patterns. Similarly, w can be determined based on at least one of the gradients for the (N - 1) DIMD patterns N Alternatively, w can be determined based on the information for deriving the weight according to the horizontal plane pattern N and the corresponding information can be signaled via a bitstream. Alternatively, w can be determined based on the weights predefined in the encoding device and the decoding device N .

[0146] When the magnitude of the gradient in the upper neighboring region is greater than the magnitude of the gradient in the left neighboring region, the current block can be a block significantly affected by the samples in the upper neighboring region. In this way, when the current block is determined to be a block significantly affected by the samples in the upper neighboring region, the predefined plane pattern can be determined as the vertical plane pattern. In other words, the predicted samples of the current block can be derived based on the weighted sum between the predicted samples derived based on the DIMD pattern and the predicted samples derived based on the vertical plane pattern

[0147] As an example, when N DIMD patterns are derived for the current block, the predicted samples of the current block can be derived as in Equation 9 below

[0148] [Equation 9]

[0149]

[0150] In Equation 9, pred can mean the predicted samples of the current block. pred 1 to pred N can respectively represent the predicted samples derived based on the first DIMD pattern to the Nth DIMD pattern. w 1 to w n are respectively the weight coefficients applied to pred1 to predn, and can be determined based on the magnitudes of the gradients for the pre-computed N DIMD patterns. Planar Ver can mean the predicted samples derived based on the vertical plane pattern, and w (N+1) can be the weight applied to the predicted samples according to the vertical plane pattern. w (N+1) can be determined based on at least one of the gradients for the N DIMD patterns. Alternatively, w can be determined based on the information for deriving the weight according to the horizontal plane pattern (N+1) and the corresponding information can be signaled via a bitstream. Alternatively, w can be determined based on the weights predefined in the encoding device and the decoding device (N+1) . Here, as described above, N is an integer of 1, 2, 3, or greater

[0151] Alternatively, when applying the weighted sum of prediction samples according to the vertical plane mode to the current block, even when N DIMD modes are derived for the current block, it is possible to limit the application of the weighted sum of prediction samples according to the Nth DIMD mode. In this case, the prediction samples of the current block can be derived as in Equation 10 below.

[0152] [Equation 10]

[0153]

[0154] Referring to Equation 10, based on the prediction samples (pred 1 to pred (N-1) ) derived respectively based on the first DIMD mode to the (N - 1)th DIMD mode (excluding the Nth DIMD mode) and the prediction samples (Planar Ver ) derived based on the vertical plane mode, the prediction samples (pred) of the current block can be derived. In other words, when the weighted sum of prediction samples according to the vertical plane mode is applied to the current block, the prediction samples according to the Nth DIMD mode can be replaced with the prediction samples according to the vertical plane mode.

[0155] Here, w 1 to w N-1 are the weights applied to pred 1 to pred (N-1) respectively, and can be determined based on the magnitudes of the gradients of the pre-computed (N - 1) DIMD modes. Similarly, w N can be determined based on at least one of the gradients for the (N - 1) DIMD modes. Alternatively, w N can be determined based on the information for deriving weights according to the vertical plane mode, and the corresponding information can be signaled through the bitstream. Alternatively, w N can be determined based on the weights predefined in the encoding device and the decoding device.

[0156] Example 2

[0157] The predetermined plane mode can be determined based on the magnitude of the gradient of the first DIMD mode for the current block. The magnitude of the gradient of the first DIMD mode can be calculated / confirmed for each sub-region within the neighboring region. Here, the sub-regions are as described in Embodiment 1. The plane mode can be determined by comparing the magnitudes of the gradients for each sub-region.

[0158] As an example, the magnitudes of the gradients of the first DIMD mode for the left neighboring region, the upper neighboring region, and the upper left neighboring region are respectively referred to as Amp L and AmpA and Amp AL As in Equation 11 below, the type of the planar mode can be determined based on a comparison between the magnitudes of the gradients.

[0159] [Equation 11]

[0160]

[0161] In Equation 11, the weights Th1 and Th2 for the threshold are weights for each neighboring region and can be any integers. As an example, Th1 and Th2 can be 2 respectively. Alternatively, Th1 can be 2 and Th2 can be 0. The weights can be predefined values equally for the encoding device and the decoding device and can be signaled at the level of at least one of VPS, SPS, PPS, Picture Header (PH), or Slice Header (SH), or can be signaled at the level of a block such as a Coding Tree Unit or a Coding Unit. Alternatively, the weights can be variably determined according to the magnitude or form of the current block.

[0162] In addition, a comparison between the magnitude of the gradient for the first DIMD mode and the magnitude of the gradient for the second DIMD mode can be further considered. Here, the magnitudes of the gradients for the first DIMD mode and the second DIMD mode can be calculated based on the entire neighboring region rather than a partial sub-region. Alternatively, the magnitudes of the gradients for the first DIMD mode and the second DIMD mode can be calculated based on a partial sub-region within the neighboring region (e.g., the left, upper, or upper-left neighboring region).

[0163] As an example, as in Equation 12 below, the type of the planar mode can be determined by further considering a comparison between the magnitude of the gradient for the first DIMD mode and the magnitude of the gradient for the second DIMD mode.

[0164] [Equation 12]

[0165]

[0166] Equation 12 means that the comparison condition between the magnitude of the gradient (Amp) for the first DIMD mode and the magnitude of the gradient (Amp’) for the second DIMD mode is added to Equation 11. In other words, when Amp is greater than the value obtained by applying a predetermined weight (Th mode ) to Amp’, either the horizontal planar mode or the vertical planar mode is available, and otherwise, the type of the planar mode can be determined as the non-oriented planar mode.

[0167] When the type of the predetermined planar mode is determined by the above method, the predicted samples of the current block can be derived as in Equation 13 below.

[0168] [Equation 13]

[0169]

[0170] In Equation 13, pred may refer to the predicted sample of the current block. pred 1 to pred N may respectively refer to the predicted samples derived based on the first DIMD mode to the Nth DIMD mode. w 1 to w N are the weights respectively applied to pred 1 to pred N and may be determined based on the magnitudes of the gradients for the N DIMD modes used for pre - calculation. pred PlanarType may refer to the predicted sample derived based on the type of the plane mode, and w (N+1) may be the weight applied to pred PlanarType .

[0171] Alternatively, when the weighted sum of the predicted samples according to the predetermined plane mode is applied to the current block, even when N DIMD modes are derived for the current block, the application of the weighted sum of the predicted samples according to the Nth DIMD mode may be restricted. In this case, the predicted sample (pred) of the current block may be derived as in Equation 14 below.

[0172] [Equation 14]

[0173]

[0174] Referring to Equation 14, the predicted sample (pred) of the current block may be derived based on the weighted sum between the predicted samples respectively derived based on the first DIMD mode to the (N - 1)th DIMD mode (excluding the Nth DIMD mode) and the predicted sample derived based on the predetermined plane mode. In other words, when the weighted sum of the predicted samples according to the predetermined plane mode is applied to the current block, the predicted sample according to the Nth DIMD mode may be replaced by the predicted sample according to the predetermined plane mode.

[0175] Example 3

[0176] When the first DIMD mode of the current block is determined to be the mode of the horizontal component, the predetermined plane mode may be determined as the horizontal plane mode. Alternatively, when it is determined that the first DIMD mode of the current block is the mode of the horizontal component, the predetermined plane mode may be determined as the vertical plane mode. In this way, the effect of obtaining a smooth predicted block may be achieved by using the plane mode in the direction opposite to the DIMD mode.

[0177] In the present disclosure, the type of the planar mode is determined by considering the first DIMD mode of the current block, but is not limited thereto. As an example, in addition to the first DIMD mode of the current block, the type of the planar mode can be determined by further considering the second DIMD mode. Specifically, the magnitudes of the gradients between the first DIMD mode and the second DIMD mode can be compared, and the result of the comparison can be further considered to determine the type of the planar mode.

[0178] When a predetermined planar mode is determined to be a horizontal planar mode, the predicted samples of the current block can be derived as in Equation 15 or 16 below. Alternatively, when a predetermined planar mode is determined to be a vertical planar mode, the predicted samples of the current block can be derived as in Equation 17 or 18 to be described below.

[0179] [Equation 15]

[0180]

[0181] In Equation 15, pred may refer to the predicted samples of the current block. pred 1 to pred N may respectively refer to the predicted samples derived based on the first DIMD mode to the Nth DIMD mode. w 1 to w N are respectively the weights applied to pred 1 to pred N and can be determined based on the magnitudes of the gradients of the N DIMD modes used for pre - calculation. Planar Hor may refer to the predicted samples derived based on the horizontal planar mode, and w (N+1) can be the weight applied to the predicted samples according to the horizontal planar mode. The method for determining w (N+1) is as described in Embodiment 2. Here, as described above, N is an integer of 1, 2, 3, or greater.

[0182] Alternatively, when the weighted sum of the predicted samples according to the horizontal planar mode is applied to the current block, even when N DIMD modes are derived for the current block, the application of the weighted sum of the predicted samples according to the Nth DIMD mode can be restricted. In this case, the predicted samples of the current block can be derived as in Equation 16 below.

[0183] [Equation 16]

[0184]

[0185] Referring to Equation 16, based on the prediction samples (pred 1 to pred (N-1) ) derived respectively based on the first DIMD mode to the N-1 DIMD modes (excluding the Nth DIMD mode) and the prediction sample (Planar Hor ) derived based on the horizontal plane mode, the prediction sample (pred) of the current block can be derived. In other words, when the weighted sum of the prediction samples according to the horizontal plane mode is applied to the current block, the prediction sample according to the Nth DIMD mode can be replaced by the prediction sample according to the horizontal plane mode. The weights in Equation 16 can be determined according to the method described in Embodiment 2.

[0186] When it is determined that the first DIMD mode of the current block is a mode of the vertical component, the predetermined plane mode can be determined as the vertical plane mode. Alternatively, when it is determined that the first DIMD mode of the current block is a mode of the vertical component, the predetermined plane mode can be determined as the horizontal plane mode. In this way, the effect of obtaining a smooth prediction block can be achieved by using the plane mode in the direction opposite to the DIMD mode.

[0187] In the present disclosure, the type of the plane mode is determined by considering the first DIMD mode of the current block, but is not limited thereto. As an example, in addition to the first DIMD mode of the current block, the type of the plane mode can be determined by further considering the second DIMD mode. Specifically, the magnitudes of the gradients between the first DIMD mode and the second DIMD mode can be compared, and the result of this comparison can be further considered to determine the type of the plane mode.

[0188] When the predetermined plane mode is determined as the vertical plane mode, the prediction sample of the current block can be derived as in Equation 17 or 18 below. Alternatively, when the predetermined plane mode is determined as the horizontal plane mode, the prediction sample of the current block can be derived as in Equation 15 or 16 above.

[0189] [Equation 17]

[0190]

[0191] In Equation 17, pred can mean the prediction sample of the current block. pred 1 to pred N can respectively mean the prediction samples derived based on the first DIMD mode to the Nth DIMD mode. w 1 to w N are respectively the weights applied to pred 1 to pred NThe weight can be determined based on the magnitudes of the gradients of the N DIMD patterns used for pre - calculation. Planar Ver can mean a prediction sample derived based on a vertical - plane pattern, and w (N+1) can be the weight applied to the prediction sample according to the vertical - plane pattern. The method for determining w (N+1) is as described in Example 2. Here, as described above, N is an integer of 1, 2, 3, or greater.

[0192] Alternatively, when applying the weighted sum of prediction samples with a vertical - plane pattern to the current block, even when N DIMD patterns are derived for the current block, the application of the weighted sum of prediction samples with the Nth DIMD pattern can be restricted. In this case, the prediction sample of the current block can be derived as in Equation 18 below.

[0193] [Equation 18]

[0194]

[0195] Referring to Equation 18, the prediction sample (pred) of the current block can be derived based on the weighted sum between the prediction samples derived respectively based on the first to the (N - 1)th DIMD patterns (excluding the Nth DIMD pattern) and the prediction sample derived based on the vertical - plane pattern. In other words, when the weighted sum of prediction samples with a vertical - plane pattern is applied to the current block, the prediction sample according to the Nth DIMD pattern can be replaced with the prediction sample according to the vertical - plane pattern. The weights in Equation 18 can be determined according to the method described in Example 2.

[0196] When the first DIMD pattern of the current block is not a pattern of a vertical component and a horizontal component, a predetermined plane pattern can be determined as a non - directional plane pattern, and the prediction sample of the current block can be derived as in Equation 19 or 20 below.

[0197] [Equation 19]

[0198]

[0199] In Equation 19, pred can mean the prediction sample of the current block. pred 1 to pred N can respectively mean the prediction samples derived based on the first to the Nth DIMD patterns. w 1 to w N are respectively the weights applied to pred 1 to pred NThe weight, and can be determined based on the magnitudes of the gradients of the N DIMD patterns used for pre - calculation. Planar can mean a prediction sample derived based on a non - directional planar pattern, and w (N+1) can be the weight applied to the prediction sample according to the non - directional planar pattern. w (N+1) can be determined based on at least one of the gradients for the N DIMD patterns. Alternatively, w (N+1) can be determined based on the information used to derive the weight according to the non - directional planar pattern, and the corresponding information can be signaled via a bitstream. Alternatively, w (N+1) can be determined based on pre - defined weights in the encoding device and the decoding device. Here, as described above, N is an integer of 1, 2, 3, or greater.

[0200] Alternatively, when applying the weighted sum of prediction samples with a non - directional planar pattern to the current block, even when N DIMD patterns are derived for the current block, the application of the weighted sum of prediction samples with the Nth DIMD pattern can be restricted. In this case, the prediction sample of the current block can be derived as in Equation 20 below.

[0201] [Equation 20]

[0202]

[0203] Referring to Equation 20, the prediction sample (pred) of the current block can be derived based on the weighted sum between the prediction samples (pred 1 to pred (N-1) ) derived based on the first DIMD pattern to the (N - 1)th DIMD pattern (excluding the Nth DIMD pattern) respectively and the prediction sample (planar) derived based on the non - directional planar pattern. In other words, when applying the weighted sum of prediction samples with a non - directional planar pattern to the current block, the prediction sample according to the Nth DIMD pattern can be replaced with the prediction sample according to the non - directional planar pattern.

[0204] Here, w 1 to w N-1 are the weights applied to pred 1 to pred (N-1) respectively, and can be determined based on the magnitudes of the gradients of the (N - 1) DIMD patterns used for pre - calculation. Similarly, w N can be determined based on at least one of the gradients of the (N - 1) DIMD patterns. Alternatively, w N can be determined based on the information used to derive the weight according to the non - directional planar pattern, and the corresponding information can be signaled via a bitstream. Alternatively, wN .

[0205] In the following, a method for determining whether the first DIMD mode of the current block is a mode of a non-oriented component and / or a mode of a vertical or horizontal component will be described.

[0206] When the first DIMD mode is a mode having an index smaller than that of the diagonal mode, the first DIMD mode may be determined as a mode of a horizontal component. When the first DIMD mode is a mode having an index larger than that of the diagonal mode, the first DIMD mode may be determined as a mode of a vertical component. Here, the diagonal mode may mean a mode referring to samples in the upper left direction or a mode having a prediction direction from the upper left to the lower right.

[0207] Alternatively, when the index of the first DIMD mode is greater than or equal to (mode Hor -K) and less than or equal to (mode Hor +K), the first DIMD mode may be determined as a mode of a horizontal component. Here, mode Hor may mean the index in the horizontal mode. When the index of the first DIMD mode is greater than or equal to (mode Ver -K) and less than or equal to (mode Ver +K), the first DIMD mode may be determined as a mode of a vertical component. Here, mode Ver may mean the index in the vertical mode. When the first DIMD mode has any other index, the first DIMD mode may be determined as a mode of a non-oriented component. Here, K may be a natural number greater than or equal to 0 and less than or equal to 16. This method may improve the prediction accuracy by assigning weights to the direction features of the prediction samples configuring the current block.

[0208] Alternatively, let's assume that the first DIMD mode is M1 and the second DIMD mode is M2. According to the indices of M1 and M2, the current block may be determined as any one of a horizontal component block, a vertical component block, or a non-oriented component block.

[0209] As an example, when M1 is a mode of a horizontal component and the absolute value of the difference between M1 and M2 is less than a predetermined threshold, the current block may be determined as a horizontal component block. In this case, the predetermined plane mode may be determined as a horizontal plane mode, and the prediction samples of the current block may be derived as in Equation 15 or 16 above.

[0210] Alternatively, when M1 is a vertical component mode and the absolute value of the difference between M1 and M2 is less than a predetermined threshold, the current block can be determined as a vertical component block. In this case, a predetermined plane mode can be determined as a vertical plane mode, and the predicted samples of the current block can be derived as in Equation 17 or 18 above.

[0211] Alternatively, when M1 is a horizontal component mode and the absolute value of the difference between M1 and M2 is greater than or equal to a predetermined threshold, the current block can be determined as a non - directional component block. When M1 is a vertical component mode and the absolute value of the difference between M1 and M2 is greater than or equal to a predetermined threshold, the current block can be determined as a non - directional component block. When M1 is a non - directional component mode, the current block can be determined as a non - directional component block. When the current block is determined as a non - directional component block, a predetermined plane mode can be determined as a non - directional plane mode, and the predicted samples of the current block can be derived as in Equation 19 or 20 above. Here, the predetermined threshold can be any one of 1 to the index of possible modes. For example, the predetermined threshold can be 5.

[0212] This method can improve the prediction accuracy by more strictly partitioning the directional features that configure the predicted samples of the current block and assigning weights to the directional features only when all conditions are met.

[0213] Alternatively, according to the directional features of N DIMD modes, the current block can be determined as any one of a horizontal component block, a vertical component block, or a non - directional component block.

[0214] As an example, when the first DIMD mode to the Nth DIMD mode are all horizontal component modes, the predetermined plane mode for the current block can be determined as a horizontal plane mode, and the predicted samples of the current block can be derived as in Equation 15 or 16 above. When the first DIMD mode to the Nth DIMD mode are all vertical component modes, the predetermined plane mode for the current block can be determined as a vertical plane mode, and the predicted samples of the current block can be derived as in Equation 17 or 18 above. For other cases (i.e., when any one of the first DIMD mode to the Nth DIMD mode has a different directional feature from another), the predetermined plane mode for the current block can be determined as a non - directional plane mode, and the predicted samples of the current block can be derived as in Equation 19 or 20 above.

[0215] Alternatively, based on the difference between the first DIMD mode among the first N DIMD modes and the directional components of n DIMD modes, the current block can be determined as any one of a horizontal component block, a vertical component block, or a non - directional component block. Here, n can be an integer greater than or equal to 2 and less than or equal to N.

[0216] As an example, when the first DIMD mode is a mode of a horizontal component and the maximum value among the differences between n DIMD modes (max(|Mi - Mj|), 1 ≤ i, j ≤ n) is less than a predetermined threshold, the current block can be determined as a horizontal component block. In this case, a predetermined plane mode can be determined as a horizontal plane mode, and the predicted samples of the current block can be derived as in Equation 15 or 16 above. Alternatively, when the first DIMD mode is a mode of a vertical component and the maximum value among the differences between n DIMD modes (max(|Mi - Mj|), 1 ≤ i, j ≤ n) is less than a predetermined threshold, the current block can be determined as a vertical component block. In this case, a predetermined plane mode can be determined as a vertical plane mode, and the predicted samples of the current block can be derived as in Equation 17 or 18 above. The predetermined threshold can be any one from 1 to the index of possible modes. For example, the predetermined threshold can be n.

[0217] Specifically, when N = 5 and n = 3, the predicted samples of the current block can be derived by the weighted sum of the predicted samples according to five DIMD modes and the predicted samples according to a predetermined plane mode. The absolute values of the differences between the first three DIMD modes in the descending order of the magnitudes of the gradients among the five DIMD modes can be calculated. When the first three DIMD modes are M1, M2, and M3, |M1 - M2|, |M1 - M3|, and |M2 - M3| can be calculated respectively. When the maximum value among the three absolute values is less than or equal to 3 and M1 is a mode of a horizontal component, a predetermined plane mode can be determined as a horizontal plane mode, and the predicted samples of the current block can be derived as in Equation 15 or 16 above.

[0218] This method can improve the prediction accuracy by more strictly dividing the directional features that configure the predicted samples of the current block and assigning weights to the directional features only when all conditions are met.

[0219] Figure 5 A schematic configuration of an intra-prediction unit 331 that performs an intra-prediction method according to the present disclosure is shown.

[0220] Refer to Figure 5 , the intra-prediction unit 331 may include a mode derivation unit 500, a predicted sample derivation unit 510, and a predicted sample modification unit 520.

[0221] The mode derivation unit 500 may derive an intra-prediction mode of the current block.

[0222] The intra-prediction mode of the current block may be derived based on decoder-side intra-mode derivation (DIMD), which is the same as described by referring to Figure 4 above.

[0223] The prediction sample exporter 510 may export the prediction samples of the current block based on the intra prediction mode of the current block.

[0224] The prediction sample exporter 510 may export the prediction samples of the current block by performing intra prediction according to one or more intra prediction modes derived based on DIMD (i.e., DIMD modes). It is the same as that described in the reference Figure 4 and is omitted here.

[0225] The prediction sample modifier 520 may modify the prediction samples of the current block based on a predetermined plane mode. The prediction sample modifier 520 may perform a weighted sum between the prediction samples derived based on one or more DIMD modes and the prediction samples derived based on the predetermined plane mode. Here, the predetermined plane mode may be any one of a non-directional plane mode, a horizontal plane mode, or a vertical plane mode. The method for determining the predetermined plane mode is the same as that described by reference Figure 4 and is omitted here for detailed description.

[0226] In addition, the prediction sample modifier 520 may adaptively perform modification of the prediction samples based on at least one of whether the neighboring region of the current block is available or a predetermined flag.

[0227] Figure 6 is according to an embodiment of the present disclosure and shows an intra prediction method performed by an encoding device.

[0228] Reference Figure 6 may be used to derive the intra prediction mode S600 of the current block based on decoder-side intra mode derivation (DIMD).

[0229] Specifically, gradients may be calculated based on at least two samples belonging to the neighboring region of the current block. One or more intra prediction modes may be derived based on at least one of the calculated gradients or the magnitude of the gradients. The top N intra prediction modes with the largest gradient magnitude may be selected, and they may be set as the intra prediction mode of the current block. Here, N may be an integer of 1, 2, 3, or more. It is the same as that described by reference Figure 4 and is omitted here for detailed description.

[0230] Reference Figure 6 may be used to derive the prediction samples of the current block based on the intra prediction mode of the current block S610.

[0231] One or more intra prediction modes may be derived based on the DIMD for the current block, and intra prediction may be performed based on the corresponding DIMD modes to export the prediction samples of the current block.

[0232] Reference Figure 6 may be used to modify the prediction samples of the current block based on a predetermined plane mode S620.

[0233] The prediction sample derived based on one or more DIMD patterns described above can be modified based on a prediction sample according to a predetermined plane pattern, and the modified prediction sample can be set as the prediction sample of the current block.

[0234] Specifically, the prediction sample of the current block can be derived based on the weighted sum between the prediction sample derived based on one or more DIMD patterns described above and the prediction sample derived based on a predetermined plane pattern. Here, the predetermined plane pattern can be any one of a non-directional plane pattern, a horizontal plane pattern, or a vertical plane pattern. The method for determining the predetermined plane pattern is the same as that by referring to Figure 4 described above, and the detailed description is omitted here.

[0235] In addition, the modification of the prediction sample can be adaptively performed based on at least one of whether the neighboring region of the current block is available or a predetermined flag. Alternatively, it can be determined whether to perform the modification of the prediction sample, and the modification of the prediction sample can be adaptively performed based on the corresponding determination. In this case, a flag indicating whether to modify the prediction sample can be encoded in the bitstream.

[0236] Figure 7 FIG. shows a schematic configuration of an intra-predictor 222 that performs an intra-prediction method according to the present disclosure.

[0237] Referring to Figure 7 , the intra-predictor 222 can include a mode exporter 700, a prediction sample exporter 710, and a prediction sample modifier 720.

[0238] The mode exporter 700 can export the intra-prediction mode of the current block.

[0239] The intra-prediction mode of the current block can be derived based on decoder-side intra-mode derivation (DIMD), which is the same as that by referring to Figure 4 described above.

[0240] The prediction sample exporter 710 can export the prediction sample of the current block based on the intra-prediction mode of the current block.

[0241] The prediction sample exporter 710 can export the prediction sample of the current block by performing intra-prediction according to one or more intra-prediction modes (i.e., DIMD modes) derived based on DIMD. It is the same as that by referring to Figure 4 described above.

[0242] The prediction sample modifier 720 may modify the prediction samples of the current block based on a predetermined plane pattern. The prediction sample modifier 520 may perform a weighted sum between the prediction samples derived based on one or more DIMD patterns and the prediction samples derived based on a predetermined plane pattern. Here, the predetermined plane pattern may be any one of a non-directional plane pattern, a horizontal plane pattern, or a vertical plane pattern. The method for determining the predetermined plane pattern is the same as that described by referring to Figure 4 and a detailed description thereof is omitted herein.

[0243] In addition, the prediction sample modifier 520 may adaptively perform modification of the prediction samples based on at least one of whether a neighboring region of the current block is available or a predetermined flag. Additionally, the prediction sample modifier 520 may determine whether to modify the prediction samples of the current block and adaptively perform modification of the prediction samples based on the corresponding determination. In this case, the entropy encoder 240 may encode a flag indicating whether to modify the prediction samples of the current block.

[0244] In the above embodiments, the method is described as a series of steps or blocks based on a flowchart, but the corresponding embodiments are not limited to the order of the steps, and some steps may occur simultaneously or in a different order from other steps as described above. Additionally, those skilled in the art can understand that the steps shown in the flowchart are not exclusive, and other steps may be included or one or more steps in the flowchart may be deleted without affecting the scope of the embodiments of the present disclosure.

[0245] The above method according to an embodiment of the present disclosure can be implemented in the form of software, and the encoding device and / or decoding device according to the present disclosure may be included in a device that performs image processing, such as a TV, a computer, a smartphone, a set-top box, a display device, etc.

[0246] In the present disclosure, when an embodiment is implemented as software, the above method may be implemented as a module (process, function, etc.) that performs the above functions. The module may be stored in a memory and may be executed by a processor. The memory may be located inside or outside the processor and may be connected to the processor by various well-known means. The processor may include an application-specific integrated circuit (ASIC), another chipset, logic circuits, and / or data processing devices. The memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium, and / or other storage devices. In other words, the embodiments described herein may be executed by being implemented on a processor, a microprocessor, a controller, or a chip. For example, each functional unit shown in each drawing may be executed by being implemented on a computer, a processor, a microprocessor, a controller, or a chip. In this case, the information for implementation (e.g., information about instructions) or algorithms may be stored in a digital storage medium.

[0247] In addition, the decoding device and encoding device applying the embodiments of the present disclosure may be included in multimedia broadcast transmission and reception devices, mobile communication terminals, home theater video devices, digital cinema video devices, surveillance cameras, video session devices, real-time communication devices such as video communication, mobile streaming devices, storage media, cameras, devices for providing video-on-demand (VoD) services, over-the-top (OTT) devices, devices for providing Internet streaming services, three-dimensional (3D) video devices, virtual reality (VR) devices, augmented reality (AR) devices, videophone video devices, transportation tool terminals (e.g., vehicle (including autonomous vehicle) terminals, aircraft terminals, ship terminals, etc.), and medical video devices, etc., and may be used to process video signals or data signals. For example, over-the-top (OTT) devices may include game consoles, Blu-ray players, Internet-connected TVs, home theater systems, smartphones, tablets, digital video recorders (DVRs), and so on.

[0248] In addition, the processing method applying the embodiments of the present disclosure can be generated in the form of a program executable by a computer and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the embodiments of the present disclosure can also be stored in the computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices for storing computer-readable data. The computer-readable recording medium may include, for example, Blu-ray Discs (BDs), universal serial buses (USBs), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, magnetic tapes, floppy disks, and optical media storage devices. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (e.g., transmitted via the Internet). In addition, the bitstream generated by the encoding method can be stored in the computer-readable recording medium or can be transmitted via a wired or wireless communication network.

[0249] In addition, the embodiments of the present disclosure can be implemented by a computer program product through program code, and the program code can be executed on a computer by the embodiments of the present disclosure. The program code can be stored on a computer-readable carrier.

[0250] Figure 8 An example of a content streaming system to which the embodiments of the present disclosure can be applied is shown.

[0251] Reference Figure 8 , the content streaming system applying the embodiments of the present disclosure may mainly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0252] The encoding server generates a bitstream by compressing the content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data and sends it to the streaming server. As another example, when a multimedia input device such as a smartphone, camera, or camcorder directly generates a bitstream, the encoding server can be omitted.

[0253] The bitstream can be generated by applying the encoding method or the bitstream generation method of the embodiments of the present disclosure, and the streaming server can temporarily store the bitstream during the process of sending or receiving the bitstream.

[0254] The streaming server sends the multimedia data to the user device via the web server based on the user's request, and the web server serves as a medium for notifying the user of what services are available. When the user requests a required service from the web server, the web server forwards it to the streaming server, and the streaming server sends the multimedia data to the user. In this case, the content streaming system can include a separate control server, and in this case, the control server controls the commands / responses between each device in the content streaming system.

[0255] The streaming server can receive the content from the media storage and / or the encoding server. For example, when receiving the content from the encoding server, the content can be received in real time. In this case, in order to provide a smooth streaming media service, the streaming server can store the bitstream for a certain period of time.

[0256] Examples of user devices can include mobile phones, smartphones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, tablet PCs, tablet computers, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head-mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc.

[0257] Each server in the content streaming system can be operated as a distributed server, and in this case, the data received from each server can be distributed and processed.

[0258] The claims set forth herein can be combined in various ways. For example, the technical features of the method claims of the present disclosure can be combined and implemented as a device, and the technical features of the device claims of the present disclosure can be combined and implemented as a method. Additionally, the technical features of the method claims of the present disclosure and the technical features of the device claims of the present disclosure can be combined and implemented as a device, and the technical features of the method claims of the present disclosure and the technical features of the device claims of the present disclosure can be combined and implemented as a method.

Claims

1. An image decoding method, comprising: deriving an intra prediction mode of a current block, wherein the intra prediction mode includes a first DIMD mode derived by decoder-side intra mode derivation (DIMD), and the DIMD is a method of deriving one or more intra prediction modes based on gradients between samples belonging to a neighboring region of the current block; deriving a first predicted sample of the current block based on the intra prediction mode; deriving a second predicted sample of the current block based on a predetermined plane mode, wherein the predetermined plane mode is any one of a non-directional plane mode, a horizontal plane mode, or a vertical plane mode; and deriving a predicted sample of the current block based on a weighted sum between the first predicted sample and the second predicted sample.

2. The method according to claim 1, wherein, the neighboring region includes a plurality of sub-regions, and wherein the plurality of sub-regions includes at least two of a left neighboring region, an upper neighboring region, or an upper-left neighboring region.

3. The method according to claim 2, wherein, calculating magnitudes of gradients for the intra prediction mode for the plurality of sub-regions respectively.

4. The method according to claim 3, wherein, determining the predetermined plane mode based on the position of the sub-region to which the magnitude of the maximum gradient among the magnitudes of the gradients for the plurality of sub-regions belongs.

5. The method according to claim 3, wherein, determining the predetermined plane mode based on a comparison between any one of the magnitudes of the gradients for the plurality of sub-regions and another one of the magnitudes of the gradients for the plurality of sub-regions.

6. The method according to claim 5, wherein, determining the predetermined plane mode based on a comparison between the magnitude of the gradient for the DIMD mode and the magnitude of the gradient for a second DIMD mode derived based on the DIMD.

7. The method according to claim 1, wherein, determining the predetermined plane mode based on the directionality of the first DIMD mode.

8. The method according to claim 7, wherein, determining the predetermined plane mode based on the difference between the first DIMD mode and a second DIMD mode derived based on the DIMD.

9. The method according to claim 7, wherein, predefined intra prediction modes are divided into a plurality of groups, and wherein determining the directionality of the first DIMD mode based on the group to which the first DIMD mode belongs among the plurality of groups.

10. An image encoding method, comprising: deriving an intra prediction mode of a current block, wherein the intra prediction mode includes a first DIMD mode derived by decoder-side intra mode derivation (DIMD), and the DIMD is a method of deriving one or more intra prediction modes based on gradients between samples belonging to a neighboring region of the current block; deriving a first predicted sample of the current block based on the intra prediction mode; deriving a second predicted sample of the current block based on a predetermined plane mode, wherein the predetermined plane mode is any one of a non-directional plane mode, a horizontal plane mode, or a vertical plane mode; and Derive a prediction sample of the current block based on a weighted sum between the first prediction sample and the second prediction sample.

11. A method for transmitting data for image information, comprising: obtaining a bitstream for the image information, wherein the bitstream is generated by: deriving an intra prediction mode of a current block, deriving a first prediction sample of the current block based on the intra prediction mode, deriving a second prediction sample of the current block based on a predetermined plane mode, deriving a prediction sample of the current block based on a weighted sum between the first prediction sample and the second prediction sample, and encoding the current block based on the prediction sample; and transmitting data including the bitstream, wherein the intra prediction mode includes a first DIMD mode derived by decoder-side intra mode derivation (DIMD), and the DIMD is a method of deriving one or more intra prediction modes based on gradients between samples belonging to a neighboring region of the current block, and wherein the predetermined plane mode is any one of a non-directional plane mode, a horizontal plane mode, or a vertical plane mode.