Apparatus for encoding / decoding image information and apparatus for transmitting data

By using symbolic data hiding enable flags and TSRC enable flags to control residual coding during image decoding, the problem of high transmission and storage costs for high-resolution, high-quality images is solved, and the efficiency of residual coding is improved.

CN121644831APending Publication Date: 2026-03-10LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2021-02-25
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

The transmission and storage costs of high-resolution, high-quality images are high, necessitating improvements in image coding efficiency, particularly residual coding efficiency.

Method used

By using the Symbol Data Hiding Enable Flag and the Transform Skip Residual Coding (TSRC) Enable Flag during image decoding, the residual coding information of the current block is controlled to generate a reconstructed image.

Benefits of technology

It improves residual coding efficiency, reduces the number of bits to be encoded, and enhances overall coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644831A_ABST
    Figure CN121644831A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an apparatus for encoding / decoding image information and an apparatus for transmitting data. An image decoding method performed by a decoding device according to the present document is characterized by comprising the steps of: acquiring a symbol data concealment availability flag relating to whether a symbol data concealment is available for a current slice; obtaining a TSRC available flag related to whether the TSRC is available for a transform skip block of the current slice; and acquiring residual encoding information on a current block within the current slice based on the TSRC available flag, where the current block is a transform skip block within the current slice, and acquiring the TSRC available flag based on the symbol data hiding available flag.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the original application No. 202180028533.9 (International Application No. PCT / KR2021 / 002411, filed on February 25, 2021, entitled "Image decoding method for residual coding and apparatus therefor"). TECHNICAL FIELD

[0002] The present document relates to an image coding technology, and more particularly, to a video decoding method and apparatus in which flag information on whether to enable / disable TSRC is encoded based on flag information on whether to enable SDH when residual data of a current block is encoded in an image coding system. BACKGROUND

[0003] Recently, in various fields, the demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing. Because the image data has high resolution and high quality, the amount of information or bits to be transmitted increases relative to conventional image data. Therefore, when transmitting image data using a medium such as a conventional wired / wireless broadband line or storing image data using an existing storage medium, the transmission cost and storage cost thereof increase.

[0004] Therefore, there is a need for an efficient image compression technology for efficiently transmitting, storing, and reproducing information of high-resolution, high-quality images. SUMMARY

[0005] TECHNICAL PROBLEM

[0006] The present disclosure provides a method and apparatus for improving image coding efficiency.

[0007] The present disclosure also provides a method and apparatus for improving residual coding efficiency.

[0008] TECHNICAL SOLUTION

[0009] According to an embodiment of the present document, a picture decoding method performed by a decoding device is provided. The method comprises the steps of obtaining a sign data hiding enabled flag for whether a sign data hiding is enabled for a current slice, obtaining a TSRC enabled flag for whether a transform skip residual coding (TSRC) is enabled for a transform skip block in the current slice, obtaining residual coding information of a current block in the current slice based on the TSRC enabled flag, deriving prediction samples of the current block based on received prediction information of the current block, deriving residual samples of the current block based on the residual coding information, and generating a reconstructed picture based on the prediction samples and the residual samples, wherein the current block is the transform skip block in the current slice, and wherein the TSRC enabled flag is obtained based on the sign data hiding enabled flag.

[0010] According to another embodiment of the present document, a decoding device for performing picture decoding is provided. The decoding device comprises an entropy decoder configured to obtain a sign data hiding enabled flag for whether a sign data hiding is enabled for a current slice, obtain a TSRC enabled flag for whether a transform skip residual coding (TSRC) is enabled for a transform skip block in the current slice, obtain residual coding information of a current block in the current slice based on the TSRC enabled flag, a predictor configured to derive prediction samples of the current block based on received prediction information of the current block, a residual processor configured to derive residual samples of the current block based on the residual coding information, and an adder configured to generate a reconstructed picture based on the prediction samples and the residual samples, wherein the current block is the transform skip block in the current slice, and wherein the TSRC enabled flag is obtained based on the sign data hiding enabled flag.

[0011] According to yet another embodiment of the present document, a video encoding method performed by an encoding device is provided. The method comprises the steps of deriving prediction samples of a current block in a current slice by performing prediction for the current block, deriving residual samples of the current block based on the prediction samples, encoding prediction information for the prediction, encoding a sign data hiding enabled flag for whether a sign data hiding is enabled for the current slice, encoding a TSRC enabled flag for whether a transform skip residual coding (TSRC) is enabled for a transform skip block in the current slice based on the sign data hiding flag, encoding residual information for the current block based on the TSRC enabled flag, and generating a bitstream comprising the sign data hiding enabled flag, the TSRC enabled flag, the prediction information and the residual information, wherein the current block is the transform skip block in the current slice.

[0012] According to yet another embodiment of the present document, a video encoding device is provided. The encoding device comprises a predictor configured to derive prediction samples of a current block in a current slice by performing prediction for the current block, a residual processor configured to derive residual samples of the current block based on the prediction samples, and an entropy encoder configured to encode prediction information for the prediction, encode a sign data hiding enabled flag for whether sign data hiding is enabled for the current slice, encode a TSRC enabled flag for whether transform skip residual coding (TSRC) is enabled for a transform skip block in the current slice based on the sign data hiding enabled flag, encode residual information of the current block based on the TSRC enabled flag, generate a bitstream comprising the sign data hiding enabled flag, the TSRC enabled flag, the prediction information, and the residual information, wherein the current block is the transform skip block in the current slice.

[0013] According to another embodiment of the present document, a computer-readable digital storage medium storing a bitstream comprising picture information causing a decoding device to perform a picture decoding method is provided. In the computer-readable digital storage medium, the picture decoding method comprises obtaining a sign data hiding enabled flag for whether sign data hiding is enabled for a current slice, obtaining the sign data hiding enabled flag for whether sign data hiding is enabled for the current slice, obtaining a TSRC enabled flag for whether transform skip residual coding (TSRC) is enabled for a transform skip block in the current slice, obtaining residual coding information of a current block in the current slice based on the TSRC enabled flag, deriving prediction samples of the current block based on received prediction information of the current block, deriving residual samples of the current block based on the residual coding information, and generating a reconstructed picture based on the prediction samples and the residual samples, wherein the current block is the transform skip block in the current slice, and wherein the TSRC enabled flag is obtained based on the sign data hiding enabled flag.

[0014] Advantageous effects

[0015] According to the present document, the efficiency of residual coding can be improved.

[0016] According to the present document, the TSRC enabled flag can be signaled according to the sign data hiding enabled flag, and by this, the coding efficiency can be improved by preventing sign data hiding from being used for transform skip blocks that do not enable TSRC, and the overall residual coding efficiency can be improved by reducing the amount of bits to be encoded.

[0017] According to the present document, the TSRC enabling flag can be signaled according to the transform skip enabling flag and the sign data hiding enabling flag, and by this, the coding efficiency can be improved by preventing sign data hiding from being used for transform skip blocks that do not enable TSRC, and the total residual coding efficiency can be improved by reducing the amount of bits to be coded. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 An example of a video / image encoding apparatus to which embodiments of the present disclosure are applicable is briefly illustrated.

[0019] Figure 2 is a schematic diagram illustrating a configuration of a video / image encoding apparatus to which embodiments of the present disclosure can be applied.

[0020] Figure 3 is a schematic diagram illustrating a configuration of a video / image decoding apparatus to which embodiments of the present disclosure can be applied.

[0021] Figure 4 An example of a video / image encoding method based on inter prediction is illustrated.

[0022] Figure 5 An example of a video / image decoding method based on inter prediction is illustrated.

[0023] Figure 6 An inter prediction process is schematically shown.

[0024] Figure 7 Context adaptive binary arithmetic coding (CABAC) for encoding syntax elements is exemplarily shown.

[0025] Figure 8 is a diagram showing exemplary transform coefficients within a 4x4 block.

[0026] Figure 9 An image encoding method performed by an encoding apparatus according to the present disclosure is briefly illustrated.

[0027] Figure 10 An encoding apparatus for performing an image encoding method according to the present disclosure is briefly illustrated.

[0028] Figure 11 An image decoding method performed by a decoding apparatus according to the present disclosure is briefly illustrated.

[0029] Figure 12 A decoding apparatus for performing an image decoding method according to the present disclosure is briefly illustrated.

[0030] Figure 13 A configuration diagram of a content streaming system to which the present disclosure is applied is illustrated. DETAILED DESCRIPTION

[0031] The present disclosure can be modified in various forms, and specific embodiments thereof will be described and illustrated in the accompanying drawings. However, these embodiments are not intended to limit the present disclosure. The terms used in the following description are merely used to describe specific embodiments, and are not intended to limit the present disclosure. Singular expressions include plural expressions as long as it is clear from different contexts. Terms such as "include" and "have" are intended to indicate that there is a feature, number, step, operation, element, component, or a combination thereof described in the following description, and it should be understood that the possibility of existence or addition of one or more different features, numbers, steps, operations, elements, components, or a combination thereof is not excluded.

[0032] In addition, the elements in the drawings described in the present disclosure are independently drawn for the purpose of conveniently explaining different specific functions, and this does not mean that the elements are implemented by independent hardware or independent software. For example, two or more of the elements can be combined to form a single element, or one element can be divided into a plurality of elements. Embodiments in which elements are combined and / or divided do not depart from the concept of the present disclosure.

[0033] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In addition, throughout the drawings, like reference numerals are used to refer to like elements, and the same description will be omitted for similar elements.

[0034] Figure 1 An example of a video / image encoding apparatus to which embodiments of the present disclosure can be applied is briefly illustrated.

[0035] Referring to Figure 1 , a video / image encoding system can include a first apparatus (a source apparatus) and a second apparatus (a sink). The source apparatus can transmit encoded video / image information or data in the form of a file or a stream to the sink via a digital storage medium or a network.

[0036] The source apparatus can include a video source, an encoding device, and a transmitter. The sink can include a receiver, a decoding device, and a renderer. The encoding device can be referred to as a video / image encoding device, and the decoding device can be referred to as a video / image decoding device. The transmitter can be included in the encoding device. The receiver can be included in the decoding device. The renderer can include a display, and the display can be configured as a separate apparatus or an external component.

[0037] The video source can acquire a video / image through a process of capturing, synthesizing, or generating a video / image. The video source can include a video / image capturing device and / or a video / image generating device. The video / image capturing device can include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device can include, for example, a computer, a tablet, and a smartphone, and can (electronically) generate a video / image. For example, a virtual video / image can be generated through a computer, etc. In this case, the video / image capturing process can be replaced by a process of generating related data.

[0038] The encoding device can encode an input video / image. The encoding device can perform a series of processes such as prediction, transformation, and quantization to achieve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0039] The transmitter can transmit the encoded image / image information or data output in the form of a bitstream to a receiver of a receiving device in the form of a file or a stream through a digital storage medium or a network. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter can include an element for generating a media file through a predetermined file format, and can include an element for transmission through a broadcasting / communication network. The receiver can receive / extract a bitstream and transmit the received bitstream to a decoding device.

[0040] The decoding device can decode a video / image by performing a series of processes such as dequantization, inverse transformation, and prediction corresponding to the operations of the encoding device.

[0041] The renderer can render the decoded video / image. The rendered video / image can be displayed through a display.

[0042] The present disclosure relates to video / image encoding. For example, the methods / embodiments disclosed in the present disclosure can be applied to the methods disclosed in the Versatile Video Coding (VVC), EVC (Elementary Video Coding) standard, AOMedia Video 1 (AV1) standard, second generation Audio Video Coding standard (AVS2), or next generation video / image encoding standards (e.g., H.267 or H.268, etc.).

[0043] The present disclosure proposes various embodiments of video / image encoding, and unless otherwise mentioned, the embodiments can be performed in combination with each other.

[0044] In the disclosure, a video can refer to a series of images over time. A picture generally refers to a unit representing one image in a specific time region, and a sub-picture / tile / slice is a unit that constitutes a part of a picture at the time of encoding. A sub-picture / tile / slice can include one or more coding tree units (CTUs). One picture can consist of one or more sub-pictures / tiles / slices. One picture can consist of one or more tile groups. One tile group can include one or more tiles. A brick can refer to a rectangular region of CTU rows within a tile in a picture. A tile can be partitioned into a plurality of bricks, each of which consists of one or more CTU rows within the tile. A tile that is not partitioned into a plurality of bricks can also be referred to as a brick. Brick scanning is a specific order of partitioning CTUs of a picture in which the CTUs are ordered in a raster scan in a brick, the tiles within a brick are consecutively ordered in a raster scan of the tiles of the brick, and the tiles in a picture are consecutively ordered in a raster scan of the tiles of the picture. In addition, a sub-picture can refer to a rectangular region of one or more slices within a picture. That is, a sub-picture contains one or more slices that collectively cover a rectangular region of a picture. A tile is a rectangular region of CTUs within a specific tile column and a specific tile row in a picture. A tile column is a rectangular region of CTUs whose height is equal to the height of a picture and whose width is specified by a syntax element in a picture parameter set. A tile row is a rectangular region of CTUs whose height is specified by a syntax element in a picture parameter set and whose width is equal to the width of a picture. Tile scanning is a specific order of partitioning CTUs of a picture in which the CTUs are consecutively ordered in a raster scan in a tile, and the tiles in a picture are consecutively ordered in a raster scan of the tiles of the picture. A slice includes an integer number of tiles of a picture that can be exclusively contained in a single NAL unit. A slice can consist of either a plurality of complete tile groups or a consecutive sequence of complete tiles of only one tile. In the disclosure, a tile group can be used interchangeably with a slice. For example, in the disclosure, a tile group / tile group header can be referred to as a slice / slice header.

[0045] A pixel or pel can mean a minimum unit constituting one picture (or image). In addition, a "sample" can be used as a term corresponding to a pixel. A sample can generally represent a pixel or a value of a pixel, can represent only a pixel / value of a pixel of a luminance component, or can represent only a pixel / value of a pixel of a chrominance component.

[0046] A unit can represent a basic unit of image processing. A unit can include at least one of a specific area of a picture and information related to the area. One unit can include one luma block and two chroma (e.g., cb, cr) blocks. In some cases, a unit can be used interchangeably with terms such as a block or an area. In general, an MxN block can include a set (or an array) of M columns and N rows of samples (or a sample array) or transform coefficients.

[0047] In the present specification, "A or B" can mean "only A", "only B", or "both A and B". In other words, in the present specification, "A or B" can be interpreted as "A and / or B". For example, "A, B, or C" in the present specification means "only A", "only B", "only C", or "any one of A, B, and C and any combination thereof".

[0048] In the present specification, a slash ( / ) or a comma (,) used can mean "and / or". For example, "A / B" can mean "A and / or B". Accordingly, "A / B" can mean "only A", "only B", or "both A and B". For example, "A, B, C" can mean "A, B, or C".

[0049] In the present specification, "at least one of A and B" can mean "only A", "only B", or "both A and B". In addition, in the present specification, the expression "at least one of A or B" or "at least one of A and / or B" can be interpreted as the same as "at least one of A and B".

[0050] In addition, in the present specification, "at least one of A, B, and C" means "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" can mean "at least one of A, B, and C".

[0051] In addition, a bracket used in the present specification can mean "for example". Specifically, when indicating "prediction (intra prediction)", "intra prediction" can be proposed as an example of "prediction". In other words, "prediction" in the present specification is not limited to "intra prediction", and "intra prediction" can be proposed as an example of "prediction". In addition, even when indicating "prediction (i.e., intra prediction)", "intra prediction" can be proposed as an example of "prediction".

[0052] In the present specification, technical features described separately in one drawing can be implemented separately or can be implemented simultaneously.

[0053] The following drawings are created in order to explain specific examples of the present specification. Since names of specific apparatuses described in the drawings or names of specific signals / messages / fields are presented in an exemplary manner, technical features of the present specification are not limited to the specific names used in the following drawings.

[0054] Figure 2 is a schematic diagram illustrating a configuration of a video / image encoding apparatus to which embodiments of the present disclosure can be applied. Hereinafter, the video encoding apparatus can include an image encoding apparatus.

[0055] Referring to Figure 2 , the encoding apparatus 200 includes an image partitioner 210, a predictor 220, a residual processor 230, and an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 can include an inter-predictor 221 and an intra-predictor 222. The residual processor 230 can include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 can further include a subtractor 231. The adder 250 can be referred to as a reconstructor or a reconstructed block generator. According to an embodiment, the image partitioner 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250, and the filter 260 can be constituted by at least one hardware component (e.g., an encoder chipset or a processor). In addition, the memory 270 can include a decoded picture buffer (DPB) or can be constituted by a digital storage medium. The hardware component can further include the memory 270 as an internal / external component.

[0056] The image partitioner 210 can partition an input image (or picture or frame) input to the encoding apparatus 200 into one or more processors. For example, the processor can be referred to as a coding unit (CU). In this case, the coding unit can be recursively partitioned from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad tree binary tree ternary (QTBTT) structure. For example, one coding unit can be partitioned into a plurality of coding units having a deeper depth based on a quad tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad tree structure can be first applied, and then the binary tree structure and / or the ternary structure can be applied. Alternatively, the binary tree structure can be first applied. The encoding process according to the disclosure can be performed based on the final coding unit that is no longer partitioned. In this case, the largest coding unit can be used as the final coding unit based on coding efficiency according to image characteristics, or if necessary, the coding unit can be recursively partitioned into a coding unit having a deeper depth and having an optimal size, and the coding unit can be used as the final coding unit. Here, the encoding process can include a process of prediction, transformation, and reconstruction, which will be described later. As another example, the processor can further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit can be separated or partitioned from the final coding unit described above. The prediction unit can be a unit of sample prediction, and the transform unit can be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.

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

[0058] In the encoding device 200, a prediction signal (prediction block, prediction sample array) output from the inter-predictor 221 or the intra-predictor 222 is subtracted from an input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array) and the generated residual signal is sent to the transformer 232. In this case, as illustrated, a unit for subtracting a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoding device 200 can be referred to as a subtractor 231. The predictor can perform prediction on a block to be processed (hereinafter referred to as a current block) and generate a prediction block including predicted samples of the current block. The predictor can determine whether to apply intra-prediction or inter-prediction on a basis of the current block or CU. As described later in the description of each prediction mode, the predictor can generate various information related to prediction, such as prediction mode information, and send the generated information to the entropy encoder 240. The information about prediction can be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0059] The intra-predictor 222 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the referred samples can be located in the vicinity of the current block, or can be far away from the current block. In intra-prediction, the prediction mode can include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes can include, for example, a DC mode and a planar mode. Depending on the level of detail of the prediction direction, the directional modes can include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and depending on the settings, more or less directional prediction modes can be used. The intra-predictor 222 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.

[0060] The inter predictor 221 can derive a prediction block of a current block based on a reference block (a reference sample array) specified by a motion vector on a reference picture. Here, to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of a block, a sub-block, or a sample based on the correlation of the motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block can be the same or different. The temporal neighboring block can be referred to as a collocated reference block, a colCU, etc., and the reference picture including the temporal neighboring block can be referred to as a colPic. For example, the inter predictor 221 can configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate to use to derive the motion vector and / or the reference picture index of the current block. The inter prediction can be performed based on various prediction modes. For example, in the case of a skip mode and a merge mode, the inter predictor 221 can use the motion information of the neighboring blocks as the motion information of the current block. In the skip mode, unlike the merge mode, a residual signal can not be transmitted. In the case of a motion vector prediction (MVP) mode, the motion vector of the neighboring block can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling a motion vector difference.

