Image encoding / decoding method and device, and recording medium storing bit stream
By analyzing the statistical characteristics of the transformation coefficients in the current block, adaptively determine the number of transformation type candidates and selecting the appropriate transformation type for inverse transformation, the problem of inefficient image encoding in the prior art is solved, and more efficient images are achieved coding.
Patent Information
- Application Number
- CN202380050155.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-07-02
- Filing Date
- 2023-07-03
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to effectively determine the range of available transformation types candidates for the current block, resulting in inefficient image encoding.
By analyzing the statistical characteristics of the transform coefficients in the current block, the number of transform type candidates is adaptively determined, and an appropriate transform type is selected based on this to perform inverse transformation.
The efficiency of image encoding is improved, the complexity of transformation encoding is reduced, and the efficiency of image encoding is improved.
Smart Images

Figure CN119452646A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to an image encoding / decoding method and apparatus and a recording medium storing a bit stream. Background Art
[0002] Recently, demands for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images have been increasing in various application fields, and thus, efficient image compression technology is being discussed.
[0003] There are various technologies, such as inter-frame prediction technology that uses video compression technology to predict pixel values included in the current picture from pictures before or after the current picture, intra-frame prediction technology that predicts pixel values included in the current picture by using pixel information in the current picture, entropy coding technology that assigns short symbols to values with high occurrence frequency and assigns long symbols to values with low occurrence frequency, etc. These image compression technologies can be used to effectively compress image data and send or store it. Summary of the invention
[0004] Technical issues
[0005] The present disclosure provides a method and apparatus for determining a range of transform type candidates available for a current block.
[0006] The present disclosure provides a method and apparatus for adaptively applying MTS to a current block.
[0007] Technical Solution
[0008] According to the image decoding method and apparatus of the present disclosure, a transform type for inverse transform of a current block can be determined from one or more MTS candidates available for the current block, and an inverse transform is performed on the transform coefficient of the current block based on the determined transform type to obtain a residual sample of the current block. Here, the number of the one or more MTS candidates available for the current block can be determined based on at least one of the sum of the transform coefficients in the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of one or more non-zero coefficients in the current block.
[0009] In the image decoding method and apparatus according to the present disclosure, the number of one or more MTS candidates available for the current block may be determined based on a comparison between the sum of transform coefficients belonging to the current block and a predetermined threshold.
[0010] In the image decoding method and device according to the present disclosure, when the sum of the transform coefficients belonging to the current block is less than or equal to a first threshold, the number of one or more MTS candidates can be determined as N1, when the sum of the transform coefficients belonging to the current block is greater than the first threshold and less than or equal to a second threshold, the number of one or more MTS candidates can be determined as N2, and when the sum of the transform coefficients belonging to the current block is greater than the second threshold, the number of one or more MTS candidates can be determined as N3.
[0011] In the image decoding method and device according to the present disclosure, the predetermined threshold can be determined based on a predetermined constant factor, and the predetermined constant factor can be determined based on a slice type, a quantization parameter of a current block, a size of a current block, a shape of a current block, a ratio of a width to a height of a current block, or at least one of information notified by a signal through a bitstream.
[0012] In the image decoding method and apparatus according to the present disclosure, the number of one or more MTS candidates available for the current block may be determined based on at least one of the position of the last significant coefficient in the current block, a scaling factor, a size of the current block, or a shape of the current block.
[0013] In the image decoding method and apparatus according to the present disclosure, the number of one or more MTS candidates available for the current block may be determined based on a comparison between the number of non-zero coefficients among the transform coefficients of the current block and a third threshold.
[0014] In the image decoding method and apparatus according to the present disclosure, when the number of one or more MTS candidates available for a current block is at least two, a transform type of the current block may be determined based on an MTS index signaled through a bitstream.
[0015] In the image decoding method and device according to the present disclosure, the maximum value (cMax) of the binarization of the MTS index can be determined based on at least one of the sum of the transform coefficients belonging to the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients among the transform coefficients of the current block.
[0016] According to the image encoding method and apparatus of the present disclosure, a transform type of a current block may be determined, and a transform may be performed on residual samples of the current block based on the transform type of the current block to derive a transform coefficient of the current block.
[0017] In the image encoding method and apparatus according to the present disclosure, the transform type of the current block may be selected from one or more MTS candidates belonging to any one of a plurality of predefined candidate groups.
[0018] In the image encoding method and device according to the present disclosure, based on selecting a candidate group of transform types for a current block, at least one of the sum of transform coefficients of the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients in the current block may need to belong to a predetermined range.
[0019] A computer-readable digital storage medium storing instructions or a program for causing an encoding device according to the present disclosure to execute an image encoding method is provided.
[0020] A computer-readable digital storage medium storing video / image information generated according to the image encoding method according to the present disclosure is provided.
[0021] A method and apparatus for transmitting video / image information generated according to an image encoding method according to the present disclosure are provided.
[0022] Beneficial Effects
[0023] According to the present disclosure, by considering the statistical characteristics of the transform coefficients in the current block, the range of available transform type candidates can be adaptively controlled, and the complexity of transform coding can be reduced.
[0024] In addition, according to the present disclosure, by adaptively applying the MTS based on the statistical characteristics of the transform coefficients in the current block, the image encoding efficiency can be improved and the complexity of transform coding can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A video / image encoding system according to the present disclosure is shown.
[0026] Figure 2 A schematic block diagram of an encoding device to which an embodiment of the present disclosure is applied and which performs encoding of a video / image signal is shown.
[0027] Figure 3 A schematic block diagram of a decoding device to which an embodiment of the present disclosure is applied and which performs decoding of a video / image signal is shown.
[0028] Figure 4 An inverse transform method performed by a decoding device according to an embodiment of the present disclosure is shown.
[0029] Figure 5 A schematic configuration of an inverse transformer 322 that performs the inverse transformation method according to the present disclosure is shown.
[0030] Figure 6 An inverse transform method performed by an encoding device according to an embodiment of the present disclosure is shown.
[0031] Figure 7 A schematic configuration of a transformer 232 that performs a transformation method according to the present disclosure is shown.
[0032] Figure 8 An example of a content streaming system to which embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0033] Since the present disclosure can be variously changed and has multiple embodiments, specific embodiments will be shown in the drawings and described in detail in the specific embodiments. However, it is not intended to limit the present disclosure to specific embodiments, but it should be understood to include all changes, equivalents and substitutions included in the spirit and technical scope of the present disclosure. While describing each figure, similar reference numerals are used for similar components.
[0034] Terms such as first, second, etc. can be used to describe various components, but components should not be limited by these terms. Terms are only used to distinguish one component from other components. For example, without departing from the scope of the present disclosure, a first component can be referred to as a second component, and similarly, a second component can also be referred to as a first component. Terms include any one or more combinations of related items in a plurality of related items.
[0035] 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 another component, but another component may exist in between. 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 another component does not exist in between.
[0036] 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 states otherwise, singular expressions include plural expressions. In this application, it should be understood that terms such as "including" or "having" are intended to specify the presence of features, quantities, steps, operations, components, parts or combinations thereof described in this specification, but do not preclude the presence or addition of one or more other features, quantities, steps, operations, components, parts or combinations thereof.
[0037] The present disclosure relates to video / image coding. For example, the methods / implementations disclosed herein may be applied to methods disclosed in the Versatile Video Coding (VVC) standard. In addition, the methods / implementations disclosed herein may be applied to methods disclosed in video coding codecs using multiple transforms, such as the Basic Video Coding (EVC) standard, the AOMedia Video1 (AV1) standard, the 2nd generation Audio Video Coding standard (AVS2), or the next generation video / image coding standard (e.g., H.267 or H.268, etc.).
[0038] This specification proposes various embodiments of video / image encoding, and unless otherwise specified, the embodiments may be performed in combination with each other.
[0039] Herein, video may 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 / patch is a unit that forms a part of a picture in encoding. A slice / patch may include at least one coding tree unit (CTU). A picture may be composed of at least one slice / patch. A patch is a rectangular area consisting of a plurality of CTUs within a specific patch column and a specific patch row of a picture. A patch column is a rectangular area of a CTU whose height is the same as the height of the picture and whose width is specified by the syntax requirements of the picture parameter set. A patch row is a rectangular area of a CTU whose height is specified by the picture parameter set and whose width is the same as the width of the picture. The CTUs within a patch may be arranged continuously according to a CTU raster scan, and the patches within a picture may be arranged continuously according to a raster scan of the patch. A slice may include an integer number of complete patches of a picture that may be exclusively included in a single NAL unit or an integer number of continuous complete CTU rows within a patch. In addition, a picture may be divided into at least two sub-pictures. A sub-picture may be a rectangular area of at least one slice within a picture.
[0040] A pixel or a picture element (pel) may represent the smallest unit constituting a picture (or image). In addition, a "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component.
[0041] A unit may represent a basic unit of image processing. A unit may include at least one of a specific area of a picture and information related to the corresponding area. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. In some cases, a unit may be used interchangeably with terms such as a block or an area. In general, an M×N block may include a set (or array) of transform coefficients or samples (or sample arrays) consisting of M columns and N rows.
[0042] Herein, "A or B" may mean "only A", "only B", or "both A and B". In other words, herein, "A or B" may be interpreted as "A and / or B". For example, herein, "A, B or C" may mean "only A", "only B", "only C", or "any combination of A, B, and C".
[0043] As used herein, a slash ( / ) or a comma may mean "and / or". For example, "A / B" may mean "A and / or B". Thus, "A / B" may mean "only A", "only B", or "both A and B". For example, "A, B, C" may mean "A, B, or C".
[0044] Herein, "at least one of A and B" may mean "only A", "only B", or "both A and B". In addition, herein, the expression "at least one of A or B" or "at least one of A and / or B" may be interpreted in the same manner as "at least one of A and B".
[0045] In addition, herein, "at least one of A, B, and C" may mean "only A", "only B", "only C", or "any combination of A, B, and C". In addition, "at least one of A, B, or C" or "at least one of A, B and / or C" may mean "at least one of A, B, and C".
[0046] In addition, the brackets used in this document may indicate "for example". Specifically, when the indication is "prediction (intra-frame prediction)", "intra-frame prediction" may be proposed as an example of "prediction". In other words, "prediction" in this document is not limited to "intra-frame prediction", and "intra-frame prediction" may be proposed as an example of "prediction". In addition, even when the indication is "prediction (i.e., intra-frame prediction)", "intra-frame prediction" may be proposed as an example of "prediction".
[0047] In this document, technical features described separately in one figure may be implemented separately or simultaneously.
[0048] Figure 1 A video / image encoding system according to the present disclosure is shown.
[0049] Reference Figure 1 , a video / image encoding system may include a first device (source device) and a second device (receiving device).
[0050] The source device may send coded 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 transmitting 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. The transmitter may be included in the encoding device. The 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.
[0051] The video source may acquire the video / image by a process of capturing, synthesizing or generating the video / image. The video source may include a device for capturing the video / image and a device for generating the video / image. The device for capturing the video / image may include at least one camera, a video / image archive including previously captured videos / images, etc. The device for generating the video / image may include a computer, a tablet computer, a smart phone, etc., and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc., and in this case, the process of capturing the video / image may be replaced by a process of generating the relevant data.
[0052] The encoding device can encode the input video / image. The encoding device can perform a series of processes such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bit stream.
[0053] The sending unit may send the encoded video / image information or data output in the form of a bit stream to the receiving unit of the receiving device in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The sending unit may include an element for generating a media file in a predetermined file format, and may include an element for sending through a broadcast / communication network. The receiving unit may receive / extract a bit stream and send it to a decoding device.
[0054] The decoding device may decode the video / image by performing a series of processes corresponding to the operations of the encoding device, such as dequantization, inverse transformation, prediction, etc.
[0055] The renderer may render the decoded video / image. The rendered video / image may be displayed by a display unit.
[0056] Figure 2 A rough block diagram of an encoding device to which embodiments of the present disclosure can be applied and to perform encoding of a video / image signal is shown.
[0057] Reference Figure 2, the encoding device 200 may be composed of an image segmenter 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, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may also include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. According to an embodiment, the above-mentioned image segmenter 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250, and the filter 260 may be configured by at least one hardware component (e.g., an encoder chipset or processor). In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include a memory 270 as an internal / external component.
[0058] The image divider 210 may divide the input image (or picture or 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 divided from a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QTBTTT) structure.
[0059] For example, a coding unit can be divided into multiple coding units with a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. In this case, for example, the quadtree structure can be applied first, and then the binary tree structure and / or the ternary tree structure can be applied. Alternatively, the binary tree structure can be applied before the quadtree structure. The encoding process according to the present specification can be performed based on the final coding unit that is no longer divided. In this case, based on the coding efficiency according to the image characteristics, the maximum coding unit can be directly used as the final coding unit, or if necessary, the coding unit can be recursively divided into coding units with a deeper depth, and the coding unit with the optimal size can be used as the final coding unit. Here, the encoding process may include processes such as prediction, transformation, and reconstruction described later.
[0060] As another example, the processing unit may also include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be divided or split from the above-mentioned final coding unit, respectively. The prediction unit may be a unit for sample prediction, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.
[0061] In some cases, a unit may be used interchangeably with terms such as a block or region. In general, an M×N block may represent a set of transform coefficients or samples consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component, or only a pixel / pixel value of a chrominance component. A sample may be used as a term for forming a picture (or image) corresponding to a pixel or a picture element.
[0062] The encoding device 200 may subtract the prediction signal (prediction block, prediction sample array) output from the inter predictor 221 or the intra predictor 222 from the 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 in the encoding device 200 that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) may be referred to as a subtractor 231.
[0063] The predictor 220 may perform prediction on a block to be processed (hereinafter referred to as a current block) and generate a prediction block including a prediction sample of the current block. The predictor 220 may determine whether to apply intra prediction or inter prediction in units of a current block or CU. The predictor 220 may generate various information about the prediction (e.g., 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.
[0064] The intra-frame predictor 222 can predict the current block by referring to the samples in the current picture. Depending on the prediction mode, the referenced sample can be located near the current block, or can be positioned at a specific distance away from the current block. In intra-frame prediction, the prediction mode may include at least one non-directional mode and multiple directional modes. The non-directional mode may include at least one of a DC mode or a plane 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 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 the neighboring blocks.
[0065] The inter-frame predictor 221 may derive a prediction block of 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 sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, the neighboring blocks may 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 may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a co-located CU (colCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter-frame predictor 221 may configure a motion information candidate list based on the 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 prediction may be performed based on various prediction modes, for example, for skip mode and merge mode, the inter predictor 221 may use the motion information of the neighboring block as the motion information of the current block. For skip mode, unlike merge mode, a residual signal may not be sent. For motion vector prediction (MVP) mode, the motion vector of the neighboring block is used as a motion vector predictor, and the motion vector difference is signaled to indicate the motion vector of the current block.
[0066] The predictor 220 can generate a prediction signal based on various prediction methods described later. For example, the predictor can not only apply intra prediction or inter prediction to predict a block, but also apply intra prediction and inter prediction at the same time. This can be called an intra-frame combined prediction (CIIP) mode. In addition, the predictor can be based on an intra-frame block copy (IBC) prediction mode, or can predict blocks based on a palette mode. The IBC prediction mode or the palette mode can be used for content image / video encoding of games, such as screen content coding (SCC), etc. IBC basically performs prediction within the current picture, but it can be performed similarly to inter prediction because it derives a reference block within the current picture. In other words, IBC can use at least one of the inter prediction techniques described herein. The palette mode can be regarded as an example of intra coding or intra prediction. When the palette mode is applied, the sample value 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 reconstruction signal or a residual signal.
[0067] 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 nonlinear transform (CNT). Here, GBT represents a transform obtained from a graph when relationship information between pixels is represented as a graph. CNT represents a transform obtained based on generating a prediction signal using all previously reconstructed pixels. In addition, 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.
[0068] 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 scanning order, and may generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.
[0069] 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 (e.g., values of syntax elements, etc.) required for video / image reconstruction other than the quantized transform coefficients together or separately.
[0070] The coding information (e.g., coded video / image information) may be transmitted or stored in units of network abstraction layer (NAL) units in the form of a bitstream. The video / image information may also include information about various parameter sets such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. Herein, information and / or syntax elements sent / signaled to a decoding device from an encoding device may be included in the video / image information. The video / image information may be encoded and included in a bitstream through the above-mentioned encoding process. The bitstream may be transmitted through a network, or may be stored in a digital storage medium. Here, the network may include a broadcast network and / or a communication network, etc., and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting a signal output from the entropy encoder 240 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding device 200, or the transmitting unit may also be included in the entropy encoder 240.
[0071] The quantized transform coefficients output from the quantizer 233 can be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) can be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients via a dequantizer 234 and an inverse transformer 235. The adder 250 can add the reconstructed residual signal to the prediction signal output from the inter-frame predictor 221 or the intra-frame 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 (similar to when the skip mode is applied), the prediction block can be used as a 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-frame prediction of the next block to be processed in the current picture, and can also be used for inter-frame prediction of the next picture by filtering as described later. In addition, in the picture coding and / or reconstruction process, luminance mapping and chrominance scaling (LMCS) can be applied.
[0072] 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 the modified reconstructed picture can be stored in the memory 270 (specifically, the DPB of the memory 270). Various filtering methods may include deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc. The filter 260 can generate various information about filtering and send it to the entropy encoder 240. The information about filtering can be encoded in the entropy encoder 240 and output in the form of a bitstream.
[0073] The modified reconstructed picture sent to the memory 270 may be used as a reference picture in the inter-frame predictor 221. When inter-frame prediction is applied therethrough, the encoding device can avoid prediction mismatch in the encoding device 200 and the decoding device, and can also improve encoding efficiency.
[0074] The DPB of the memory 270 may store the modified reconstructed picture to be used as a reference picture in the inter-frame predictor 221. The memory 270 may store the motion information of the block from which the motion information in the current picture is derived (or encoded) and / or the motion information of the block in the previously reconstructed picture. The stored motion information may be sent to the inter-frame predictor 221 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 270 may store the reconstructed samples of the reconstructed block in the current picture and send them to the intra-frame predictor 222.
[0075] Figure 3 A rough block diagram of a decoding device to which embodiments of the present disclosure can be applied and which performs decoding of a video / image signal is shown.
[0076] Reference Figure 3 , the decoding device 300 may 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 may include an inter-frame predictor 332 and an intra-frame predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322.
[0077] According to an embodiment, the above entropy decoder 310, the residual processor 320, the predictor 330, the adder 340 and the filter 350 may be configured by one hardware component (e.g., a decoder chipset or a processor). In addition, the memory 360 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include the memory 360 as an internal / external component.
[0078] When a bit stream including video / image information is input, the decoding device 300 may respond to the Figure 2 The processing of video / image information in the encoding device reconstructs the image. For example, the decoding device 300 can derive the unit / block based on the block segmentation related information obtained from the bit stream. The decoding device 300 can perform decoding using the processing unit applied in the encoding device. Therefore, the processing unit of decoding can be a coding unit, and the coding unit can be divided from the coding tree unit or the larger coding unit according to the quadtree structure, the binary tree structure and / or the ternary tree structure. At least one transform unit can be derived from the coding unit. And, the reconstructed image signal decoded and output by the decoding device 300 can be played by a playback device.
[0079] The decoding device 300 may receive the bit stream from Figure 2The signal output by the encoding device of the video image processing apparatus 310 can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive the information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information can also include information about various parameter sets such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information can also include general constraint information. The decoding device can also decode the picture based on the information about the parameter set and / or the general constraint information. The information and / or syntax elements signaled / received described later in this article can be decoded by a decoding process and obtained from the bitstream. For example, the entropy decoder 310 can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, CABAC, etc., and output the values of the syntax elements required for image reconstruction and the quantized values of the transform coefficients of the residual. In more detail, the CABAC entropy decoding method can receive bins corresponding to various syntax elements from a bitstream, use the syntax element information to be decoded, the decoded information of the neighboring blocks and the blocks to be decoded, or the information of the symbol / bin decoded in the previous step to determine the context model, perform arithmetic decoding of the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate symbols corresponding to the values of the various syntax elements. In this case, after determining the context model, the CABAC entropy decoding method can update the context model by using the information about the decoded symbol / bin for the context model of the next symbol / bin. Among the information decoded in the entropy decoder 310, the information about the prediction is provided to the predictor (inter-frame predictor 332 and intra-frame predictor 331), and the residual value (ie, quantized transform coefficients and 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). In addition, the information about filtering among the information decoded in the entropy decoder 310 can be provided to the filter 350. In addition, a receiving unit (not shown) that receives a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300 , or the receiving unit may be a component of the entropy decoder 310 .
[0080] In addition, the decoding device according to the present 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 a dequantizer 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.
[0081] The dequantizer 321 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 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 scanning order performed in the encoding device. The dequantizer 321 may perform dequantization on the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.
[0082] The inverse transformer 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0083] The predictor 320 may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The predictor 320 may determine whether to apply intra prediction or inter prediction to the current block based on the information on prediction output from the entropy decoder 310 and determine a specific intra / inter prediction mode.
[0084] The predictor 320 can generate a prediction signal based on various prediction methods described later. For example, the predictor 320 can not only apply intra prediction or inter prediction to predict a block, but also apply intra prediction and inter prediction at the same time. This can be called an intra-frame combined prediction (CIIP) mode. In addition, the predictor can be based on an intra-frame block copy (IBC) prediction mode, or can predict blocks based on a palette mode. The IBC prediction mode or the palette mode can be used for content image / video encoding of games, such as screen content coding (SCC), etc. IBC basically performs prediction within the current picture, but it can be performed similarly to inter prediction because it derives a reference block within the current picture. In other words, IBC can use at least one of the inter prediction techniques described herein. The palette mode can be regarded as an example of intra coding or intra prediction. When the palette mode is applied, information about the palette table and the palette index can be included in the video / image information and notified with a signal.
[0085] The intra-frame predictor 331 can predict the current block by referencing samples within the current picture. Depending on the prediction mode, the referenced samples can be located near the current block, or can be located a specific distance away from the current block. In intra-frame prediction, the prediction mode can include at least one non-directional mode and multiple directional modes. The intra-frame predictor 331 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.
[0086] The inter-frame predictor 332 may derive a prediction block of 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 sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter-frame predictor 332 may configure a motion information candidate list based on neighboring blocks, and derive a motion vector and / or a reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating the inter-frame prediction mode of the current block.
[0087] The adder 340 may add the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including the inter-frame predictor 332 and / or the intra-frame 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 (similar to when the skip mode is applied), the prediction block can be used as a reconstructed block.
[0088] The adder 340 may be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra-frame prediction of the next block to be processed in the current picture, may be output by filtering as described later, or may be used for inter-frame prediction of the next picture. In addition, luminance mapping and chrominance scaling (LMCS) may be applied in the picture decoding process.
[0089] 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, the DPB of the memory 360). Various filtering methods may include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.
[0090] 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 block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the block in the previously reconstructed picture. The stored motion information can be sent to the inter-frame predictor 332 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 360 can store the reconstructed samples of the reconstructed block in the current picture and send them to the intra-frame predictor 331.
[0091] Herein, the embodiments described in the filter 260, the inter-frame predictor 221, and the intra-frame predictor 222 of the encoding device 200 may also be applied equivalently or correspondingly to the filter 350, the inter-frame predictor 332, and the intra-frame predictor 331 of the decoding device 300, respectively.
[0092] Figure 4 An inverse transform method performed by a decoding device according to an embodiment of the present disclosure is shown.
[0093] The present disclosure relates to an inverse transform method based on multiple transform selection (MTS). MTS may refer to a method for determining a transform type for horizontal / vertical transform by selecting any one of a plurality of transform type candidates. Hereinafter, a plurality of transform type candidates for MTS are referred to as MTS candidates.
[0094] Each MTS candidate may include a transform type for horizontal transform and a transform type for vertical transform. Each MTS candidate may be configured by a combination of two transform types predefined equally for the encoding device and the decoding device. Here, the predefined transform type may include at least one of one or more DCT-based first transform types or one or more DST-based second transform types. As an example, the first transform type candidate may include at least one of DCT-2, DCT-3, DCT-4, DCT-5, or DCT-8. The second transform type candidate may include at least one of DST-7, DST-1, or DST-4.
[0095] Alternatively, the MTS candidates may be determined by being divided into MTS candidates for horizontal transformation and MTS candidates for vertical transformation, respectively. In this case, each MTS candidate may include at least two transformation types predefined equally for the encoding device and the decoding device. The MTS candidate for horizontal transformation may be equally used as the MTS candidate for vertical transformation.
[0096] Reference Figure 4 , a transform type of the current block may be determined from one or more MTS candidates available for the current block ( S400 ).
[0097] The transform type for horizontal and / or vertical transform of the current block may be determined based on any one MTS candidate selected from one or more MTS candidates, respectively.
[0098] The number of one or more MTS candidates available for the current block may be determined based on at least one of the sum of the transform coefficients in the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of one or more non-zero coefficients. The size of one or more transform coefficients in the current block may refer to the size of the transform coefficient greater than or equal to a specific threshold size. The size of one or more transform coefficients in the current block may refer to the size of the transform coefficient belonging to a specific position in the current block. Here, the specific position may include the upper left position in the current block and / or at least one sample position adjacent to the upper left position.
[0099] When the number of MTS candidates available for the current block is 1, it may mean that MTS is not applied to the current block. In this case, the corresponding MTS candidates may include DCT-2 and DCT-2 as transform types for horizontal transform and vertical transform, respectively. On the other hand, when the number of MTS candidates available for the current block is 2 or more, it may mean that MTS is applied to the current block. Therefore, whether MTS is applied to the current block may be determined based on a method for determining the number of MTS candidates available for the current block to be described later. In this case, the step of determining the transform type of the current block may include a step of determining whether MTS is applied to the current block.
[0100] Hereinafter, a method for determining the number of one or more MTS candidates available for a current block is described in detail.
[0101] Method 1: Method based on the sum of transform coefficients
[0102] The number of one or more MTS candidates available for the current block may be determined based on whether the sum of transform coefficients belonging to the current block is greater than a predetermined threshold. Here, the sum of transform coefficients may refer to the sum of absolute values of transform coefficients.
[0103] As an example, when the sum of the transform coefficients belonging to the current block is less than or equal to the threshold, the number of one or more MTS candidates may be N1, and when the sum of the transform coefficients belonging to the current block is greater than the threshold, the number of one or more MTS candidates may be N2. Here, the threshold may be determined based on a predetermined constant factor (C). For example, the threshold may be defined as 6*C. In addition, N1 may be 1, and N2 may be 4. However, not limited thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0104] Alternatively, when the sum of the transform coefficients belonging to the current block is less than or equal to the threshold, the number of one or more MTS candidates may be N1, and when the sum of the transform coefficients belonging to the current block is greater than the threshold, the number of one or more MTS candidates may be N3. Here, the threshold may be determined based on a predetermined constant factor (C). For example, the threshold may be defined as 32*C. In addition, N1 may be 1, and N3 may be 6. However, not limited thereto, N3 may be an integer greater than N1, such as 2, 3, 4, 5, or more.
[0105] Alternatively, when the sum of the transform coefficients belonging to the current block is less than or equal to the threshold, the number of one or more MTS candidates may be N2, and when the sum of the transform coefficients belonging to the current block is greater than the threshold, the number of one or more MTS candidates may be N3. Here, the threshold may be determined based on a predetermined constant factor (C). For example, the threshold may be defined as 32*C. In addition, N2 may be 4, and N3 may be 6. However, not limited thereto, N2 may be an integer less than N3, such as 2, 3, 5, or more, and N3 may be an integer greater than N2, such as 3, 4, 5, 7, or more.
[0106] Alternatively, when the sum of the transform coefficients belonging to the current block is less than or equal to the first threshold, the number of one or more MTS candidates may be N1. When the sum of the transform coefficients belonging to the current block is greater than the first threshold and less than or equal to the second threshold, the number of one or more MTS candidates may be N2. When the sum of the transform coefficients belonging to the current block is greater than the second threshold, the number of one or more MTS candidates may be N3. Here, the first threshold and the second threshold may be determined based on a predetermined constant factor (C), respectively. For example, the first threshold and the second threshold may be defined as 16*C and 32*C, respectively. In addition, N1, N2, and N3 may be 1, 4, and 6, respectively. However, not limited thereto, N2 may be an integer greater than N1 and less than N3, such as 2, 3, 5, or more. N3 may be an integer greater than N2, such as 2, 3, 5, 7, or more.
[0107] Information for determining at least one of the above-mentioned threshold, the first threshold, the second threshold, or the constant factor (C) may be signaled through the bitstream. The constant factor (C) may be a constant value predefined equally for the encoding device and the decoding device. Alternatively, the constant factor (C) may be variably determined based on at least one of a slice type, a quantization parameter (QP) of a current block, a size of a current block, a shape of a current block (i.e., whether it is non-square), a ratio of a width to a height of a current block, or information signaled through the bitstream. Here, the signaled information may be information encoded for determining at least one of the above-mentioned threshold, the first threshold, the second threshold, or the constant factor (C).
[0108] As an example, when the quantization parameter of the current block is less than the first value, the constant factor may be determined to be 2, and when the quantization parameter of the current block is greater than or equal to the first value, the constant factor may be determined to be 1. Here, the first value may be 22.
[0109] Alternatively, when the quantization parameter of the current block is less than the first value, the constant factor may be determined to be 2, and when the quantization parameter of the current block is greater than or equal to the first value, the constant factor may be determined to be 0.5. Here, the first value may be 22.
[0110] Alternatively, when the quantization parameter of the current block is less than the second value, the constant factor may be determined to be 2, and when the quantization parameter of the current block is greater than or equal to the second value, the constant factor may be determined to be 0.5. Here, the second value may be 37.
[0111] Alternatively, when the quantization parameter of the current block is less than the first value, the constant factor may be determined to be 2. When the quantization parameter of the current block is greater than or equal to the first value and less than the second value, the constant factor may be determined to be 1. When the quantization parameter of the current block is greater than or equal to the second value, the constant factor may be determined to be 0.5. Here, the first value and the second value may be 22 and 37, respectively.
[0112] As an example, when the size of the current block is smaller than the first size, the constant factor may be determined to be 1, and when the size of the current block is greater than or equal to the first size, the constant factor may be determined to be 2. Here, the first size may be 128. However, without limitation thereto, the first size may be 16, 32, or 64.
[0113] Alternatively, when the size of the current block is smaller than the first size, the constant factor may be determined to be 1, and when the size of the current block is greater than or equal to the first size, the constant factor may be determined to be 3. Here, the first size may be 128. However, without limitation thereto, the first size may be 16, 32, or 64.
[0114] Alternatively, when the size of the current block is smaller than the second size, the constant factor may be determined to be 2, and when the size of the current block is greater than or equal to the second size, the constant factor may be determined to be 3. Here, the second size may be 512. However, without limitation thereto, the second size may be larger than the first size and may be 32, 64, 128, or 256.
[0115] Alternatively, when the size of the current block is smaller than the first size, the constant factor may be determined to be 1. When the size of the current block is greater than or equal to the first size and smaller than the second size, the constant factor may be determined to be 2. When the size of the current block is greater than or equal to the second size, the constant factor may be determined to be 1. Here, the first size and the second size may be 128 and 512, respectively. However, without limitation thereto, the first size may be 16, 32, or 64, and the second size is greater than the first size and may be 32, 64, 128, or 256.
[0116] As an example, when the ratio of the width to the height of the current block is less than the first value, the constant factor may be determined to be 1. When the ratio of the width to the height of the current block is greater than or equal to the first value and less than the second value, the constant factor may be determined to be 2. When the ratio of the width to the height of the current block is greater than or equal to the second value, the constant factor may be determined to be 3.
[0117] The size of the current block mentioned above may refer to the size of a transform block having the same size as the current block to be decoded, or may refer to the size of the remaining area (i.e., the low-frequency area) in the corresponding transform block except for the high-frequency area where all transform coefficients are 0. Here, the size is defined as the total number of samples belonging to the current block (or low-frequency area), but is not limited thereto. For example, the size may be expressed as width, height, minimum / maximum of width and height, or the sum of width and height.
[0118] Instead of the sum of the transform coefficients in the current block, the number and / or size of the transform coefficients may be used to determine the number of MTS candidates. To this end, the term "sum of transform coefficients" in the above method 1 may be applied by replacing it with "the number of transform coefficients" or "the size of one or more transform coefficients". Alternatively, at least two of the sum, number or size of the transform coefficients may be used together to determine the number of MTS candidates.
[0119] Method 2: Method based on the position of the last significant coefficient
[0120] The number of one or more MTS candidates available for the current block may be determined based on the position of the last significant coefficient in the current block. Here, the position of the last significant coefficient may be defined as a scanning order (or scanning position) according to a predetermined scanning method. The scanning method may be any of diagonal scanning, horizontal scanning, vertical scanning, z scanning, or raster scanning. Alternatively, the position of the last significant coefficient may be defined as the coordinates of the last significant coefficient based on the upper left sample of the current block.
[0121] Specifically, the number of one or more MTS candidates available for the current block can be determined based on at least one of the position of the last significant coefficient in the current block, the size of the current block, the shape of the current block (i.e., whether it is non-square), and the ratio of the width and height of the current block. As an example, the number of MTS candidates can be expressed as follows:
[0122] [Formula 1]
[0123] NumMtsCand=min(MaxNumMtsCand,(LastScanPos*Scale / cbSize))
[0124] In Formula 1, NumMtsCand represents the number of one or more MTS candidates available for the current block. MaxNumMtsCand may represent the maximum number of MTS candidates predefined in the encoding device and the decoding device. LastScanPos may represent the position of the last valid coefficient in the current block, and Scale may be a scaling factor applied to LastScanPos. The scaling factor may be a value predefined identically for the encoding device and the decoding device, and may be 1, 2, 3, 4, 5, 6, or more. cbSize represents the size of the current block as described in “Method 1 based on the sum of transform coefficients”.
[0125] According to Formula 1, the number of one or more MTS candidates available for the current block may be configured as (LastScanPos*Scale / cbSize). However, when the value of (LastScanPos*Scale / cbSize) exceeds the predefined maximum number of MTS candidates, the number of one or more MTS candidates available for the current block may be limited to the predefined maximum number of MTS candidates.
[0126] Alternatively, the number of one or more MTS candidates available for the current block may be determined based on whether the last significant coefficient exists in an upper left region of the current block (or a low frequency region).
[0127] As an example, it is assumed that the width and height of the current block (or low-frequency region) are W1 and H1, respectively, and the width and height of the upper left region are W2 and H2, respectively. W2 may be less than or equal to W1, and H2 may be less than or equal to H1. In this case, when the last significant coefficient does not exist in the upper left region of the current block (i.e., when the last significant coefficient exists in a region other than the upper left region of the current block), the number of one or more MTS candidates may be N1. On the other hand, when the last significant coefficient exists in the upper left region of the current block, the number of one or more MTS candidates may be N2. However, although the last significant coefficient exists in the upper left region of the current block, when the last significant coefficient exists in the upper left sample position (i.e., DC position) of the current block (or low-frequency region), the number of one or more MTS candidates may be N1. Here, N1 may be 1, and N2 may be 4. However, without limitation thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0128] Method 3: Method based on the number of non-zero coefficients
[0129] The number of one or more MTS candidates available for the current block may be determined based on whether the number of non-zero coefficients among the transform coefficients of the current block is greater than a predetermined threshold.
[0130] To this end, the threshold value may be defined as at least one of the minimum number of non-zero coefficients of the MTS allowed / applied to the current block (MinNumNonzero) or the maximum number of non-zero coefficients of the MTS allowed / applied to the current block (MaxNumNonzero). MinNumNonzero and MaxNumNonzero may be numbers predefined equally for the encoding device and the decoding device, respectively. Alternatively, MinNumNonzero may be a predefined fixed number (e.g., 2) regardless of the size of the current block, and MaxNumNonzero may be a variable number determined based on the size of the current block. In addition, in order to determine the number of one or more MTS candidates, both MinNumNonzero and MaxNumNonzero may be considered, or only either MinNumNonzero or MaxNumNonzero may be considered.
[0131] As an example, when the number of non-zero coefficients belonging to the current block is less than MinNumNonzero, the number of one or more MTS candidates may be N1, and when the number of non-zero coefficients belonging to the current block is greater than or equal to MinNumNonzero, the number of one or more MTS candidates may be N2. Here, N1 may be 1, and N2 may be 4. However, not limited thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0132] Alternatively, when the number of non-zero coefficients belonging to the current block is greater than MaxNumNonzero, the number of one or more MTS candidates may be N1, and when the number of non-zero coefficients belonging to the current block is less than or equal to MaxNumNonzero, the number of one or more MTS candidates may be N2. Here, N1 may be 1, and N2 may be 4. However, not limited thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0133] Alternatively, when the number of non-zero coefficients belonging to the current block is less than MinNumNonzero, the number of one or more MTS candidates may be N1. When the number of non-zero coefficients belonging to the current block is greater than or equal to MinNumNonzero or less than or equal to MaxNumNonzero, the number of one or more MTS candidates may be N2. When the number of non-zero coefficients belonging to the current block is greater than MaxNumNonzero, the number of one or more MTS candidates may be N1. Here, N1 may be 1 and N2 may be 4. However, without limitation thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0134] Methods 1 to 3 are independent implementations, and the number of one or more MTS candidates available for the current block can be determined using any one of methods 1 to 3. Alternatively, the number of one or more MTS candidates available for the current block can be determined based on a combination of at least two of methods 1 to 3.
[0135] Hereinafter, a method for selecting a transform type of a current block from among one or more MTS candidates available for the current block is described in detail.
[0136] When the number of one or more MTS candidates available for the current block is two or more, the transform type of the current block can be determined based on the MTS index. Here, the MTS index can specify any one of the multiple MTS candidates. The transform type for horizontal transform and the transform type for vertical transform can be determined based on the MTS candidate specified by the MTS index.
[0137] Alternatively, the MTS index may be defined for each transform direction, respectively. In this case, the MTS index may include an MTS index for horizontal transform and an MTS index for vertical transform. In this case, the transform type for horizontal transform of the current block may be determined based on the MTS index for horizontal transform, and the transform type for vertical transform of the current block may be determined based on the MTS index for vertical transform.
[0138] The MTS index may be signaled through the bitstream. The MTS index may be encoded by context-adaptive binary arithmetic coding (CABAC).
[0139] The maximum value (cMax) of the binarization of the MTS index may be variably determined according to the number of one or more MTS candidates determined based on at least one of the above methods 1 to 3. In other words, the maximum value (cMax) of the binarization of the MTS index may be determined based on at least one of the sum of transform coefficients belonging to the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients among the transform coefficients of the current block. As an example, the maximum value (cMax) of the binarization of the MTS index may be configured as a value obtained by subtracting 1 from the number of one or more MTS candidates determined based on at least one of the above methods 1 to 3.
[0140] The MTS index can be derived based on the coding parameters of the current block. Here, the coding parameters may include at least one of the prediction mode showing the intra mode or the inter mode, the width and / or height of the current block (or the transform block), or the partition information of the current block (or the transform block). The partition information may include at least one of information showing whether partitioning is performed, information showing the partition direction, information about the number of partitions generated by block partitioning, information about the position of the partition to which the inverse transform is applied among the partitions generated by block partitioning, or information showing whether asymmetric partitioning is performed.
[0141] On the other hand, when the number of one or more MTS candidates available for the current block is 1, the transform type for horizontal transform and the transform type for vertical transform of the current block may be determined based on the corresponding MTS candidates. In this case, the MTS index may not be signaled through the bitstream, and the MTS index may be derived as a value predefined equally for the encoding apparatus and the decoding apparatus.
[0142] Reference Figure 4 , an inverse transform may be performed on the transform coefficients of the current block based on the transform type of the current block to obtain residual samples of the current block S410.
[0143] The inverse transform may be performed based on a separate transform. As an example, a vertical transform may be performed on each column of transform coefficients of the current block, and a horizontal transform may be performed on each row of result values thereof. Alternatively, a horizontal transform may be performed on each row of transform coefficients of the current block, and a vertical transform may be performed on each column of result values thereof.
[0144] The current block may be reconstructed based on the residual samples obtained through the inverse transform and the prediction samples of the current block.
[0145] Figure 5 A schematic configuration of an inverse transformer 322 that performs the inverse transformation method according to the present disclosure is shown.
[0146] Reference Figure 4 , describing the inverse transform method performed in the decoding device, which can be equivalently performed in the inverse transformer 322 of the decoding device, and its detailed description is omitted.
[0147] Reference Figure 5 , the inverse transformer 322 may include a transform type determiner 500 and a residual sample acquirer 510 .
[0148] The transform type determiner 500 may determine the transform type of the current block from one or more MTS candidates available for the current block. In other words, the transform type determiner 500 may select any one of the one or more MTS candidates, and may determine the transform type for horizontal and / or vertical transform of the current block based on the selected MTS candidate, respectively.
[0149] The transform type determiner 500 may determine the number of one or more MTS candidates available for the current block based on at least one of the sum of the transform coefficients in the current block, the number of the transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of one or more non-zero coefficients in the current block. To this end, reference may be used. Figure 4 At least one of methods 1 to 3 described above.
[0150] In addition, whether to apply MTS to the current block may be determined based on a method for determining the number of MTS candidates available for the current block. In this case, the transform type determiner 500 may determine whether to apply MTS to the current block.
[0151] When the number of one or more MTS candidates available for the current block is two or more, the transform type determiner 500 may determine the transform type of the current block based on a predetermined MTS index. The MTS index may be signaled through a bitstream or may be derived based on a coding parameter of the current block.
[0152] On the other hand, when the number of one or more MTS candidates available for the current block is 1, the transform type determiner 500 may determine a transform type for horizontal transform and a transform type for vertical transform of the current block based on the corresponding MTS candidates.
[0153] The residual sample acquirer 510 may perform inverse transformation on the transformation coefficient of the current block based on the transformation type of the current block, thereby obtaining the residual sample of the current block.
[0154] Figure 6 An inverse transform method performed by an encoding device according to an embodiment of the present disclosure is shown.
[0155] The present disclosure relates to a transformation method based on MTS. As described above, MTS may refer to a method for determining a transformation type for horizontal / vertical transformation by selecting any one of a plurality of MTS candidates. Here, each MTS candidate may include a transformation type for horizontal transformation and a transformation type for vertical transformation. Alternatively, the MTS candidate may be separately defined as an MTS candidate for horizontal transformation and an MTS candidate for vertical transformation.
[0156] Reference Figure 6 , the transformation type of the current block may be determined S600.
[0157] The transform type for horizontal and / or vertical transform of the current block may be determined based on any one of the MTS candidates predefined for the encoding device and the decoding device, respectively. Figure 4As described, each predefined MTS candidate may be configured as a combination of two transform types equally predefined by the encoding device and the decoding device. Alternatively, the MTS candidate may be separately determined as an MTS candidate for horizontal transform and an MTS candidate for vertical transform. Alternatively, the MTS candidate for horizontal transform may be equally used as an MTS candidate for vertical transform.
[0158] Reference Figure 6 , a transformation may be performed on the residual samples of the current block based on the transformation type of the current block to derive a transformation coefficient of the current block S610.
[0159] The transformation may be performed according to the inverse process of the above-mentioned inverse transformation. As an example, a horizontal transformation may be performed on each row of residual samples of the current block, and a vertical transformation may be performed on each column of result values thereof. Alternatively, a vertical transformation may be performed on each column of residual samples of the current block, and a horizontal transformation may be performed on each row of result values thereof.
[0160] The transform coefficient induced through the transform may be encoded to generate residual information of the current block, and the generated residual information may be inserted into a bitstream.
[0161] The transform type of the current block may be any one selected from one or more MTS candidates belonging to a predetermined candidate group. The predetermined candidate group may be any one of a plurality of candidate groups equally predefined for the encoding device and the decoding device. The plurality of candidate groups may include different numbers of MTS candidates. As an example, the plurality of candidate groups may include at least two of a first candidate group, a second candidate group, or a third candidate group. Here, the first candidate group may include N1 MTS candidates, the second candidate group may include N2 MTS candidates, and the third candidate group may include N3 MTS candidates.
[0162] Based on selecting a candidate group for the transform type of the current block (or the number of MTS candidates belonging to the corresponding candidate group), at least one of the sum of the transform coefficients of the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients may need to / be restricted to belong to a predetermined range.
[0163] Method 1: Requirements for the sum of transform coefficients
[0164] According to the candidate group for selecting the transform type of the current block, the sum of the transform coefficients of the current block may need to belong to a range less than or equal to a predetermined threshold, or may need to belong to a range greater than a predetermined threshold. Here, the sum of the transform coefficients may refer to the sum of the absolute values of the transform coefficients.
[0165] As an example, when the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the sum of the transform coefficients belonging to the current block may be less than or equal to the threshold, or may be greater than the threshold. On the other hand, when the transform type of the current block is selected from the second candidate group including N2 MTS candidates, the sum of the transform coefficients belonging to the current block may need to be greater than the threshold. Here, the threshold may be determined based on a predetermined constant factor (C). For example, the threshold may be defined as 6*C. In addition, N1 may be 1 and N2 may be 4. However, not limited to this, N2 may be an integer greater than N1, such as 2, 3, 5, 6 or more.
[0166] Alternatively, when the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the sum of the transform coefficients belonging to the current block may be less than or equal to the threshold, or may be greater than the threshold. On the other hand, when the transform type of the current block is selected from the third candidate group including N3 MTS candidates, the sum of the transform coefficients belonging to the current block may need to be greater than the threshold. Here, the threshold may be determined based on a predetermined constant factor (C). For example, the threshold may be defined as 32*C. In addition, N1 may be 1 and N3 may be 6. However, not limited to this, N3 may be an integer greater than N1, such as 2, 3, 4, 5 or more.
[0167] Alternatively, when the transform type of the current block is selected from the second candidate group including N2 MTS candidates, the sum of the transform coefficients belonging to the current block may need to be less than or equal to the threshold. On the other hand, when the transform type of the current block is selected from the third candidate group including N3 MTS candidates, the sum of the transform coefficients belonging to the current block may need to be greater than the threshold. Here, the threshold may be determined based on a predetermined constant factor (C). For example, the threshold may be defined as 32*C. In addition, N2 may be 4 and N3 may be 6. However, without limitation thereto, N2 may be an integer less than N3, such as 2, 3, 5 or more, and N3 may be an integer greater than N2, such as 3, 4, 5, 7 or more.
[0168] Alternatively, when the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the sum of the transform coefficients belonging to the current block may be less than or equal to the first threshold, or may be greater than the first threshold. When the transform type of the current block is selected from the second candidate group including N2 MTS candidates, the sum of the transform coefficients belonging to the current block may need to be greater than the first threshold and less than or equal to the second threshold. When the transform type of the current block is selected from the third candidate group including N3 MTS candidates, the sum of the transform coefficients belonging to the current block may need to be greater than the second threshold. Here, the first threshold and the second threshold may be determined based on a predetermined constant factor (C), respectively. For example, the first threshold and the second threshold may be defined as 16*C and 32*C, respectively. In addition, N1, N2, and N3 may be 1, 4, and 6, respectively. However, not limited thereto, N2 may be an integer greater than N1 and less than N3, such as 2, 3, 5, or more. N3 may be an integer greater than N2, such as 2, 3, 5, 7, or more.
[0169] Information for determining at least one of the above-mentioned threshold, the first threshold, the second threshold or the constant factor (C) may be encoded and inserted into the bitstream. The above-mentioned constant factor (C) may be a constant value predefined equally for the encoding device and the decoding device. Alternatively, the constant factor (C) may be variably determined based on at least one of the slice type, the quantization parameter (QP) of the current block, the size of the current block, the shape of the current block (i.e., whether it is non-square), or the ratio of the width and height of the current block. In this case, information for determining the constant factor (C) may be additionally encoded and inserted into the bitstream. This is similar to referring to Figure 4 Same as described in detail.
[0170] Instead of the sum of the transform coefficients in the current block, the above requirements may be applied to the number and / or size of the transform coefficients. To this end, the term "sum of the transform coefficients" in Method 1 may be applied by replacing it with "the number of transform coefficients" or "the size of one or more transform coefficients". Alternatively, the above requirements may be applied together to at least two of the sum, number or size of the transform coefficients.
[0171] Method 2: Requirements for the position of the last significant coefficient
[0172] According to the candidate group for selecting the transform type of the current block, the last significant coefficient in the current block may need to be located in a predetermined area within the current block, or exist in a predetermined position within the current block. Here, the position of the last significant coefficient may be defined as a scanning order (or scanning position) according to a predetermined scanning method. The scanning method may be any of diagonal scanning, horizontal scanning, vertical scanning, z scanning, or raster scanning. Alternatively, the position of the last significant coefficient may be defined as the coordinates of the last significant coefficient based on the upper left sample of the current block.
[0173] As an example, when the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the last significant coefficient may need to exist at the position where NumMtsCand has a value of N1 in the above formula 1. Similarly, when the transform type of the current block is selected from the second candidate group including N2 MTS candidates, the last significant coefficient may need to exist at the position where NumMtsCand has a value of N2. When the transform type of the current block is selected from the third candidate group including N3 MTS candidates, the last significant coefficient may need to exist at the position where NumMtsCand has a value of N3.
[0174] Alternatively, according to the candidate group for selecting the transform type of the current block, the last significant coefficient may need to exist in the upper left region within the current block (or the low frequency region).
[0175] As an example, assume that the width and height of the current block (or low-frequency region) are W1 and H1, respectively, and the width and height of the upper left region are W2 and H2, respectively. W2 may be less than or equal to W1, and H2 may be less than or equal to H1. When the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the last significant coefficient may exist in the upper left region of the current block, or may exist in a region other than the upper left region within the current block. On the other hand, when the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the last significant coefficient may need to exist in the upper left region of the current block. In addition, although the last significant coefficient exists in the upper left region of the current block, the last significant coefficient may need to exist in the upper left sample position (i.e., DC position) of the current block (or low-frequency region). Here, N1 may be 1, and N2 may be 4. However, without limitation thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0176] Method 3: Requirements on the number of non-zero coefficients
[0177] According to the candidate group for selecting the transform type of the current block, the number of non-zero coefficients in the current block may need to belong to a range less than or equal to a predetermined threshold, or may need to belong to a range greater than a predetermined threshold. Here, the threshold may be defined as at least one of the minimum number of non-zero coefficients (MinNumNonzero) of the MTS allowed / applied to the current block or the maximum number of non-zero coefficients (MaxNumNonzero) of the MTS allowed / applied to the current block, which is consistent with the reference Figure 4 Same as described.
[0178] As an example, when the transform type of the current block is selected from the first candidate group including N1 MTS candidates, the number of non-zero coefficients belonging to the current block may be less than MinNumNonzero, or may be greater than or equal to MinNumNonzero. On the other hand, when the transform type of the current block is selected from the second candidate group including N2 MTS candidates, the number of non-zero coefficients belonging to the current block may need to be greater than or equal to MinNumNonzero. Here, N1 may be 1, and N2 may be 4. However, not limited to this, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0179] Alternatively, when the transform type of the current block is selected from a first candidate group including N1 MTS candidates, the number of non-zero coefficients belonging to the current block may be greater than MaxNumNonzero, or may be less than or equal to MaxNumNonzero. On the other hand, when the transform type of the current block is selected from a second candidate group including N2 MTS candidates, the number of non-zero coefficients belonging to the current block may need to be less than or equal to MaxNumNonzero. Here, N1 may be 1, and N2 may be 4. However, without limitation thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0180] Alternatively, when the transform type of the current block is selected from a first candidate group including N1 MTS candidates, the number of non-zero coefficients belonging to the current block may be less than MinNumNonzero, or may be greater than or equal to MinNumNonzero and MaxNumNonzero. On the other hand, when the transform type of the current block is selected from a second candidate group including N2 MTS candidates, the number of non-zero coefficients belonging to the current block may need to be greater than or equal to MinNumNonzero and less than or equal to MaxNumNonzero. Here, N1 may be 1 and N2 may be 4. However, without limitation thereto, N2 may be an integer greater than N1, such as 2, 3, 5, 6, or more.
[0181] The above methods 1 to 3 may be applied as independent implementations. Alternatively, based on a combination of at least two of methods 1 to 3, at least two of the sum of transform coefficients, the position of the last significant coefficient, or the number of non-zero coefficients may need to belong to a predetermined range.
[0182] An MTS index indicating the selected MTS candidate may be encoded and inserted into the bitstream. When two MTS candidates are selected, the MTS index may be encoded and inserted into the bitstream for each transform direction.
[0183] The MTS index may be encoded by context adaptive binary arithmetic coding (CABAC). The maximum value (cMax) of the binarization of the MTS index may be determined based on at least one of the sum of the transform coefficients belonging to the current block, the number of transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients among the transform coefficients of the current block. Alternatively, the maximum value (cMax) of the binarization of the MTS index may be determined based on the number of MTS candidates belonging to the candidate group for selecting the transform type of the current block.
[0184] Alternatively, without encoding the MTS index, one or two MTS candidates among multiple MTS candidates may be selected based on the encoding parameters of the current block. Here, the encoding parameters may include at least one of the prediction mode showing the intra mode or the inter mode, the width and / or height of the current block (or the transform block), or the partition information of the current block (or the transform block). The partition information may include at least one of information showing whether partitioning is performed, information showing the partition direction, information about the number of partitions generated by block partitioning, information about the position of the partition to which the inverse transform is applied among the partitions generated by block partitioning, or information showing whether asymmetric partitioning is performed.
[0185] Figure 7 A schematic configuration of a transformer 232 that performs a transformation method according to the present disclosure is shown.
[0186] Reference Figure 6 , describes a transformation method performed in an encoding device, which can be equivalently performed in the transformer 232 of the encoding device, and its detailed description is omitted below.
[0187] Reference Figure 7 , the transformer 232 may include a transform type determiner 700 and a transform coefficient deriver 710 .
[0188] The transform type determiner 700 may determine the transform type of the current block. In other words, the transform type determiner 700 may determine the transform type for horizontal and / or vertical transform of the current block based on any one of the MTS candidates predefined in the encoding apparatus and the decoding apparatus, respectively.
[0189] The transform type determiner 700 may select an MTS candidate from any one of a plurality of candidate groups, and determine a transform type for horizontal transform and / or a transform type for vertical transform of the current block based on the selected MTS candidate.
[0190] Alternatively, the transform type determiner 700 may select two MTS candidates from any one of a plurality of candidate groups. In this case, the transform type for horizontal transform of the current block may be determined based on any one of the two MTS candidates, and the transform type for vertical transform of the current block may be determined based on the other of the two MTS candidates.
[0191] The transform coefficient deriver 710 may perform transform on the residual samples of the current block based on the transform type of the current block to derive the transform coefficient of the current block.
[0192] According to the candidate group for selecting the transform type of the current block (or the number of MTS candidates belonging to the corresponding candidate group), the derived transform coefficient may need to meet the requirements of at least one of the above-mentioned methods 1 to 3.
[0193] The MTS index indicating the selected MTS candidate may be encoded in the entropy encoder 240 and inserted into the bitstream. When two MTS candidates are selected, the MTS index may be encoded for each transform direction. The entropy encoder 240 may encode the MTS index by context adaptive binary arithmetic coding (CABAC).
[0194] Alternatively, the transform type determiner 700 may select one or two MTS candidates based on coding parameters of the current block, where the coding parameters are the same as described above.
[0195] In the above embodiments, the method is described based on a flowchart as a series of steps or boxes, but the corresponding embodiments are not limited to the order of steps, and some steps may occur simultaneously with other steps or in a different order as described above. In addition, it will be understood by those skilled in the art that the steps shown in the flowchart are not exclusive, and other steps may be included without affecting the scope of the embodiments of the present disclosure, or one or more steps in the flowchart may be deleted.
[0196] The above-mentioned method according to the 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 can be included in a device that performs image processing, such as a TV, a computer, a smart phone, a set-top box, a display device, etc.
[0197] In the present disclosure, when the embodiment is implemented as software, the above method can be implemented as a module (process, function, etc.) that performs the above functions. The module can be stored in a memory and can be executed by a processor. The memory can be inside or outside the processor and can be connected to the processor by various well-known means. The processor may include an application-specific integrated circuit (ASIC), another chipset, a logic circuit and / or a data processing device. 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 another storage device. In other words, the embodiments described herein can be implemented on a processor, a microprocessor, a controller or a chip to perform. For example, the functional units shown in the various figures can be implemented on a computer, a processor, a microprocessor, a controller or a chip to perform. In this case, the information (e.g., information about instructions) or the algorithm used for implementation can be stored in a digital storage medium.
[0198] In addition, the decoding device and the encoding device to which the embodiments of the present disclosure are applied may be included in a multimedia broadcast sending and receiving device, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video conversation device, a real-time communication device similar to video communication, a mobile streaming device, a storage medium, a camera, a device for providing a video on demand (VOD) service, an OTT (over the top) video device, a device for providing an Internet streaming service, a three-dimensional (3D) video device, a virtual reality (VR) device, an augmented reality (AR) device, a video phone video device, a transportation terminal (e.g., a vehicle (including an autonomous vehicle) terminal, an aircraft terminal, a ship terminal, etc.) and a medical video device, etc., and may be used to process a video signal or a data signal. For example, an OTT (over the top) video device may include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.
[0199] In addition, the processing method to which the embodiments of the present disclosure are applied can be generated in the form of a program executed by a computer and can be stored in a computer-readable recording medium. The multimedia data with a data structure according to the embodiments of the present disclosure can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices that store computer-readable data. The computer-readable recording medium may include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical media storage device. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (for example, transmission via the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium, or can be sent via a wired / wireless communication network.
[0200] In addition, the embodiments of the present disclosure may be implemented by a computer program product through program code, and the program code may be executed on a computer through the embodiments of the present disclosure. The program code may be stored on a computer readable carrier.
[0201] Figure 8 An example of a content streaming system to which embodiments of the present disclosure can be applied is shown.
[0202] Reference Figure 8 , a content streaming system to which an embodiment of the present disclosure is applied may generally include an encoding server, a streaming server, a network server, a media storage, a user device, and a multimedia input device.
[0203] The encoding server generates a bitstream by compressing content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data and transmits it to a streaming server. As another example, when a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.
[0204] A bitstream may be generated by an encoding method or a bitstream generating method to which an embodiment of the present disclosure is applied, and a streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.
[0205] The streaming server sends multimedia data to the user device through the network server based on the user request, and the network server serves as a medium to inform the user what services are available. When the user requests a desired service from the network server, the network server transmits the request to the streaming server, and the streaming server sends the multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls the command / response between the various devices in the content streaming system.
[0206] The streaming server may receive content from a media storage and / or encoding server. For example, when receiving content from an encoding server, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server may store the bitstream for a specific period of time.
[0207] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, touch screen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, head-mounted displays (HMDs)), digital TVs, desktops, digital signage, etc.
[0208] Each server in the content streaming system may operate as a distributed server, and in this case, data received from each server may be distributed and processed.
[0209] The claims set forth herein may be combined in various ways. For example, the technical features of the method claims of the present disclosure may be combined and implemented as a device, and the technical features of the device claims of the present disclosure may be combined and implemented as a method. In addition, the technical features of the method claims of the present disclosure and the technical features of the device claims may 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 may be combined and implemented as a method.
Claims
1. An image decoding method, the image decoding method comprising the following steps: Determining a transform type for inverse transform of the current block from one or more multi-transform selection (MTS) candidates available for the current block; as well as performing an inverse transform on the transform coefficients of the current block based on the determined transform type to obtain residual samples of the current block, The number of the one or more MTS candidates available for the current block is determined based on at least one of the sum of the transform coefficients in the current block, the number of the transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of one or more non-zero coefficients in the current block.
2. The image decoding method according to claim 1, wherein: The number of the one or more MTS candidates available for the current block is determined based on a comparison between a sum of the transform coefficients belonging to the current block and a predetermined threshold.
3. The image decoding method according to claim 2, wherein: The predetermined threshold includes a first threshold and a second threshold. wherein, when the sum of the transform coefficients belonging to the current block is less than or equal to the first threshold, the number of the one or more MTS candidates is determined to be N1, wherein, when the sum of the transform coefficients belonging to the current block is greater than the first threshold and less than or equal to the second threshold, the number of the one or more MTS candidates is determined to be N2, and When the sum of the transform coefficients belonging to the current block is greater than the second threshold, the number of the one or more MTS candidates is determined to be N3.
4. The image decoding method according to claim 2, wherein: The predetermined threshold is determined based on a predetermined constant factor, and The predetermined constant factor is determined based on at least one of a slice type, a quantization parameter of the current block, a size of the current block, a shape of the current block, a ratio of a width to a height of the current block, or information signaled via a bitstream.
5. The image decoding method according to claim 1, wherein: The number of the one or more MTS candidates available for the current block is determined based on at least one of the position of the last significant coefficient in the current block, a scaling factor, a size of the current block, or a shape of the current block.
6. The image decoding method according to claim 1, wherein: The number of the one or more MTS candidates available for the current block is determined based on a comparison between a number of non-zero coefficients among the transform coefficients of the current block and a third threshold.
7. The image decoding method according to claim 1, wherein: When the number of the one or more MTS candidates available for the current block is two or more, the transform type of the current block is determined based on an MTS index signaled through a bitstream.
8. The image decoding method according to claim 7, wherein: The binarized maximum value (cMax) of the MTS index is determined based on at least one of the sum of the transform coefficients belonging to the current block, the number of the transform coefficients in the current block, the size of the one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients among the transform coefficients of the current block.
9. A method for encoding an image, the method comprising the following steps: Determine the transform type of the current block; as well as performing a transform on residual samples of the current block based on the transform type of the current block to derive transform coefficients of the current block, wherein the transform type of the current block is selected from one or more multi-transform selection (MTS) candidates belonging to any one of a plurality of predefined candidate groups, and Among them, based on selecting the candidate group of the transform type of the current block, at least one of the sum of the transform coefficients of the current block, the number of the transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients in the current block needs to belong to a predetermined range.
10. A computer-readable storage medium storing a bit stream generated by an image encoding method, the image encoding method comprising the following steps: Determine the transform type of the current block; as well as performing a transform on residual samples of the current block based on the transform type of the current block to derive transform coefficients of the current block, wherein the transform type of the current block is selected from one or more multi-transform selection (MTS) candidates belonging to any one of a plurality of predefined candidate groups, and Among them, based on selecting the candidate group of the transform type of the current block, at least one of the sum of the transform coefficients of the current block, the number of the transform coefficients in the current block, the size of one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients in the current block needs to belong to a predetermined range.
11. A method for transmitting data for an image, the method comprising the steps of: Acquire a bitstream for the image, wherein the bitstream is generated by the following steps: determining a transform type of a current block, performing a transform on residual samples of the current block based on the transform type of the current block to derive transform coefficients of the current block, and encoding the derived transform coefficients; and sending said data comprising said bit stream, wherein the transform type of the current block is selected from one or more multi-transform selection (MTS) candidates belonging to any one of a plurality of predefined candidate groups, and Wherein, based on selecting the candidate group of the transform type of the current block, at least one of the size of one or more transform coefficients of the current block, the sum of the transform coefficients of the current block, the number of the transform coefficients in the current block, the size of the one or more transform coefficients in the current block, the position of the last significant coefficient in the current block, or the number of non-zero coefficients in the current block needs to belong to a predetermined range. 12 . An image decoding device, the image decoding device executing the image decoding method according to claim 1 .
13. An image encoding device, the image encoding device executing the image encoding method according to claim 9.
14. An apparatus for transmitting data for an image, the apparatus executing the method for transmitting data for an image according to claim 11.