Video decoding method and apparatus
By using adjacent samples to perform sinusoidal prediction and cost export in the video encoding system, the problem of low coding efficiency of high-resolution video is solved, and more efficient video data compression and transmission is achieved.
Patent Information
- Application Number
- JP2024544443
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-01-27
- Filing Date
- 2023-01-10
- Publication Date
- 2025-02-06
AI Technical Summary
Existing video encoding technologies are difficult to efficiently compress and transmit high-resolution, high-quality video data, especially Immersive Media such as VR and AR content, resulting in increased transmission and storage costs.
By predicting the signature information of the conversion coefficients in the video encoding system, sinusoidal prediction is performed using adjacent samples, the cost of candidate signature combinations is derived, and the recovery image is generated based on this.
Improves video encoding efficiency, reduces computational complexity, and improves the accuracy of signature prediction, thereby improving coding efficiency.
Smart Images

Figure 2025503968000001_ABST
Abstract
Description
[Technical field]
[0001] This document relates to a video coding technology, and more particularly, to a video decoding method and apparatus for predicting sign information of transform coefficients in a video coding system to code video information. [Background technology]
[0002] Recently, the demand for high-resolution, high-quality video / images such as 4K or 8K or higher UHD (Ultra High Definition) video / images is increasing in various fields. As the video / image data has higher resolution and quality, the amount of information or bits transmitted relatively increases compared to existing video / image data, so that when video / image data is transmitted using existing media such as wired or wireless broadband lines or when video / image data is stored using existing storage media, the transmission and storage costs increase.
[0003] In addition, interest and demand for immersive media such as virtual reality (VR), artificial reality (AR) content and holograms has been increasing recently, and the broadcast of videos / images with different image characteristics from real images, such as game images, is increasing.
[0004] Therefore, there is a demand for a highly efficient image compression technology in order to effectively compress and transmit, store, and play back high-resolution, high-quality video / image information having the above-mentioned various characteristics. Summary of the Invention [Problem to be solved by the invention]
[0005] The technical problem of this document is to provide a method and apparatus for improving video / image coding efficiency.
[0006] Another technical problem of this document is to provide a method and apparatus for performing sign prediction for a current block.
[0007] Another technical problem of this document is to provide a method and apparatus for deriving costs of candidate signature combinations for signature prediction. [Means for solving the problem]
[0008] According to an embodiment of the present document, a video decoding method is provided, which is performed by a decoding device, comprising the steps of: deriving adjacent samples for sign prediction of a current block, deriving costs of candidate sign combinations of transform coefficients of the current block based on the adjacent samples, predicting signs of the transform coefficients from the candidate sign combinations based on the costs, deriving residual samples of the current block based on the predicted signs, and generating a reconstructed picture based on the residual samples.
[0009] According to another embodiment of the present document, there is provided a decoding device for performing video decoding, the decoding device including a memory and at least one processor coupled to the memory, the at least one processor being configured to derive adjacent samples for sign prediction of a current block, derive costs of candidate sign combinations of transform coefficients of the current block based on the adjacent samples, predict signs of the transform coefficients from the candidate sign combinations based on the costs, derive residual samples of the current block based on the predicted signs, and generate a reconstructed picture based on the residual samples.
[0010] According to another embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including the steps of: deriving neighboring samples for sign prediction based on a size or a prediction mode of a current block, deriving costs of candidate sign combinations of transform coefficients of the current block based on the neighboring samples, predicting signs of the transform coefficients from the candidate sign combinations based on the costs, and encoding residual information of the current block including a syntax element for the predicted sign, wherein a target syntax element among the syntax elements indicates whether a predicted sign of a transform coefficient for the target syntax element is accurate.
[0011] According to another embodiment of the present document, there is provided a video encoding apparatus, comprising: a memory and at least one processor coupled to the memory, the at least one processor configured to derive neighboring samples for sign prediction based on a size or a prediction mode of a current block, derive costs of candidate sign combinations of transform coefficients of the current block based on the neighboring samples, predict signs of the transform coefficients from the candidate sign combinations based on the costs, and encode residual information of the current block including syntax elements for the predicted signs, wherein a target syntax element among the syntax elements indicates whether a predicted sign of a transform coefficient for the target syntax element is accurate.
[0012] According to another embodiment of the present document, there is provided a digital storage medium, the digital storage medium storing a bitstream including residual information encoded by a video encoding method according to the present document.
[0013] According to another embodiment of the present document, there is provided a data transmission method for an image, the data transmission method including the steps of: obtaining a bitstream of image information including residual information including a syntax element for a predicted sign of a transform coefficient of a current block; and transmitting the data including the bitstream of the image information including the residual information, wherein a target syntax element among the syntax elements indicates whether a predicted sign of a transform coefficient for the target syntax element is accurate, and the predicted sign is derived by deriving adjacent samples for sign prediction based on a size or a prediction mode of the current block, deriving costs of candidate sign combinations of the transform coefficients based on the adjacent samples, and predicting the sign of the transform coefficient from the candidate sign combinations based on the costs.
[0014] According to another embodiment of the present document, there is provided an apparatus for transmitting data for an image, the apparatus including at least one processor for acquiring a bitstream of image information including residual information including a syntax element for a predicted sign of a transform coefficient of a current block, and a transmitter for transmitting the data including the bitstream of the image information including the residual information, wherein a target syntax element among the syntax elements indicates whether a predicted sign of a transform coefficient for the target syntax element is accurate, and the predicted sign is derived by deriving adjacent samples for sign prediction based on a size or a prediction mode of the current block, deriving costs of candidate sign combinations of the transform coefficients based on the adjacent samples, and predicting the sign of the transform coefficient from the candidate sign combinations based on the costs.
[0015] According to this document, adjacent samples for cost derivation for a candidate sign combination can be determined based on the size of the current block, thereby reflecting the characteristics of the image to improve the accuracy of sign prediction and reducing the complexity of cost calculation to improve coding efficiency.
[0016] According to this document, adjacent samples for cost derivation for sign combination candidates can be determined based on the intra prediction mode of the current block, thereby reflecting the characteristics of the image to improve sign prediction accuracy and reducing the complexity of cost calculation to improve coding efficiency.
[0017] According to this document, when inter prediction is applied to a current block, a cost for a sign combination candidate can be derived using adjacent samples of a derived predicted block, thereby reflecting the characteristics of the image to improve sign prediction accuracy and improve coding efficiency. [Brief description of the drawings]
[0018] [Figure 1] 1 illustrates generally an example of a video / image coding system in which embodiments of the present document may be applied;
[0019] [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device to which the embodiments of this document can be applied.
[0020] [Diagram 3] FIG. 1 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of the present document can be applied.
[0021] [Figure 4] 1 illustrates an example of an intra-prediction based video encoding method.
[0022] [Diagram 5]1 illustrates an example of an intra-prediction based video decoding method.
[0023] [Figure 6] 65 intra-directional modes of prediction directions are shown exemplarily.
[0024] [Figure 7] The quantization is shown in Quantizer for Video / Image Coding Standards.
[0025] [Figure 8] 13 shows an exemplary diagram of adjacent samples for deriving the cost of a signature combination hypothesis.
[0026] [Figure 9] 13 shows an example of adjacent reconstruction samples and hypothetical reconstruction samples of a current block for calculating the cost of a signature combination hypothesis when the width and height of the current block are different.
[0027] [Figure 10] 13 shows an example of adjacent reconstruction samples and hypothetical reconstruction samples of a current block for calculating the cost of a signature combination hypothesis when the width and height of the current block are different.
[0028] [Figure 11] 13 illustrates an example of neighboring reconstructed samples and hypothetical reconstructed samples of a current block for calculating a cost of a sign combination hypothesis when an intra prediction mode is applied to the current block.
[0029] [Figure 12] When an inter prediction mode is applied to the current block, an embodiment will be described in which adjacent reconstructed samples of a predicted block are used to calculate the cost of a sign combination hypothesis.
[0030] [Figure 13]When an inter prediction mode is applied to the current block, an embodiment will be described in which only adjacent reconstructed samples of the predicted block are used to calculate the cost of the sign combination hypothesis.
[0031] [Figure 14] 1 illustrates a schematic diagram of a video encoding method using an encoding device according to the present document.
[0032] [Figure 15] 1 illustrates a schematic diagram of an encoding device for performing a video encoding method according to the present document;
[0033] [Figure 16] 1 illustrates an outline of a video decoding method using a decoding device according to the present document.
[0034] [Figure 17] 1 illustrates a schematic diagram of a decoding device for performing a video decoding method according to the present document.
[0035] [Figure 18] 1 illustrates an exemplary structural diagram of a content streaming system to which the embodiments of this document are applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0036] This document may be modified in various ways and may have various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit the embodiments of this document to the specific embodiment. The terms used in this document are merely used to describe a specific embodiment, and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this document, the terms "include" or "have" specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the document, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0037] Meanwhile, each configuration in the drawings described in this document is illustrated independently for the convenience of explaining the different characteristic functions, and does not mean that each configuration is realized by separate hardware or software. For example, two or more of each configuration may be combined to form one configuration, and one configuration may be divided into multiple configurations. An embodiment in which each configuration is integrated and / or separated is also included in the scope of this document as long as it does not deviate from the essence of this document.
[0038] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used for the same components in the drawings, and duplicated descriptions of the same components may be omitted.
[0039] FIG. 1 illustrates a schematic diagram of an example of a video / image coding system in which embodiments of the present document may be applied.
[0040] As shown in Figure 1, the video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device in a file or streaming form via a digital recording medium or a network.
[0041] The source device may comprise a video source, an encoding device, and a sending unit. The receiving device may comprise a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may comprise a display unit, which may be a separate device or an external component.
[0042] A video source may acquire video / images through a video / image capture, synthesis, or generation process, etc. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process in which the associated data is generated.
[0043] An encoding device can encode an input video / image. The encoding device can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0044] The transmitting unit may transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital recording medium or a network in the form of a file or streaming. The digital recording medium may include various recording media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit may include an element for generating a media file through a predetermined file format and may include an element for transmission via a broadcasting / communication network. The receiving unit may receive / extract the bitstream and transmit it to a decoding device.
[0045] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.
[0046] The renderer can render the decoded video / images, and the rendered video / images can be displayed via a display unit.
[0047] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document can be applied to methods disclosed in the versatile video coding (VVC) standard, the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2), or the next generation video / image coding standard (e.g., H.267 or H.268, etc.).
[0048] In this document, various embodiments relating to video / image coding are presented, which, unless otherwise stated, may also be implemented in combination with each other.
[0049] In this document, a video may refer to a collection of a series of images over time. A picture generally refers to a unit showing one image at a specific time, and a subpicture / slice / tile is a unit that constitutes a part of a picture in coding. A subpicture / slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more subpictures / slices / tiles. A picture may be composed of one or more tile groups. A tile group may include one or more tiles. A brick may refer to a rectangular area of a row of CTUs in a tile in a picture. A tile may be partitioned into multiple bricks, and each brick may be composed of one or more rows of CTUs in the tile. A tile that is not partitioned into multiple bricks may also be called a brick. A brick scan may indicate a particular sequential ordering of CTUs partitioning a picture, where the CTUs may be aligned in a brick-CTU raster scan, the bricks in a tile may be aligned contiguously in a raster scan of the bricks of the tile, and the tiles in a picture may be aligned contiguously in a raster scan of the tiles of the picture. A sub-picture may also indicate a rectangular region of one or more slices in a picture. That is, a sub-picture may include one or more slices that collectively cover a rectangular region of a picture. A tile is a particular tile column and a rectangular region of a CTU within the particular tile column. The tile column is a rectangular region of a CTU, where the rectangular region has a height equal to the height of the picture, and a width may be specified by a syntax element in a picture parameter set. The tile row is a rectangular region of a CTU, where the rectangular region has a width equal to the height of the picture, and a height is equal to the height of the picture.A tile scan may indicate a particular sequential ordering of CTUs that partition a picture, and the CTUs may be consecutively aligned in a raster scan of CTUs within a tile, and tiles within a picture may be consecutively aligned in a raster scan of the tiles of the picture. A slice may contain an integer number of bricks of a picture, and the integer number of bricks may be contained in one NAL unit. A slice may consist of a number of complete tiles or may be a continuous sequence of complete bricks of one tile. In this document, tile group and slice may be used interchangeably. For example, in this document, tile group / tile group header may be referred to as slice / slice header.
[0050] A pixel or a pel may refer to the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may be "sample." A sample may generally indicate a pixel or a pixel value, may indicate only a pixel / pixel value of a luma component, or may indicate only a pixel / pixel value of a chroma component.
[0051] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. A unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be used in combination with terms such as block or area, depending on the case. In a general case, an M×N block may include a sample (or sample array) consisting of M columns and N rows, or a set (or array) of transform coefficients.
[0052] In this document, "A or B" can mean "A only," "B only," or "both A and B." In other words, in this document, "A or B" can be interpreted as "A and / or B." For example, in this document, "A, B or C" can mean "A only," "B only," "C only," or "any combination of A, B and C."
[0053] The slash ( / ) and comma used in this document can mean "and / or." For example, "A / B" can mean "A and / or B." This allows "A / B" to mean "A only," "B only," or "both A and B." For example, "A, B, C" can mean "A, B, or C."
[0054] In this document, "at least one of A and B" can mean "A only," "B only," or "both A and B." Also, in this document, the expressions "at least one of A or B" and "at least one of A and / or B" can be interpreted as "at least one of A and B."
[0055] In this document, "at least one of A, B and C" can mean "A only," "B only," "C only," or "any combination of A, B and C." Additionally, "at least one of A, B or C" and "at least one of A, B and / or C" can mean "at least one of A, B and C."
[0056] Furthermore, parentheses used in this document may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction." In other words, "prediction" in this document is not limited to "intra prediction," and "intra prediction" is proposed as an example of "prediction." Furthermore, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction."
[0057] In this document, technical features described individually in one drawing may be embodied individually or simultaneously.
[0058] The following drawings are created to explain a specific example of the present document. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present document are not limited to the specific names used in the following drawings.
[0059] 2 is a diagram for explaining the configuration of a video / image encoding device to which the embodiments of this document can be applied. Hereinafter, the video encoding device may include an image encoding device.
[0060] As shown in FIG. 2, the encoding device 200 may be configured to include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 210, the prediction unit 220, the residual processing unit 230, the entropy encoding unit 240, the addition unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chip set or a processor) according to an embodiment. In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital recording medium. The hardware components may further include the memory 270 as an internal / external component.
[0061] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. As an example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, a quad-tree structure may be applied first, and a binary tree structure and / or a ternary structure may be applied later. Alternatively, a binary tree structure may be applied first. The coding procedure according to this document may be performed based on a final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit described above.The prediction unit is a unit of sample prediction, and the transform unit is a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0062] The unit may be used interchangeably with terms such as block or area. In the general case, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to a pixel or pel of one picture (or image).
[0063] The encoding device 200 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 221 or the intra prediction unit 222 from an input image signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoder 200 may be called a subtraction unit 231. The prediction unit may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as will be described later in the description of each prediction mode. The prediction information can be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0064] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional mode may include, for example, a DC mode and a planar mode. The directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction mode applied to the neighboring block.
[0065] The inter prediction unit 221 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between a neighboring block and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 221 may generate information indicating which candidate is used to derive a motion vector and / or a reference picture index of the current block by forming a motion information candidate list based on neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 221 may use motion information of a neighboring block as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of a motion vector prediction (MVP) mode, the motion vector of a neighboring block can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.
[0066] The prediction unit 220 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, or may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The prediction unit may also be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information regarding a palette table and a palette index.
[0067] The prediction signal generated through the prediction unit (including the inter prediction unit 221 and / or the intra prediction unit 222) may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to non-square, variable-sized blocks.
[0068] The quantizer 233 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoder 240, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal as a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 240 may encode information required for video / image restoration (e.g., values of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of network abstraction layer (NAL) units. The video / image information may 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). The video / image information may further include general constraint information. Information and / or syntax elements transmitted / signaled from an encoding device to a decoding device in this document may be included in the video / image information. The video / image information may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in a digital recording medium. Here, the network may include a broadcasting network and / or a communication network, and the digital recording medium may include various recording media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storing unit (not shown) for storing the signal may be configured as an internal / external element of the encoding device 200, or the transmitting unit may be included in the entropy encoding unit 240.
[0069] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be restored by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 250 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 221 or the intra prediction unit 222. When there is no residual for the current block, such as when a skip mode is applied, a predicted block may be used as a reconstructed block. The adder 250 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering, as described below.
[0070] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or reconstruction.
[0071] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 270, specifically, in the DPB of the memory 270. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 260 may generate various information related to filtering and transmit it to the entropy encoding unit 240, as will be described later in relation to each filtering method. The information related to filtering may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0072] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter prediction unit 221. When inter prediction is applied through this, the encoding apparatus may avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus 300, and may also improve encoding efficiency.
[0073] The memory 270DPB may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 221 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 222.
[0074] FIG. 3 is a diagram illustrating a schematic configuration of a video / image decoding device to which the embodiments of this document can be applied.
[0075] Referring to FIG. 3, the decoding device 300 may include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an intra predictor 331 and an inter predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 321. The entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. Also, the memory 360 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0076] When a bitstream including video / image information is input, the decoding apparatus 300 can restore an image corresponding to a process in which the video / image information is processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive a unit / block based on block division related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied in the encoding apparatus. Thus, the processing unit of the decoding is, for example, a coding unit, and the coding unit can be divided from a coding tree unit or a maximum 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 coding unit. Then, the restored image signal decoded and output by the decoding apparatus 300 can be reproduced by a reproduction device.
[0077] The decoding device 300 may receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image information may 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 may further include general constraint information. The decoding device may further decode pictures based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be decoded via the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 310 may decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration, quantized values of transform coefficients related to residuals, etc. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in the bitstream, determine a context model using information on the syntax element to be decoded and decode information on the neighboring and blocks to be decoded, or information on symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. In this case, the CABAC entropy decoding method may update the context model using information on the decoded symbols / bins for the context model of the next symbol / bin after determining the context model.Among the information decoded by the entropy decoding unit 310, information related to prediction is provided to a prediction unit (inter prediction unit 332 and intra prediction unit 331), and residual values entropy decoded by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). Also, among the information decoded by the entropy decoding unit 310, information related to filtering may be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to this document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the addition unit 340, the filtering unit 350, the memory 360, the inter prediction unit 332, and the intra prediction unit 331.
[0078] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scan order performed in the encoding device. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0079] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0080] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on information on the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0081] The prediction unit 320 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.
[0082] The intra prediction unit 331 may predict a current block by referring to samples in a current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on a prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine a prediction mode to be applied to the current block using a prediction mode applied to a neighboring block.
[0083] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted from an inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 332 may configure a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.
[0084] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 332 and / or the intra prediction unit 331). When there is no residual for a current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block.
[0085] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of a next block to be processed in a current picture, and may be output after filtering as described below, or may be used for inter prediction of a next picture.
[0086] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during the picture decoding process.
[0087] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.
[0088] The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter prediction unit 332. The memory 360 may store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 260 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 331.
[0089] In this document, the embodiments described for the filtering unit 260, the inter prediction unit 221, and the intra prediction unit 222 of the encoding device 200 can also be applied identically or correspondingly to the filtering unit 350, the inter prediction unit 332, and the intra prediction unit 331 of the decoding device 300, respectively.
[0090] Meanwhile, as described above, prediction is performed to improve compression efficiency when performing video coding. Through this, a predicted block including a predicted sample for a current block, which is a block to be coded, can be generated. For example, when the above-mentioned intra prediction is performed, correlation between samples can be used, and a difference between an original block and a predicted block, i.e., a residual, can be obtained. The above-mentioned transformation and quantization can be applied to the residual, and thus spatial redundancy can be removed. Specifically, an encoding method and a decoding method using intra prediction will be described below.
[0091] FIG. 4 illustrates an example of an intra-prediction based video encoding method. Referring to FIG. 4, an encoding apparatus may derive an intra-prediction mode for a current block (S400) and derive neighboring reference samples of the current block (S410). The encoding apparatus may determine a best intra-prediction mode for optimizing bit rate and distortion for the current block. The encoding apparatus may generate prediction samples in the current block based on the intra-prediction mode and the neighboring reference samples (S420). In this case, the encoding apparatus may perform a prediction sample filtering procedure (S430). The prediction sample filtering may be called post-filtering. Some or all of the prediction samples may be filtered by the prediction sample filtering procedure. In some cases, the step of S430 may be omitted.
[0092] The encoding apparatus may generate a residual sample for the current block based on the (filtered) prediction sample (S440). The encoding apparatus may encode image information including prediction mode information indicating the intra prediction mode and residual information regarding the residual sample (S450). The encoded image information may be output in the form of a bitstream. The output bitstream may be transmitted to a decoding apparatus via a storage medium or a network.
[0093] FIG. 5 illustrates an example of an intra-prediction based video decoding method. Referring to FIG. 5, the decoding apparatus may perform operations corresponding to those performed by the encoding apparatus. For example, the decoding apparatus may derive an intra-prediction mode for a current block based on received prediction mode information (S500). The decoding apparatus may derive neighboring reference samples of the current block (S510). The decoding apparatus may generate prediction samples in the current block based on the intra-prediction mode and the neighboring reference samples (S520). In this case, the decoding apparatus may perform a prediction sample filtering procedure (S530). The prediction sample filtering may be referred to as post-filtering. Some or all of the prediction samples may be filtered by the prediction sample filtering procedure. In some cases, the step S530 may be omitted.
[0094] The decoding apparatus may generate a residual sample for the current block based on the received residual information (S540). The decoding apparatus may generate a reconstructed sample for the current block based on the (filtered) prediction sample and the residual sample, and generate a reconstructed picture based on the reconstructed sample (S550).
[0095] Meanwhile, when intra prediction is applied to the current block, the encoding device / decoding device may derive an intra prediction mode for the current block as described above, and may derive a predicted sample of the current block based on the intra prediction mode. That is, the encoding device / decoding device may derive the predicted sample of the current block by applying a directional mode or a non-directional mode based on neighboring reference samples of the current block.
[0096] For reference, for example, the intra prediction modes may include two non-directional (or non-angular) intra prediction modes and 65 directional (or angular) intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode numbered 0 and a DC intra prediction mode numbered 1, and the directional intra prediction modes may include 65 intra prediction modes numbered 2 to 66. However, this is merely an example, and this document may be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, a 67th intra prediction mode may be further used, and the 67th intra prediction mode may indicate a linear model (LM) mode.
[0097] FIG. 6 exemplarily shows intra-directional modes of 65 prediction directions.
[0098] Referring to FIG. 6, the intra prediction modes may be classified into those having horizontal directionality and those having vertical directionality, with the 34th intra prediction mode having a left-up diagonal prediction direction as the center. H and V in FIG. 6 respectively mean horizontal directionality and vertical directionality, and the numbers from -32 to 32 indicate a displacement of 1 / 32 units on a sample grid position. The 2nd to 33rd intra prediction modes have horizontal directionality, and the 34th to 66th intra prediction modes have vertical directionality. The 18th and 50th intra prediction modes indicate horizontal and vertical intra prediction modes, respectively, and the 2nd intra prediction mode may be called a left-down diagonal intra prediction mode, the 34th intra prediction mode may be called a left-up diagonal intra prediction mode, and the 66th intra prediction mode may be called a right-up diagonal intra prediction mode.
[0099] The encoding device and the decoding device may also perform sign prediction for the residual coefficients. For example, the encoding device and the decoding device may predict signs for a limited number of residual coefficients per block, where the block is a CU or TU, and the residual coefficients may also be called transform coefficients.
[0100] For example, if n signatures are predicted for the current block, the encoding device and the decoding device n Sign combinations hypothesis We can compute the cost for the sign combination hypothesis, hypothesis The signature combination with the smallest cost among hypothesis can be predicted using the n signatures.
[0101] Meanwhile, for example, the encoding apparatus may determine a predicted sign among the signs of residual coefficients in the current block and predict the determined sign. The encoding apparatus may determine a predicted sign among the signs of residual coefficients in the current block according to RDO decision making.
[0102] Generally, the sign of a transform coefficient having a large value is relatively easy to predict because the sign error of the transform coefficient having a large value has a relatively high influence on a reconstructed block. When determining the predicted sign based on the above-mentioned logic, a sorting based approach can be applied. For example, one method of sorting transform coefficients of a transform block is based on the absolute value of the transform coefficient level. However, in video / image coding standards such as the VVC standard and ECM-2.0, two quantizers are used, so the transform coefficient level does not accurately reflect the quantization. Therefore, sorting on the transform coefficient level cannot obtain optimal performance.
[0103] FIG. 7 shows quantization by a quantizer of a video / picture coding standard. The horizontal axis of FIG. 7 represents dequantized coefficients, and the vertical axis represents the level of the dequantized coefficients. Referring to FIG. 7, for the same level value, the dequantized coefficients are different according to two quantizers (Q0 and Q1 in FIG. 7) as follows:
[0104] Case 1: Level = 2, quantizer Q0. Dequantized transform coefficients = 4△ k
[0105] Case 2: Level=2, quantizer Q1. Dequantized transform coefficients=3△ k
[0106] The two cases mentioned above are all level 2, but the dequantized transform coefficients in case 1 (4△ k ) is the dequantized transform coefficient (3△ k ) is larger than the qIdx value (dequantized transform coefficient = qIdx × △ k ) transform coefficient alignment can be performed based on
[0107] The qIdx of the transform coefficient level depends on the DQ state and can be calculated as follows:
[0108]
number
[0109] After the absolute values of the transform coefficient levels of the current block are decoded, the current block may be sorted based on the qIdx value. For example, the transform coefficient with the highest qIdx value may be located at the beginning of the sorted current block. The sign of the first maxNumPredSigns signs in the sorted current block may be predicted, and the remaining signs may be EP coded. That is, the transform coefficients of the current block may be sorted based on the qIdx value, and the n transform coefficients with the largest qIdx value may be determined as transform coefficients to be sign predicted. Here, the current block is a transform block (TB).
[0110] Then, for example, if n (n<=maxNumPredSigns) signatures are predicted for the current block, the encoding device and the decoding device n Sign combinations hypothesis Using the border-cost measure for each of n Sign combinations hypothesis 2 corresponding to n It is possible to perform border reconstructions twice. For example, if n (n<=maxNumPredSigns) signatures are predicted for the current block, then 2 nSimplified border reconstructions can be performed as described below. One reconstruction can be performed for each particular combination of signs for the n residual coefficients. For example, for a particular reconstruction, only the leftmost and topmost pixels of the block can be regenerated by an inverse transform with the addition of a block prediction. The first inverse transform (vertical inverse transform) is completed, but the second inverse transform (horizontal inverse transform) is faster since it only needs to generate the leftmost and topmost pixel output. Also, for example, the number of inverse transform operations performed can be reduced using a "template" system. A template can be defined for an inverse transformed block when the inverse transform is performed assuming the coefficients to be 1 at the coordinates of the coefficients whose signs are predicted. The template-based operation can be performed as follows:
[0111] 1. The inverse transform can be performed by setting one of the coefficients whose sign is predicted to 1 and the remaining coefficients to 0. That is, for the signs of n predicted coefficients, the kth predicted coefficient (k is 0 to n-1) can be set to 1 and the remaining coefficients can be set to 0 as a template. The block obtained by adding up all n templates is the first sign combination. hypothesis (sign combination hypothesis).
[0112] 2. Sign combinations where only one sign is negative hypothesis is the first sign combination hypothesis You can also use other sign combinations. hypothesis The already configured sign combination hypothesis It can be configured using templates.
[0113] For example, the storage / restore and template application when three signatures are predicted is as shown in the following table: hypothesisis as shown in the table below.
[0114] [Table 1]
[0115] [Table 2]
[0116] Or, use the Gray code method to combine the signs hypothesis That is, the k-th sign combination can be constructed. hypothesis is the k-1th sign combination hypothesis and can be composed of one of n templates (where k is 1 to n-1). hypothesis (When all signatures are positive) can be constructed by the sum of all templates as described above. For example, the storage / restore and template application when four signatures are predicted are as shown in the table below. That is, template and signature combinations when four signatures are predicted hypothesis is as shown in the table below.
[0117] [Table 3]
[0118] Referring to Table 3, the following sign combinations hypothesis The boundary reconstruction for the desired current hypothesis Previously, only a single predicted sign was needed to be modified to construct hypothesis This change in signature can then be initiated by taking the signature combination of the template that corresponds to the expected signature. hypothesisApproximations can be made by doubling and adding / subtracting at the boundaries. The approximations disclosed in the above table can be used only for the sign prediction process, not the final reconstruction process. That is, the approximations are reconstruction values generated for the sign prediction process, not the reconstruction sample generation process of the current block.
[0119] Sign combination hypothesis The cost of can be calculated as follows:
[0120] Each sign combination corresponds to the concept of image continuity at the block boundary. hypothesis There may be a cost associated with the signature combination. hypothesis The cost of the sign combination hypothesis This corresponds to the concept of image continuity at block boundaries for . The sign prediction value can be derived by minimizing the cost.
[0121] Figure 8 shows the sign combination hypothesis 4 shows an example of adjacent samples for deriving the cost of
[0122] 8 discloses previously restored neighboring pixels, the leftmost pixel and the topmost pixel of the current block for cost calculation. The neighboring pixels may include left neighboring pixels p-2,y and p-1,y and top neighboring pixels px,-2 and px,-1. Here, if the width and height of the current block are W,H, then y is 0 to H-1 and x is 0 to W-1. For example, the cost may be derived as follows:
[0123]
number
[0124] The cost function for deriving the cost can be defined as the sum of absolute second derivatives of the residual domain for the upper row and left column of the current block as shown in the above formula, where R is the reconstructed neighbor pixel, P is the predicted pixel of the current block, and r is the residual hypothesis Specifically, w is the width of the current block, h is the height of the current block, and R x、-2 is the upper adjacent pixel at (x, -2), R x、-1 is the upper adjacent pixel at (x, -1), P x、0 is the predicted pixel at (x, 0), r x、0 is at (x, 0) position hypothesis Residual pixel, R -2、y is the left adjacent pixel at (-2, y), R -1、y is the left adjacent pixel at (-1, y), P 0、y is the predicted pixel at (0, y), r 0、y is at (0, y) position hypothesis On the other hand, the (-R -2 +2R -1 -P0) term can be calculated only once per block, and then the sign combination hypothesis The cost calculation is the residual hypothesis can only be calculated by subtracting
[0125] Meanwhile, the sign prediction of the residual coefficients may be applied only partially in the region of the TU. The sign prediction area of the transform block may be performed up to a maximum of 32×32 blocks. For example, the sign of the upper left M×N block of the transform block may be predicted. The values of M and N may be calculated as follows:
[0126]
number
[0127] Here, width may indicate the width of the transform block, and height may indicate the height of the transform block. Also, sign prediction may be applied not only to coefficients after the first transform (e.g., MTS, DCT2, etc.) but also to coefficients after the LFNST mode. Also, to achieve a better gain / complexity trade-off, for example, the signs of up to four (i.e., n=4) transform coefficients may be predicted for one LFNST transform block.
[0128] For each predicted signature, the encoding device selects the signature combination with the lowest cost of matching the true values of the signatures already transmitted. hypothesis Alternatively, for example, the sign residual may not be sent initially, and the sign combination with the lowest cost may simply be searched for. hypothesis The predicted value of the current signature can be calculated by the signature combination. hypothesis For example, the sign combination hypothesis The lowest cost signature combination hypothesis The values of the n signatures can then be predicted.
[0129] If the prediction corresponds to the true value of the code, the sign residual may be transmitted as '0', otherwise it may be transmitted as '1'. That is, if the value of the predicted sign is correct, a syntax element for the sign with a value of 0 may be transmitted, and if the value of the predicted sign is not correct, a syntax element for the sign with a value of 1 may be transmitted. The syntax element may also be referred to as the sign residual.
[0130] The decoding device can parse the coefficients, signs, and sign residuals as part of the parsing process. The sign residuals can be parsed at the end of the TU, at which point the decoding device may know the absolute values of all the coefficients. Thus, the decoding device can determine what signs are predicted, and can determine the context model to use when parsing the sign prediction residual based on the dequantized coefficient values for each predicted sign.
[0131] Also, knowledge of whether the prediction was "correct" or "incorrect" can simply be stored as part of the CU data for the block being parsed - the actual signs of the residual coefficients are not known at this point.
[0132] In the reconstruction process, the decoding apparatus may perform operations similar to those of the encoding apparatus. That is, the decoding apparatus may perform the sign combination for the sign prediction described above. hypothesis A generation and cost calculation operation can be performed.
[0133] For example, for n signatures predicted by the TU, the decoder needs to n Perform boundary reconstruction times to find the sign combination hypothesis Then, the actual sign to apply to the residual coefficients with the predicted sign can be determined by an exclusive-or operation of the following values:
[0134] 1.The predicted value of the sign.
[0135] 2. The "correct" or "incorrect" data stored in the CU upon bitstream parsing.
[0136] On the other hand, in each TU in which the sign of a coefficient is “hidden” using an existing sign data hiding mechanism, sign prediction can be performed using only other coefficients by treating the corresponding coefficient (i.e., the coefficient whose sign is hidden) as “not available” in the sign prediction process.
[0137] Meanwhile, as described above, sign prediction may be performed on the first n transform coefficients sorted in descending order by dequantized qIdx, where n may be defined as 1 to the number of transform coefficients that are sign predictable in the current coefficient group (CG), or may be arbitrarily set to 8. When a target for which sign prediction is to be performed is determined, a maximum of 2 n sign combinations can be generated, and instead of calculating the cost by cycling through all cases to construct restored pixels, sign prediction can be performed by specifying the above-mentioned template and reusing the repeated template, thereby reducing the cost calculation complexity.
[0138] For each signature combination, an optimal signature prediction value can be determined by a cost function. That is, an optimal signature combination can be derived based on the cost of the signature combination, and a predicted signature can be determined for the derived signature combination. For example, the signature combination hypothesis After inverse quantization and inverse transformation of each coefficient, the discontinuity with the surrounding already restored samples is calculated to obtain the sign combination. hypothesis You can calculate the cost of the sign combination hypothesis The signature combination with the smallest cost among hypothesiscan be determined as the final sign predicted value. At this time, the second primary inverse transform (i.e., horizontal transform) can reduce complexity by inverse transforming only the top row and left column of the current block. Thereafter, when coding the actual sign flag, the sign predicted value and the value of the actual sign flag, i.e., whether the predicted sign and the actual sign are the same, can be context coded to improve coding performance. In other words, when sign prediction is applied as described above, unlike the existing sign flag, the amount of information bits for indicating the sign of the block can be reduced by context coding the syntax element related to the sign, thereby improving coding efficiency. That is, in the existing video coding system, when coding the sign, the occurrence probability is 50:50 and there is no trend between the sign flags, so bypass coding is performed, but when sign prediction is performed, the more accurate the sign prediction is, the more likely the syntax element is to be the same as the prediction, so context coding can be performed, thereby improving coding efficiency.
[0139] However, since sign prediction can be applied to n non-zero coefficients available in a 32x32 transform block, the complexity may increase when calculating the cost for a large block or a block with many transform coefficients. When sign prediction is applied to a small block or only to a part of the transform block, the transform coefficients are less than n, and the complexity can be reduced. In addition, when the transform block is a non-square block, the cost calculation process for determining discontinuity with adjacent blocks may have different characteristics from when the transform block is a square block. Therefore, this document proposes an embodiment in which it is determined whether the width and height of the current block are the same, and if they are different, only the discontinuity cost for the larger of the width and height is calculated.
[0140] Figure 9 shows the sign combination when the width and height of the current block are different. hypothesis The adjacent reconstruction samples and the current block for calculating the cost of hypothesis 9 shows an example of a reconstruction sample. Referring to FIG. 9, the current block is a non-square block whose width is greater than its height. If the width of the current block is greater than its height, the sign combination is performed due to discontinuity with the samples of the upper adjacent block of the current block. hypothesis For example, if the width of the current block is greater than the height, the cost of the upper adjacent samples of the current block and the predicted samples of the top row of the current block, and hypothesis Sign combination based on residual samples only hypothesis For example, if the width of the current block is greater than its height, the cost of the sign combination hypothesis The cost of can be derived as follows:
[0141]
number
[0142] where w is the width of the current block, R x、-2 is the upper adjacent pixel at (x, -2), R x、-1 is the upper adjacent pixel at (x, -1), P x、0 is the predicted pixel at (x, 0), r x、0 is at (x, 0) position hypothesis A residual pixel can be indicated.
[0143] Also, for example, if the height of the current block is greater than the width, the left adjacent sample of the current block and the predicted sample of the leftmost column of the current block, hypothesis Sign combination based on residual samples only hypothesis For example, if the height of the current block is greater than the width, the cost of the sign combination hypothesis The cost of can be derived as follows:
[0144]
number
[0145] where h is the current block height, R -2、y is the left adjacent pixel at (-2, y), R -1、y is the left adjacent pixel at (-1, y), P 0、y is the predicted pixel at (0, y), r 0、y is at (0, y) position hypothesis A residual pixel can be indicated.
[0146] Alternatively, as another embodiment, a method may be proposed in which it is determined whether the width and height of the current block are the same, and if they are different, the same or similar number of pixels may be used according to the ratio of the width and height. For example, this document proposes an embodiment in which it is determined whether the width and height of the current block are the same, and the number of samples of the larger of the width and height is adjusted to be the same as the number of samples of the smaller of the width and height according to the ratio of the width and height, and the cost is calculated.
[0147] Figure 10 shows the sign combination when the width and height of the current block are different. hypothesis The adjacent reconstruction samples and the current block for calculating the cost of hypothesis 1 shows an example of a restored sample.
[0148] 10, the current block is a non-square block whose width is twice as large as its height. For example, if the width of the current block is twice as large as its height, only one of two pixels corresponding to the width can be used for cost calculation. In other words, if the width of the current block is twice as large as its height, the upper adjacent sample of the current block, the predicted sample of the top row of the current block, and hypothesis For the residual samples, only one of two samples can be used for cost calculation. Or, for example, if the height of the current block is four times larger than the width, only one of four pixels corresponding to the height can be used for cost calculation. In other words, if the height of the current block is four times larger than the width, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and hypothesis Only one of the four residual samples can be used for cost calculation. Through the above-described embodiment, more accurate discontinuity characteristics can be taken into account in signature prediction, or the complexity of cost calculation can be reduced compared to the existing signature prediction method.
[0149] For example, if the width of the current block is greater than the height, the signature combination according to this embodiment hypothesis The cost of can be derived as follows:
[0150]
number
[0151] Here, w is the width of the current block, h is the height of the current block, and R x、-2 is the upper adjacent pixel at (x, -2), R x、-1is the upper adjacent pixel at (x, -1), P x、0 is the predicted pixel at (x, 0), r x、0 is at (x, 0) position hypothesis Residual pixel, R -2、y is the left adjacent pixel at (-2, y), R -1、y is the left adjacent pixel at (-1, y), P 0、y is the predicted pixel at (0, y), r 0、y is at (0, y) position hypothesis A residual pixel can be indicated.
[0152] Or, for example, if the height of the current block is greater than the width, the signature combination according to this embodiment hypothesis The cost of can be derived as follows:
[0153]
number
[0154] Here, w is the width of the current block, h is the height of the current block, and R x、-2 is the upper adjacent pixel at (x, -2), R x、-1 is the upper adjacent pixel at (x, -1), P x、0 is the predicted pixel at (x, 0), r x、0 is at (x, 0) position hypothesis Residual pixel, R -2、y is the left adjacent pixel at (-2, y), R -1、y is the left adjacent pixel at (-1, y), P 0、y is the predicted pixel at (0, y), r 0、y is at (0, y) position hypothesis A residual pixel can be indicated.
[0155] Alternatively, in another embodiment, when the current block is a residual block of an intra prediction block, a method may be proposed in which a neighboring reconstruction pixel that is mainly used according to an intra prediction mode of the current block is determined as a pixel for cost calculation. hypothesis In the present embodiment, a method is proposed in which neighboring restored pixels for cost calculation are selectively used based on the intra prediction mode of the current block when calculating a cost for selecting the neighboring restored pixels for cost calculation based on the intra prediction mode of the current block. That is, for example, the present embodiment may select neighboring samples based on the intra prediction mode of the current block, and perform sign combination based on the selected neighboring samples. hypothesis We propose a method for calculating the cost.
[0156] FIG. 11 shows the sign combination when intra prediction mode is applied to the current block. hypothesis The adjacent reconstruction samples and the current block for calculating the cost of hypothesis 1 shows an example of a restored sample.
[0157] For example, FIG. 11 shows a sign combination when the current block is a transform block of a block having an intra prediction mode larger than the vertical intra prediction mode (i.e., the 50th intra prediction mode). hypothesis The adjacent reconstruction samples and the current block for calculating the cost of hypothesis An example of selecting a reconstruction sample can be given.
[0158] For example, if the intra prediction mode of the current block is higher than the vertical intra prediction mode, the current block is sign-combined with the upper adjacent pixel as shown in FIG. 11(a). hypothesis The first row (i.e., the top row) of the current block is the temporary restored pixel (predicted pixel and hypothesis Sign combination using only the residual pixel hypothesis For example, if the intra prediction mode of the current block is a higher intra prediction mode than the vertical intra prediction mode, the sign combination can be calculated based on Equation 4. hypothesis The cost can be calculated.
[0159] Alternatively, for example, if the intra prediction mode of the current block is a higher intra prediction mode than the vertical intra prediction mode, all the pixels that are primarily used are used, and only some of the other reference samples are used to perform sign combination, as shown in FIG. 11(b). hypothesis For example, if the intra prediction mode of the current block is a higher intra prediction mode than the vertical intra prediction mode, a sign combination with the upper adjacent pixel of the current block may be calculated. hypothesis The first row (i.e., the top row) of the current block is the temporary restored pixel (predicted pixel and hypothesis The residual pixel is used in its entirety and the sign combination with the adjacent pixel on the left hypothesis The first column (i.e., the leftmost column) of the current block is the temporarily restored pixel (predicted pixel and hypothesis Residual pixels) use only one of the two pixels to combine the signs hypothesis For example, if the intra prediction mode of the current block is a higher intra prediction mode than the vertical intra prediction mode, the cost of the sign combination can be calculated based on Equation 7. hypothesis The cost can be calculated.
[0160] Alternatively, for example, if the intra prediction mode of the current block is an intra prediction mode smaller than a horizontal intra prediction mode (i.e., the 18th intra prediction mode), the current block may be sign-combined with the left adjacent pixel of the current block. hypothesis The first column (i.e., the leftmost column) of the current block is the temporarily restored pixel (predicted pixel and hypothesis Sign combination using only the residual pixel hypothesis For example, if the intra prediction mode of the current block is a lower intra prediction mode than the horizontal intra prediction mode, the sign combination can be calculated according to Equation 5. hypothesis The cost can be calculated.
[0161] Alternatively, for example, if the intra prediction mode of the current block is a smaller intra prediction mode than the horizontal intra prediction mode, the sign combination is performed by using all the pixels that are primarily used and only using a part of the other reference samples. hypothesis For example, if the intra prediction mode of the current block is a lower intra prediction mode than the horizontal intra prediction mode, a sign combination with the left adjacent pixel of the current block may be calculated. hypothesis The first column (i.e., the leftmost column) of the current block is the temporarily restored pixel (predicted pixel and hypothesis The residual pixel is used in its entirety and the sign combination with the upper adjacent pixel is used. hypothesis The first row (i.e., the top row) of the current block is the temporary restored pixel (predicted pixel and hypothesis Residual pixels) use only one of the two pixels to combine the signs hypothesis For example, if the intra prediction mode of the current block is a lower intra prediction mode than the horizontal intra prediction mode, the cost of the sign combination can be calculated according to Equation 6. hypothesis The cost can be calculated.
[0162] Alternatively, as another embodiment, a method may be proposed in which all intra prediction modes are divided into M groups, and pixels to be used for cost calculation are selected according to the group to which the intra prediction mode of the current block belongs.
[0163] As an example, the intra prediction modes can be divided into four groups (M=4). For example, the first group can be designated as intra prediction modes smaller than the 18th intra prediction mode (i.e., the 1st to 17th intra prediction modes), the second group can be designated as the 18th to 33rd intra prediction modes, the third group can be designated as the 34th to 50th intra prediction modes, and the fourth group can be designated as intra prediction modes equal to or larger than the 50th intra prediction mode. In this case, when the intra prediction mode of the current block is included in the first group, the sign combination is performed based only on the left adjacent sample and the first column (i.e., the leftmost column) sample of the current block. hypothesis If the intra prediction mode of the current block is included in the fourth group, the sign combination is calculated based only on the upper neighboring samples and the first row (i.e., the top row) samples of the current block. hypothesis In addition, if the intra prediction mode of the current block is included in the second group, the left adjacent samples and the samples in the first column (i.e., the leftmost column) of the current block are all used, and the upper adjacent samples and the samples in the first row (i.e., the topmost row) of the current block are only partially used to perform sign combination. hypothesis If the intra prediction mode of the current block is included in the third group, the upper neighboring samples and the samples in the first row (i.e., the top row) of the current block are all used, and the left neighboring samples and the samples in the first column (i.e., the leftmost column) of the current block are only partially used to perform sign combination. hypothesis The cost can be calculated.
[0164] In addition, this embodiment, which proposes a method of selecting samples for cost calculation based on the intra prediction mode of the current block, can be combined with the above-proposed embodiment.
[0165] Alternatively, in another embodiment, sign prediction is performed on the transform block of the inter prediction block. hypothesis (sign prediction hypothesis), i.e., sign combination hypothesis In calculating the cost for , a method is proposed in which the cost is calculated using both the restored neighboring pixels of the current block and the neighboring pixels of the predicted block, or the cost is calculated using only the neighboring pixels of the predicted block.
[0166] FIG. 12 shows the sign combination when the inter prediction mode is applied to the current block. hypothesis 1 shows an example of using adjacent reconstructed samples of a prediction block to calculate the cost of .
[0167] When an inter prediction mode is applied to a current block and a prediction block is constructed from a reference picture based on motion information, not only the prediction block but also neighboring pixels of the prediction block may be fetched. In this embodiment, the neighboring pixels of the fetched prediction block are combined by sign prediction. hypothesis Figure 12 shows the sign combination. hypothesis In the present embodiment, when inter prediction is applied to the current block, a sign combination is performed using an upper adjacent sample and a left adjacent sample of a reference block in a reference picture derived based on motion information of the current block to calculate the cost of the current block. hypothesis For example, the cost of the signature combination according to this embodiment can be calculated. hypothesis The cost of can be derived as follows:
[0168]
number
[0169] where R is the neighbor pixel of the current block, P is the predicted pixel of the current block, and r is the residual hypothesis Specifically, R x、-2 is the upper neighboring pixel at location (x, -2) in the current picture, P x、-1 is the upper neighboring pixel of the reference block at position (x, -1) in the reference picture, P x、0 is the predicted pixel at (x, 0), r x、0 is at (x, 0) position hypothesis Residual pixel, R -2、y is the left adjacent pixel at (-2, y) in the current picture, P -1、y is the left adjacent pixel of the reference block at position (-1, y) in the reference picture, P 0、y is the predicted pixel at (0, y), r 0、y is at (0, y) position hypothesis On the other hand, the (-R -2 +2P -1 -P0) term can be calculated only once per block, and then the residual hypothesis The reconstructed pixels of the current block may be constructed by subtracting only the 1st pixel and the 2nd pixel. In addition, for example, if the current block is a bi-predictive block, neighboring pixels of the prediction block (i.e., neighboring pixels of the reference block in the reference picture) may also be constructed in the same manner as the prediction block construction method.
[0170] Alternatively, the sign combination can be performed by using only the neighboring pixels of the prediction block in the reference picture. hypothesis An embodiment can be proposed to calculate the cost of
[0171] FIG. 13 shows the sign combination when the inter prediction mode is applied to the current block. hypothesis 1 shows an example in which only adjacent reconstructed samples of a prediction block are used to calculate the cost of .
[0172] For example, when inter prediction is applied to the current block, the sign combination is performed using only the upper adjacent samples and the left adjacent samples of a reference block in a reference picture derived based on the motion information of the current block. hypothesisFor example, the cost of the signature combination according to this embodiment can be calculated. hypothesis The cost of can be derived as follows:
[0173]
number
[0174] where P is the predicted pixel of the current block, and r is the residual hypothesis Specifically, P x、-2 is the upper adjacent pixel of the reference block at position (x, -2) in the reference picture, P x、-1 is the upper neighboring pixel of the reference block at position (x, -1) in the reference picture, P x、0 is the predicted pixel at (x, 0), r x、0 is at (x, 0) position hypothesis Residual pixel, P -2、y is the left adjacent pixel of the reference block at location (-2, y) in the reference picture, P -1、y is the left adjacent pixel of the reference block at position (-1, y) in the reference picture, P 0、y is the predicted pixel at (0, y), r 0、y is at (0, y) position hypothesis Residual pixels can be expressed as the residual hypothesis The reconstructed pixels of the current block may be constructed by subtracting only the 1st pixel and the 2nd pixel. In addition, for example, if the current block is a bi-predictive block, neighboring pixels of the prediction block (i.e., neighboring pixels of the reference block in the reference picture) may also be constructed in the same manner as the prediction block construction method.
[0175] Alternatively, in another embodiment, when the current block is a transform block for an inter prediction mode, adjacent pixels of a prediction block in a reference picture are sign predicted. hypothesisWe propose a method to determine whether to use a reference picture in cost calculation based on the distance between the current picture and the reference picture. For example, if inter prediction is applied to the current block and the picture order count (POC) of the current picture and the reference picture differs by a certain value or more, the sign combination is determined based on the above-mentioned Equation 2. hypothesis If the difference between the POC of the current picture and the reference picture is not greater than a certain value, the sign combination is calculated based on the above-mentioned Equation 8 or Equation 9. hypothesis For example, the specific value is 16. Alternatively, for example, when inter prediction is applied to the current block and the reference picture index of the current block is equal to or greater than a specific value, the sign combination can be calculated based on Equation 2. hypothesis If the reference picture index is not equal to or greater than a certain value, the cost of the sign combination is calculated based on Equation 8 or 9. hypothesis Alternatively, for example, if inter prediction is applied to the current block and the reference picture index of the current block is 0, the cost of the sign combination can be calculated based on Equation 2. hypothesis If the reference picture index is not 0, the cost of the sign combination is calculated based on the above-mentioned Equation 8 or Equation 9. hypothesis Alternatively, for example, the neighboring pixels of the prediction block in the reference picture can be sign predicted based on the temporal layer index of the reference picture and the temporal layer index of the current picture. hypothesis A decision can be made as to whether or not to use it in the cost calculation.
[0176] Alternatively, as another embodiment, the neighboring pixels of the prediction block in the reference picture are predicted by sign prediction. hypothesisWe propose a method to determine whether to use the quantization parameter (QP) between the current block and the predicted block of the current block based on the quantization parameter (QP) between the current block and the predicted block of the reference picture. For example, if inter prediction is applied to the current block and the QP of the current block and the QP of the predicted block in the reference picture differ by a certain value or more, the sign combination is determined based on the above-mentioned Equation 2. hypothesis If the difference between the QP of the current block and the QP of the predicted block in the reference picture is not greater than a certain value, the sign combination is calculated based on the above-mentioned Equation 8 or Equation 9. hypothesis For example, the specific value is 5. Alternatively, for example, only when the current block is a unidirectional predicted block, i.e., only when unidirectional inter prediction is applied to the current block, the sign combination is performed using neighboring pixels of the predicted block in the reference picture. hypothesis In other words, only when unidirectional inter prediction is applied to the current block, the sign combination can be calculated based on Equation 8 or 9. hypothesis Alternatively, for example, only when the current block is a bidirectional predicted block, i.e., only when bidirectional inter prediction is applied to the current block, the sign combination can be calculated using neighboring pixels of the predicted block in the reference picture. hypothesis In other words, only when bidirectional inter prediction is applied to the current block, the sign combination can be calculated based on Equation 8 or 9. hypothesis The cost can be calculated.
[0177] Also, the sign combination is performed using the neighboring pixels of the prediction block in the reference picture. hypothesis This embodiment, which proposes a method for calculating the cost of, can be combined with the above-proposed embodiment.
[0178] FIG 14 is a schematic diagram showing a video encoding method by an encoding apparatus according to the present document. The method disclosed in FIG 14 may be performed by the encoding apparatus disclosed in FIG 2. Specifically, for example, S1400 to S1420 in FIG 14 may be performed by a residual processing unit of the encoding apparatus, and S1430 may be performed by an entropy encoding unit of the encoding apparatus. In addition, although not shown, the process of deriving a prediction sample for the current block may be performed by a prediction unit of the encoding apparatus, and the process of generating a reconstructed sample and a reconstructed picture based on the prediction sample and the residual sample may be performed by an adder of the encoding apparatus.
[0179] The encoding apparatus derives neighboring samples for sign prediction based on a size or a prediction mode of a current block (S1400). The encoding apparatus may derive neighboring samples for sign prediction of the current block. For example, the encoding apparatus may derive neighboring samples for the sign prediction based on a size and / or a prediction mode of the current block.
[0180] The encoding apparatus derives costs of sign combination candidates of the transform coefficients of the current block based on the neighboring samples (S1410). The encoding apparatus may derive neighboring samples for the sign prediction based on a size and / or a prediction mode of the current block, and may derive costs of sign combination candidates of the transform coefficients of the current block based on the derived neighboring samples.
[0181] As an example, the neighboring samples may be derived based on the size of the current block.
[0182] For example, if the width of the current block is greater than the height of the current block, the cost of a particular signature combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For example, if the width of the current block is greater than the height of the current block, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the cost of the particular signature combination candidate of the top row. hypothesis For example, if the width of the current block is greater than the height of the current block, the cost of the specific signature combination candidate can be derived based on only the residual sample. x、-2 is the upper adjacent sample at (x, -2), R x、-1 is the upper adjacent sample at (x, -1), P x、0 is the predicted sample at position (x, 0), r x、0 is at (x, 0) position hypothesis Residual samples can be shown.
[0183] Alternatively, for example, if the height of the current block is greater than the width of the current block, the cost of a particular signature combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular signature combination candidate of the leftmost column. hypothesis For example, if the height of the current block is greater than the width of the current block, the cost of a particular signature combination candidate may be calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the residual sample of the particular signature combination candidate of the leftmost column. hypothesisFor example, if the height of the current block is greater than the width of the current block, the cost of the specific signature combination candidate can be derived based on only the residual sample. -2、y is the left adjacent sample at (-2, y), R -1、y is the left adjacent sample at (-1, y), P 0、y is the predicted sample at (0, y), r 0、y is at (0, y) position hypothesis Residual samples can be shown.
[0184] Alternatively, for example, if the width of the current block is greater than the height of the current block, the cost of a particular signature combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis The prediction sample may be derived based on the residual sample, the upper adjacent sample, and the prediction sample. hypothesis The number of residual samples per row may be selected to be equal to the height. For example, the cost of a particular signature combination candidate may be calculated using the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and if the width of the current block is greater than the height of the current block, the upper neighboring sample, the predicted sample, and hypothesis The number of residual samples per row may be selected to be equal to the height. In this case, the cost of the specific signature combination candidate may be derived according to Equation 6 above.
[0185] Alternatively, for example, if the height of the current block is greater than the width of the current block, the cost of a particular signature combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular signature combination candidate of the leftmost column. hypothesis The left adjacent sample, the prediction sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. For example, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and if the height of the current block is greater than the width of the current block, the left adjacent sample, the predicted sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. In this case, the cost of the specific signature combination candidate may be derived according to Equation 7 above.
[0186] Or, as an example, the neighboring samples may be derived based on a prediction mode of the current block.
[0187] For example, the neighboring samples may be derived based on the intra-prediction mode of the current block.
[0188] For example, if the intra prediction mode of the current block is an intra prediction mode with a larger vertical intra prediction mode, the cost of a particular sign combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular sign combination candidate of the top row. hypothesisFor example, if the intra prediction mode of the current block is an intra prediction mode having a larger vertical intra prediction mode, the cost of a particular sign combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular sign combination candidate of the top row. hypothesis The intra prediction mode having a larger number than the vertical intra prediction mode may be derived based only on the residual sample. The intra prediction mode having a larger number than the vertical intra prediction mode among the intra prediction modes. For example, the intra prediction mode having a larger number than the vertical intra prediction mode (e.g., intra prediction mode no. 50) may be derived based on only the residual sample.
[0189] Or, for example, if the intra prediction mode of the current block is an intra prediction mode with a smaller horizontal intra prediction mode, the cost of a particular sign combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis For example, if the intra prediction mode of the current block is an intra prediction mode in which the horizontal intra prediction mode is smaller, the cost of a particular sign combination candidate may be calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis The horizontal intra prediction mode may be derived based only on the residual sample. The smaller intra prediction mode of the horizontal intra prediction mode is an intra prediction mode having a smaller number than the horizontal intra prediction mode among the intra prediction modes. For example, the smaller intra prediction mode of the horizontal intra prediction mode (e.g., intra prediction mode no. 18) is an intra prediction mode having a smaller number than 18.
[0190] Alternatively, for example, if the intra prediction mode of the current block is an intra prediction mode with a larger vertical intra prediction mode, the cost of a particular sign combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis The left adjacent sample, the prediction sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. For example, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and if the intra prediction mode of the current block is an intra prediction mode with a larger vertical intra prediction mode, the left neighboring sample, the prediction sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. In this case, the cost of the specific signature combination candidate may be derived according to Equation 7 above.
[0191] Or, for example, if the intra prediction mode of the current block is an intra prediction mode with a smaller horizontal intra prediction mode, the cost of a particular sign combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular sign combination candidate of the top row. hypothesis The prediction sample may be derived based on the residual sample, the upper adjacent sample, and the prediction sample. hypothesisThe number of residual samples per row may be selected to be equal to the height. For example, the cost of a particular signature combination candidate may be calculated using the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and the residual sample, and if the intra prediction mode of the current block is an intra prediction mode with a smaller horizontal intra prediction mode, the upper neighboring sample, the prediction sample, and hypothesis The number of residual samples per row may be selected to be equal to the height. In this case, the cost of the specific signature combination candidate may be derived according to Equation 6 above.
[0192] Alternatively, for example, intra prediction modes may be divided into M groups, and the neighboring samples may be derived according to the group to which the intra prediction mode of the current block belongs. For example, intra prediction modes may be divided into 4 groups, and if the intra prediction mode of the current block is included in a first group, the cost of a particular sign combination candidate may be calculated based on the left neighboring sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis Alternatively, if the intra prediction mode of the current block is included in the fourth group, the cost of a particular signature combination candidate may be derived based on only the residual samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesisAlternatively, if the intra prediction mode of the current block is included in the second group, the cost of the specific signature combination candidate may be derived based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column. hypothesis Residual samples, some upper adjacent samples of the current block, some predicted samples of the top row of the current block, and some of the candidate signature combinations of the top row hypothesis For example, if the intra prediction mode of the current block is included in the second group, the cost of a particular signature combination candidate may be derived based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the residual sample of the particular signature combination candidate of the leftmost column. hypothesis For the residual sample, the upper adjacent sample of the current block, the predicted sample of the top row of the current block, and the specific signature combination candidate of the top row, hypothesis and the residual sample, hypothesis The residual samples may be selected to be the same number as the height per column. Alternatively, if the intra prediction mode of the current block is included in the third group, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis A residual sample, a portion of the left adjacent samples of the current block, a portion of the predicted samples of the leftmost column of the current block, and a portion of the predicted samples of the leftmost column for the specific signature combination candidate hypothesisFor example, if the intra prediction mode of the current block is included in the third group, the cost of a particular signature combination candidate may be calculated based on the upper neighboring samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis a residual sample, and hypothesis The number of residual samples per column can be selected to be equal to the width.
[0193] Alternatively, for example, when inter prediction is applied to the current block, neighboring samples of a reference block in a reference picture may be derived based on motion information of the current block, and a cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block. For example, when inter prediction is applied to the current block, neighboring samples of a reference block in a reference picture may be derived based on motion information of the current block, and a cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block and the neighboring samples of the current block. The cost may be derived based on Equation 8 above. Alternatively, for example, when inter prediction is applied to the current block, neighboring samples of a reference block in a reference picture may be derived based on motion information of the current block, and a cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block, the predicted sample of the current block, and the cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block, the predicted sample of the current block, and the cost of a specific sign combination candidate. hypothesisThe cost may be derived based on residual samples. That is, for example, when inter prediction is applied to the current block, neighboring samples of the current block are not used in deriving the cost. The cost may be derived based on Equation 9 above.
[0194] Or, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate can be determined based on the difference between a picture order count (POC) of the current picture and the POC of the reference picture. For example, if the difference between the POC of the current picture and the POC of the reference picture is equal to or greater than a specific value, adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate, and if the difference between the POC of the current picture and the POC of the reference picture is not equal to or greater than a specific value, adjacent samples of a reference block in a reference picture are not used to derive the cost of a sine combination candidate. For example, the specific value is 16.
[0195] Or, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of the sine combination candidate can be determined based on a reference picture index for the current block. For example, when the reference picture index for the current block is smaller than a specific value, adjacent samples of a reference block in a reference picture are used to derive the cost of the sine combination candidate, and when the reference picture index for the current block is equal to or larger than a specific value, adjacent samples of a reference block in a reference picture are not used to derive the cost of the sine combination candidate. For example, the specific value is 1.
[0196] Or, for example, if inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sign combination candidate can be determined based on a temporal layer index of the current picture and a temporal layer index of the reference picture.
[0197] Or, for example, when inter prediction is applied to the current block, whether adjacent samples of the reference block in the reference picture are used to derive the cost of the sine combination candidate can be determined based on the QP (quantization parameter) of the current block and the QP of the reference block. For example, if the difference between the QP of the current block and the QP of the reference block is not equal to or greater than a specific value, adjacent samples of the reference block in the reference picture are used to derive the cost of the sine combination candidate, and if the difference between the QP of the current block and the QP of the reference block is equal to or greater than a specific value, adjacent samples of the reference block in the reference picture are not used to derive the cost of the sine combination candidate. For example, the specific value is 5.
[0198] Alternatively, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate may be determined based on whether the inter prediction of the current block is unidirectional inter prediction. For example, when the inter prediction of the current block is unidirectional inter prediction, adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate.
[0199] Alternatively, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate may be determined based on whether the inter prediction of the current block is bidirectional inter prediction. For example, when the inter prediction of the current block is bidirectional inter prediction, adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate.
[0200] Meanwhile, for example, the encoding apparatus may derive prediction samples by performing an inter prediction mode or an intra prediction mode on the current block. Also, for example, the encoding apparatus may derive prediction samples by performing a partial inverse transformation and a border reconstruction on the sign combination candidate. hypothesis Residual samples can be derived, hypothesis A reconstruction sample can be derived.
[0201] The encoding apparatus predicts the sign of the transform coefficient from the sign combination candidates based on the cost (S1420). The encoding apparatus may predict the sign of the transform coefficient from the sign combination candidates based on the cost. For example, the encoding apparatus may predict the sign combination candidate having the smallest cost among the sign combination candidates as the sign of the transform coefficient. Meanwhile, the sign combination candidates may include a sign combination hypothesis It can also be called.
[0202] Meanwhile, for example, the encoding apparatus may derive a residual sample of the current block based on the predicted sign, and may generate a reconstructed picture based on the predicted sample of the current block and the residual sample.
[0203] The encoding apparatus encodes residual information of the current block, including syntax elements for the predicted signature (S1430).
[0204] The encoding apparatus may encode residual information of a current block including a syntax element for the predicted sign. For example, the syntax element for the predicted sign may indicate whether the predicted sign is accurate. That is, for example, a target syntax element among the syntax elements may indicate whether a predicted sign of a transform coefficient for the target syntax element is accurate. The syntax element for the predicted sign of a transform coefficient of the current block may indicate the above-mentioned sign residual. Video information may include the residual information.
[0205] Meanwhile, for example, the encoding apparatus may generate and encode prediction mode information for the current block. For example, the prediction mode information may indicate an intra prediction mode or an inter prediction mode applied to the current block. Also, the encoding apparatus may generate and encode prediction related information for motion information of the current block. The motion information may include a motion vector and a reference picture index.
[0206] Also, for example, the encoding apparatus may encode residual information for the residual samples, the residual information including syntax elements for predicted signs of the transform coefficients of the current block.
[0207] The image information may include prediction mode information, prediction related information, and / or residual information of the current block, and may be encoded by an encoding device and output in the form of a bitstream.
[0208] Meanwhile, the bitstream including the video information can be transmitted to the decoding device via a network or a (digital) storage medium, where the network can include a broadcasting 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.
[0209] Figure 15 is a schematic diagram of an encoding device for performing a video encoding method according to the present document. The method disclosed in Figure 14 can be performed by the encoding device disclosed in Figure 15. Specifically, for example, a residual processing unit of the encoding device of Figure 15 can perform S1400 to S1420, and an entropy encoding unit of the encoding device can perform S1430. Although not shown, a process of generating reconstructed samples and reconstructed pictures based on the residual samples and predicted samples can be performed by an adder of the encoding device.
[0210] FIG 16 is a schematic diagram showing a video decoding method by a decoding device according to the present document. The method disclosed in FIG 16 may be performed by the decoding device disclosed in FIG 3. Specifically, for example, S1000 to S2430 in FIG 16 may be performed by a prediction unit of the decoding device. Also, although not shown, a process of obtaining video information including intra prediction mode information and residual information for the current block through a bitstream may be performed by an entropy decoding unit of the decoding device, a process of deriving the residual sample for the current block based on the residual information may be performed by an inverse transform unit of the decoding device, and a process of generating a reconstructed picture based on the prediction sample and the residual sample may be performed by an adder of the decoding device.
[0211] A decoding apparatus derives neighboring samples for sign prediction of a current block (S1600). The decoding apparatus may derive neighboring samples for sign prediction of a current block. For example, the decoding apparatus may derive neighboring samples for sign prediction based on a size and / or a prediction mode of the current block.
[0212] The decoding apparatus derives costs of sign combination candidates of the transform coefficients of the current block based on the neighboring samples (S1610). The decoding apparatus may derive costs of sign combination candidates of the transform coefficients of the current block based on the neighboring samples.
[0213] As an example, the neighboring samples may be derived based on the size of the current block.
[0214] For example, if the width of the current block is greater than the height of the current block, the cost of a particular signature combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For example, if the width of the current block is greater than the height of the current block, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the cost of the particular signature combination candidate of the top row. hypothesis For example, if the width of the current block is greater than the height of the current block, the cost of the specific signature combination candidate can be derived based on only the residual sample. x、-2 is the upper adjacent sample at (x, -2), R x、-1 is the upper adjacent sample at (x, -1), P x、0 is the predicted sample at position (x, 0), r x、0 is at (x, 0) position hypothesisResidual samples can be shown.
[0215] Alternatively, for example, if the height of the current block is greater than the width of the current block, the cost of a particular signature combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular signature combination candidate of the leftmost column. hypothesis For example, if the height of the current block is greater than the width of the current block, the cost of a particular signature combination candidate may be calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the residual sample of the particular signature combination candidate of the leftmost column. hypothesis For example, if the height of the current block is greater than the width of the current block, the cost of the specific signature combination candidate can be derived based on only the residual sample. -2、y is the left adjacent sample at (-2, y), R -1、y is the left adjacent sample at (-1, y), P 0、y is the predicted sample at (0, y), r 0、y is at (0, y) position hypothesis Residual samples can be shown.
[0216] Alternatively, for example, if the width of the current block is greater than the height of the current block, the cost of a particular signature combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis The prediction sample may be derived based on the residual sample, the upper adjacent sample, and the prediction sample. hypothesis The number of residual samples per row may be selected to be equal to the height. For example, the cost of a particular signature combination candidate may be calculated using the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesisFor the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and if the width of the current block is greater than the height of the current block, the upper neighboring sample, the predicted sample, and hypothesis The number of residual samples per row may be selected to be equal to the height. In this case, the cost of the specific signature combination candidate may be derived according to Equation 6 above.
[0217] Alternatively, for example, if the height of the current block is greater than the width of the current block, the cost of a particular signature combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular signature combination candidate of the leftmost column. hypothesis The left adjacent sample, the prediction sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. For example, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and if the height of the current block is greater than the width of the current block, the left adjacent sample, the predicted sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. In this case, the cost of the specific signature combination candidate may be derived according to Equation 7 above.
[0218] Or, as an example, the neighboring samples may be derived based on a prediction mode of the current block.
[0219] For example, the neighboring samples may be derived based on the intra-prediction mode of the current block.
[0220] For example, if the intra prediction mode of the current block is an intra prediction mode with a larger vertical intra prediction mode, the cost of a particular sign combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular sign combination candidate of the top row. hypothesis For example, if the intra prediction mode of the current block is an intra prediction mode having a larger vertical intra prediction mode, the cost of a particular sign combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular sign combination candidate of the top row. hypothesis The intra prediction mode having a larger vertical intra prediction mode may be derived based only on the residual sample. The intra prediction mode having a larger number than the vertical intra prediction mode among the intra prediction modes. For example, the intra prediction mode having a larger vertical intra prediction mode (e.g., intra prediction mode no. 50) may be derived based only on the residual sample.
[0221] Or, for example, if the intra prediction mode of the current block is an intra prediction mode with a smaller horizontal intra prediction mode, the cost of a particular sign combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesisFor example, if the intra prediction mode of the current block is an intra prediction mode in which the horizontal intra prediction mode is smaller, the cost of a particular sign combination candidate may be calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis The horizontal intra prediction mode may be derived based only on the residual sample. The smaller intra prediction mode of the horizontal intra prediction mode is an intra prediction mode having a smaller number than the horizontal intra prediction mode among the intra prediction modes. For example, the smaller intra prediction mode of the horizontal intra prediction mode (e.g., intra prediction mode no. 18) is an intra prediction mode having a smaller number than 18.
[0222] Alternatively, for example, if the intra prediction mode of the current block is an intra prediction mode with a larger vertical intra prediction mode, the cost of a particular sign combination candidate is calculated based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis The left adjacent sample, the prediction sample, and hypothesis The number of residual samples per column may be selected to be equal to the width. For example, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis and if the intra prediction mode of the current block is an intra prediction mode with a larger vertical intra prediction mode, the left neighboring sample, the prediction sample, and hypothesisThe number of residual samples per column may be selected to be equal to the width. In this case, the cost of the specific signature combination candidate may be derived according to Equation 7 above.
[0223] Or, for example, if the intra prediction mode of the current block is an intra prediction mode with a smaller horizontal intra prediction mode, the cost of a particular sign combination candidate is calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular sign combination candidate of the top row. hypothesis The prediction sample may be derived based on the residual sample, the upper adjacent sample, and the prediction sample. hypothesis The number of residual samples per row may be selected to be equal to the height. For example, the cost of a particular signature combination candidate may be calculated using the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis If the intra prediction mode of the current block is an intra prediction mode with a smaller horizontal intra prediction mode, the upper neighboring sample, the prediction sample, and the hypothesized residual sample may be selected to be the same number as the height per row. In this case, the cost of the specific signature combination candidate may be derived according to Equation 6.
[0224] Alternatively, for example, intra prediction modes may be divided into M groups, and the neighboring samples may be derived according to the group to which the intra prediction mode of the current block belongs. For example, intra prediction modes may be divided into 4 groups, and if the intra prediction mode of the current block is included in a first group, the cost of a particular sign combination candidate may be calculated based on the left neighboring sample of the current block, the predicted sample of the leftmost column of the current block, and the cost of the particular sign combination candidate of the leftmost column. hypothesis Alternatively, if the intra prediction mode of the current block is included in the fourth group, the cost of a particular signature combination candidate may be derived based on only the residual samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis Alternatively, if the intra prediction mode of the current block is included in the second group, the cost of the specific signature combination candidate may be derived based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column. hypothesis Residual samples, some upper adjacent samples of the current block, some predicted samples of the top row of the current block, and some of the candidate signature combinations of the top row hypothesis For example, if the intra prediction mode of the current block is included in the second group, the cost of a particular signature combination candidate may be derived based on the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the residual sample of the particular signature combination candidate of the leftmost column. hypothesis For the residual sample, the upper adjacent sample of the current block, the predicted sample of the top row of the current block, and the specific signature combination candidate of the top row, hypothesis and the residual sample, hypothesisThe residual samples may be selected to be the same number as the height per column. Alternatively, if the intra prediction mode of the current block is included in the third group, the cost of a particular signature combination candidate may be calculated based on the upper adjacent samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis A residual sample, a portion of the left adjacent samples of the current block, a portion of the predicted samples of the leftmost column of the current block, and a portion of the predicted samples of the leftmost column for the specific signature combination candidate hypothesis For example, if the intra prediction mode of the current block is included in the third group, the cost of a particular signature combination candidate may be calculated based on the upper neighboring samples of the current block, the predicted samples of the top row of the current block, and the particular signature combination candidate of the top row. hypothesis For the residual sample, the left adjacent sample of the current block, the predicted sample of the leftmost column of the current block, and the specific signature combination candidate of the leftmost column, hypothesis a residual sample, and hypothesis The number of residual samples per column can be selected to be equal to the width.
[0225] Alternatively, for example, when inter prediction is applied to the current block, neighboring samples of a reference block in a reference picture may be derived based on motion information of the current block, and a cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block. For example, when inter prediction is applied to the current block, neighboring samples of a reference block in a reference picture may be derived based on motion information of the current block, and a cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block and the neighboring samples of the current block. The cost may be derived based on Equation 8 above. Alternatively, for example, when inter prediction is applied to the current block, neighboring samples of a reference block in a reference picture may be derived based on motion information of the current block, and a cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block, the predicted sample of the current block, and the cost of a specific sign combination candidate may be derived based on the neighboring samples of the reference block, the predicted sample of the current block, and the cost of a specific sign combination candidate. hypothesis The cost may be derived based on residual samples, that is, for example, when inter prediction is applied to the current block, neighboring samples of the current block are not used in deriving the cost, and the cost may be derived based on Equation 9, described above.
[0226] Or, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate can be determined based on the difference between a picture order count (POC) of the current picture and the POC of the reference picture. For example, if the difference between the POC of the current picture and the POC of the reference picture is equal to or greater than a specific value, adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate, and if the difference between the POC of the current picture and the POC of the reference picture is not equal to or greater than a specific value, adjacent samples of a reference block in a reference picture are not used to derive the cost of a sine combination candidate. For example, the specific value is 16.
[0227] Or, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of the sine combination candidate can be determined based on a reference picture index for the current block. For example, when the reference picture index for the current block is smaller than a specific value, adjacent samples of a reference block in a reference picture are used to derive the cost of the sine combination candidate, and when the reference picture index for the current block is equal to or larger than a specific value, adjacent samples of a reference block in a reference picture are not used to derive the cost of the sine combination candidate. For example, the specific value is 1.
[0228] Or, for example, if inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sign combination candidate can be determined based on a temporal layer index of the current picture and a temporal layer index of the reference picture.
[0229] Or, for example, when inter prediction is applied to the current block, whether adjacent samples of the reference block in the reference picture are used to derive the cost of the sine combination candidate can be determined based on the QP (quantization parameter) of the current block and the QP of the reference block. For example, if the difference between the QP of the current block and the QP of the reference block is not equal to or greater than a specific value, adjacent samples of the reference block in the reference picture are used to derive the cost of the sine combination candidate, and if the difference between the QP of the current block and the QP of the reference block is equal to or greater than a specific value, adjacent samples of the reference block in the reference picture are not used to derive the cost of the sine combination candidate. For example, the specific value is 5.
[0230] Alternatively, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate may be determined based on whether the inter prediction of the current block is unidirectional inter prediction. For example, when the inter prediction of the current block is unidirectional inter prediction, adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate.
[0231] Alternatively, for example, when inter prediction is applied to the current block, whether adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate may be determined based on whether the inter prediction of the current block is bidirectional inter prediction. For example, when the inter prediction of the current block is bidirectional inter prediction, adjacent samples of a reference block in a reference picture are used to derive the cost of a sine combination candidate.
[0232] Meanwhile, for example, the decoding apparatus may derive prediction samples by performing an inter prediction mode or an intra prediction mode on the current block based on prediction mode information acquired through a bitstream. Also, for example, the decoding apparatus may derive prediction samples by performing a partial inverse transformation and a border reconstruction on the sign combination candidate. hypothesis Residual samples can be derived, hypothesis A reconstruction sample can be derived.
[0233] The decoding apparatus predicts the sign of the transform coefficient from the sign combination candidates based on the cost (S1620). The decoding apparatus may predict the sign of the transform coefficient from the sign combination candidates based on the cost. For example, the decoding apparatus may predict the sign combination candidate having the smallest cost among the sign combination candidates as the sign of the transform coefficient. Meanwhile, the sign combination candidate may be a sign combination. hypothesis It can also be called.
[0234] The decoding apparatus derives a residual sample of the current block based on the predicted sign (S1630). The decoding apparatus can derive a residual sample of the current block based on the predicted sign.
[0235] For example, the decoding apparatus may determine whether the predicted sign is accurate based on a syntax element for the predicted sign, and may derive the sign of the transform coefficient based on a result of the determination. For example, the decoding apparatus may obtain residual information of the current block, and the residual information may include a syntax element for the predicted sign. For example, the syntax element for the predicted sign may indicate whether the predicted sign is accurate. That is, for example, a target syntax element among the syntax elements may indicate whether a predicted sign of a transform coefficient for the target syntax element is accurate. For example, if a target syntax element indicates that a predicted sign of a transform coefficient for the target syntax element is accurate, the decoding apparatus may determine that the predicted sign is accurate and derive the predicted sign as the sign of the transform coefficient. That is, for example, if the target syntax element indicates that the predicted sign of the transform coefficient is accurate, the sign of the transform coefficient may be derived as a positive number if the predicted sign is positive, and the sign of the transform coefficient may be derived as a negative number if the predicted sign is negative. Or, for example, if the target syntax element indicates that the predicted sign of the transform coefficient for the target syntax element is not accurate, the decoding apparatus may determine that the predicted sign is not accurate and may derive a sign opposite to the predicted sign as the sign of the transform coefficient. That is, for example, if the target syntax element indicates that the predicted sign of the transform coefficient is not accurate, the sign of the transform coefficient may be derived as a negative number if the predicted sign is positive, and the sign of the transform coefficient may be derived as a positive number if the predicted sign is negative.The syntax element for the predicted sign of the transform coefficients of the current block may indicate the sign residual described above.
[0236] Thereafter, for example, the decoding device can derive an absolute value of the transform coefficient based on residual information of the current block, and can derive a residual sample for the transform coefficient based on the derived sign for the transform coefficient and the absolute value.
[0237] The decoding apparatus generates a reconstructed picture based on the residual samples (S1640). For example, the decoding apparatus may generate a reconstructed picture based on the residual samples.
[0238] Meanwhile, for example, the decoding apparatus may derive a prediction sample by performing an inter prediction mode or an intra prediction mode for the current block based on prediction mode information acquired through a bitstream, and may generate the reconstructed picture by adding the prediction sample and the residual sample. For example, the decoding apparatus may derive an intra prediction mode for the current block based on prediction mode information, may derive a prediction sample of the current block based on the intra prediction mode, and may generate a reconstructed sample and a reconstructed picture by adding the prediction sample and the residual sample. Alternatively, for example, the decoding apparatus may determine that inter prediction is applied to the current block based on prediction mode information, may derive motion information of the current block based on prediction related information for the current block, may derive a reference block in a reference picture based on the motion information, may derive a prediction sample of the current block based on the reference block, and may generate a reconstructed sample and a reconstructed picture by adding the prediction sample and the residual sample. As mentioned above, thereafter, if necessary, in-loop filtering procedures such as deblocking filtering, SAO and / or ALF procedures may be applied to the reconstructed samples to improve the subjective / objective image quality.
[0239] Meanwhile, for example, a decoding device may obtain image information of the current block through a bitstream, the image information may include prediction mode information and / or residual information of the current block, and the residual information may include syntax elements for predicted signs of transform coefficients of the current block.
[0240] Figure 17 is a schematic diagram of a decoding device for performing the video decoding method according to the present document. The method disclosed in Figure 16 can be performed by the decoding device disclosed in Figure 17. Specifically, for example, the residual processing unit of the decoding device of Figure 17 can perform S1600 to S1630 of Figure 16, and the adder of the decoding device of Figure 17 can perform S1640 of Figure 16.
[0241] According to the above-mentioned document, adjacent samples for cost derivation for a candidate sign combination can be determined based on the size of the current block, thereby reflecting the characteristics of the image to improve the accuracy of sign prediction and reducing the complexity of cost calculation to improve coding efficiency.
[0242] In addition, according to this document, adjacent samples for cost derivation for sign combination candidates can be determined based on the intra prediction mode of the current block, thereby reflecting the characteristics of the image to improve sign prediction accuracy and reducing the complexity of cost calculation to improve coding efficiency.
[0243] In addition, according to this document, when inter prediction is applied to a current block, a cost for a sign combination candidate can be derived using adjacent samples of a reference block derived, thereby reflecting the characteristics of an image, improving the accuracy of sign prediction, and improving coding efficiency.
[0244] In the above-described embodiments, the method is described with reference to a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and certain steps may occur in a different order or simultaneously with other steps than those described above. Also, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps of the flow chart may be deleted without affecting the scope of this document.
[0245] The embodiments described in this document may be implemented and executed on a processor, a microprocessor, a controller, or a chip. For example, the functional units illustrated in the drawings may be implemented and executed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information (e.g., information on instructions) or algorithms for implementation may be stored in a digital recording medium.
[0246] In addition, the decoding device and encoding device to which the embodiment of this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, a vehicle terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, an over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.
[0247] In addition, the processing method to which the embodiments of this document are applied may be produced in the form of a program executed by a computer and may be stored in a computer-readable recording medium. Multimedia data having a data structure according to this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium may also include a medium realized in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bit stream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.
[0248] Furthermore, the embodiments of the present document may be embodied in a computer program product having program code, the program code being executable by a computer in accordance with the embodiments of the present document. The program code may be stored on a computer readable carrier.
[0249] FIG. 18 exemplarily illustrates a structural diagram of a content streaming system to which the embodiments of this document are applied.
[0250] A content streaming system to which the embodiments of this document are applied can broadly include an encoding server, a streaming server, a web server, a media repository, a user device, and a multimedia input device.
[0251] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.
[0252] The bitstream may be generated by an encoding method or a bitstream generation method to which an embodiment of this document is applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.
[0253] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.
[0254] The streaming server may receive content from a media repository and / or an encoding server. For example, when the content is received from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time in order to provide a smooth streaming service.
[0255] Examples of the user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glass, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.
[0256] The claims described herein may be combined in various ways. For example, the technical features of the method claims herein may be combined and embodied in an apparatus, and the technical features of the apparatus claims herein may be combined and embodied in a method. Also, the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied in an apparatus, and the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied in a method.
Claims
1. 1. A video decoding method performed by a decoding device, comprising: deriving adjacent samples for signature prediction of the current block; deriving costs of candidate sign combinations of transform coefficients of the current block based on the neighboring samples; predicting signs of the transform coefficients from the candidate sign combinations based on the costs; deriving a residual sample of the current block based on the predicted signature; and generating a reconstructed picture based on the residual samples.
2. The method of claim 1, wherein the neighboring samples are derived based on a size of the current block.
3. 3. The image decoding method of claim 2, wherein if the width of the current block is greater than the height of the current block, a cost of a particular signature combination candidate is derived based on upper adjacent samples of the current block, predicted samples of a top row of the current block, and hypothetical residual samples for the particular signature combination candidate of the top row.
4. If the width of the current block is greater than the height of the current block, the cost of the specific signature combination candidate is derived based on the following formula: where w is the width of the current block, R x、-2 is the upper adjacent sample at (x, -2) position, R x、-1 is the upper adjacent sample at (x, -1) position, P x、0 is the predicted sample at position (x, 0), r x、0 4. The video decoding method of claim 3, wherein x denotes a hypothetical residual sample at position (x, 0).
5. 3. The image decoding method of claim 2, wherein if the height of the current block is greater than the width of the current block, a cost of a particular signature combination candidate is derived based on a left adjacent sample of the current block, a predicted sample of a leftmost column of the current block, and a hypothetical residual sample for the particular signature combination candidate of the leftmost column.
6. If the height of the current block is greater than the width of the current block, the cost of the specific signature combination candidate is derived based on the following formula: where h is the height of the current block, R -2、y is the left adjacent sample at the (-2, y) position, R -1、y is the left adjacent sample at the (-1, y) position, P 0、y is the predicted sample at (0, y), r 0、y 6. The video decoding method of claim 5, wherein: denotes a hypothetical residual sample at position (0,y).
7. If the width of the current block is greater than the height of the current block, a cost of the specific signature combination candidate is derived based on upper adjacent samples of the current block, predicted samples of a top row of the current block, and hypothetical residual samples for the specific signature combination candidate of the top row; 3. The method of claim 2, wherein the upper neighboring samples, the prediction samples, and the hypothesis residual samples are selected in a number equal to the height per row.
8. If the height of the current block is greater than the width of the current block, a cost of the specific signature combination candidate is derived based on a left adjacent sample of the current block, a predicted sample of a leftmost column of the current block, and a hypothetical residual sample for the specific signature combination candidate of the leftmost column; 3. The method of claim 2, wherein the left adjacent sample, the predicted sample, and the hypothesis residual sample are selected in a number equal to the width per column.
9. 2. The image decoding method of claim 1, wherein, when an intra prediction mode of the current block is an intra prediction mode higher than a vertical intra prediction mode, a cost of a particular sign combination candidate is derived based on upper adjacent samples of the current block, predicted samples of a top row of the current block, and hypothetical residual samples for the particular sign combination candidate of the top row.
10. 2. The image decoding method of claim 1, wherein, when an intra prediction mode of the current block is an intra prediction mode smaller than a horizontal intra prediction mode, a cost of a particular sign combination candidate is derived based on a left adjacent sample of the current block, a predicted sample of a leftmost column of the current block, and a hypothetical residual sample for the particular sign combination candidate of the leftmost column.
11. 2. The image decoding method of claim 1, wherein, when inter prediction is applied to the current block, neighboring samples of a reference block of a reference picture derived based on motion information of the current block are used to derive the cost.
12. 1. A video encoding method performed by an encoding device, comprising: deriving neighboring samples for sign prediction based on a size or a prediction mode of a current block; deriving costs of candidate sign combinations of transform coefficients of the current block based on the neighboring samples; predicting signs of the transform coefficients from the candidate sign combinations based on the costs; encoding residual information of the current block including a syntax element for the predicted signature; A target syntax element among the syntax elements indicates whether a predicted sign of a transform coefficient for the target syntax element is accurate.
13. 13. The image encoding method of claim 12, wherein if the width of the current block is greater than the height of the current block, a cost of a particular signature combination candidate is derived based on upper adjacent samples of the current block, predicted samples of a top row of the current block, and hypothetical residual samples for the particular signature combination candidate of the top row.
14. A digital storage medium on which a bitstream containing residual information encoded by the video encoding method according to claim 12 is stored.
15. In a method of transmitting data for video, obtaining a bitstream of video information including residual information including syntax elements for predicted signs of transform coefficients of a current block; transmitting the data including the bitstream of the video information including the residual information; A target syntax element among the syntax elements indicates whether a predicted sign of a transform coefficient for the target syntax element is accurate; The transmission method, characterized in that the predicted sign is derived by deriving adjacent samples for sign prediction based on a size or a prediction mode of the current block, deriving a cost of a sign combination candidate of the transform coefficient based on the adjacent samples, and predicting the sign of the transform coefficient from the sign combination candidate based on the cost.