[0061] The predictor 220 can generate a prediction signal based on various prediction methods described below. For example, the predictor can not only apply intra prediction or inter prediction to predict one block, but also can simultaneously apply both the intra prediction and the inter prediction. This can be referred to as combined inter-intra prediction (CIIP). In addition, the predictor can predict a block based on an intra block copy (IBC) prediction mode or a palette mode. The IBC prediction mode or the palette mode can be used for content image / video encoding of a game or the like, e.g., screen content coding (SCC). The IBC is basically performed in the current picture, but can be performed similarly to the inter prediction in that a reference block is derived in the current picture. That is, the IBC can use at least one of the inter prediction techniques described in the disclosure. The palette mode can be regarded as an example of intra coding or intra prediction. When the palette mode is applied, sample values within a picture can be signaled based on information about a palette table and a palette index.

[0062] The prediction signal generated by the predictor (including the inter-predictor 221 and / or the intra-predictor 222) can be used to generate a reconstructed signal or to generate a residual signal. The transformer 232 can generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique can include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a karhunen-loève transform (KLT), a graph-based transform (GBT), or a conditional non-linear transform (CNT). Here, the GBT denotes a transform obtained from a graph when relationship information between pixels is represented by a graph. The CNT refers to a transform generated based on a prediction signal generated using all previously reconstructed pixels. Also, the transform process can be applied to a square pixel block having the same size, or can be applied to a block having a variable size other than a square.

[0063] The quantizer 233 can quantize the transform coefficients and transmit them to the entropy encoder 240, and the entropy encoder 240 can encode a quantized signal (information about the quantized transform coefficients) and output a bitstream. The information about the quantized transform coefficients can be referred to as residual information. The quantizer 233 can rearrange the block-type quantized transform coefficients into a one-dimensional vector form based on a coefficient scan order, and generate information about the quantized transform coefficients based on the one-dimensional vector-form quantized transform coefficients. Information about the transform coefficients can be generated. The entropy encoder 240 can perform various encoding methods such as, for example, exponential Golomb (Golomb), context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 240 can encode information (e.g., values of syntax elements, etc.) required for video / image reconstruction together or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) can be transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer). The video / image information can further 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 further include general constraint information. In the disclosure, information and / or syntax elements transmitted / signaled from the encoding apparatus to the decoding apparatus can be included in the video / picture information. The video / image information can be encoded through the above-described encoding process and included in the bitstream. The bitstream can be transmitted through a network, or can be stored in a digital storage medium. The network can include a broadcast network and / or a communication network, and the digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that transmits a signal output from the entropy encoder 240 and / or a storage unit (not shown) that stores the signal can be included as an internal / external element of the encoding apparatus 200, and alternatively, the transmitter can be included in the entropy encoder 240.

[0064] The quantized transform coefficients output from the quantizer 233 can be used to generate a prediction signal. For example, a residual signal (a residual block or a residual sample) can be reconstructed by applying dequantization and inverse transform to the quantized transform coefficients using the inverse quantizer 234 and the inverse transformer 235. The adder 250 adds the reconstructed residual signal to the prediction signal output from the inter-predictor 221 or the intra-predictor 222 to generate a reconstructed signal (a reconstructed picture, a reconstructed block, a reconstructed sample array). If there is no residual for a block to be processed (such as in the case where a skip mode is applied), the prediction block can be used as the reconstructed block. The adder 250 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-prediction of a next block to be processed in the current picture, and can be used for inter-prediction of a next picture through filtering as described below.

[0065] Further, during picture encoding and / or reconstruction, luminance mapping with chrominance scaling (LMCS) can be applied.

[0066] The filter 260 can improve 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 store the modified reconstructed picture in the memory 270 (specifically, the DPB of the memory 270). The various filtering methods can include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filter 260 can generate various information related to filtering, and transmit the generated information to the entropy encoder 240, as described later in the description of the various filtering methods. The information related to filtering can be encoded by the entropy encoder 240 and output in the form of a bitstream.

[0067] The modified reconstructed picture transmitted to the memory 270 can be used as a reference picture in the inter-predictor 221. When inter-prediction is applied by the encoding apparatus, prediction mismatch between the encoding apparatus 200 and a decoding apparatus can be avoided, and encoding efficiency can be improved.

[0068] The DPB of the memory 270 can store the modified reconstructed picture used as a reference picture in the inter-predictor 221. The memory 270 can store motion information of a block from which motion information in the current picture is derived (or encoded), and / or motion information of a reconstructed block in the picture. The stored motion information can be transmitted to the inter-predictor 221, and used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 can store reconstructed samples of a reconstructed block in the current picture, and can transfer the reconstructed samples to the intra-predictor 222.

[0069] Figure 3 is a schematic diagram illustrating a configuration of a video / image decoding apparatus to which embodiments of the present disclosure can be applied.

[0070] Referring to Figure 3 , the decoding apparatus 300 can include an entropy decoder 310, a residue processor 320, a predictor 330, an adder 340, a filter 350, a memory 360. The predictor 330 can include an inter-predictor 332 and an intra-predictor 331. The residue processor 320 can include a dequantizer 321 and an inverse transformer 322. According to an embodiment, the entropy decoder 310, the residue processor 320, the predictor 330, the adder 340, and the filter 350 can be constituted by hardware components (e.g., a decoder chipset or a processor). In addition, the memory 360 can include a decoded picture buffer (DPB), or can be constituted by a digital storage medium. The hardware components can further include the memory 360 as an internal / external component.

[0071] When a bitstream including video / image information is input, the decoding apparatus 300 can reconstruct an image in correspondence with the processing of the video / image information handled in the encoding apparatus of Figure 2 . For example, the decoding apparatus 300 can derive a unit / block based on block partitioning-related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processor applied in the encoding apparatus. Accordingly, the processor for decoding can be, for example, an encoding unit, and can partition an encoding unit from a coding tree unit or a largest coding unit according to a quad-tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the encoding unit. The reconstructed image signal decoded and output by the decoding apparatus 300 can be reproduced through a reproducing device.

[0072] The decoding apparatus 300 can receive a bitstream from Figure 2The signal output from the encoding apparatus can be received, and the received signal can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse a bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information can further include information on various parameter sets such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information can further include general constraint information. The decoding apparatus can further decode a picture based on the information on the parameter sets and / or the general constraint information. The signaled / received information and / or syntax elements described later in the disclosure can be decoded through the decoding process and obtained from the bitstream. For example, the entropy decoder 310 decodes information in the bitstream based on an encoding method such as exponential Golomb coding, CAVLC, or CABAC, and outputs syntax elements and quantized values of transform coefficients of a residual required for image reconstruction. More specifically, the CABAC entropy decoding method can receive bins corresponding to each syntax element in the bitstream, determine a context model using information of a decoding target syntax element, decoding information of a decoding target block, or a symbol / bin decoded in a previous stage, and arithmetically decode the bins by predicting a probability of occurrence of the bins according to the determined context model, and generate a symbol corresponding to a value of each syntax element. In this case, after the context model is determined, the CABAC entropy decoding method can update the context model by using information of the decoded symbol / bin for the context model of the next symbol / bin. Information related to prediction among the information decoded by the entropy decoder 310 can be provided to the predictor (inter-predictor 332 and intra-predictor 331), and residual values (that is, quantized transform coefficients and related parameter information) on 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 (a residual block, residual samples, a residual sample array). In addition, information on filtering among the information decoded by the entropy decoder 310 can be provided to the filter 350. Further, a receiver (not shown) for receiving a signal output from the encoding apparatus can be further configured as an internal / external element of the decoding apparatus 300, or the receiver can be a component of the entropy decoder 310. In addition, the decoding apparatus according to the disclosure can be referred to as a video / image / picture decoding apparatus, and the decoding apparatus can be classified into an information decoder (a video / image / picture information decoder) and a sample decoder (a video / image / picture sample decoder). The information decoder can include the entropy decoder 310, and the sample decoder can include at least one of the inverse quantizer 321, the inverse transformer 322, the adder 340, the filter 350, the memory 360, the inter-predictor 332, and the intra-predictor 331.

[0073] The dequantizer 321 can dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 321 can rearrange the quantized transform coefficients in the form of a two-dimensional block. In this case, the rearrangement can be performed based on a coefficient scanning order performed in the encoding apparatus. The dequantizer 321 can perform dequantization on the quantized transform coefficients by using a quantization parameter (e.g., quantization step length information), and obtain the transform coefficients.

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

[0075] The predictor can perform prediction on the current block and generate a prediction block including predicted samples of the current block. The predictor can determine whether to apply intra prediction or inter prediction to the current block based on information about prediction output from the entropy decoder 310, and can determine a specific intra / inter prediction mode.

[0076] The predictor can generate a predicted signal based on various prediction methods described below. For example, the predictor can not only apply intra prediction or inter prediction to predict one block, but also can simultaneously apply intra prediction and inter prediction. This can be referred to as combined inter and intra prediction (CIIP). In addition, the predictor can predict a block based on an intra block copy (IBC) prediction mode or a palette mode. The IBC prediction mode or the palette mode can be used for content image / video encoding of games, etc., for example, screen content coding (SCC). The IBC basically performs prediction in the current picture, but can be performed similarly to inter prediction in that a reference block is derived in the current picture. That is, the IBC can use at least one of the inter prediction techniques described in the present disclosure. The palette mode can be regarded as an example of intra coding or intra prediction. When the palette mode is applied, sample values within a picture can be signaled based on information about a palette table and a palette index.

[0077] The intra predictor 331 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the referred samples can be located in the vicinity of the current block, or can be far from the current block. In intra prediction, the prediction mode can include a plurality of non-directional modes and a plurality of directional modes. The intra predictor 331 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.

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

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

[0080] The adder 340 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra prediction of a next block to be processed in the current picture, can be output through filtering as described below, or can be used for inter prediction of a next picture.

[0081] In addition, luminance mapping and chrominance scaling (LMCS) can be applied in the picture decoding process.

[0082] The filter 350 can improve 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 store the modified reconstructed picture in the memory 360 (specifically, the DPB of the memory 360). The various filtering methods can include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0083] The reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter prediction 332. The memory 360 can store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a reconstructed block in the picture. The stored motion information can be sent to the inter prediction 332 to be utilized as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 360 can store reconstructed samples of a reconstructed block in the current picture and can transfer the reconstructed samples to the intra prediction 331.

[0084] In the disclosure, the embodiments described in the filter 260, the inter prediction 221, and the intra prediction 222 of the encoding apparatus 200 can be the same as or respectively applied to correspond to the filter 350, the inter prediction 332, and the intra prediction 331 of the decoding apparatus 300. The same can also apply to the inter prediction 332 and the intra prediction 331.

[0085] In the disclosure, at least one of the quantization / dequantization and / or the transform / inverse transform can be omitted. When the quantization / dequantization is omitted, the quantized transform coefficient can be referred to as a transform coefficient. When the transform / inverse transform is omitted, the transform coefficient can be referred to as a coefficient or a residual coefficient, or for the unity of expression, can still be referred to as a transform coefficient.

[0086] In the disclosure, the quantized transform coefficient and the transform coefficient can be referred to as a transform coefficient and a scaled transform coefficient, respectively. In this case, the residual information can include information on the transform coefficient, and the information on the transform coefficient can be signaled through a residual coding syntax. The transform coefficient can be derived based on the residual information (or the information on the transform coefficient), and the scaled transform coefficient can be derived by inverse transforming (scaling) the transform coefficient. The residual sample can be derived based on inverse transforming (transforming) the scaled transform coefficient. This can also be applied / expressed in other parts of the disclosure.

[0087] Further, as described above, when performing video encoding, prediction is performed to improve compression efficiency. By doing so, a prediction block including prediction samples for a current block can be generated as a block to be encoded, i.e., an encoding target block. Here, the prediction block includes prediction samples in a spatial domain (or pixel domain). The prediction block is derived in the same way in the encoding device and the decoding device, and the encoding device can signal information about a residual between the original block and the prediction block (residual information) to the decoding device instead of original sample values of the original block, thereby improving image encoding efficiency. The decoding device can derive a residual block including residual samples based on the residual information, add the residual block and the prediction block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.

[0088] The residual information can be generated through a transform and quantization process. For example, the encoding device can derive a residual block between the original block and the prediction block, can perform a transform process on residual samples (a residual sample array) included in the residual block to derive transform coefficients, can perform a quantization process on the transform coefficients to derive quantized transform coefficients, and can signal the relevant residual information to the decoding device (through a bitstream). Here, the residual information can include value information of the quantized transform coefficients, position information, value information of a transform technique, a transform core, and a quantization parameter, etc. The decoding device can perform a dequantization / inverse transform process based on the residual information and derive the residual samples (or the residual block). The decoding device can generate a reconstructed picture based on the prediction block and the residual block. Further, for a reference for inter prediction of a picture to be referred to later, the encoding device can dequantize / inverse transform the quantized transform coefficients to derive the residual block, and generate a reconstructed picture based thereon.

[0089] Intra prediction can refer to a prediction that generates prediction samples of a current block based on reference samples in a picture to which the current block belongs (hereinafter referred to as a current picture). When intra prediction is applied to the current block, neighboring reference samples to be used for intra prediction of the current block can be derived. The neighboring reference samples of the current block can include samples neighboring a left boundary of the current block having a size of nWx nH and a total of 2x nH samples neighboring a lower left of the current block, samples neighboring a top boundary of the current block and a total of 2x nW samples neighboring an upper right of the current block, and samples neighboring an upper left of the current block. Alternatively, the neighboring reference samples of the current block can include a plurality of columns of top neighboring samples and a plurality of rows of left neighboring samples. Further, the neighboring reference samples of the current block can include a total of nH samples neighboring a right boundary of the current block having a size of nWx nH, a total of nW samples neighboring a lower boundary of the current block, and samples neighboring a lower right boundary of the current block.

[0090] However, some neighboring reference samples of the current block are not yet decoded or can not be available. In this case, the decoder can construct the neighboring reference samples to be used for prediction by replacing the unavailable samples with available samples. Alternatively, the neighboring reference samples to be used for prediction can be configured by interpolating the available samples.

[0091] When deriving the neighboring reference samples, (i) the prediction sample can be derived based on an average or an interpolation of the neighboring reference samples of the current block, or (ii) the prediction sample can be derived based on a reference sample existing in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. Case (i) can be referred to as a non-directional mode or a non-angular mode, and case (ii) can be referred to as a directional mode or an angular mode.

[0092] In addition, the prediction sample can be generated by interpolating a first neighboring sample located in a prediction direction of an intra prediction mode of the current block and a second neighboring sample located in a direction opposite to the prediction direction among the neighboring reference samples. The above-described case can be referred to as linear interpolation intra prediction (LIP). In addition, a linear model (LM) can be used to generate a chroma prediction sample based on a luma sample. This case can be referred to as an LM mode or a chroma component LM (CCLM) mode.

[0093] In addition, a temporary prediction sample of the current block is derived based on the filtered neighboring reference samples, and the prediction sample of the current block can also be derived by weightedly summing at least one reference sample derived according to an intra prediction mode among the existing neighboring reference samples (i.e., unfiltered neighboring reference samples) and the temporary prediction sample. The above-described case can be referred to as position dependent intra prediction (PDPC).

[0094] In addition, a reference sample line having the highest prediction accuracy is selected from among the neighboring multiple reference sample lines of the current block, and a prediction sample is derived using a reference sample located in a prediction direction in the selected line. In this case, the intra prediction encoding can be performed by indicating (signaling) the reference sample line used to the decoding device. The above-described case can be referred to as multi-reference line intra prediction or MRL-based intra prediction.

[0095] In addition, the current block is divided into vertical sub-partitions or horizontal sub-partitions, and the intra prediction is performed based on the same intra prediction mode, but the neighboring reference samples can be derived and used in units of the sub-partitions. That is, in this case, the intra prediction mode of the current block is equally applied to the sub-partitions, but in some cases, the intra prediction performance can be improved by deriving and using the neighboring reference samples in units of the sub-partitions. This prediction method can be referred to as intra prediction based on internal sub-partition (ISP).

[0096] The above-described intra prediction method can be referred to as an intra prediction type to be distinguished from the intra prediction mode. The intra prediction type can be referred to by various terms such as an intra prediction technique or an additional intra prediction mode. For example, the intra prediction type (or the additional intra prediction mode, etc.) can include at least one of the above-described LIP, PDPC, MRL, and ISP. A general intra prediction method excluding a specific intra prediction type such as LIP, PDPC, MRL, and ISP can be referred to as a normal intra prediction type. When the above-described specific intra prediction type is not applied, the normal intra prediction type can be generally applied, and prediction can be performed based on the above-described intra prediction mode. In addition, if necessary, post-processing filtering can be performed on the derived prediction samples.

[0097] Specifically, the intra prediction process can include an intra prediction mode / type determination step, a neighboring reference sample derivation step, and a prediction sample derivation step based on the intra prediction mode / type. In addition, if necessary, a post-filtering step can be performed on the derived prediction samples.

[0098] When intra prediction is applied, the intra prediction mode applied to the current block can be determined using the intra prediction mode of the neighboring block. For example, the decoding apparatus can select one of the most probable mode (MPM) candidates in an MPM list derived based on the intra prediction mode of the neighboring block (e.g., the left neighboring block and / or the top neighboring block) of the current block and an additional candidate mode, or select one of the remaining intra prediction modes (and the planar mode) based on the remaining intra prediction mode information, which is not included in the MPM candidates. The MPM list can be configured to include or not include the planar mode as a candidate. For example, when the MPM list includes the planar mode as a candidate, the MPM list can have 6 candidates, and when the MPM list does not include the planar mode as a candidate, the MPM list can have 5 candidates. When the MPM list does not include the planar mode as a candidate, a non-planar flag (e.g., intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not the planar mode can be signaled. For example, the MPM flag can be first signaled, and when the value of the MPM flag is 1, the MPM index and the non-planar flag can be signaled. In addition, when the value of the non-planar flag is 1, the MPM index can be signaled. Here, the fact that the MPM list is configured not to include the planar mode as a candidate is that the planar mode is always considered to be the MPM, not that the planar mode is not the MPM, and thus, the flag (not the planar flag) is first signaled to check whether it is the planar mode.

[0099] For example, an intra prediction mode applied to a current block can be indicated to be in MPM candidates (and a planar mode) or in remaining modes based on an MPM flag (e.g., intra_luma_mpm_flag). An MPM flag with a value of 1 can indicate that the intra prediction mode of the current block is within the MPM candidates (and a planar mode), and an MPM flag with a value of 0 can indicate that the intra prediction mode of the current block is not within the MPM candidates (and a planar mode). A non-planar flag (e.g., intra_luma_not_planar_flag) with a value of 0 can indicate that the intra prediction mode of the current block is a planar mode, and a non-planar flag with a value of 1 can indicate that the intra prediction mode of the current block is not a planar mode. An MPM index can be signaled in the form of an mpm_idx or an intra_luma_mpm_idx syntax element, and remaining intra prediction mode information can be signaled in the form of a rem_intra_luma_pred_mode or an intra_luma_mpm_remainder syntax element. For example, the remaining intra prediction mode information can indicate one of the remaining intra prediction modes that are not included in the MPM candidates (and a planar mode) among all intra prediction modes by indexing in the order of the prediction mode numbers. The intra prediction mode can be an intra prediction mode for a luma component (samples). Hereinafter, the intra prediction mode information can include at least one of an MPM flag (e.g., intra_luma_mpm_flag), a non-planar flag (e.g., intra_luma_not_planar_flag), an MPM index (e.g., mpm_idx or intra_luma_mpm_idx), or remaining intra prediction mode information (rem_intra_luma_luma_mpm_mode or intra_luma_mpminder). In the disclosure, an MPM list can be referred to by various terms such as an MPM candidate list and candModeList. When MIP is applied to a current block, a separate MPM flag (e.g., intra_mip_mpm_flag) of MIP, an MPM index (e.g., intra_mip_mpm_idx), and remaining intra prediction mode information (e.g., intra_mip_mpm_remainder) can be signaled, and a non-planar flag can not be signaled.

[0100] In other words, generally, when performing block partitioning of an image, a current block to be encoded and a neighboring block have similar image characteristics. Accordingly, there is a high probability that the current block and the neighboring block have the same or similar intra prediction modes. Accordingly, an encoder can use an intra prediction mode of the neighboring block to encode an intra prediction mode of the current block.

[0101] For example, the decoding apparatus / encoding apparatus can construct a most probable mode (MPM) list of the current block. The MPM list can be referred to as an MPM candidate list. Here, the MPM can refer to a mode used for improving coding efficiency in consideration of similarity between the current block and neighboring blocks during intra prediction mode encoding. As described above, the MPM list can be constructed to include the planar mode, or can be constructed to exclude the planar mode. For example, when the MPM list includes the planar mode, the number of candidates in the MPM list can be 6. Also, when the MPM list does not include the planar mode, the number of candidates in the MPM list can be 5.

[0102] The encoder / decoder can construct an MPM list including five MPMs or six MPMs.

[0103] To construct the MPM list, three types of modes such as a default intra mode, a neighboring intra mode, and a derived intra mode can be considered.

[0104] For the neighboring intra mode, two neighboring blocks (i.e., a left neighboring block and a top neighboring block) can be considered.

[0105] As described above, if the MPM list is constructed to not include the planar mode, the planar mode can be excluded from the list, and the number of MPM list candidates can be set to five.

[0106] In addition, a non-directional mode (or a non-angular mode) among the intra prediction modes can include a DC mode based on an average value of neighboring reference samples of the current block or an interpolated planar mode.

[0107] Further, when inter prediction is applied, a predictor of the encoding / decoding device can derive prediction samples by performing inter prediction in a unit of block. Inter prediction can be applied when prediction is performed on a current block. That is, a predictor (more specifically, an inter predictor) of the encoding / decoding device can derive prediction samples by performing inter prediction in a unit of block. Inter prediction can mean prediction derived by a method depending on a data element (e.g., a sample value or motion information) of a picture other than a current picture. When inter prediction is applied to a current block, a prediction block (a prediction sample array) of the current block can be derived based on a reference block (a reference sample array) specified by a motion vector on a reference picture indicated by a reference picture index. In this case, in order to reduce the amount of motion information transmitted in an inter prediction mode, motion information of the current block can be predicted in a unit of block, sub-block, or sample based on the correlation of the motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can also include inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of applying inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in a reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block can be the same as or different from each other. The temporal neighboring block can be referred to as such a name as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block can be referred to as a collocated picture (colPic). For example, a motion information candidate list can be configured based on neighboring blocks of the current block, and in order to derive a motion vector and / or a reference picture index of the current block, flag or index information indicating which candidate is selected (used) can be signaled. Inter prediction can be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, motion information of the current block can be the same as that of a selected neighboring block. In the case of the skip mode, a residual signal can not be transmitted as in the merge mode. In the case of a motion vector prediction (MVP) mode, a motion vector of a selected neighboring block can be used as a motion vector predictor, and a motion vector difference can be signaled. In this case, the motion vector of the current block can be derived using a sum of the motion vector predictor and the motion vector difference.

[0108] Motion information can further include L0 motion information and / or L1 motion information depending on inter prediction types (L0 prediction, L1 prediction, Bi-prediction, etc.). An L0 directional motion vector can be referred to as an L0 motion vector or MVL0, and an L1 directional motion vector can be referred to as an L1 motion vector or MVL1. Prediction based on an L0 motion vector can be referred to as L0 prediction, prediction based on an L1 motion vector can be referred to as L1 prediction, and prediction based on both an L0 motion vector and an L1 motion vector can be referred to as bi-prediction. Here, an L0 motion vector can indicate a motion vector associated with a reference picture list L0, and an L1 motion vector can indicate a motion vector associated with a reference picture list L1. A reference picture list L0 can include pictures preceding a current picture in output order, and a reference picture list L1 can include pictures succeeding the current picture in output order as reference pictures. A preceding picture can be referred to as a forward (reference) picture, and a succeeding picture can be referred to as a backward (reference) picture. A reference picture list L0 can further include pictures succeeding the current picture in output order as reference pictures. In this case, a preceding picture can be indexed first in the reference picture list L0, and then a succeeding picture can be indexed. A reference picture list L1 can further include pictures preceding the current picture in output order as reference pictures. In this case, a succeeding picture can be indexed first in the reference picture list L1, and then a preceding picture can be indexed. Here, the output order can correspond to a picture order count (POC) order.

[0109] A video / image encoding process based on inter prediction can illustratively include, for example, the following.

[0110] Figure 4 Examples of a video / image encoding method based on inter prediction are exemplified.

[0111] The encoding device performs inter prediction on the current block (S400). The encoding device can derive an inter prediction mode and motion information of the current block, and generate prediction samples of the current block. At this time, the inter prediction mode derivation process, the motion information derivation process, and the prediction sample generation process can be performed simultaneously, and any one of the processes can be performed earlier than the other processes. For example, the inter prediction unit of the encoding device can include a prediction mode derivation unit, a motion information derivation unit, and a prediction sample derivation unit, and the prediction mode derivation unit can derive a prediction mode for the current block, the motion information derivation unit can derive motion information of the current block, and the prediction sample derivation unit can derive prediction samples of the current block. For example, the inter prediction unit of the encoding device can search for a block similar to the current block in a predetermined region (search region) of a reference picture through motion estimation, and derive a reference block having a minimum difference from the current block or equal to or less than a predetermined criterion. A reference picture index of a reference picture in which the reference block is located can be indicated based on this derivation, and a motion vector can be derived based on a position difference between the reference block and the current block. The encoding device can determine a mode applied to the current block among various prediction modes. The encoding device can compare RD costs of the various prediction modes, and determine a best prediction mode for the current block.

[0112] For example, when the skip mode or the merge mode is applied to the current block, the encoding device can configure a merge candidate list to be described below, and derive a reference block having a minimum difference from the current block or equal to or less than a predetermined criterion among reference blocks indicated by merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block can be selected, and merge index information indicating the selected merge candidate can be generated and signaled to the decoding device. Motion information of the current block can be derived by using motion information of the selected merge candidate.

[0113] As another example, when the (A)MVP mode is applied to the current block, the encoding device can configure an (A)MVP candidate list to be described below, and use a motion vector of a selected mvp candidate among mvp candidates included in the (A)MVP candidate list as an mvp of the current block. In this case, for example, a motion vector indicating a reference block derived through motion estimation can be used as a motion vector of the current block, and an mvp candidate having a motion vector having a minimum difference from the motion vector of the current block among the mvp candidates can become the selected mvp candidate. A motion vector difference (MVD) obtained by subtracting the mvp from the motion vector of the current block can be derived. In this case, information about the MVD can be signaled to the decoding device. Furthermore, when the (A)MVP mode is applied, a value of a reference picture index can be configured as reference picture index information and separately signaled to the decoding device.

[0114] The encoding device can derive the residual samples based on the prediction samples (S410). The encoding device can derive the residual samples by comparing the original samples of the current block and the prediction samples.

[0115] The encoding device encodes the image information including the prediction information and the residual information (S420). The encoding device can output the encoded image information in the form of a bitstream. The prediction information can include information on prediction mode information (e.g., a skip flag, a merge flag, or a mode index, etc.) and information on motion information, as information related to the prediction process. The information on motion information can include candidate selection information (e.g., a merge index, an mvp flag, or an mvp index), which is information used to derive a motion vector. In addition, the information on motion information can include information on an MVD and / or reference picture index information. In addition, the information on motion information can include information indicating whether to apply L0 prediction, L1 prediction, or bi-prediction. The residual information is information on the residual samples. The residual information can include information on quantized transform coefficients used for the residual samples.

[0116] The output bitstream can be stored in a (digital) storage medium and transmitted to a decoding device, or transmitted to a decoding device via a network.

[0117] In addition, as described above, the encoding device can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is to derive the same prediction result as that performed by the decoding device, and as a result, the encoding efficiency can be improved. Accordingly, the encoding device can store the reconstructed picture (or the reconstructed samples or the reconstructed blocks) in a memory and use the reconstructed picture as a reference picture. As described above, in-loop filtering processing can be further applied to the reconstructed picture.

[0118] The video / image decoding process based on inter prediction can illustratively include, for example, the following.

[0119] Figure 5 An example of a video / image decoding method based on inter prediction is exemplified.

[0120] Referring to Figure 5 , the decoding device can perform operations corresponding to those performed by the encoding device. The decoding device can perform prediction on the current block based on the received prediction information and derive prediction samples.

[0121] Specifically, the decoding device can determine a prediction mode of the current block based on the received prediction information (S500). The decoding device can determine which inter prediction mode to apply to the current block based on the prediction mode information in the prediction information.

[0122] For example, it can be determined whether the merge mode or the (A)MVP mode is applied to the current block based on the merge flag. Alternatively, one of various inter prediction mode candidates can be selected based on the mode index. The inter prediction mode candidates can include the skip mode, the merge mode and / or the (A)MVP mode, or can include various inter prediction modes to be described below.

[0123] The decoding device derives the motion information of the current block based on the determined inter prediction mode (S510). For example, when the skip mode or the merge mode is applied to the current block, the decoding device can configure a merge candidate list to be described below and select one of the merge candidates included in the merge candidate list. Here, the selection can be performed based on selection information (merge index). The motion information of the current block can be derived by using the motion information of the selected merge candidate. The motion information of the selected merge candidate can be used as the motion information of the current block.

[0124] As another example, when the (A)MVP mode is applied to the current block, the decoding device can configure an (A)MVP candidate list to be described below and use the motion vector of the selected mvp candidate among the motion vector predictor (mvp) candidates included in the (A)MVP candidate list as the mvp of the current block. Here, the selection can be performed based on selection information (mvp flag or mvp index). In this case, the MVD of the current block can be derived based on information about the MVD, and the motion vector of the current block can be derived based on the mvp and the MVD of the current block. In addition, the reference picture index of the current block can be derived based on the reference picture index information. The picture indicated by the reference picture index in the reference picture list for the current block can be derived as the reference picture referred to for inter prediction of the current block.

[0125] In addition, as described below, the motion information of the current block can be derived without candidate list configuration, and in this case, the motion information of the current block can be derived according to the process disclosed in the prediction mode. In this case, the candidate list configuration can be omitted.

[0126] The decoding device can generate the prediction samples for the current block based on the motion information of the current block (S520). In this case, the reference picture can be derived based on the reference picture index of the current block, and the prediction samples of the current block can be derived by using the samples of the reference block indicated by the motion vector of the current block on the reference picture. In this case, in some cases, a prediction sample filtering process for all or some of the prediction samples of the current block can be further performed.

[0127] For example, an inter prediction unit of a decoding device can include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and the prediction mode determination unit can determine a prediction mode for a current block based on received prediction mode information, the motion information derivation unit can derive motion information (motion vector and / or reference picture index) for the current block based on information about received motion information, and the prediction sample derivation unit can derive prediction samples for the current block.

[0128] The decoding device generates residual samples for the current block based on the received residual information (S530). The decoding device can generate reconstructed samples for the current block based on the prediction samples and the residual samples, and generate a reconstructed picture based on the generated reconstructed samples (S540). Thereafter, in-loop filtering processes can be further applied to the reconstructed picture as described above.

[0129] Figure 6 An inter prediction process is schematically illustrated.

[0130] Referring to Figure 6 As described above, an inter prediction process can include an inter prediction mode determination step, a motion information derivation step according to the determined prediction mode, and a prediction processing (prediction sample generation) step based on the derived motion information. The inter prediction process can be performed by an encoding device and a decoding device as described above. In this document, an encoding device can include an encoding device and / or a decoding device.

[0131] Referring to Figure 6 The encoding device determines an inter prediction mode for a current block (S600). Various inter prediction modes can be used for prediction of the current block in a picture. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, subblock merge mode, merge with MVD (MMVD) mode, and history motion vector prediction (HMVP) mode can be used. Decoder-side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, bi-prediction with CU-level weights (BCW), and bi-directional optical flow (BDOF) etc. can be further used as additional modes. The affine mode can also be referred to as affine motion prediction mode. The MVP mode can also be referred to as advanced motion vector prediction (AMVP) mode. In this document, some modes and / or motion information candidates derived by some modes can also be included in one of motion information related candidates in other modes. For example, a HMVP candidate can be added to a merge candidate of merge / skip mode, or to an mvp candidate of MVP mode. If the HMVP candidate is used as a motion information candidate of the merge mode or the skip mode, the HMVP candidate can be referred to as a HMVP merge candidate.

[0132] Prediction mode information indicating an inter prediction mode of the current block can be signaled from the encoding device to the decoding device. In this case, the prediction mode information can be included in the bitstream and received by the decoding device. The prediction mode information can include index information indicating one of a plurality of candidate modes. Alternatively, the inter prediction mode can be indicated by hierarchical signaling of flag information. In this case, the prediction mode information can include one or more flags. For example, whether to apply a skip mode can be indicated by signaling a skip flag, when the skip mode is not applied, whether to apply a merge mode can be indicated by signaling a merge flag, and when the merge mode is not applied, an indication to apply a MVP mode or a flag for additional distinction can be further signaled. An affine mode can be signaled as an independent mode, or as a dependent mode with respect to the merge mode or the MVP mode. For example, the affine mode can include an affine merge mode and an affine MVP mode.

[0133] The encoding device derives motion information for the current block (S610). The motion information derivation can be based on the inter prediction mode.

[0134] The encoding device can perform inter prediction using the motion information of the current block. The encoding device can derive the optimal motion information for the current block through a motion estimation process. For example, the encoding device can search for a similar reference block having high correlation in a predetermined search range in a reference picture by using an original block in an original picture for the current block, in fractional pixel units, and derive the motion information through the searched reference block. The similarity of the blocks can be derived according to a difference in phase-based sample values. For example, the similarity of the blocks can be calculated based on a sum of absolute differences (SAD) between the current block (or a template of the current block) and the reference block (or a template of the reference block). In this case, the motion information can be derived based on the reference block having the minimum SAD in the search area. The derived motion information can be signaled to the decoding device according to various methods based on the inter prediction mode.

[0135] The encoding device performs inter prediction based on the motion information for the current block (S620). The encoding device can derive prediction sample(s) for the current block based on the motion information. The current block including the prediction samples can be referred to as a prediction block.

[0136] Furthermore, as described above, the encoding apparatus can perform various encoding methods such as exponential Golomb, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC). In addition, the decoding apparatus can decode information in the bitstream on the basis of the encoding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements and quantized values of transform coefficients related to a residual necessary for image reconstruction.

[0137] For example, the above-described encoding method can be performed as described below.

[0138] Figure 7 An exemplary context adaptive binary arithmetic coding (CABAC) for encoding a syntax element is shown. For example, in the CABAC encoding process, when an input signal is a syntax element rather than a binary value, the encoding apparatus can convert the input signal into a binary value by binarizing a value of the input signal. In addition, when the input signal is already a binary value (i.e., when the value of the input signal is a binary value), binarization can not be performed, and can be bypassed. Here, each binary number 0 or 1 constituting a binary value can be referred to as a bin. For example, if a binary string after binarization is 110, each of 1, 1, and 0 can be referred to as a bin. A bin for one syntax element can indicate a value of the syntax element.

[0139] Thereafter, bins of binarization of the syntax element can be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding apparatus can assign a context model reflecting a probability value to a corresponding bin, and encode the corresponding bin on the basis of the assigned context model. The regular encoding engine of the encoding apparatus can update the context model for each bin after encoding each bin. The bin encoded as described above can be referred to as a context-coded bin.

[0140] In addition, when bins of binarization of the syntax element are input to the bypass encoding engine, they can be encoded as follows. For example, the bypass encoding engine of the encoding apparatus omits a process of estimating a probability with respect to an input bin and a process of updating a probability model applied to the bin after encoding. When bypass encoding is applied, the encoding apparatus can encode the input bin by applying a uniform probability distribution instead of assigning a context model, thereby increasing an encoding rate. The bin encoded as described above can be referred to as a bypass bin.

[0141] Entropy decoding can mean a process of performing the same processing as the above-described entropy encoding in reverse order.

[0142] For example, when a syntax element is decoded based on a context model, the decoding device can receive a bin corresponding to the syntax element through a bitstream, determine a context model using the syntax element and decoded information of a target block or a neighboring block or information of a decoded symbol / bin in a previous stage, predict a probability of occurrence of the received bin according to the determined context model, and perform arithmetic decoding on the bin to derive a value of the syntax element. Thereafter, the context model of the decoded bin can be updated using the determined context model.

[0143] In addition, for example, when a syntax element is bypass-decoded, the decoding device can receive a bin corresponding to the syntax element through a bitstream and decode the input bin by applying a uniform probability distribution. In this case, a process for deriving a context model of the syntax element and a process for updating a context model applied to the bin after decoding can be omitted.

[0144] As described above, a residual sample can be derived into a quantized transform coefficient through a transform and quantization process. The quantized transform coefficient can also be referred to as a transform coefficient. In this case, the transform coefficient in a block can be signaled in the form of residual information. The residual information can include residual coding syntax. That is, the encoding device can configure residual coding syntax using the residual information, encode the same, and output the same in the form of a bitstream, and the decoding device can decode the residual coding syntax from the bitstream and derive a residual (quantized) transform coefficient. The residual coding syntax can include syntax elements indicating whether a transform is applied to a corresponding block, a position of a last significant transform coefficient in a block, whether there is a significant transform coefficient in a sub-block, a size / sign of a significant transform coefficient, and the like, as will be described later.

[0145] For example, syntax elements related to residual data encoding / decoding can be expressed as shown in the following table.

[0146] [Table 1]

[0147]

[0148]

[0149]

[0150] transform_skip_flag indicates whether a transform is skipped in an associated block. The transform_skip_flag can be a syntax element of a transform skip flag. The associated block can be a coding block (CB) or a transform block (TB). The CB and the TB can be interchangeably used with respect to a transform (and quantization) and a residual coding process. For example, as described above, residual samples can be derived for a CB, and transform coefficients (quantized) can be derived by a transform and quantization of the residual samples, and by a residual coding process, information (e.g., syntax elements) efficiently indicating a position, size, sign, etc. of the (quantized) transform coefficients can be generated and signaled. The quantized transform coefficients can be simply referred to as transform coefficients. Generally, when the CB is not greater than a maximum TB, a size of the CB can be the same as a size of the TB, and in this case, a target block to be transformed (and quantized) and residual coded can be referred to as a CB or a TB. Also, when the CB is greater than the maximum TB, a target block to be transformed (and quantized) and residual coded can be referred to as a TB. Hereinafter, it will be described that syntax elements related to a residual coding are signaled in units of transform blocks (TBs), but this is an example, and as described above, the TBs can be interchangeably used with coding blocks (CBs).

[0151] Also, syntax elements signaled after the transform skip flag can be the same as syntax elements disclosed in Table 2 and / or Table 3 below, and detailed descriptions regarding the syntax elements are described below.

[0152] [Table 2]

[0153]

[0154]

[0155]

[0156]

[0157]

[0158]

[0159] [Table 3]

[0160]

[0161]

[0162]

[0163] According to the present embodiment, as shown in Table 1, the residual coding can be divided according to the value of the syntax element transform_skip_flag of the transform skip flag. That is, based on the value of the transform skip flag (based on whether the transform is skipped), different syntax elements can be used for the residual coding. The residual coding used when the transform skip is not applied (i.e., when the transform is applied) can be referred to as regular residual coding (RRC), and the residual coding used when the transform skip is applied (i.e., when the transform is not applied) can be referred to as transform skip residual coding (TSRC). In addition, the regular residual coding can be referred to as general residual coding. In addition, the regular residual coding can be referred to as regular residual coding syntax structure, and the transform skip residual coding can be referred to as transform skip residual coding syntax structure. The above Table 2 can show the syntax elements of the residual coding when the value of transform_skip_flag is 0 (i.e., when the transform is applied), and the above Table 3 can show the syntax elements of the residual coding when the value of transform_skip_flag is 1 (i.e., when the transform is not applied).

[0164] Specifically, for example, the transform skip flag indicating whether the transform of the transform block is skipped can be parsed, and it can be determined whether the transform skip flag is 1. If the value of the transform skip flag is 0, as shown in Table 2, the syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gtx_flag, par_level_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level for the residual coefficients of the transform block can be parsed, and the residual coefficients can be derived based on the syntax elements. In this case, the syntax elements can be parsed in sequence, and the parsing order can be changed. In addition, abs_level_gtx_flag can represent abs_level_gt1_flag and / or abs_level_gt3_flag. For example, abs_level_gtx_flag[n] can be an example of the first transform coefficient level flag (abs_level_gt1_flag), and abs_level_gtx_flag[n] can be an example of the second transform coefficient level flag (abs_level_gt3_flag).

[0165] Referring to Table 2 above, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level can be encoded / decoded. In addition, sb_coded_flag can be denoted as coded_sub_block_flag.

[0166] In an embodiment, the encoding device can encode (x, y) position information of the last non-zero transform coefficient in the transform block based on the syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. More specifically, last_sig_coeff_x_prefix denotes a prefix of the column position of the last significant coefficient in the transform block in a scan order, last_sig_coeff_y_prefix denotes a prefix of the row position of the last significant coefficient in the transform block in the scan order, last_sig_coeff_x_suffix denotes a suffix of the column position of the last significant coefficient in the transform block in the scan order, and last_sig_coeff_y_suffix denotes a suffix of the row position of the last significant coefficient in the transform block in the scan order. Here, the significant coefficient can denote a non-zero coefficient. In addition, the scan order can be a right diagonal scan order. Alternatively, the scan order can be a horizontal scan order or a vertical scan order. The scan order can be determined based on whether intra / inter prediction is applied to the target block (CB or CB including TB) and / or a specific intra / inter prediction mode.

[0167] Thereafter, the encoding device can divide the transform block into 4x4 sub-blocks, and then indicate whether there is a non-zero coefficient in the current sub-block using a 1-bit syntax element coded_sub_block_flag for each 4x4 sub-block.

[0168] If the value of coded_sub_block_flag is 0, there is no more information to be transmitted, and thus the encoding apparatus can terminate the encoding process for the current sub-block. In contrast, if the value of coded_sub_block_flag is 1, the encoding apparatus can successively perform the encoding process for sig_coeff_flag. Since a sub-block including the last non-zero coefficient does not need to encode coded_sub_block_flag and a sub-block including DC information of a transform block has a high probability of including a non-zero coefficient, coded_sub_block_flag can not be encoded and its value can be assumed to be 1.

[0169] If the value of coded_sub_block_flag is 1 and thus it is determined that there is a non-zero coefficient in the current sub-block, the encoding apparatus can encode sig_coeff_flag having a binary value according to the reverse scanning order. The encoding apparatus can encode a 1-bit syntax element sig_coeff_flag for each transform coefficient according to the scanning order. If the value of the transform coefficient at the current scanning position is not 0, the value of sig_coeff_flag can be 1. Here, in the case of a sub-block including the last non-zero coefficient, sig_coeff_flag does not need to be encoded for the last non-zero coefficient, and thus the encoding process for the sub-block can be omitted. Level information encoding can be performed only when sig_coeff_flag is 1, and four syntax elements can be used in the level information encoding process. More specifically, each sig_coeff_flag[xC][yC] can indicate whether the level (value) of the corresponding transform coefficient at each transform coefficient position (xC, yC) in the current TB is non-zero. In an embodiment, sig_coeff_flag can correspond to an example of a syntax element indicating whether a quantized transform coefficient is a non-zero significant coefficient.

[0170] The level value remaining after encoding sig_coeff_flag can be derived as shown in the following equation. That is, a syntax element remAbsLevel indicating the level value to be encoded can be derived from the following equation.

[0171] [Equation 1]

[0172]

[0173] Herein, coeff means an actual transform coefficient value.

[0174] In addition, abs_level_gt1_flag can indicate whether remAbsLevel' of a corresponding scan position (n) is greater than 1. For example, when the value of abs_level_gt1_flag is 0, the absolute value of a transform coefficient of a corresponding position can be 1. In addition, when the value of abs_level_gt1_flag is 1, remAbsLevel indicating a level value to be encoded later can be updated as shown in the following equation.

[0175] [Equation 2]

[0176]

[0177] In addition, the least significant bit (LSB) value of remAbsLevel described in Equation 2 above can be encoded by par_level_flag as in Equation 3 below.

[0178] [Equation 3]

[0179]

[0180] Herein, par_level_flag[n] can indicate the parity of a transform coefficient level (value) at a scan position (n).

[0181] The transform coefficient level value remAbsLevel to be encoded after performing par_level_flag encoding can be updated as shown in the following equation.

[0182] [Equation 4]

[0183]

[0184] abs_level_gt3_flag can indicate whether remAbsLevel' of a corresponding scan position (n) is greater than 3. The encoding of abs_remainder can be performed only in the case where rem_abs_gt3_flag is equal to 1. The relationship between the actual transform coefficient value coeff and each syntax element can be expressed as shown below using the following equation.

[0185] [Equation 5]

[0186]

[0187] In addition, the following table indicates an example related to Equation 5 above.

[0188] [Table 4]

[0189]

[0190] Herein, |coeff| indicates a transform coefficient level (value), and can also be indicated as AbsLevel of the transform coefficient. In addition, a sign of each coefficient can be coded by using coeff_sign_flag as a 1-bit symbol.

[0191] In addition, if the value of the transform skip flag is 1, syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag, and / or abs_remainder for residual coefficients of the transform block can be parsed as shown in Table 3, and residual coefficients can be derived based on the syntax elements. In this case, the syntax elements can be parsed in turn, and the parsing order can be changed. In addition, abs_level_gtx_flag can represent abs_level_gt1_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, and / or abs_level_gt9_flag. For example, abs_level_gtx_flag[n][j] can be a flag indicating whether an absolute value or level (value) of a transform coefficient at a scan position n is greater than (j<<1)+1. The condition (j<<1)+1 can be optionally replaced with a specific threshold value such as a first threshold value, a second threshold value, etc.

[0192] Further, CABAC provides high performance, but has a drawback of poor throughput performance. This is caused by a regular coding engine of CABAC. Regular coding (i.e., coding by the regular coding engine of CABAC) exhibits high data dependency because it uses a probability state and a range that are updated by coding of a previous bin, and it takes a lot of time to read a probability interval and determine a current state. The throughput problem of CABAC can be solved by limiting the number of bins that are context coded. For example, as shown in Table 2 above, the sum of bins for representing sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag can be limited to the number of bins depending on a corresponding block size. In addition, for example, as shown in Table 3 above, the sum of bins for representing sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, abs_level_gt9_flag can be limited to the number of bins depending on a corresponding block size. For example, if the corresponding block is a 4x4 size block, the sum of bins of sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag or sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, abs_level_gt9_flag can be limited to 32 (or, for example, 28), and if the corresponding block is a 2x2 size block, the sum of bins of sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag can be limited to 8 (or, for example, 7). The limited number of bins can be represented by remBinsPass1 or RemCcbs. Alternatively, for example, for higher CABAC throughput, the number of bins that are context coded can be limited for a block (CB or TB) including a coding target CG. In other words, the number of bins that are context coded can be limited in units of blocks (CB or TB).For example, when the size of the current block is 16x16, the number of bins used for context encoding of the current block can be limited to 1.75 times the number of pixels of the current block (i.e., 448), regardless of the current CG.

[0193] In this case, if all the context-encoded bins with the limited number are used when encoding the context elements, the encoding apparatus can binarize the remaining coefficients by the method of binarizing the coefficients as described below, instead of using context encoding, and can perform bypass encoding. In other words, for example, if the number of context-encoded bins for 4x4 CG encoding is 32 (or, for example, 28), or if the number of context-encoded bins for 2x2 CG encoding is 8 (or, for example, 7), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag encoded with context-encoded bins can no longer be encoded, and can be directly encoded as dec_abs_level. Alternatively, for example, when the number of context-encoded bins for 4x4 block encoding is 1.75 times the number of pixels of the entire block, i.e., when it is limited to 28, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag encoded as context-encoded bins can no longer be encoded, and can be directly encoded as dec_abs_level, as shown in Table 5 below.

[0194] [Table 5]

[0195]

[0196] A value |coeff| can be derived based on dec_abs_level. In this case, the transform coefficient value, i.e., |coeff|, can be derived as shown in the following equation.

[0197] [Equation 6]

[0198]

[0199] In addition, coeff_sign_flag can indicate the sign of the transform coefficient level at the corresponding scan position n. That is, coeff_sign_flag can indicate the sign of the transform coefficient at the corresponding scan position n.

[0200] Figure 8 An example of transform coefficients in a 4x4 block is shown.

[0201] Figure 8The 4x4 block of the quantized coefficient can represent an example of a quantized coefficient. Figure 8 The block of the quantized coefficient can be a 4x4 transform block or a 4x4 sub-block of an 8x8, 16x16, 32x32, or 64x64 transform block. Figure 8 The 4x4 block of the quantized coefficient can represent a luma block or a chroma block.

[0202] Further, as described above, when the input signal is not a binary value but a syntax element, the encoding apparatus can transform the input signal into a binary value by binarizing a value of the input signal. Also, the decoding apparatus can decode the syntax element to derive a binarized value (e.g., binarized bin) of the syntax element, and can de-binarize the binarized value to derive a value of the syntax element. The binarization process can be performed as a truncated rice (TR) binarization process, a k-th order exponential golomb (EGk) binarization process, a limited k-th order exponential golomb (limited EGk), a fixed length (FL) binarization process, etc. Also, the de-binarization process can denote a process performed based on the TR binarization process, the EGk binarization process, or the FL binarization process to derive the value of the syntax element.

[0203] For example, the TR binarization process can be performed as follows.

[0204] An input of the TR binarization process can be cMax and cRiceParam for the syntax element and a request for the TR binarization. Also, an output of the TR binarization process can be the TR binarization for symbolVal which is a value corresponding to a bin string.

[0205] Specifically, for example, in a case where there is a suffix bin string for the syntax element, the TR bin string for the syntax element can be a concatenation of a prefix bin string and the suffix bin string, and in a case where there is no suffix bin string, the TR bin string for the syntax element can be the prefix bin string. For example, the prefix bin string can be derived as follows.

[0206] A prefix value of symbolVal for the syntax element can be derived as shown in the following equation.

[0207] [Equation 7]

[0208]

[0209] In this context, prefixVal can denote a prefix value of symbolVal. The prefix of the TR bin string for the syntax element (i.e., the prefix bin string) can be derived as follows.

[0210] For example, if the prefixVal is less than cMax » cRiceParam, the prefix bin string can be a bit string of length prefixVal+1 indexed by the binIdx. That is, if the prefixVal is less than cMax » cRiceParam, the prefix bin string can be a bit string of which the number of bits indicated by the binIdx is prefixVal+1. The bins of the binIdx less than the prefixVal can be equal to 1. Also, the bin of the binIdx identical to the prefixVal can be equal to 0.

[0211] For example, the bin string derived by unary binarization of the prefixVal can be as shown in the following table.

[0212] [Table 6]

[0213]

[0214] Also, if the prefixVal is not less than cMax » cRiceParam, the prefix bin string can be a bit string of length cMax » cRiceParam and all bits of which are 1.

[0215] Also, if the cMax is greater than the symbolVal and if the cRiceParam is greater than 0, there can be a suffix bin string of the TR bin string. For example, the suffix bin string can be derived as described below.

[0216] The suffix value for the symbolVal of the syntax element can be derived as shown in the following equation.

[0217] [Equation 8]

[0218]

[0219] Herein, the suffixVal can denote a suffix value of the symbolVal.

[0220] The suffix of the TR bin string (i.e., the suffix bin string) can be derived based on the FL binarization process for the suffixVal of which the value cMax is (1 « cRiceParam) - 1.

[0221] Also, if the value of the input parameter (i.e., the cRiceParam) is 0, the TR binarization can be exactly truncated unary binarization, and can always use the value cMax identical to the possible maximum value of the syntax element to be decoded.

[0222] In addition, for example, the EGk binarization process can be performed as follows. The syntax element coded with ue(v) can be a syntax element subjected to exponential Golomb coding.

[0223] For example, the 0th order exponential Golomb (EG0) binarization process can be performed as follows.

[0224] The parsing process for the syntax element can start from reading a bit including a first non-zero bit from a current position of the bitstream and counting a number of leading bits equal to 0. This process can be expressed as shown in the following table.

[0225] [Table 7]

[0226]

[0227] In addition, the variable codeNum can be derived as follows.

[0228] [Equation 9]

[0229]

[0230] Herein, the value returned from read_bits(leadingZeroBits) (i.e., the value indicated by read_bits(leadingZeroBits)) can be interpreted as a binary representation of an unsigned integer of the most significant bit recorded first.

[0231] The structure of the exponential Golomb code in which a bit string is divided into "prefix" bits and "suffix" bits can be expressed as shown in the following table.

[0232] [Table 8]

[0233]

[0234] The "prefix" bits can be the bits parsed for the calculation of leadingZeroBits as described above, and can be indicated by 0 or 1 in the bit string in Table 8. That is, the bit string indicated by 0 or 1 in Table 8 above can represent the prefix bit string. The "suffix" bits can be the bits parsed in the calculation of codeNum, and can be represented by xi in Table 8 above. That is, the bit string indicated by xi in Table 8 above can represent the suffix bit string. Here, i can be a value from 0 to LeadingZeroBits - 1. In addition, each xi can be equal to 0 or 1.

[0235] The bit string assigned to codeNum can be as shown in the following table.

[0236] [Table 9]

[0237]

[0238] If the descriptor of the syntax element is ue(v) (i.e., if the syntax element is coded with ue(v)), the value of the syntax element can be equal to codeNum.

[0239] In addition, for example, the EGk binarization process can be executed as follows.

[0240] The input of the EGk binarization process can be a request for EGk binarization. In addition, the output of the EGk binarization process can be the EGk binarization for symbolVal (i.e., a value corresponding to a bin string).

[0241] The bin string of the EGk binarization process for symbolVal can be derived as follows.

[0242] [Table 10]

[0243]

[0244] Referring to Table 10 above, a binary value X can be added to the end of the bin string by each call of put(X). Herein, X can be 0 or 1.

[0245] In addition, for example, the limited EGk binarization process can be executed as follows.

[0246] The input of the limited EGk binarization process can be a request for limited EGk binarization, a Rice parameter ricParam, a variable log2TransformRange that is a binary logarithm representing a maximum value, and a variable maxPreExtLen that is a maximum prefix extension length. In addition, the output of the limited EGk binarization process can be the limited EGk binarization for symbolVal that is a value corresponding to an empty string.

[0247] The bin string of the limited EGk binarization process for symbolVal can be derived as follows.

[0248] [Table 11]

[0249]

[0250] In addition, for example, the FL binarization process can be executed as follows.

[0251] The input of the FL binarization process can be a request for cMax and FL binarization for a syntax element. In addition, the output of the FL binarization process can be the FL binarization for symbolVal that is a value corresponding to a bin string.

[0252] The FL binarization can be configured by using a fixed-length bit string having a bit number of symbolVal. In this context, the fixed-length bit can be an unsigned integer bit string. That is, a bit string for symbolVal as a symbol value can be derived by the FL binarization, and a bit length (i.e., a bit number) of the bit string can be a fixed length.

[0253] For example, the fixed length can be derived as shown in the following equation.

[0254] [Equation 10]

[0255]

[0256] An index for a bin of the FL binarization can be a method using a value sequentially increasing from a most significant bit to a least significant bit. For example, a bin index related to the most significant bit can be binIdx = 0.

[0257] Further, for example, a binarization process for a syntax element abs_remainder in residual information can be performed as follows.

[0258] An input for the binarization process for abs_remainder can be a request for binarization of a syntax element abs_remainder[n], a color component cIdx, and a luma position (x0, y0). The luma position (x0, y0) can indicate a top-left sample of a current luma transform block based on a top-left luma sample of a picture.

[0259] An output for the binarization process for abs_remainder can be a binarization of abs_remainder (i.e., a binarized bit string of abs_remainder). A bit string available for abs_remainder can be derived by the binarization process.

[0260] A Rice parameter cRiceParam for abs_remainder[n] can be derived with a Rice parameter derivation process performed by inputting a color component cIdx and a luma position (x0, y0), a current coefficient scan position (xC, yC), log2TbWidth as a binary logarithm of a transform block width, and log2TbHeight as a binary logarithm of a transform block height. A detailed description of the Rice parameter derivation process will be described later.

[0261] In addition, for example, cMax of abs_remainder[n] to be currently encoded can be derived based on the Rice parameter cRiceParam. cMax can be derived as shown in the following equation.

[0262] [Formula 11]

[0263]

[0264] In addition, binarization for abs_remainder (i.e., bin string for abs_remainder) can be a concatenation of a prefix bin string and a suffix bin string in the presence of the suffix bin string. Also, in the absence of the suffix bin string, the bin string for abs_remainder can be the prefix bin string.

[0265] For example, the prefix bin string can be derived as follows.

[0266] The prefix value prefixVal for abs_remainder[n] can be derived as shown in the following formula.

[0267] [Formula 12]

[0268]

[0269] The prefix of the bin string (i.e., prefix bin string) for abs_remainder[n] can be derived by TR binarization process for prefixVal, with cMax and cRiceParam as inputs.

[0270] If the prefix bin string is identical to a bit string of all bits being 1 and bit length of 6, there can be a suffix bin string for the bin string of abs_remainder[n] and it can be derived as follows.

[0271] The Rice parameter derivation process for dec_abs_level[n] can be as follows.

[0272] The inputs of the Rice parameter derivation process can be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a log2TbWidth as a binary logarithm of a transform block width, and a log2TbHeight as a binary logarithm of a transform block height. The luma position (x0, y0) can indicate a top-left sample of a current luma transform block based on a top-left luma sample of a picture. Also, the output of the Rice parameter derivation process can be a Rice parameter cRiceParam.

[0273] For example, the variable locSumAbs can be derived based on an array AbsLevel[x][y] of a transform block having a given component index cIdx and a top-left luma position (x0, y0), similar to the pseudo code disclosed in the following table.

[0274] [Table 12]

[0275]

[0276] Then, based on the given variable locSumAbs, the Rice parameter cRiceParam can be derived as shown in the following table.

[0277] [Table 13]

[0278]

[0279] In addition, for example, in the Rice parameter derivation process for abs_remainder[n], baseLevel can be set to 4.

[0280] Alternatively, for example, the Rice parameter cRiceParam can be determined based on whether a transform is applied to the current block. That is, if a transform is not applied to the current TB including the current CG, in other words, if a transform is skipped for the current TB including the current CG, the Rice parameter cRiceParam can be derived as 1.

[0281] In addition, the suffix value suffixVal of abs_remainder can be derived as shown in the following equation.

[0282] [Equation 13]

[0283]

[0284] The suffix bin string of the bin string of abs_remainder can be derived by a limited EGk binarization process for suffixVal, where k is set to cRiceParam+1, riceParam is set to cRiceParam, log2TransformRange is set to 15, and maxPreExtLen is set to 11.

[0285] Further, for example, the binarization process for the syntax element dec_abs_level in the residual information can be performed as follows.

[0286] The input to the binarization process for dec_abs_level can be a request for binarization of the syntax elements dec_abs_level[ n ], a color component cldx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a log2TbWidth that is a binary logarithm of a transform block width, and a log2TbHeight that is a binary logarithm of a transform block height. The luma position (x0, y0) can indicate a top-left sample of a current luma transform block based on a top-left luma sample of a picture.

[0287] The output of the binarization process for dec_abs_level can be a binarization of dec_abs_level (i.e., a bin string of dec_abs_level). The available bin string of dec_abs_level can be derived by the binarization process.

[0288] A Rice parameter cRiceParam of dec_abs_level[ n ] can be derived by a Rice parameter derivation process performed with the inputs of the color component cldx, the luma position (x0, y0), the current coefficient scan position (xC, yC), the log2TbWidth that is a binary logarithm of a transform block width, and the log2TbHeight that is a binary logarithm of a transform block height. Hereinafter, the Rice parameter derivation process will be described in detail.

[0289] In addition, for example, a cMax of dec_abs_level[ n ] can be derived based on the Rice parameter cRiceParam. The cMax can be derived as shown in the following table.

[0290] [Equation 14]

[0291]

[0292] Further, the binarization for dec_abs_level[ n ] (i.e., a bin string for dec_abs_level[ n ]) can be a concatenation of a prefix bin string and a suffix bin string in a case where the suffix bin string is present. In addition, in a case where the suffix bin string is not present, the bin string for dec_abs_level[ n ] can be the prefix bin string.

[0293] For example, the prefix bin string can be derived as described below.

[0294] A prefix value prefixVal of dec_abs_level[ n ] can be derived as shown in the following equation.

[0295] [Equation 15]

[0296]

[0297] The prefix of the bin string (i.e., the prefix bin string) of dec_abs_level[n] can be derived by the TR binarization process for prefixVal, where cMax and cRiceParam are used as inputs.

[0298] If the prefix bin string is identical to the bit string with all bits being 1 and the bit length being 6, there can be a suffix bin string of the bin string of dec_abs_level[n] and it can be derived as follows.

[0299] The Rice parameter derivation process for dec_abs_level[n] can be as follows.

[0300] The inputs of the Rice parameter derivation process can be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a log2TbWidth being a binary logarithm of a transform block width, and a log2TbHeight being a binary logarithm of a transform block height. The luma position (x0, y0) can indicate a top-left sample of a current luma transform block based on a top-left luma sample of a picture. In addition, the output of the Rice parameter derivation process can be a Rice parameter cRiceParam.

[0301] For example, a variable locSumAbs can be derived based on an array AbsLevel[x][y] of a transform block having a given component index cIdx and a top-left luma position (x0, y0), similar to the pseudo code disclosed in the following table.

[0302] [Table 14]

[0303]

[0304] Then, based on the given variable locSumAbs, the Rice parameter cRiceParam can be derived as shown in the following table.

[0305] [Table 15]

[0306]

[0307] In addition, for example, in the Rice parameter derivation process for dec_abs_level[n], baseLevel can be set to 0 and ZeroPos[n] can be derived as follows.

[0308] [Equation 16]

[0309]

[0310] In addition, the suffix value suffixVal of dec_abs_level[n] can be derived as shown in the following equation.

[0311] [Equation 17]

[0312]

[0313] The suffix bin string of the bin string of dec_abs_level[n] can be derived by the limited EGk binarization process for suffixVal, where k is set to cRiceParam+1, truncSuffixLen is set to 15, and maxPreExtLen is set to 11.

[0314] In addition, RRC and TSRC can have the following differences.

[0315] For example, the Rice parameter of the syntax element abs_remainder[] in TSRC can be derived as 1. The Rice parameter cRiceParam of the syntax element abs_remainder[] in RRC can be derived based on lastAbsRemainder and lastRiceParam as described above, but the Rice parameter cRiceParam of the syntax element abs_remainder[] in TSRC can be derived as 1. That is, for example, when transform skip is applied to the current block (e.g., the current TB), the Rice parameter cRiceParam of abs_remainder[] of TSRC for the current block can be derived as 1.

[0316] - Additionally, for example, referring to Table 3 and Table 4, in RRC, abs_level_gtx_flag[n] and / or abs_level_gtx_flag[n] can be signaled, but in TSRC, abs_level_gtx_flag[n], abs_level_gtx_flag[n], abs_level_gtx_flag[n], abs_level_gtx_flag[n], and abs_level_gtx_flag[n] can be signaled. Here, abs_level_gtx_flag[n] can be denoted as abs_level_gt1_flag or a first coefficient level flag, abs_level_gtx_flag[n] can be denoted as abs_level_gt3_flag or a second coefficient level flag, abs_level_gtx_flag[n] can be denoted as abs_level_gt5_flag or a third coefficient level flag, abs_level_gtx_flag[n] can be denoted as abs_level_gt7_flag or a fourth coefficient level flag, and abs_level_gtx_flag[n] can be denoted as abs_level_gt9_flag or a fifth coefficient level flag. Specifically, the first coefficient level flag can be a flag for whether the coefficient level is greater than a first threshold (e.g., 1), the second coefficient level flag can be a flag for whether the coefficient level is greater than a second threshold (e.g., 3), the third coefficient level flag can be a flag for whether the coefficient level is greater than a third threshold (e.g., 5), the fourth coefficient level flag can be a flag for whether the coefficient level is greater than a fourth threshold (e.g., 7), and the fifth coefficient level flag can be a flag for whether the coefficient level is greater than a fifth threshold (e.g., 9). As described above, in TSRC, abs_level_gtx_flag[n], abs_level_gtx_flag[n], and abs_level_gtx_flag[n], abs_level_gtx_flag[n], abs_level_gtx_flag[n] can also be included compared to RRC.

[0317] - Additionally, for example, in RRC, the syntax element coeff_sign_flag can be bypass coded, but in TSRC, the syntax element coeff_sign_flag can be bypass coded or context coded.

[0318] - Furthermore, for example, when bins for context coding of the current block are exhausted, in the RRC, it can be coded as a syntax element dec_abs_level, but in the TSRC, it can be coded as a syntax element abs_remainder.

[0319] - Furthermore, for example, the order of parsing the transform coefficients of the RRC can be parsed in a right-bottom to left-top direction in a right-top diagonal scan order based on the last non-zero coefficient, but in the case of the TSRC, it can be parsed in a left-top to right-bottom direction in a right-top diagonal order, and the position information of the last non-zero coefficient can be omitted.

[0320] - Furthermore, for example, in the RRC, a dependent quantization (DQ) or a sign data hiding method (SDH) can be applied, but in the TSRC, the dependent quantization and the sign data hiding method can not be used.

[0321] Furthermore, a sign data hiding (SDH) method can be proposed with respect to residual coding. The sign data hiding method can be as follows.

[0322] In deriving the transform coefficients, the sign of the transform coefficients can be derived based on a 1-bit sign flag (syntax element coeff_sign_flag described above). In this regard, the SDH can indicate a technique for explicit signaling of coeff_sign_flag for the first significant transform coefficient in a sub-block / group of coefficients (CG) in order to improve coding efficiency. Here, the value of coeff_sign_flag for the first significant transform coefficient can be derived based on the sum of absolute levels (i.e., absolute values) of the significant transform coefficients in the corresponding sub-block / group of coefficients. That is, the sign of the first significant transform coefficient can be derived based on the sum of absolute levels of the significant transform coefficients in the corresponding sub-block / group of coefficients. Further, the significant transform coefficients can refer to the non-zero transform coefficients whose (absolute) values are not 0. For example, when the sum of absolute levels of the significant transform coefficients is even, the value of coeff_sign_flag for the first significant transform coefficient can be derived as 1, and when the sum of absolute levels of the significant transform coefficients is odd, the value of coeff_sign_flag for the first significant transform coefficient can be derived as 0. In other words, for example, when the sum of absolute levels of the significant transform coefficients is even, the sign of the first significant transform coefficient can be derived as negative, and when the sum of absolute levels of the significant transform coefficients is odd, the sign of the first significant transform coefficient can be derived as positive. Alternatively, for example, when the sum of absolute levels of the significant transform coefficients is even, the value of coeff_sign_flag for the first significant transform coefficient can be derived as 0, and when the sum of absolute levels of the significant transform coefficients is odd, the value of coeff_sign_flag for the first significant transform coefficient can be derived as 1. In other words, for example, when the sum of absolute levels of the significant transform coefficients is even, the sign of the first significant transform coefficient can be derived as positive, and when the sum of absolute levels of the significant transform coefficients is odd, the sign of the first significant transform coefficient can be derived as negative.

[0323] For example, the SDH in the residual syntax can be represented as shown in the following table.

[0324] [Table 16]

[0325]

[0326] Referring to Table 16, a variable signHiddenFlag can indicate whether SDH is applied or not. The variable signHiddenFlag can also be referred to as signHidden. For example, when the value of the variable signHiddenFlag is 0, the variable signHiddenFlag can indicate that SDH is not applied, and when the value of the variable signHiddenFlag is 1, the variable signHiddenFlag can indicate that SDH is applied. For example, the value of the variable signHiddenFlag can be set based on signaled flag information (e.g., sh_sign_data_hidden_used_flag or pic_sign_data_hiding_enabled_flag or sps_sign_data_hiding_enabled_flag). Also, for example, the value of the variable signHiddenFlag can be set based on lastSigScanPosSb and firstSigScanPosSb. Here, lastSigScanPosSb can indicate the position of the last significant transform coefficient searched in a corresponding sub-block / coefficient group according to a scan order, and firstSigScanPosSb can indicate the position of the first significant transform coefficient searched in a corresponding sub-block / coefficient group according to the scan order. Generally, lastSigScanPosSb can be located in a relatively high frequency component region compared to firstSigScanPosSb. Thus, when lastSigScanPosSb - firstSigScanPosSb is greater than a predetermined threshold, the signHidden value can be derived as 1 (i.e., SDH is applied), and otherwise the signHidden value can be derived as 0 (i.e., SDH is not applied). Here, for example, referring to Table 35, the threshold can be set to 3.

[0327] In addition, referring to Table 16, even if the value of signHiddenFlag is 0 (i.e.,!signHiddenFlag), if the current coefficient is not the first significant coefficient in the (sub)block according to the scan order (i.e., n!= firstSigScanPosSb), coeff_sign_flag[n] of the current coefficient can be explicitly signaled.

[0328] Furthermore, referring to Table 16, if the value of signHiddenFlag is 1 and the current coefficient is the first significant coefficient in the (sub)block according to the scan order (i.e., n = first_sig_scan_pos_subb), the explicit signaling of coeff_sign_flag[n] for the current coefficient can be omitted. In this case, the value of coeff_sign_flag[n] for the current coefficient (i.e., the first significant coefficient) can be derived as follows. For example, the value of coeff_sign_flag[n] for the first significant coefficient can be derived based on the coeff_sign_flag[n] values for the remaining significant coefficients in the corresponding (sub)block other than the first significant coefficient. For example, when the sum of the coeff_sign_flag[n] values for the significant coefficients is even, the coeff_sign_flag[n] for the first significant coefficient can be derived as 1, while when the sum of the coeff_sign_flag[n] values for the significant coefficients is odd, the coeff_sign_flag[n] for the first significant coefficient can be derived as 0. Alternatively, when the sum of the coeff_sign_flag[n] values for the significant coefficients is even, the coeff_sign_flag[n] for the first significant coefficient can be derived as 0, while when the sum of the coeff_sign_flag[n] values for the significant coefficients is odd, the coeff_sign_flag[n] for the first significant coefficient can be derived as 1.

[0329] Furthermore, if the above-mentioned sign data hiding is activated in high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.), and if sh ts residual coding disabled flag is 1, the sign data hiding process of RRC can be used for lossless coding. Thus, due to incorrect setting in the encoding device, lossless coding can become impossible. Alternatively, if lossy coding (i.e., non-invertible encoding method) other than lossless coding is applied, and the residual signal to which transform skip has been applied is encoded with RRC while BDPCM is applied, although the interval in which the residual value becomes 0 occurs more frequently than in the general case due to the difference between the residuals, BDPCM can also suffer from encoding loss because of the execution of SDH according to the SDH application condition. Specifically, for example, if there are valid transform coefficients (non-zero residual data) at positions 0 and 15 in the CG, respectively, and the transform coefficient values at the remaining positions in the CG are 0, SDH can be applied to the CG according to the above-mentioned SDH application condition, so that the sign data (i.e., encoding of the sign flag) of the first valid transform coefficient of the CG can be omitted. Thus, in this case, in order to omit the sign data, the parity of only two residual data of the CG can be adjusted in the quantization step, so that more encoding loss can occur compared to the case where SDH is not applied. This situation can also occur in blocks to which BDPCM is not applied, but due to the characteristic of BDPCM, the level is lowered by the difference from the neighboring residual, so that the disadvantageous situation can occur more frequently when SDH is applied.

[0330] Therefore, in the present document, in order to prevent unintended encoding loss or malfunction caused by the use of SDH and residual coding (i.e., encoding of residual samples of transform skip blocks in the current slice with RRC) together when sh ts residual coding disabled flag = 1, an embodiment for setting dependency / constraint between the above-mentioned two techniques is provided.

[0331] Furthermore, as described above, the residual data encoding method can include regular residual coding (RRC) and transform skip residual coding (TSRC).

[0332] As shown in Table 1, the residual data coding method for the current block among the above two methods can be determined based on the values of transform_skip_flag and sh_ts_residual_coding_disabled_flag. Here, the syntax element sh_ts_residual_coding_disabled_flag can indicate whether TSRC is enabled. Thus, even when transform_skip_flag indicates that the transform is skipped, if sh_ts_residual_coding_disabled_flag indicates that TSRC is not enabled, syntax elements according to RRC on the transform skipped block can be signaled. That is, when the value of transform_skip_flag is 0 or the value of sh_ts_residual_coding_disabled_flag is 1, RRC can be used, and otherwise, TSRC can be used.

[0333] The present document proposes a method in which sh_ts_residual_coding_disabled_flag depends on pic_sign_data_hiding_enabled_flag as an embodiment. For example, the syntax element proposed in the present embodiment can be as shown in the following table.

[0334] [Table 17]

[0335]

[0336] Here, for example, pic_sign_data_hiding_enabled_flag can be a flag for whether sign data hiding is enabled. For example, pic_sign_data_hiding_enabled_flag can indicate whether sign data hiding is enabled. That is, for example, pic_sign_data_hiding_enabled_flag can indicate whether sign data hiding is enabled for blocks of a picture of a sequence or picture header structure (i.e., picture_header_structure()). For example, pic_sign_data_hiding_enabled_flag can indicate whether a sign data hiding usage flag indicating whether sign data hiding is used for a current slice can be present. For example, pic_sign_data_hiding_enabled_flag having a value of 1 can indicate that sign data hiding is enabled, and pic_sign_data_hiding_enabled_flag having a value of 0 can indicate that sign data hiding is not enabled. For example, pic_sign_data_hiding_enabled_flag having a value of 1 can indicate that a sign flag for which sign data hiding has been applied can be present, and pic_sign_data_hiding_enabled_flag having a value of 0 can indicate that a sign flag for which sign data hiding has been applied is not present.

[0337] According to Table 17 described above, sh_ts_residual_coding_disabled_flag can be signaled only when sign data hiding is not enabled. In addition, sh_ts_residual_coding_disabled_flag can not be signaled when sign data hiding is enabled, and the value of sh_ts_residual_coding_disabled_flag can be inferred to be 0 (residual samples of a transform skip block in a current slice are encoded with TSRC syntax) or 1 (residual samples of a transform skip block in a current slice are encoded with RRC syntax).

[0338] Here, for example, pic_sign_data_hiding_enabled_flag can be signaled as a picture header syntax or a slice header syntax. For example, when pic_sign_data_hiding_enabled_flag is signaled as a syntax other than the picture header syntax, it can be referred to as another name. For example, when pic_sign_data_hiding_enabled_flag is signaled as a syntax of a slice header, pic_sign_data_hiding_enabled_flag can be expressed as sh_sign_data_hiding_enabled_flag. In addition, sh_ts_residual_coding_disabled_flag can be signaled as a slice header syntax, or can be signaled as a high level syntax (HLS) (e.g., SPS syntax / VPS syntax / PPS syntax / picture header (PH) syntax / DPS syntax, etc.) other than the slice header syntax or a low level (CU / TU). When the residual coding method is determined by whether SDH is enabled, it can be interpreted to conform to the present embodiment regardless of the up / down relationship of the signaled syntax or the position on the syntax.

[0339] In addition, according to the conventional image / video encoding, in a high level syntax (SPS syntax / VPS syntax / PPS syntax / DPS syntax / picture header syntax / slice header syntax, etc.) or a low level (CU / TU), SDH is enabled, and when sh_ts_residual_coding_disabled_flag is 1, SDH in the above RRC can be used for lossless encoding, and thus lossless encoding can become impossible due to incorrect setting in the encoding apparatus. Therefore, in the present document, in order to prevent unintended encoding loss or failure caused by using SDH and residual coding together when sh_ts_residual_coding_disabled_flag = 1 (i.e., residual samples of a transform skip block in a current slice are encoded with RRC), an embodiment in which SDH is not used when encoding a level of a transform coefficient when the value of transform_skip_flag is 1 is provided. The residual coding syntax according to the proposed embodiment can be as shown in the following table.

[0340] [Table 18]

[0341]

[0342]

[0343]

[0344]

[0345]

[0346]

[0347] Referring to Table 18 above, a variable signHidden indicating whether to apply SDH can be derived based on a value of transform_skip_flag. For example, when the value of transform_skip_flag is 1, the value of signHidden can be derived as 0. That is, for example, when the value of transform_skip_flag is 1, SDH can not be applied in deriving a sign of a transform coefficient of a current block.

[0348] In addition, herein, to prevent unintended coding loss or malfunction caused by using SDH and residual coding together when sh_ts_residual_coding_disabled_flag = 1 (i.e., residual samples of a transform skip block in a current slice are encoded using RRC), an implementation in which SDH is not used when encoding a level of a transform coefficient when the value of BdpcmFlag is 1 is provided. The residual coding syntax according to the proposed implementation can be as shown in the following table.

[0349] [Table 19]

[0350]

[0351]

[0352]

[0353]

[0354]

[0355]

[0356] Referring to Table 19 above, a variable signHidden indicating whether to apply SDH can be derived based on a value of a variable BdpcmFlag indicating whether to apply BDPCM. For example, when the value of BdpcmFlag is 1, the value of signHidden can be derived as 0. That is, for example, when the value of BdpcmFlag is 1 (when BDPCM is applied to a current block), SDH can not be applied in deriving a sign of a transform coefficient of the current block.

[0357] Referring to Table 19, when BdpcmFlag is 1, if lossy coding is applied, SDH of TSRC is allowed, but if BDPCM is applied, SDH can not be used.

[0358] In addition, this document proposes various implementations related to the signaling of the above-mentioned syntax element sh ts residual coding disabled flag.

[0359] For example, as mentioned above, since sh ts residual coding disabled flag is a syntax element defining whether TSRC is disabled, it can not be necessary to signal it when transform skip blocks are not used. That is, signaling sh ts residual coding disabled flag can be meaningful only when the syntax element for whether transform skip blocks are used indicates that transform skip blocks are used.

[0360] Accordingly, this document proposes an implementation in which sh ts residual coding disabled flag is signaled only when sps transform skip enabled flag is 1. The syntax according to this implementation is shown in the following table.

[0361] [Table 20]

[0362]

[0363] Referring to Table 20, sh_ts_residual_coding_disabled_flag can be signaled when sps_transform_skip_enabled_flag is 1, and can not be signaled when sps_transform_skip_enabled_flag is 0. Here, for example, sps_transform_skip_enabled_flag can indicate whether or not transform skip blocks are used. That is, for example, sps_transform_skip_enabled_flag can indicate whether or not transform skip is enabled. For example, when the value of sps_transform_skip_enabled_flag is 1, sps_transform_skip_enabled_flag can indicate that a transform skip flag (transform_skip_flag) can be present in the transform unit syntax, and when the value of sps_transform_skip_enabled_flag is 0, sps_transform_skip_enabled_flag can indicate that the transform skip flag is not present in the transform unit syntax. Also, when sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag can be inferred to be 0. Also, the above-described sps_transform_skip_enabled_flag can be signaled in the SPS, or can be signaled in a high-level syntax (VPS, PPS, picture header syntax, slice header syntax, etc.) or a low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than the SPS. Also, it can be signaled before sh_ts_residual_coding_disabled_flag.

[0364] Also, the present document proposes embodiments in connection with the above-described embodiments regarding signaling of sh_ts_residual_coding_disabled_flag. For example, embodiments of signaling of sh_ts_residual_coding_disabled_flag as shown in the following table can be proposed.

[0365] [Table 21]

[0366]

[0367] Referring to Table 21, sh_ts_residual_coding_disabled_flag can be signaled when sps_transform_skip_enabled_flag is 1 and pic_sign_data_hiding_enabled_flag is 0, and can not be signaled otherwise. Further, sh_ts_residual_coding_disabled_flag can be inferred to be 0 when sh_ts_residual_coding_disabled_flag is not signaled.

[0368] Alternatively, for example, an implementation of signaling sh_ts_residual_coding_disabled_flag as shown in the following table can be proposed.

[0369] [Table 22]

[0370]

[0371] Referring to Table 22, sh_ts_residual_coding_disabled_flag can be signaled when pic_sign_data_hiding_enabled_flag is 0 or sps_transform_skip_enabled_flag is 1, and can not be signaled otherwise. Further, sh_ts_residual_coding_disabled_flag can be inferred to be 0 when sh_ts_residual_coding_disabled_flag is not signaled.

[0372] Further, for example, according to the embodiment, a method of signaling the syntax elements ph_dep_quant_enabled_flag and sh_ts_residual_coding_disabled_flag in the same high-level syntax or low-level syntax can be proposed. For example, referring to Table 22 above, both ph_dep_quant_enabled_flag and sh_ts_residual_coding_disabled_flag can be signaled in the picture header syntax. In this case, sh_ts_residual_coding_disabled_flag can be referred to as ph_ts_residual_coding_disabled_flag. Further, ph_dep_quant_enabled_flag can be a flag indicating whether dependent quantization is enabled. For example, ph_dep_quant_enabled_flag can indicate whether dependent quantization is enabled. That is, for example, ph_dep_quant_enabled_flag can indicate whether dependent quantization is enabled for blocks of pictures in a sequence. For example, ph_dep_quant_enabled_flag can indicate whether there can be a dependent quantization usage flag indicating whether dependent quantization is used for a current slice. For example, a value of 1 for ph_dep_quant_enabled_flag can indicate that dependent quantization is enabled, and a value of 0 for ph_dep_quant_enabled_flag can indicate that dependent quantization is not enabled. Further, for example, according to the signaled syntax, ph_dep_quant_enabled_flag can be referred to as sh_dep_quant_enabled_flag.

[0373] Alternatively, for example, an embodiment of signaling sh_ts_residual_coding_disabled_flag as shown in the following table can be proposed.

[0374] [Table 23]

[0375]

[0376] Referring to Table 23, sh ts residual coding disabled flag can be signaled when pic sign data hiding enabled flag is 0 and sps transform skip enabled flag is 1, and can not be signaled otherwise. Further, sh ts residual coding disabled flag can be inferred to be 0 when it is not signaled. Further, for example, referring to the above Table 23, both ph dep quant enabled flag and sh ts residual coding disabled flag can be signaled in the picture header syntax. In this case, sh ts residual coding disabled flag can be referred to as ph ts residual coding disabled flag.

[0377] Further, this document proposes implementations in which the above syntax elements ph dep quant enabled flag, pic sign data hiding enabled flag, and / or sh ts residual coding disabled flag are signaled in the same high-level syntax (VPS, SPS, PPS, picture header, slice header, etc.) or low-level syntax (slice data, coding unit, transform unit, etc.).

[0378] For example, implementations in which both pic sign data hiding enabled flag and sh ts residual coding disabled flag are signaled in the picture header syntax can be proposed as shown in the following table.

[0379] [Table 24]

[0380]

[0381] In this case, sh ts residual coding disabled flag can be referred to as ph ts residual coding disabled flag.

[0382] According to this embodiment, the syntax element indicating whether the residual coding of transform skip block (i.e., TSRC) is enabled (i.e., sh ts residual coding disabled flag) can be signaled only when the value of the syntax element indicating whether SDH is enabled in HLS (i.e., pic sign data hiding enabled flag) is 0. For example, referring to Table 24, pic sign data hiding enabled flag can be signaled in the picture header syntax, and when the value of pic sign data hiding enabled flag is 0, ph ts residual coding disabled flag can be signaled in the picture header syntax. Further, for example, when the value of pic sign data hiding enabled flag is 1, ph ts residual coding disabled flag can not be signaled. When sh ts residual coding disabled flag is not signaled, sh ts residual coding disabled flag can be inferred to be 0. Further, when the value of sps sign data hiding enabled flag is 1, pic sign data hiding enabled flag can be signaled in the picture header syntax.

[0383] The above embodiment according to Table 24 is merely an example, and the two syntax elements can be signaled in a high level syntax (VPS, SPS, PPS, slice header, etc.) or a low level syntax (slice data, coding unit, transform unit, etc.) other than the picture header.

[0384] Alternatively, for example, as shown in the following table, an embodiment in which the syntax element indicating whether SDH is enabled can be signaled only when the value of the syntax element indicating whether the residual coding of transform skip block (i.e., TSRC) is enabled (i.e., when TSRC is enabled) (i.e., sh ts residual coding disabled flag) is 0 can be provided.

[0385] [Table 25]

[0386]

[0387] Referring to Table 25, pic_sign_data_hiding_enabled_flag can be signaled in the picture header syntax when the value of ph ts residual coding disabled flag is 0. Further, for example, pic_sign_data_hiding_enabled_flag can not be signaled when the value of ph ts residual coding disabled flag is 1. Further, for example, pic_sign_data_hiding_enabled_flag can be inferred to be 0 in the decoding device when it is not signaled.

[0388] The above-described embodiment according to Table 25 is merely an example, and the two syntax elements can be signaled in a high-level syntax (VPS, SPS, PPS, slice header, etc.) or a low-level syntax (slice data, coding unit, transform unit, etc.) other than the picture header.

[0389] Alternatively, for example, a method for restricting pic_sign_data_hiding_enabled_flag and / or ph_dep_quant_enabled_flag based on ph ts residual coding disabled flag can be proposed.

[0390] For example, as shown in the following table, an embodiment in which pic_sign_data_hiding_enabled_flag and ph_dep_quant_enabled_flag are signaled only when the value of ph ts residual coding disabled flag is 0 can be provided.

[0391] [Table 26]

[0392]

[0393] Referring to Table 26, pic_sign_data_hiding_enabled_flag and ph_dep_quant_enabled_flag can be signaled in the picture header syntax when the value of ph ts residual coding disabled flag is 0. Further, for example, pic_sign_data_hiding_enabled_flag and ph_dep_quant_enabled_flag can not be signaled when the value of ph ts residual coding disabled flag is 1. Further, for example, when pic_sign_data_hiding_enabled_flag and ph_dep_quant_enabled_flag are not signaled, pic_sign_data_hiding_enabled_flag and ph_dep_quant_enabled_flag can be inferred to be 0 in a decoding device.

[0394] Further, for example, referring to Table 26 above, ph ts residual coding disabled flag, pic_sign_data_hiding_enabled_flag, and ph_dep_quant_enabled_flag can all be signaled in the picture header syntax.

[0395] In addition, embodiments in connection with signaling sh ts residual coding disabled flag described above can be combined with embodiments described herein. For example, embodiments of signaling sh ts residual coding disabled flag as shown in the following table can be proposed.

[0396] [Table 27]

[0397]

[0398] Referring to Table 27, ph ts residual coding disabled flag can be signaled when pic sign data hiding enabled flag is 0 or sps transform skip enabled flag is 1, and otherwise ph ts residual coding disabled flag can not be signaled. Further, when ph ts residual coding disabled flag is not signaled, ph ts residual coding disabled flag can be inferred to be 0 in a decoding device. Further, pic sign data hiding enabled flag can be signaled in a picture header syntax when the value of sps sign data hiding enabled flag is 1.

[0399] Alternatively, for example, an implementation of signaling sh ts residual coding disabled flag as shown in the following table can be proposed.

[0400] [Table 28]

[0401]

[0402] Referring to Table 28, ph ts residual coding disabled flag can be signaled when pic sign data hiding enabled flag is 0 and sps transform skip enabled flag is 1, and otherwise ph ts residual coding disabled flag can not be signaled. Further, when ph ts residual coding disabled flag is not signaled, ph ts residual coding disabled flag can be inferred to be 0 in a decoding device. Further, pic sign data hiding enabled flag can be signaled in a picture header syntax when the value of sps sign data hiding enabled flag is 1.

[0403] Alternatively, for example, an implementation of signaling sh ts residual coding disabled flag as shown in the following table can be proposed.

[0404] [Table 29]

[0405]

[0406] Referring to Table 29, ph ts residual coding disabled flag can be signaled when sps transform skip enabled flag is 1, and can not be signaled otherwise. Further, referring to Table 29, pic sign data hiding enabled flag can be signaled when ph ts residual coding disabled flag is 0, and can not be signaled otherwise. Further, when ph ts residual coding disabled flag is not signaled, ph ts residual coding disabled flag can be inferred to be 0 in a decoding device. Further, when pic sign data hiding enabled flag is not signaled, pic sign data hiding enabled flag can be inferred to be 0 in a decoding device.

[0407] Alternatively, for example, an implementation of signaling sh ts residual coding disabled flag as shown in the following table can be proposed.

[0408] [Table 30]

[0409]

[0410] Referring to Table 30, when sps_transform_skip_enabled_flag is 1, ph ts residual coding disabled flag can be signaled, and otherwise ph ts residual coding disabled flag can not be signaled. In addition, referring to Table 30, when ph ts residual coding disabled flag is 0, pic sign data hiding enabled flag and ph dep quant enabled flag can be signaled, and otherwise pic sign data hiding enabled flag and ph dep quant enabled flag can not be signaled. Further, when ph ts residual coding disabled flag is not signaled, in the decoding device, ph ts residual coding disabled flag can be inferred to be 0. Further, when pic sign data hiding enabled flag and ph dep quant enabled flag are not signaled, in the decoding device, pic sign data hiding enabled flag and ph dep quant enabled flag can be inferred to be 0.

[0411] Further, as described above, the information (syntax elements) in the syntax tables disclosed in this document can be included in the image / video information, and can be configured / encoded in the encoding device and transmitted to the decoding device in the form of a bitstream. The decoding device can parse / decode the information (syntax elements) in the corresponding syntax table. The decoding device can perform a block / image / video reconstruction process based on the decoded information.

[0412] Figure 9 An image encoding method performed by an encoding device according to the present disclosure is briefly illustrated. Figure 9 The method disclosed in the present disclosure can be performed by Figure 2 The encoding device disclosed in the present disclosure is performed. Specifically, for example, Figure 9 S900 of the present disclosure can be performed by a predictor of the encoding device, S910 can be performed by a residual processor of the encoding device, and Figure 9 S920 to S960 of the present disclosure can be performed by an entropy encoder of the encoding device. In addition, although not shown, a process of generating a reconstructed sample of a current block and a reconstructed picture based on a residual sample and a prediction sample of the current block can be performed by an adder of the encoding device.

[0413] The encoding device derives prediction samples of the current block by performing prediction on the current block in the current slice (S900). For example, the encoding device can derive the prediction samples of the current block by performing intra prediction or inter prediction on the current block. For example, the encoding device can determine whether to perform inter prediction or intra prediction on the current block, can determine a particular inter prediction mode or a particular intra prediction mode based on the RD cost, and can derive the prediction samples of the current block based on the determined prediction mode.

[0414] For example, the encoding device can derive an inter prediction mode and motion information of the current block, and generate the prediction samples of the current block. Here, the inter prediction mode determining process, the motion information deriving process, and the prediction sample generating process can be performed simultaneously and any one process can be performed earlier than the other processes. For example, the inter prediction unit of the encoding device can include a prediction mode determining unit, a motion information deriving unit, and a prediction sample deriving unit, and the prediction mode determining unit can determine the prediction mode of the current block, the motion information deriving unit can derive the motion information of the current block, and the prediction sample deriving unit can derive the prediction samples of the current block. For example, the inter prediction unit of the encoding device can search for a block similar to the current block in a predetermined region (search region) of a reference picture through motion estimation, and derive a reference block in which the difference from the current block is the smallest or equal to or less than a predetermined criterion. The reference picture index indicating the reference picture in which the reference block is located can be derived based on this, and the motion vector can be derived based on the positional difference between the reference block and the current block. The encoding device can determine a mode applied to the current block among various prediction modes. The encoding device can compare the RD costs of the various prediction modes and determine the best prediction mode of the current block.

[0415] For example, the encoding device can configure a motion information candidate list of the current block, and derive a reference block in which the difference from the current block is the smallest or equal to or less than a predetermined criterion among the reference blocks indicated by the motion information candidates included in the motion information candidate list. In this case, the motion information candidate associated with the derived reference block can be selected, and the motion information of the current block can be derived based on the motion information of the selected motion information candidate.

[0416] The encoding device derives residual samples of the current block based on the prediction samples (S910). For example, the encoding device can derive the residual samples of the current block by subtracting the prediction samples from the original samples of the current block.

[0417] The encoding device encodes prediction information for prediction (S920). The picture information can include prediction information of the current block. For example, the prediction information can include prediction mode information and information related to motion information of the current block as information related to the prediction process. The information related to the motion information of the current block can include motion information candidate index information as information for deriving a motion vector. In addition, for example, the information related to the motion information can include the above-described motion vector difference (MVD) information and / or reference picture index information.

[0418] The encoding device encodes a sign data hiding enabled flag for whether sign data hiding is enabled for the current slice (S930). The encoding device can encode a sign data hiding enabled flag for whether sign data hiding is enabled for the current slice. The picture information can include the sign data hiding enabled flag. For example, the encoding device can determine whether sign data hiding is enabled for blocks of pictures in a sequence, and can encode the sign data hiding enabled flag for whether sign data hiding is enabled. For example, the sign data hiding enabled flag can be a flag for whether sign data hiding is enabled. For example, the sign data hiding enabled flag can indicate whether sign data hiding is enabled. That is, for example, the sign data hiding enabled flag can indicate whether sign data hiding is enabled for blocks of pictures in a sequence. For example, the sign data hiding enabled flag can indicate whether a sign data hiding usage flag indicating whether sign data hiding is used for the current slice can exist. For example, the sign data hiding enabled flag having a value of 1 can indicate that sign data hiding is enabled, and the sign data hiding enabled flag having a value of 0 can indicate that sign data hiding is not enabled. For example, the sign data hiding enabled flag having a value of 1 can indicate that a sign flag to which sign data hiding has been applied exists, and the sign data hiding enabled flag having a value of 0 can indicate that a sign flag to which sign data hiding has been applied does not exist. In addition, for example, the sign data hiding enabled flag can be signaled in a sequence parameter set (SPS) syntax. Alternatively, for example, the sign data hiding enabled flag can be signaled in a picture header syntax or a slice header syntax. A syntax element of the sign data hiding enabled flag can be the above-described sps_sign_data_hiding_enabled_flag.

[0419] The encoding device encodes a TSRC enabled flag for whether transform skip residual coding (TSRC) is enabled for a transform skip block in the current slice based on the sign data hiding enabled flag (S940). The picture information can include the TSRC enabled flag.

[0420] For example, the encoding device can encode the TSRC enabled flag based on the sign data hiding enabled flag. For example, the TSRC enabled flag can be encoded based on a value of the sign data hiding enabled flag being 0. That is, for example, the TSRC enabled flag can be encoded when the value of the sign data hiding enabled flag is 0 (i.e., when the sign data hiding enabled flag indicates that the sign data hiding is not enabled). In other words, for example, the TSRC enabled flag can be signaled when the value of the sign data hiding enabled flag is 0 (i.e., when the sign data hiding enabled flag indicates that the sign data hiding is not enabled). Further, for example, the TSRC enabled flag can not be encoded and a value of the TSRC enabled flag can be derived as 0 in the decoding device when the value of the sign data hiding enabled flag is 1. That is, for example, the TSRC enabled flag can not be signaled and a value of the TSRC enabled flag can be derived as 0 in the decoding device when the value of the sign data hiding enabled flag is 1.

[0421] Here, for example, the TSRC enabled flag can be a flag for whether the TSRC is enabled. That is, for example, the TSRC enabled flag can be a flag indicating whether the TSRC is enabled for a block in a slice. In other words, for example, the TSRC enabled flag can be a flag indicating whether the TSRC is enabled for a transform skip block in a slice. For example, the TSRC enabled flag having a value of 1 can indicate that the TSRC is not enabled, and the TSRC enabled flag having a value of 0 can indicate that the TSRC is enabled. Further, for example, the TSRC enabled flag can be signaled in a slice header syntax. A syntax element of the TSRC enabled flag can be the sh ts residual coding disabled flag described above. The TSRC enabled flag can be referred to as a TSRC disabled flag.

[0422] Furthermore, for example, the encoding device can determine whether dependent quantization is enabled for blocks of pictures in a sequence and can encode a dependent quantization enabled flag for whether dependent quantization is enabled. The picture information can include the dependent quantization enabled flag. For example, the dependent quantization enabled flag can be a flag for whether dependent quantization is enabled. For example, the dependent quantization enabled flag can indicate whether dependent quantization is enabled. That is, for example, the dependent quantization enabled flag can indicate whether dependent quantization is enabled for blocks of pictures in a sequence. For example, the dependent quantization enabled flag can indicate whether there can be a dependent quantization use flag that indicates whether dependent quantization is used for a current slice. For example, a dependent quantization enabled flag with a value of 1 can indicate that dependent quantization is enabled and a dependent quantization enabled flag with a value of 0 can indicate that dependent quantization is not enabled. Furthermore, for example, the dependent quantization enabled flag can be signaled in a SPS syntax, a slice header syntax, or the like. A syntax element of the dependent quantization enabled flag can be the aforementioned sps_dep_quant_enabled_flag.

[0423] Furthermore, for example, the encoding device can encode a transform skip enabled flag for whether transform skip is enabled for a current slice. The picture information can include the transform skip enabled flag. For example, the encoding device can determine whether transform skip is enabled for blocks of pictures in a sequence and can encode a transform skip enabled flag for whether transform skip is enabled. For example, the transform skip enabled flag can be a flag for whether transform skip is enabled. For example, the transform skip enabled flag can indicate whether transform skip is enabled. That is, for example, the transform skip enabled flag can indicate whether transform skip is enabled for blocks of pictures in a sequence. For example, the transform skip enabled flag can indicate whether there can be a transform skip flag. For example, a transform skip enabled flag with a value of 1 can indicate that transform skip is enabled and a transform skip enabled flag with a value of 0 can indicate that transform skip is not enabled. That is, for example, a transform skip enabled flag with a value of 1 can indicate that a transform skip flag can be present and a transform skip enabled flag with a value of 0 can indicate that a transform skip flag is not present. Furthermore, for example, the transform skip enabled flag can be signaled in a sequence parameter set (SPS) syntax. A syntax element of the transform skip enabled flag can be the aforementioned sps_transform_skip_enabled_flag.

[0424] Furthermore, for example, the TSRC enable flag can be encoded based on the sign data hiding enable flag and / or the transform skip enable flag. For example, the TSRC enable flag can be encoded based on the sign data hiding enable flag having a value of 0 and the transform skip enable flag having a value of 1. That is, for example, when the value of the sign data hiding enable flag is 0 (i.e., the sign data hiding enable flag indicates that sign data hiding is not enabled) and the value of the transform skip enable flag is 1 (i.e., when the transform skip enable flag indicates that transform skip is enabled), the TSRC enable flag can be encoded (or signaled). Furthermore, for example, when the value of the transform skip enable flag is 0, the TSRC enable flag can not be encoded, and the value of the TSRC enable flag can be derived to be 0. That is, for example, when the value of the transform skip enable flag is 0, the TSRC enable flag can not be signaled, and the value of the TSRC enable flag can be derived to be 0.

[0425] The encoding device encodes the residual information for the current block based on the TSRC enable flag (S950). The encoding device can encode the residual information for the current block based on the TSRC enable flag.

[0426] For example, the encoding device can determine the residual coding syntax for the current block based on the TSRC enable flag. For example, the encoding device can determine the residual coding syntax for the current block to be one of a regular residual coding (RRC) syntax and a transform skip residual coding (TSRC) syntax based on the TSRC enable flag. The RRC syntax can indicate a syntax according to RRC, and the TSRC syntax can indicate a syntax according to TSRC.

[0427] For example, based on the TSRC enable flag having a value of 1, the residual coding syntax for the current block can be determined to be a regular residual coding (RRC) syntax. In this case, for example, a transform skip flag for whether the current block is transform skipped can be encoded, and the value of the transform skip flag can be 1. For example, the image information can include the transform skip flag of the current block. The transform skip flag can indicate whether the current block is transform skipped. That is, the transform skip flag can indicate whether a transform has been applied to the transform coefficients of the current block. The syntax element representing the transform skip flag can be transform_skip_flag as described above. For example, when the value of the transform skip flag is 1, the transform skip flag can indicate that a transform has not been applied to the current block (i.e., transform skip), and if the value of the transform skip flag is 0, the transform skip flag can indicate that a transform has been applied to the current block. For example, if the current block is a transform skipped block, the value of the transform skip flag of the current block can be 1.

[0428] Further, for example, the residual coding syntax for the current block can be determined to be a transform skipped residual coding (TSRC) syntax based on the TSRC enable flag having a value of 0. Further, for example, a transform skip flag for whether the current block is transform skipped can be encoded, and the residual coding syntax for the current block can be determined to be a transform skipped residual coding (TSRC) syntax based on the transform skip flag having a value of 1 and the TSRC enable flag having a value of 0. Further, for example, a transform skip flag for whether the current block is transform skipped can be encoded, and the residual coding syntax for the current block can be determined to be a regular residual coding (RRC) syntax based on the transform skip flag having a value of 0 and the TSRC enable flag having a value of 0.

[0429] Then, for example, the encoding device can encode the residual information of the determined residual coding syntax for the current block. The encoding device can encode the residual information of the determined residual coding syntax for the residual samples of the current block. For example, the residual information of the regular residual coding (RRC) syntax for the current block can be encoded based on the TSRC enable flag having a value of 1, and the residual information of the TSRC syntax for the current block can be encoded based on the TSRC enable flag having a value of 0. The image information can include the residual information.

[0430] In particular, for example, the encoding device can derive transform coefficients of the current block based on the residual samples. For example, the encoding device can determine whether a transform is applied to the current block. That is, the encoding device can determine whether a transform is applied to the residual samples of the current block. The encoding device can determine whether a transform is applied to the current block in consideration of coding efficiency. For example, the encoding device can determine that no transform is applied to the current block. Further, the block to which no transform is applied can be referred to as a transform skipped block.

[0431] When the transform is not applied to the current block, that is, when the transform is not applied to the residual samples, the encoding device can derive the derived residual samples as the transform coefficients of the current block. Further, when the transform is applied to the current block, that is, when the transform is applied to the residual samples, the encoding device can perform a transform on the residual samples to derive the transform coefficients of the current block. The current block can include a plurality of sub-blocks or a coefficient group (CG). In addition, the size of the sub-block of the current block can be a 4x4 size or a 2x2 size. That is, the sub-block of the current block can include up to 16 non-zero transform coefficients or up to 4 non-zero transform coefficients. Here, the current block can be a coding block (CB) or a transform block (TB). Further, the transform coefficients can be referred to as residual coefficients.

[0432] When the residual coding syntax for the current block is determined to be the RRC syntax, the encoding device can encode the residual information of the RRC syntax for the current block. For example, the residual information of the RRC syntax can include the syntax elements disclosed in Table 2 as described above.

[0433] For example, the residual information of the RRC syntax can include syntax elements for transform coefficients of a current block. Here, the transform coefficients can be referred to as residual coefficients.

[0434] For example, the syntax elements can include syntax elements such as last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, abs_remainder, dec_abs_level, and / or coeff_sign_flag.

[0435] Specifically, for example, the syntax elements can include position information indicating a position of a last non-zero transform coefficient in a residual coefficient array of a current block. That is, the syntax elements can include position information indicating a position of a last non-zero transform coefficient in a scan order of the current block. The position information can include information of a prefix indicating a column position of the last non-zero transform coefficient, information of a prefix indicating a row position of the last non-zero transform coefficient, information of a suffix indicating the column position of the last non-zero transform coefficient, and information of a suffix indicating the row position of the last non-zero transform coefficient. Syntax elements of the position information can be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. In addition, the non-zero transform coefficient can be referred to as a significant coefficient.

[0436] Further, for example, the syntax elements can include a coded sub-block flag indicating whether a sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag for whether a coefficient level of the transform coefficient is greater than a first threshold, a parity level flag for a parity of the coefficient level, and / or a second coefficient level flag for whether the coefficient level of the transform coefficient is greater than a second threshold. Here, the coded sub-block flag can be sb_coded_flag or coded_sub_block_flag; the significant coefficient flag can be sig_coeff_flag; the first coefficient level flag can be abs_level_gt1_flag or abs_level_gtx_flag; the parity level flag can be par_level_flag; and the second coefficient level flag can be abs_level_gt3_flag or abs_level_gtx_flag.

[0437] Further, for example, the syntax elements can include coefficient value related information for a value of a transform coefficient of the current block. The coefficient value related information can be abs_remainder and / or dec_abs_level.

[0438] Further, for example, the syntax elements can include a sign flag indicating a sign of the transform coefficient. The sign flag can be coeff_sign_flag.

[0439] Further, for example, when sign data hiding is applied to the current block, a sign flag of a first significant transform coefficient of a current group (CG) in the current block can not be encoded and signaled. That is, for example, when the sign data hiding is applied to the current block, the syntax elements can not include the sign flag indicating the sign of the first significant transform coefficient. Further, for example, whether the sign data hiding is applied to the current block can be derived based on a sign data hiding enabled flag and / or a position of the first significant transform coefficient of the current CG of the current block and a position of a last significant transform coefficient. For example, when a value of the sign data hiding enabled flag is 1 and a value obtained by subtracting the position of the first significant transform coefficient from the position of the last significant transform coefficient is greater than 3 (i.e., when the value of the sign data hiding enabled flag is 1 and a number of significant transform coefficients in the current CG is greater than 3), the sign data hiding can be applied to the current CG of the current block.

[0440] In addition, for example, when the residual coding syntax of the current block is determined as the TSRC syntax, the encoding device can encode residual information for the TSRC syntax of the current block. For example, the residual information of the TSRC syntax can include the syntax elements illustrated in Table 3 above.

[0441] For example, the residual information of the TSRC syntax can include syntax elements for transform coefficients of the current block. Here, the transform coefficients can also be referred to as residual coefficients.

[0442] For example, the syntax elements can include context-coded syntax elements and / or bypass-coded syntax elements for the transform coefficients. The syntax elements can include syntax elements such as sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, and / or abs_remainder.

[0443] For example, the context-coded syntax elements for the transform coefficients can include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a sign flag indicating a sign of the transform coefficient, a first coefficient level flag for whether a coefficient level of the transform coefficient is greater than a first threshold, and / or a parity level flag for a parity of the coefficient level of the transform coefficient. In addition, for example, the context-coded syntax elements can include a second coefficient level flag for whether the coefficient level of the transform coefficient is greater than a second threshold, a third coefficient level flag for whether the coefficient level of the transform coefficient is greater than a third threshold, a fourth coefficient level flag for whether the coefficient level of the transform coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag for whether the coefficient level of the transform coefficient is greater than a fifth threshold. Here, the significant coefficient flag can be sig_coeff_flag, the sign flag can be coeff_sign_flag, the first coefficient level flag can be abs_level_gt1_flag, and the parity level flag can be par_level_flag. In addition, the second coefficient level flag can be abs_level_gt3_flag or abs_level_gtx_flag, the third coefficient level flag can be abs_level_gt5_flag or abs_level_gtx_flag, the fourth coefficient level flag can be abs_level_gt7_flag or abs_level_gtx_flag, and the fifth coefficient level flag can be abs_level_gt9_flag or abs_level_gtx_flag.

[0444] In addition, for example, the bypass-coded syntax elements for the transform coefficients can include coefficient level information of a value (or a coefficient level) of the transform coefficient and / or a sign flag indicating a sign of the transform coefficient. The coefficient level information can be abs_remainder and / or dec_abs_level, and the sign flag can be ceff_sign_flag.

[0445] The encoding apparatus generates a bitstream including the sign data hiding enabling flag, the TSRC enabling flag, the prediction information, and the residual information (S960). For example, the encoding apparatus can output the image information including the sign data hiding enabling flag, the TSRC enabling flag, the prediction information, and the residual information as the bitstream. The bitstream can include the sign data hiding enabling flag, the TSRC enabling flag, the prediction information, and the residual information. In addition, the bitstream can further include the dependent quantization enabling flag and / or the transform skip enabling flag.

[0446] Further, the bitstream can be transmitted to the decoding apparatus through a network or a (digital) storage medium. Here, the network can include a broadcasting network, a communication network, etc., and the digital storage medium can include various storage media such as a universal serial bus (USB), a secure digital (SD), a compact disc (CD), a digital video disc (DVD), a Blu-ray, a hard disk drive (HDD), a solid state drive (SSD), etc.

[0447] Figure 10 An encoding apparatus for performing an image encoding method according to the present disclosure is briefly exemplified. Figure 9 The method disclosed in Figure 10 The encoding apparatus disclosed in can be performed. Specifically, for example, Figure 10 The predictor of the encoding apparatus of can perform Figure 9 S900 in, Figure 10 The residual processor of the encoding apparatus of can perform Figure 9 S910 in, and Figure 10 The entropy encoder of the encoding apparatus of can perform Figure 9 S920 to S960 in. In addition, although not shown, the process of generating the reconstructed sample of the current block and the reconstructed picture based on the residual sample of the current block and the prediction sample can be performed by the adder of the encoding apparatus.

[0448] Figure 11 An image decoding method performed by a decoding apparatus according to the present disclosure is briefly exemplified. Figure 11 The method disclosed in Figure 3 The decoding apparatus disclosed in can be performed. Specifically, for example, Figure 11 S1100 to S1120 of can be performed by the entropy decoder of the decoding apparatus, Figure 11 S1130 of can be performed by the predictor of the decoding apparatus, Figure 11 S1140 of can be performed by the residual processor of the decoding apparatus, and S1150 can be performed by the adder of the decoding apparatus. In addition, although not shown, the process of receiving the prediction information of the current block can be performed by the entropy decoder of the decoding apparatus.

[0449] The decoding device obtains a sign data hiding enabled flag for whether sign data hiding is enabled for a current slice (SI 100). The decoding device can obtain, from a bitstream, picture information including the sign data hiding enabled flag. The picture information can include the sign data hiding enabled flag. For example, the sign data hiding enabled flag can be a flag for whether sign data hiding is enabled. For example, the sign data hiding enabled flag can indicate whether sign data hiding is enabled. That is, for example, the sign data hiding enabled flag can indicate whether sign data hiding is enabled for blocks of pictures in a sequence. For example, the sign data hiding enabled flag can indicate whether a sign data hiding usage flag indicating whether sign data hiding is used for a current slice can be present. For example, the sign data hiding enabled flag with a value of 1 can indicate that sign data hiding is enabled, and the sign data hiding enabled flag with a value of 0 can indicate that sign data hiding is not enabled. For example, the sign data hiding enabled flag with a value of 1 can indicate that a sign flag for which sign data hiding has been applied is present, and the sign data hiding enabled flag with a value of 0 can indicate that a sign flag for which sign data hiding has been applied is not present. Further, for example, the sign data hiding enabled flag can be signaled in a sequence parameter set (SPS) syntax. Alternatively, for example, the sign data hiding enabled flag can be signaled in a picture header syntax or a slice header syntax. A syntax element of the sign data hiding enabled flag can be the sps_sign_data_hiding_enabled_flag described above.

[0450] The decoding device obtains a transform skip residual coding (TSRC) enabled flag for whether TSRC is enabled for a transform skip block in the current slice (SI 110). The picture information can include the TSRC enabled flag.

[0451] For example, the decoding device can obtain the TSRC enabled flag based on the sign data hiding enabled flag. For example, the TSRC enabled flag can be obtained based on the sign data hiding enabled flag with a value of 0. That is, for example, the TSRC enabled flag can be obtained when the value of the sign data hiding enabled flag is 0 (i.e., when the sign data hiding enabled flag indicates that sign data hiding is not enabled). In other words, for example, the TSRC enabled flag can be signaled when the value of the sign data hiding enabled flag is 0 (i.e., when the sign data hiding enabled flag indicates that sign data hiding is not enabled). Further, for example, the TSRC enabled flag can not be obtained when the value of the sign data hiding enabled flag is 1, and the value of the TSRC enabled flag can be derived to be 0. That is, for example, the TSRC enabled flag can not be signaled when the value of the sign data hiding enabled flag is 1, and the value of the TSRC enabled flag can be derived to be 0.

[0452] Here, for example, the TSRC enabling flag can be a flag for whether TSRC is enabled. That is, for example, the TSRC enabling flag can be a flag indicating whether TSRC is enabled for a block in a slice. In other words, for example, the TSRC enabling flag can be a flag indicating whether TSRC is enabled for a transform skip block in a slice. Here, the block can be a coding block (CB) or a transform block (TB). For example, the TSRC enabling flag with a value of 1 can indicate that TSRC is not enabled, and the TSRC enabling flag with a value of 0 can indicate that TSRC is enabled. Further, for example, the TSRC enabling flag can be signaled in a slice header syntax. The syntax element of the TSRC enabling flag can be the sh_ts_residual_coding_disabled_flag described above. The TSRC enabling flag can be referred to as a TSRC disabling flag.

[0453] Further, for example, the decoding device can obtain a dependent quantization enabling flag. The decoding device can obtain image information including the dependent quantization enabling flag through a bitstream. The image information can include the dependent quantization enabling flag. For example, the dependent quantization enabling flag can be a flag for whether dependent quantization is enabled. For example, the dependent quantization enabling flag can indicate whether dependent quantization is enabled. That is, for example, the dependent quantization enabling flag can indicate whether dependent quantization is enabled for a block of a picture in a sequence. For example, the dependent quantization enabling flag can indicate whether there can be a dependent quantization usage flag indicating whether dependent quantization is used for a current slice. For example, the dependent quantization enabling flag with a value of 1 can indicate that dependent quantization is enabled, and the dependent quantization enabling flag with a value of 0 can indicate that dependent quantization is not enabled. Further, for example, the dependent quantization enabling flag can be signaled in an SPS syntax, a slice header syntax, or the like. The syntax element of the dependent quantization enabling flag can be the sps_dep_quant_enabled_flag described above.

[0454] Further, for example, the decoding device can obtain a transform skip enabled flag. The decoding device can obtain image information including the transform skip enabled flag through a bitstream. The image information can include the transform skip enabled flag. For example, the transform skip enabled flag can be a flag for whether transform skip is enabled. For example, the transform skip enabled flag can indicate whether transform skip is enabled. That is, for example, the transform skip enabled flag can indicate whether transform skip is enabled for blocks of pictures in a sequence. For example, the transform skip enabled flag can indicate whether a transform skip flag can be present. For example, the transform skip enabled flag with a value of 1 can indicate that transform skip is enabled, and the transform skip enabled flag with a value of 0 can indicate that transform skip is not enabled. That is, for example, the transform skip enabled flag with a value of 1 can indicate that the transform skip flag can be present, and the transform skip enabled flag with a value of 0 can indicate that the transform skip flag is not present. Further, for example, the transform skip enabled flag can be signaled in a sequence parameter set (SPS) syntax. A syntax element of the transform skip enabled flag can be the above-described sps_transform_skip_enabled_flag.

[0455] Further, for example, the TSRC enabled flag can be obtained based on the sign data hiding enabled flag and / or the transform skip enabled flag. For example, the TSRC enabled flag can be obtained based on the sign data hiding enabled flag with a value of 0 and the transform skip enabled flag with a value of 1. That is, for example, when the value of the sign data hiding enabled flag is 0 (i.e., the sign data hiding enabled flag indicates that sign data hiding is not enabled), and the value of the transform skip enabled flag is 1 (i.e., when the transform skip enabled flag indicates that transform skip is enabled), the TSRC enabled flag can be obtained (or signaled). Further, for example, when the value of the transform skip enabled flag is 0, the TSRC enabled flag can not be obtained, and the value of the TSRC enabled flag can be derived to be 0. That is, for example, when the value of the transform skip enabled flag is 0, the TSRC enabled flag can not be signaled, and the value of the TSRC enabled flag can be derived to be 0.

[0456] The decoding device obtains residual coding information for a current block in a current slice based on the TSRC enabled flag (S1120). The decoding device can obtain residual information for the current block in the current slice based on the TSRC enabled flag. Here, the current block can be a coding block (CB) or a transform block (TB).

[0457] For example, the decoding device can determine the residual coding syntax for the current block in the current slice based on the TSRC enabling flag. For example, the decoding device can determine the residual coding syntax for the current block as one of regular residual coding (RRC) syntax and transform skip residual coding (TSRC) syntax based on the TSRC enabling flag. The RRC syntax can indicate a syntax according to RRC, and the TSRC syntax can indicate a syntax according to TSRC. Further, for example, the current block can be a transform skip block in the current slice. Here, the transform skip block can mean a block for which a transform is not applied.

[0458] For example, the residual coding syntax for the current block in the current slice can be determined as regular residual coding (RRC) syntax based on the TSRC enabling flag having a value of 1. In this case, for example, a transform skip flag for whether the current block is transform skipped can be obtained based on the transform skip enabling flag having a value of 1, and the value of the transform skip flag can be 1. For example, the picture information can include the transform skip flag for the transform skip block. The transform skip flag can indicate whether the current block is transform skipped. That is, the transform skip flag can indicate whether a transform is applied to the transform coefficients of the current block. The syntax element representing the transform skip flag can be the above-described transform_skip_flag. For example, when the value of the transform skip flag is 1, the transform skip flag can indicate that the transform is not applied to the current block (i.e., transform skip), and when the value of the transform skip flag is 0, the transform skip flag can indicate that the transform is applied to the current block. For example, the value of the transform skip flag of the current block can be 1.

[0459] Further, for example, the residual coding syntax for the current block can be determined as transform skip residual coding (TSRC) syntax based on the TSRC enabling flag having a value of 0. Further, for example, a transform skip flag for whether the current block is transform skipped can be obtained, and the residual coding syntax for the current block can be determined as transform skip residual coding (TSRC) syntax based on the transform skip flag having a value of 1 and the TSRC enabling flag having a value of 0. Further, for example, a transform skip flag for whether the current block is transform skipped can be obtained, and the residual coding syntax for the current block can be determined as regular residual coding (RRC) syntax based on the transform skip flag having a value of 0 and the TSRC enabling flag having a value of 0.

[0460] Then, for example, the decoding device can obtain residual information for the determined residual coding syntax for the current block. For example, the residual information for the regular residual coding (RRC) syntax can be obtained based on the TSRC enabling flag having a value of 1, and the residual information for the TSRC syntax can be obtained based on the TSRC enabling flag having a value of 0. The picture information can include the residual information.

[0461] For example, when the residual coding syntax for the current block is determined to be the RRC syntax, the decoding device can obtain residual information for the RRC syntax of the current block. For example, the residual information for the RRC syntax can include the syntax elements shown in Table 2 above.

[0462] For example, the residual information for the RRC syntax can include syntax elements for transform coefficients of the current block. Here, the transform coefficients can be referred to as residual coefficients.

[0463] For example, the syntax elements can include syntax elements such as last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, abs_remainder, dec_abs_level, and / or coeff_sign_flag.

[0464] Specifically, for example, the syntax elements can include position information indicating a position of a last non-zero transform coefficient in a residual coefficient array of the current block. That is, the syntax elements can include position information indicating a position of a last non-zero transform coefficient in a scan order of the current block. The position information can include information of a prefix indicating a column position of the last non-zero transform coefficient, information of a prefix indicating a row position of the last non-zero transform coefficient, information of a suffix indicating the column position of the last non-zero transform coefficient, and information of a suffix indicating the row position of the last non-zero transform coefficient. The syntax elements of the position information can be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. In addition, the non-zero transform coefficient can be referred to as a significant coefficient.

[0465] Further, for example, the syntax elements can include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag for whether a coefficient level of the transform coefficient is greater than a first threshold, a parity level flag for a parity of the coefficient level, and / or a second coefficient level flag for whether the coefficient level of the transform coefficient is greater than a second threshold. Here, the coded sub-block flag can be sb_coded_flag or coded_sub_block_flag, the significant coefficient flag can be sig_coeff_flag, the first coefficient level flag can be abs_level_gt1_flag or abs_level_gtx_flag, the parity level flag can be par_level_flag, and the second coefficient level flag can be abs_level_gt3_flag or abs_level_gtx_flag.

[0466] Further, for example, the syntax elements can include coefficient value related information of a transform coefficient value of the current block. The coefficient value related information can be abs_remainder and / or dec_abs_level.

[0467] Further, for example, the syntax elements can include a sign flag indicating a sign of the transform coefficient. The sign flag can be coeff_sign_flag.

[0468] Further, for example, when the sign data hiding is applied to the current block, a sign flag of a first significant transform coefficient of a current coefficient group (CG) in the current block can not be signaled. That is, for example, when the sign data hiding is applied to the current block, the syntax elements can not include the sign flag indicating the sign of the first significant transform coefficient. Further, for example, whether the sign data hiding is applied to the current block can be derived based on a sign data hiding enabled flag, and / or a position of the first significant transform coefficient of the current CG and a position of a last significant transform coefficient. For example, when a value of the sign data hiding enabled flag is 1, and a value obtained by subtracting the position of the first significant transform coefficient from the position of the last significant transform coefficient is greater than 3 (i.e., when the value of the sign data hiding enabled flag is 1, and the number of significant transform coefficients in the current CG is greater than 3, the sign data hiding can be applied to the current CG of the current block.

[0469] In addition, for example, when the residual coding syntax for the current block is determined as the TSRC syntax, the decoding device can obtain residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax can include the syntax elements illustrated in Table 3 above.

[0470] For example, the residual information of the TSRC syntax can include syntax elements for transform coefficients of the current block. Here, the transform coefficients can be referred to as residual coefficients.

[0471] For example, the syntax elements can include context-coded syntax elements and / or bypass-coded syntax elements for the transform coefficients. The syntax elements can include syntax elements such as sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, and / or abs_remainder.

[0472] For example, the context-coded syntax elements for the transform coefficients can include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient; a sign flag indicating a sign of the transform coefficient; a first coefficient level flag for whether a coefficient level for the transform coefficient is greater than a first threshold; and / or a parity level flag for a parity check of the coefficient level for the transform coefficient. Further, for example, the context-coded syntax elements can include a second coefficient level flag for whether the coefficient level for the transform coefficient is greater than a second threshold; a third coefficient level flag for whether the coefficient level for the transform coefficient is greater than a third threshold; a fourth coefficient level flag for whether the coefficient level for the transform coefficient is greater than a fourth threshold; and / or a fifth coefficient level flag for whether the coefficient level for the transform coefficient is greater than a fifth threshold. Here, the significant coefficient flag can be sig_coeff_flag; the sign flag can be coeff_sign_flag; the first coefficient level flag can be abs_level_gt1_flag; and the parity level flag can be par_level_flag. In addition, the second coefficient level flag can be abs_level_gt3_flag or abs_level_gtx_flag. The third coefficient level flag can be abs_level_gt5_flag or abs_level_gtx_flag; the fourth coefficient level flag can be abs_level_gt7_flag or abs_level_gtx_flag; and the fifth coefficient level flag can be abs_level_gt9_flag or abs_level_gtx_flag.

[0473] Further, for example, the bypass-coded syntax elements for the transform coefficients can include coefficient level information of a value (or a coefficient level) of the transform coefficient and / or a sign flag representing a sign of the transform coefficient. The coefficient level information can be abs_remainder and / or dec_abs_level, and the sign flag can be ceff_sign_flag.

[0474] The decoding device derives prediction samples of the current block based on the received prediction information for the current block (S1130). For example, the decoding device can derive the prediction samples of the current block based on an inter prediction mode or an intra prediction mode determined according to the received prediction information. For example, the decoding device can derive motion information of the current block based on an inter prediction mode determined according to the received prediction information. For example, the decoding device can construct a motion information candidate list for the current block, can select one motion information candidate in the motion information candidate list based on motion information candidate index information included in the prediction information, and can derive the motion information of the current block based on the selected motion information candidate. Then, for example, the decoding device can derive a reference picture of the current block based on a reference picture index of the current block, and can derive the prediction samples of the current block based on samples of a reference block indicated by a motion vector of the current block on the reference picture. The motion information can include the reference picture index and the motion vector of the current block.

[0475] The decoding device derives residual samples of the current block based on the residual coding information (S1140). For example, the decoding device can derive transform coefficients of the current block based on the residual coding information, and can derive the residual samples of the current block based on the transform coefficients.

[0476] For example, the decoding device can derive transform coefficients of the current block based on syntax elements of the residual coding information. Thereafter, the decoding device can derive the residual samples of the current block based on the transform coefficients. For example, when the transform is not applied to the current block based on the transform skip flag, i.e., when the value of the transform skip flag is 1, the decoding device can derive the transform coefficients as the residual samples of the current block. Alternatively, for example, when the transform is applied to the current block based on the transform skip flag, i.e., when the value of the transform skip flag is 0, the decoding device can dequantize the transform coefficients to derive the residual samples of the current block. Alternatively, for example, when the transform is applied to the current block based on the transform skip flag, i.e., when the value of the transform skip flag is 0, the decoding device can inverse transform the transform coefficients to derive the residual samples of the current block. Alternatively, for example, when the transform is applied to the current block based on the transform skip flag, i.e., when the value of the transform skip flag is 0, the decoding device can dequantize the transform coefficients and inverse transform the dequantized transform coefficients to derive the residual samples of the current block.

[0477] Further, for example, when the sign data hiding is applied to the current block, the sign of the first significant transform coefficient of the current CG in the current block can be derived based on the sum of absolute values of the significant transform coefficients in the current CG. For example, when the sum of absolute values of the significant transform coefficients is even, the sign of the first significant transform coefficient can be derived as a positive value, and when the sum of absolute values of the significant transform coefficients is odd, the sign of the first significant transform coefficient can be derived as a negative value.

[0478] The decoding device generates a reconstructed picture based on the prediction samples and the residual samples (S1150). For example, the decoding device can generate reconstructed samples of the current block and / or the reconstructed picture based on the prediction samples and the residual samples. For example, the decoding device can generate the reconstructed samples by adding the prediction samples and the residual samples.

[0479] Thereafter, as described above, in-loop filtering processes such as the ALF process, the SAO, and / or the deblocking filtering can be applied to the reconstructed picture as needed in order to improve the subjective / objective video quality.

[0480] Figure 12 A decoding device for performing the image decoding method according to the present disclosure is briefly illustrated. Figure 11 The method disclosed in the present disclosure can be performed by Figure 12 The decoding device disclosed in the present disclosure. Specifically, for example, Figure 12 The entropy decoder of the decoding device of Figure 11 S1100 to S1120 of the present disclosure, Figure 12 The predictor of the decoding device of the present disclosure can perform Figure 11 S1130 of the present disclosure, Figure 12 The residual processor of the decoding device of the present disclosure can perform Figure 11 S1140 of the present disclosure, and Figure 12 The adder of the decoding device of the present disclosure can perform Figure 11 S1150 of the present disclosure. In addition, although not shown, the process of receiving the prediction information of the current block can be performed by the entropy decoder of the decoding device of the present disclosure. Figure 12

[0481] According to the present document, as described above, the efficiency of the residual coding can be improved.

[0482] In addition, according to the present document, the TSRC enabling flag can be signaled according to the sign data hiding enabling flag, and by this, the coding efficiency can be improved by preventing the sign data hiding from being used for the transform skip block in which the TSRC is not enabled, and the overall residual coding efficiency can be improved by reducing the amount of bits to be coded.

[0483] ​In addition, the TSRC enabling flag can be signaled according to the transform skip enabling flag and the sign data hiding enabling flag according to the present document, and by this, it is possible to improve coding efficiency by preventing sign data hiding for transform skip blocks which do not enable TSRC, and it is possible to improve overall residual coding efficiency by reducing the amount of bits to be coded.

[0484] In the above embodiments, the methods are described based on flowcharts having a series of steps or blocks. The present disclosure is not limited to the order of the above steps or blocks. Some steps or blocks can be performed in a different order from other steps or blocks described above or simultaneously. Also, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive and can further include other steps, or one or more steps of the flowcharts can be deleted without affecting the scope of the present disclosure.

[0485] The embodiments described in the present specification can be executed by being implemented on a processor, a microprocessor, a controller, or a chip. For example, the functional units shown in each drawing can be executed by being implemented on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information for implementation (for example, information on instructions) or an algorithm can be stored in a digital storage medium.

[0486] In addition, the decoding apparatus and the encoding apparatus to which the present disclosure is applied can be included in a multimedia broadcast transmitting / receiving apparatus, a mobile communication terminal, a home theater video apparatus, a digital theater video apparatus, a surveillance camera, a video chat apparatus, a real-time communication apparatus such as video communication, a mobile streaming apparatus, a storage medium, a camcorder, a VoD service providing apparatus, an over-the-top (OTT) video apparatus, an Internet streaming service providing apparatus, a three-dimensional (3D) video apparatus, a teleconference video apparatus, a transport user apparatus (for example, a vehicle user apparatus, an airplane user apparatus, and a ship user apparatus), and a medical video device, and the decoding apparatus and the encoding apparatus to which the present disclosure is applied can be used to process a video signal or a data signal. For example, the over-the-top (OTT) video apparatus can include a game console, a Blu-ray player, an Internet access television, a home theater system, a smart phone, a tablet, a digital video recorder (DVR), etc.

[0487] In addition, the processing method according to the present disclosure can be generated in the form of a program executed by a computer, and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the present disclosure can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices in which computer-readable data are stored. The computer-readable recording medium can include, for example, a 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 data 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, a bitstream generated by the encoding method can be stored in a computer-readable recording medium or transmitted through a wired / wireless communication network.

[0488] In addition, the embodiments of the present disclosure can be implemented using a computer program product according to program codes, and the program codes can be executed in a computer by the embodiments of the present disclosure. The program codes can be stored on a computer-readable carrier.

[0489] Figure 13 A structure diagram of a content streaming system to which the present disclosure is applied is exemplified.

[0490] The content streaming system to which the embodiments of the present disclosure are applied can mainly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0491] The encoding server compresses content input from a multimedia input device such as a smartphone, a camera, or a camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, when a multimedia input device such as a smartphone, a camera, or a camcorder, etc. directly generates a bitstream, the encoding server can be omitted.

[0492] The bitstream can be generated by applying the encoding method or the bitstream generation method to which the embodiments of the present disclosure are applied, and the streaming server can temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0493] The streaming server transmits multimedia data to a user device through a web server based on a user request, and the web server serves as a medium for informing a service to a user. When a user requests a desired service from the web server, the web server delivers the request to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system can include a separate control server. In this case, the control server is used to control commands / responses between devices within the content streaming system.

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

[0495] Examples of user devices can include mobile phones, smartphones, laptops, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, touchscreen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, and head-mounted displays), digital TVs, desktop computers, and digital signage. Each server within a content streaming system can operate as a distributed server, in which case data received from each server can be distributed.

[0496] The claims described in this disclosure can be combined in various ways. For example, the technical features of the method claims of this disclosure can be combined to implement an apparatus, and the technical features of the apparatus claims of this disclosure can be combined to implement a method. Furthermore, the technical features of the method claims and the apparatus claims of this disclosure can be combined to implement an apparatus, and the technical features of the method claims and the apparatus claims of this disclosure can be combined to implement a method.

Claims

1. An apparatus for decoding image information, the apparatus comprising: a memory and at least one processor coupled to the memory, the at least one processor configured to: obtain a sign data hiding enabling flag for whether to enable sign data hiding; obtain a TSRC disabling flag for whether to use transform skip residual coding (TSRC) for a transform skip block in a current slice; obtain residual coding information for a current block in the current slice based on the TSRC disabling flag; derive prediction samples of the current block based on received prediction information for the current block; derive residual samples of the current block based on the residual coding information; and generate a reconstructed picture based on the prediction samples and the residual samples, wherein the current block is the transform skip block in the current slice, and wherein the TSRC disabling flag is obtained from a slice header syntax in a bitstream based on the sign data hiding enabling flag.

2. An apparatus for encoding image information, the apparatus comprising: a memory and at least one processor coupled to the memory, the at least one processor configured to: derive prediction samples of a current block in a current slice by performing prediction for the current block; derive residual samples of the current block based on the prediction samples; encode prediction information for the prediction; encode a sign data hiding enabling flag for whether to enable sign data hiding; based on the sign data hiding enabling flag, encode a TSRC disabling flag for whether to use transform skip residual coding (TSRC) for a transform skip block in the current slice; based on the TSRC disabling flag, encode residual information for the current block; and generate a bitstream including the sign data hiding enabling flag, the TSRC disabling flag, the prediction information, and the residual information, wherein the current block is the transform skip block in the current slice, and wherein the TSRC disabling flag is signaled in a slice header syntax.

3. An apparatus for transmitting data for image information, the apparatus comprising: at least one processor configured to obtain a bitstream including a sign data hiding enabling flag, a TSRC disabling flag, prediction information, and residual information, the bitstream generated based on: deriving prediction samples of a current block in a current slice by performing prediction for the current block; deriving residual samples of the current block based on the prediction samples; encoding the prediction information for the prediction; encoding the sign data hiding enabling flag for whether to enable sign data hiding; based on the sign data hiding enabling flag, encoding the TSRC disabling flag for whether to use transform skip residual coding (TSRC) for a transform skip block in the current slice; and based on the TSRC disabling flag, encoding the residual information for the current block; and a transmitter configured to transmit the data including the bitstream, The current block is the transform skip block in the current slice, The TSRC deactivation flag is signaled in slice header syntax.