CN111727606A - Video decoding method and apparatus thereof, and video encoding method and apparatus thereof - Google Patents

Video decoding method and apparatus thereof, and video encoding method and apparatus thereof Download PDF

Info

Publication number
CN111727606A
CN111727606A CN201880089530.4A CN201880089530A CN111727606A CN 111727606 A CN111727606 A CN 111727606A CN 201880089530 A CN201880089530 A CN 201880089530A CN 111727606 A CN111727606 A CN 111727606A
Authority
CN
China
Prior art keywords
current block
transform coefficient
information
coordinates
coefficient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201880089530.4A
Other languages
Chinese (zh)
Other versions
CN111727606B (en
Inventor
朴银姬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Samsung Electronics Co Ltd filed Critical Samsung Electronics Co Ltd
Priority to CN202310308625.3A priority Critical patent/CN116132694A/en
Priority to CN202310312637.3A priority patent/CN116112669A/en
Publication of CN111727606A publication Critical patent/CN111727606A/en
Application granted granted Critical
Publication of CN111727606B publication Critical patent/CN111727606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • H04N19/45Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder performing compensation of the inverse transform mismatch, e.g. Inverse Discrete Cosine Transform [IDCT] mismatch
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Disclosed is a video decoding method, the method comprising: determining a scan region including all significant transform coefficients in a current block; scanning information related to transform coefficients in the scanning area in a predetermined scanning order; performing binary arithmetic decoding based on the scanned information on the transform coefficients to generate binary arithmetic decoded information; performing inverse binarization on the binary arithmetic decoded information to obtain information on a transform coefficient of the current block; performing inverse quantization and inverse transform based on information on transform coefficients of the current block to generate a residual block of the current block; and restoring the current block based on the generated residual block. According to the disclosed video decoding method, binary arithmetic decoding is performed using a context model determined based on at least one of a size and a shape of a current block.

Description

Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
Technical Field
To a video decoding method and a video encoding method. And more particularly, to entropy decoding and entropy encoding.
Background
With the development and popularization of hardware capable of playing and storing high-resolution or high-quality video content, there is an increasing demand for video codecs that efficiently perform encoding or decoding with respect to the high-resolution or high-quality video content. According to the existing video codec, video is encoded in a limited encoding method by a tree structure-based coding unit.
Image data in the spatial domain is transformed into coefficients in the frequency domain by using a frequency transform. The video codec divides an image into blocks having a predetermined size and performs encoding on frequency coefficients in block units by performing Discrete Cosine Transform (DCT) on each block to perform a fast operation of frequency transform. The coefficients in the frequency domain have a form that is easily compressed compared to the image data in the spatial domain. In particular, since image pixel values in a spatial domain are expressed as a prediction error through inter prediction or intra prediction of a codec, much data may be transformed into zero when frequency transformation is performed on the prediction error. The video codec reduces the amount of data by replacing data that continuously recurs with data having a small size.
Disclosure of Invention
Technical problem
According to various embodiments, it is possible to determine a scanning area based on various elements, scan information related to coefficients, and perform binarization/inverse binarization and context model-based binary arithmetic coding/decoding to improve efficiency of entropy coding.
According to various embodiments, in entropy encoding and decoding of transform coefficients, a quadrilateral scanning area including all significant transform coefficients in a current block may be determined, and significant transform coefficients in the quadrilateral scanning area are scanned, thereby reducing unnecessary scanning; the significant transform coefficients having a correlation with each other are scanned adjacently, thereby improving the efficiency of entropy coding. A context model related to syntax on a transform coefficient may be determined based on various factors, thereby improving entropy coding efficiency. In particular, a context model related to a syntax element regarding a transform coefficient may be determined in consideration of at least one of a size of a block and a shape of the block, thereby improving entropy coding efficiency. In addition, a context model related to syntax regarding a transform coefficient may be determined in consideration of a scan region, thereby improving entropy coding efficiency. In addition, it is possible to perform codec on information on coordinates in a horizontal direction and information on coordinates in a vertical direction of a designated scanning area without independently performing codec on the information on the coordinates in the horizontal direction and the information on the coordinates in the vertical direction in consideration of a correlation between the coordinates in the horizontal direction and the coordinates in the vertical direction, thereby improving codec efficiency.
A computer-readable recording medium in which a program for implementing the methods of various embodiments is recorded may be included.
Of course, technical problems of various embodiments are not limited to the above-described features, and other technical problems not mentioned will be clearly understood by those skilled in the art from the following description.
Technical scheme
Technical problems of the present invention are not limited to the above-described features, and other technical problems not mentioned will be clearly understood by those skilled in the art from the following description.
A video decoding method according to various embodiments may include the steps of: determining a scan region including all significant transform coefficients in a current block; scanning information related to transform coefficients in the scanning area in a predetermined scanning order; performing binary arithmetic decoding based on the scanned information on the transform coefficients to generate binary arithmetic decoded information; performing inverse binarization on the binary arithmetically decoded information to obtain information related to a transform coefficient of the current block; performing inverse quantization and inverse transform based on information on transform coefficients of the current block to generate a residual block of the current block; and restoring the current block based on the generated residual block.
The binary arithmetic decoding may be performed using a context model determined based on at least one of a size and a shape (shape) of the current block.
All significant transform coefficients in the current block may be included in the quadrangular scan area, and the remaining areas other than the quadrangular scan area within the current block may include only 0 s that are not significant transform coefficients.
The scanning area may be a quadrangular scanning area, and the step of determining the scanning area may include: obtaining information on coordinates specifying a quadrangular scanning area from a bitstream; and determining a quadrangular scanning area of the transform coefficient in the current block based on information on coordinates specifying the quadrangular scanning area, wherein the coordinates specifying the horizontal direction of the quadrangular scanning area may indicate the coordinates of the significant transform coefficient pixel located at the rightmost side in the current block, the coordinates specifying the vertical direction of the quadrangular scanning area may indicate the coordinates of the significant transform coefficient pixel located at the lowermost side in the current block, wherein flag information indicating whether a difference between coordinate values in a horizontal direction and coordinate values in a vertical direction of the specified quadrangular scanning area is included in the information on the coordinates of the specified quadrangular scanning area may be included in the bitstream, wherein when the flag information indicates that a difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction of the specified quadrangular scanning area is included, the information on the coordinates of the specified quadrangular scanning area may include: information indicating a coordinate for one direction among coordinates in a horizontal direction for a pixel of a significant transform coefficient located on the rightmost side in the current block and coordinates in a vertical direction for a pixel of a significant transform coefficient located on the lowermost side in the current block, and information indicating a difference (difference) between the coordinates for the one direction and the coordinates for the remaining directions.
The size of the current block may be determined based on at least one of the minimum value and the maximum value of the height and the width of the current block, and the shape of the current block may be determined based on whether the height and the width of the current block are the same, whether the height is greater than the width, or whether the width is greater than the height.
The step of determining a scan area including all significant transform coefficients in the current block may include: generating an interchanged current block by interchanging (swap) coordinates of a horizontal direction and coordinates of a vertical direction indicating a position of a transform coefficient in the current block with each other when the height and the width of the current block are different; and determining a scan region including all significant transform coefficients in the interchanged current block, wherein the step of determining the scan region including all significant transform coefficients in the interchanged current block may include: when the height and width of the current block are different, the horizontal direction coordinates and the vertical direction coordinates of the designated scanning area are interchanged with each other, and the scanning area is determined based on the interchanged horizontal direction coordinates and vertical direction coordinates.
The bitstream may include information indicating whether flag information indicating whether a difference between coordinate values of a horizontal direction and a vertical direction of the designated scanning area is included and information related to coordinates of the designated scanning area, the information related to coordinates of the designated scanning area may include information related to coordinates of the horizontal direction and information related to coordinates of the vertical direction of the designated scanning area, and when the flag information indicates that a difference between coordinate values of the horizontal direction and coordinate values of the vertical direction of the designated quadrangular scanning area is included, the information related to coordinates of the horizontal direction and the information related to coordinates of the vertical direction of the designated scanning area may include information indicating coordinates for one direction among coordinates of the horizontal direction and coordinates of the vertical direction and information indicating a difference between coordinates for the one direction and coordinates for the remaining directions, wherein the step of determining a scan region including all significant transform coefficients in the interchanged current block may comprise: when the height and width of the current block are different, the horizontal direction coordinates and the vertical direction coordinates obtained from the information on the coordinates specifying the scanning area are interchanged with each other, and the scanning area is determined based on the interchanged horizontal direction coordinates and vertical direction coordinates.
The context model in the context model related to flag information of the current transform coefficient may be determined based on at least one of: the size of the scan area, the number of coefficients scanned in the scan area before the current transform coefficient in a predetermined scan order (count), the relative position of the current transform coefficient in the scan area, and whether the current significant transform coefficient is the transform coefficient of the first of the transform coefficients scanned in the scan area in the predetermined scan order.
When the context model related to the flag information of the current transform coefficient is determined based on the size of the scan area and the number of flag information of the transform coefficient scanned before the current transform coefficient in the predetermined scan order, the context model related to the flag information of the current transform coefficient may be determined based on a predetermined context offset, wherein the predetermined context offset corresponds to a case where the number of flag information of the transform coefficient scanned before the current coefficient is less than a predetermined value based on the size of the scan area.
When determining a context model related to flag information of a current transform coefficient based on a relative position of the current transform coefficient in a scan region,
The context model related to the current transform coefficient may be determined based on a predetermined context offset, where the predetermined context offset corresponds to a case where the coordinates of the current transform coefficient are less than a predetermined value based on the coordinates of the location of the specified scan area.
The information related to the transform coefficient may include at least one of flag information indicating whether the transform coefficient is greater than a predetermined value, which may be at least one of 0, 1, and 2, remaining level (remaining level) information regarding an absolute value of a significant transform coefficient, sign information of the transform coefficient, and binarization parameter information for inverse binarization of the transform coefficient.
A video encoding method according to various embodiments may include the steps of: obtaining a transformation coefficient of a current block; determining a scan region including all significant transform coefficients in a current block; scanning information on transform coefficients included in the scanning area in a predetermined scanning order and performing binarization based on the scanned information on the transform coefficients to generate binarized information; performing binary arithmetic encoding on the binarized information to generate entropy-encoded information; and generating a bitstream including the entropy-encoded information, wherein the binary arithmetic encoding may be performed using a context model determined based on at least one of a size and a shape of the current block.
The scan area may be a quadrangular scan area, a coordinate in a horizontal direction specifying the quadrangular scan area may indicate a coordinate of a significant transform coefficient pixel located on the rightmost side in the current block, a coordinate in a vertical direction specifying the quadrangular scan area may indicate a coordinate of a significant transform coefficient pixel located on the lowermost side in the current block, information on the coordinate specifying the quadrangular scan area and flag information may be included in the bitstream, wherein the flag information may indicate whether a difference between a coordinate value in the horizontal direction and a coordinate value in the vertical direction specifying the quadrangular scan area is included in the information on the coordinate specifying the quadrangular scan area, wherein when the flag information indicates that a difference between a coordinate value in the horizontal direction and a coordinate value in the vertical direction specifying the quadrangular scan area is included, the information on the coordinate specifying the quadrangular scan area may include information indicating a significant transform coefficient located on the rightmost side in the current block Information for a coordinate with respect to one direction among a coordinate of a horizontal direction of a pixel and a coordinate of a vertical direction of a pixel for a significant transform coefficient located at the lowermost side in the current block, and information indicating a difference between the coordinate with respect to the one direction and the coordinate with respect to the remaining directions.
A video decoding apparatus according to various embodiments may include: an entropy decoding unit that determines a scan area including all significant transform coefficients in the current block, scans information related to the transform coefficients in the scan area in a predetermined scan order, performs binary arithmetic decoding based on the scanned information related to the transform coefficients to generate binary arithmetic decoded information, and performs inverse binarization on the binary arithmetic decoded information to obtain information related to the transform coefficients of the current block; and an image restoring unit which generates a residual block of the current block by performing inverse quantization and inverse transform based on information related to a transform coefficient of the current block, and restores the current block based on the generated residual block, wherein binary arithmetic decoding may be performed using a context model determined based on at least one of a size and a shape (shape) of the current block.
A video encoding apparatus according to various embodiments may include: an entropy encoding unit obtaining transform coefficients of a current block, determining a scan area including all significant transform coefficients in the current block, scanning information related to the transform coefficients included in the scan area in a predetermined scan order, performing binarization based on the scanned information related to the transform coefficients to generate binarized information, and performing binary arithmetic encoding on the binarized information to generate entropy-encoded information; and a bitstream generation unit generating a bitstream including the entropy-encoded information, wherein the binary arithmetic encoding may be performed using a context model determined by at least one of a size and a shape based on the current block.
A computer-readable recording medium in which a program for implementing the methods of various embodiments is recorded may be included.
Drawings
Fig. 1a shows a block diagram of a video decoding apparatus according to various embodiments.
Fig. 1b shows a flow diagram of a video decoding method according to various embodiments.
Fig. 1c shows a block diagram of a video encoding apparatus according to various embodiments.
Fig. 1d shows a flow diagram of a video encoding method according to various embodiments.
Fig. 1e shows a block diagram of an image decoding unit according to various embodiments.
FIG. 1f shows a block diagram of an image encoding unit according to various embodiments.
Fig. 2 is a schematic diagram for explaining a method of scanning transform coefficients within a block according to an embodiment.
Fig. 3a is a schematic diagram for explaining a method of scanning transform coefficients within a block, according to an embodiment.
Fig. 3b is a schematic diagram for explaining the operation of determining coefficient groups (sub-blocks) within a block and the operation performed in accordance with the coefficient groups according to an embodiment.
Fig. 4 is a schematic diagram for explaining a process of determining a context model for performing context-based binary arithmetic coding on information related to transform coefficients according to an embodiment.
Fig. 5 is a schematic diagram for explaining a process of determining a context model for performing context-based binary arithmetic coding on information related to transform coefficients according to another embodiment.
Fig. 6a is a schematic diagram for illustrating a horizontal-first zig-zag scanning order for scanning information related to transform coefficients in a block, according to an embodiment.
Fig. 6b is a schematic diagram for illustrating a vertical-first zig-zag scanning order for scanning information related to transform coefficients in a block, according to an embodiment.
Fig. 6c is a schematic diagram for explaining a horizontal scanning order for scanning information on transform coefficients in a block according to an embodiment.
Fig. 6d is a schematic diagram for explaining a vertical scanning order for scanning information on transform coefficients in a block according to an embodiment.
Fig. 6e is a schematic diagram for explaining a diagonal scanning order for scanning information on transform coefficients in a block according to an embodiment.
Fig. 7a is a schematic diagram for explaining a process of changing (swap) a scanning area by interchanging coordinates of a horizontal direction and a vertical direction of transform coefficient pixels in a quadrilateral scanning area according to an embodiment.
Fig. 7b is a schematic diagram for explaining a process of changing a scanning area by interchanging coordinates of a horizontal direction and a vertical direction of transform coefficient pixels in the scanning area according to an embodiment.
Fig. 8 is a diagram for explaining a process of determining a context model related to syntax element information of a transform coefficient in a current block by based on at least one of a size of the current block and a shape (shape) of the current block, according to an embodiment.
Fig. 9a to 9c are schematic diagrams for explaining a residual coding syntax structure (syntax structure) according to an embodiment.
Fig. 9d to 9f are diagrams for explaining a structure of a residual coding syntax according to another embodiment.
Fig. 10 illustrates a process of determining at least one coding unit by dividing a current coding unit according to an embodiment.
Fig. 11 illustrates a process of determining at least one coding unit by dividing a non-square shaped coding unit according to an embodiment.
Fig. 12 illustrates a process of dividing a coding unit based on at least one of block shape information and division shape information according to an embodiment.
Fig. 13 illustrates a method of determining a predetermined coding unit from an odd number of coding units according to an embodiment.
Fig. 14 illustrates an order of processing a plurality of coding units when the plurality of coding units are determined by dividing a current coding unit according to an embodiment.
Fig. 15 illustrates a process of determining that a current coding unit is to be divided into an odd number of coding units when the coding units cannot be processed in a predetermined order according to an embodiment.
Fig. 16 illustrates a process of determining at least one coding unit by dividing a first coding unit according to an embodiment.
Fig. 17 illustrates that when a second coding unit of a non-square shape determined by dividing a first coding unit satisfies a predetermined condition, shapes in which the second coding unit can be divided are limited, according to an embodiment.
Fig. 18 illustrates a process of dividing a square-shaped coding unit when the division shape information indicates that the division into four square-shaped coding units is impossible, according to an embodiment.
Fig. 19 illustrates that the processing order among a plurality of coding units may be changed according to the division process of the coding units according to an embodiment.
Fig. 20 illustrates a process of determining a depth of a coding unit as a shape and size of the coding unit change when the coding unit is recursively divided to determine a plurality of coding units according to an embodiment.
Fig. 21 illustrates a depth that can be determined based on the shape and size of a coding unit and a partial index (hereinafter, referred to as PID) for distinguishing the coding unit according to an embodiment.
Fig. 22 illustrates determining a plurality of coding units from a plurality of predetermined data units included in a picture according to an embodiment.
Fig. 23 illustrates a processing block used as a reference for determining the determination order of reference coding units included in a picture according to an embodiment.
Detailed Description
Hereinafter, "image" may indicate a still image or a moving image of a video, i.e., the video itself.
Hereinafter, "sample" indicates data assigned to a sampling position of an image, and is data that is a processing object. For example, a pixel in an image of the spatial domain may be a sample.
Hereinafter, "Current Block" may indicate a Block of an image to be encoded or decoded.
Fig. 1a shows a block diagram of a video decoding apparatus according to various embodiments.
The video decoding apparatus 100 according to various embodiments may include an entropy decoding unit 105 and an image restoration unit 120.
The entropy decoding unit 105 may obtain syntax element (syntax element) information received from the bitstream and perform entropy decoding on the syntax element information. At this time, the syntax element information received from the bitstream may be various syntax element information regarding the picture.
The entropy decoding unit 105 may obtain syntax element information related to transform coefficients in the current block from the bitstream, and may perform entropy decoding on the syntax element information related to transform coefficients in the current block. At this time, the current block may be a data unit that may be used in the process of performing encoding/decoding on an image described by referring to fig. 10 to 23.
The entropy decoding unit 105 may obtain information on the transform coefficient in the current block by scanning syntax element information on the transform coefficient in the entropy-decoded current block according to a predetermined scanning order. The predetermined scan order may be various scan orders in the reverse direction. Here, the scanning order in the reverse direction may be a scanning order from the lower right-side pixel in the block to the upper left-side pixel of the transform coefficient in the block. The order in which the transform coefficients are scanned in order from the upper left transform coefficient pixel to the transform coefficient located on the lower right side may be referred to as a forward direction scan order, and the order in which the transform coefficients are scanned in order from the last transform coefficient located on the lower right side to the upper left transform coefficient may be referred to as an inverse direction scan order. The syntax element information related to the transform coefficient in the current block may be flag (flag) information indicating whether the transform coefficient in the current block is greater than a predetermined value. At this time, the predetermined value may be an integer value greater than or equal to 0. For example, it may be 0, 1 or 2.
Also, the syntax element information related to the transform coefficient in the current block may be syntax element information indicating a remaining level absolute value (remaining level absolute value). The residual level absolute value may represent a difference between an absolute value of a level of the transform coefficient and an absolute value of a base level (base level). The absolute value of the base level may be determined by based on syntax element information indicating whether the absolute value of the transform coefficient is greater than a predetermined value. For example, the sum of the value of flag information (Greater than 0flag or sig _ coeff _ flag; hereinafter, referred to as GTO flag) indicating whether the absolute value of the transform coefficient is Greater than 0 (or, whether the transform coefficient is a significant transform coefficient, where the significant transform coefficient represents a transform coefficient whose absolute value is Greater than 0), the value of flag information (Greater than1flag or coeff _ abs _ level _ Greater1_ flag; hereinafter, referred to as GT1 flag) indicating whether the absolute value of the transform coefficient is Greater than1, and the value of flag information (Greater than 2flag or coeff _ abs _ level _ Greater2_ flag; hereinafter, referred to as GT2 flag) indicating whether the absolute value of the transform coefficient is Greater than 2 may be the absolute value of the base level. Here, when flag information indicating whether an absolute value of a transform coefficient is greater than a predetermined value indicates that it is greater than the predetermined value, the value of the flag information may be 1, and when the flag information indicates that it is less than the predetermined value, the value of the flag information may be 0. A part of the flag information on the size of the transform coefficient may not be obtained from the bitstream. According to an embodiment, when a flag indicating whether the size of a transform coefficient is greater than n (n is an integer) is referred to as GTn, a flag indicating whether the size of a transform coefficient is greater than (n +1) is referred to as GT (n +1), and a flag indicating whether the size of a transform coefficient is greater than (n +2) is referred to as GT (n +2), only flags indicating whether the absolute value of a transform coefficient is greater than n or n +1, which is relatively smaller from reference values of n, n +1, and n +2 (i.e., GTn and GT (n +1)), may be transmitted without including GT (n +2) in a bitstream.
For example, in the case where the GT0 flag information and the GT1 flag information indicate that the absolute values of the transform coefficients are greater than 0 and 1, respectively, when the GT2 flag information is not included in the bitstream, the GT2 flag information is excluded and only the GT0 flag information and the GT1 flag information are used, so the absolute value of the transform coefficient is greater than 1, so the entropy decoding unit 105 determines the remaining absolute value of 2 subtracted from the absolute value of the transform coefficient as the remaining level absolute value of the transform coefficient.
When the GT0 flag information, the GT1 flag information, and the GT2 flag information represent greater than 0, 1, and 2, respectively, the entropy decoding unit 105 may determine a remaining absolute value, which is a value obtained by subtracting 3 from the absolute value of the transform coefficient, as a remaining level absolute value of the transform coefficient, since the absolute value of the transform coefficient is greater than 2. In other words, the residual level absolute value may indicate a difference in absolute value between a predetermined absolute value determined based on information indicating whether the absolute value of the transform coefficient is greater than a predetermined value and the absolute value of the significant transform coefficient. The entropy decoding unit 105 may obtain syntax element information received from a bitstream and perform binary arithmetic decoding (binary arithmetic decoding) on the syntax element information, and perform inverse binarization (inverse binarization) on an output (i.e., a binary string) generated by performing the binary arithmetic decoding. The binary arithmetic decoding operation may be performed by the binary arithmetic decoding unit 110, and the inverse binarization operation may be performed by the inverse binarization unit 115.
The binary arithmetic decoding unit 110 may perform binary arithmetic decoding based on a predetermined context model (context model) on syntax element information obtained from a bitstream. Here, the context model may be information related to the occurrence probability of the binary (bin). The information related to the occurrence probability of the binary value (bin) may include information (valMPS) indicating one of a Symbol having a relatively low occurrence probability (i.e., a Least Probable Symbol (LPS)) and a Symbol having a high occurrence probability (i.e., a Most Probable Symbol) opposite thereto among the two symbols 0 and 1, and information related to the occurrence probability of the one Symbol. The probability of occurrence has a value between 0 and 1. Accordingly, when the probability of one symbol of the MPS and the LPS is determined, since the information on the occurrence probability of the other symbol is information on the probability that the occurrence probability on the determined symbol will be subtracted from 1, the binary arithmetic decoding unit 110 may determine the occurrence probability for the remaining symbols when the occurrence probability for one symbol is determined. At this time, the occurrence probability for one symbol previously determined may be the occurrence probability of the LPS. The occurrence probability of the symbol corresponding to the index value may be predetermined in the table, and the occurrence probability information on the symbol may be information pStateIdx indicating an index indicating the occurrence probability of the determined symbol in the table.
The predetermined context model may be determined by based on an index (bin index) indicating a binary (bin) position, an occurrence probability of binary values included in a surrounding block of a block including binary values, and various elements of the current block or the surrounding block, and the like.
Alternatively, the binary arithmetic decoding unit 110 may perform binary arithmetic decoding on syntax element information obtained from the bitstream by a bypass (by-pass) mode. At this time, for a current binary arithmetically decoded binary (bin), the probability of obtaining 0 or 1 is fixed to 0.5, and the binary arithmetically decoded can be performed for the syntax element information by based on the probability.
The inverse binarization unit 115 may perform inverse binarization on a binary string (bin string) that is an output value generated by performing binary arithmetic decoding. The inverse binarization unit 115 may perform inverse binarization for the binary string by based on an inverse binarization method corresponding to a predetermined binarization method. The predetermined binarization methods may include a fixed length (FixedLength) binarization method, a Rice (Rice) binarization method, an Exponential-Golomb (Exponential-Golomb) binarization method, and a Golomb-Rice (Golomb-Rice) binarization method. Alternatively, the predetermined binarization method may be a binarization method that combines the first binarization method and the second binarization method. For example, the inverse binarization unit 115 may perform inverse binarization on a first binary string that is a part of a binary string of a syntax element by based on an inverse binarization method corresponding to a first binarization method, and may perform inverse binarization on a second binary string that is a part of a binary string of a syntax element by based on an inverse binarization method corresponding to a second binarization method. The portion of the binary string may be a prefix (prefix) or suffix (suffix) of the binary string of the syntax element.
The binarization method or the inverse binarization method both relate to a code word which specifies a 1:1 correspondence of a binary string comprising at least one binary value corresponding to a value of a syntax element. In terms of encoding, a binary string including at least one binary corresponding to a value of a syntax element may be determined according to one of the various binarization methods described above, and in terms of decoding, a value of a syntax element corresponding to a binary string may be determined according to a reverse binarization method. For example, when a binary string a corresponding to a value a of a syntax element (a is a real number) is determined according to a predetermined binarization/inverse binarization method, a process of determining the binary string a with reference to the value a of the syntax element may be referred to as binarization, and a process of determining the value a of the syntax element with reference to the binary string a may be referred to as inverse binarization. However, as described above, binarization and inverse binarization essentially specify a mapping relationship between a value of a syntax element and a binary string, and those skilled in the art can easily understand that binarization and inverse binarization are substantially the same.
The entropy decoding unit 105 may obtain information on the transform coefficient in the current block by scanning syntax element information on the transform coefficient in the current block according to a predetermined scanning order and performing entropy decoding thereon. The predetermined scan order may be an order of zigzag scanning (zigzag scan) according to the reverse direction or an order of diagonal scanning (diagonalscan) according to the reverse direction. But is not limited thereto, the predetermined scan order may be a variety of scan orders, such as an order of horizontal scanning according to an inverse direction or a scan order according to vertical scanning, and the like. The predetermined scan order may be determined by based on at least one of a horizontal-direction coordinate (e.g., an x-coordinate (x is an integer)) value of an effective transform coefficient pixel located at the rightmost side in the current block and a vertical-direction coordinate (e.g., a y-coordinate (y is an integer)) value of an effective transform coefficient pixel located at the lowermost side in the current block. For example, the entropy decoding unit 105 may determine the predetermined scanning order by the magnitude of the coordinate values in the horizontal direction and the magnitude of the coordinate values in the vertical direction. When the coordinate values in the horizontal direction are greater than the coordinate values in the vertical direction, the entropy decoding unit 105 may determine the vertical scanning order in the reverse direction as a predetermined scanning order. When the coordinate values in the vertical direction are greater than the coordinate values in the horizontal direction, the entropy decoding unit 105 may determine the horizontal scanning order in the reverse direction as a predetermined scanning order.
Alternatively, when the coordinate value in the horizontal direction is greater than the coordinate value in the vertical direction, the entropy decoding unit 105 may determine a vertical first zigzag scan order (vertical first zigzag scan order) in the reverse direction as the predetermined scan order. The vertical-first zigzag scanning order will be described in detail with reference to fig. 6 b. When the coordinate value in the vertical direction is greater than the coordinate value in the horizontal direction, the entropy decoding unit 105 may determine a horizontal first zigzag scanning order (horizontal first zigzag scanning order) in the reverse direction as a predetermined scanning order. The horizontal-first zigzag scanning order will be described in detail with reference to fig. 6 a. When the coordinate values in the vertical direction are greater than the coordinate values in the horizontal direction, the entropy decoding unit 105 may determine one of a vertical-priority zigzag scanning order and a horizontal-priority zigzag scanning order in the reverse direction as a predetermined scanning order.
Alternatively, when the coordinate value in the horizontal direction is greater than the coordinate value in the vertical direction, the entropy decoding unit 105 may determine a horizontal first zigzag scanning order (horizontal first zigzag scan order) in the reverse direction as a predetermined scanning order. When the coordinate value in the horizontal direction is greater than the coordinate value in the vertical direction, the entropy decoding unit 105 may determine a vertical first zigzag scan order (vertical first zigzag scan order) in the reverse direction as a predetermined scan order.
Before scanning information related to transform coefficients, the entropy decoding unit 105 may determine a scanning area including all significant transform coefficients in the current block. At this time, all significant transform coefficients in the current block may be included in the scan area, and the remaining area of the current block excluding the scan area may include only transform coefficients that are not significant transform coefficients and 0. At this time, when scanning is performed in accordance with a predetermined positive direction scanning order from the transform coefficient at the upper left end of the scanning area, the scanning area may be an area including transform coefficients up to the last scanned significant transform coefficient (hereinafter referred to as the last significant transform coefficient). At this time, the coordinates of the designated scanning area may be the coordinates of the last scanned significant transform coefficient pixel.
The entropy decoding unit 105 may obtain information on coordinates indicating the last significant transform coefficient from the bitstream and determine the scan area based on the information on the coordinates indicating the last significant transform coefficient. For example, the entropy decoding unit 105 may obtain information indicating coordinate values of a horizontal direction of the last significant transform coefficient and information indicating coordinate values of a vertical direction of the last significant transform coefficient from the bitstream. At this time, it is possible to perform binary arithmetic decoding on each information to obtain a binary string relating to each information, and to obtain the coordinate values of the horizontal direction of the last significant transformation coefficient and the coordinate values of the vertical direction of the last significant transformation coefficient using an inverse binarization method corresponding to a predetermined binarization method for each binary string.
The entropy decoding unit 105 may perform a first inverse binarization method on a first binary string that is a part of the binary string to obtain a first value, and perform a second inverse binarization method on a second binary string that is another part of the binary string to obtain a second value. The coordinate value in the horizontal direction of the last significant transform coefficient and the coordinate value in the vertical direction of the last significant transform coefficient may be obtained by based on the first value and the second value. At this time, the first binarization string may be a prefix (prefix), and the first inverse binarization method may be an inverse binarization method corresponding to a fixed-length binarization method. The second binarization string may be a suffix (suffix), and the second inverse binarization method may be an inverse binarization method corresponding to a truncated unary code binarization method.
Alternatively, the scan region may be a quadrangular scan region, and the quadrangular scan region may be a region specified by the horizontal-direction coordinates of the significant transform coefficient pixels located on the rightmost side among all the significant transform coefficients in the current block and the vertical-direction coordinates of the significant transform coefficient pixels located on the lowermost side in the current block.
The entropy decoding unit 105 may obtain information on the coordinates specifying the quadrangular scanning area from the bitstream, and determine the quadrangular scanning area by based on the obtained information on the coordinates specifying the quadrangular scanning area. For example, the entropy decoding unit 105 may obtain, from the bitstream, information indicating the coordinate values in the horizontal direction of the significant transform coefficient pixel located on the rightmost side among all the significant transform coefficients in the current block and information indicating the coordinate values in the vertical direction of the significant transform coefficient pixel located on the bottommost side among all the significant transform coefficients in the current block. At this time, the entropy decoding unit 105 may perform binary arithmetic decoding on each information to obtain a binary string relating to each information, and obtain, using an inverse binarization method corresponding to a predetermined binary method for the binary string, a horizontal-direction coordinate value of a significant transform coefficient pixel located on the rightmost side among all significant transform coefficients in the current block and a vertical-direction coordinate value of a significant transform coefficient pixel located on the lowermost side among all significant transform coefficients in the current block. The entropy decoding unit 105 may perform a first inverse binarization method on a first binary string that is a part of the binary string to obtain a first value, and perform a second inverse binarization method on a second binary string that is another part of the binary string to obtain a second value. The coordinate value of the horizontal direction of the significant transform coefficient pixel located at the rightmost side among all the significant transform coefficients in the current block and the coordinate value of the vertical direction of the significant transform coefficient pixel located at the lowermost side among all the significant transform coefficients in the current block may be obtained based on the first value and the second value. At this time, the first binary string may be a prefix (prefix), and the first inverse binarization method may be an inverse binarization method corresponding to a fixed-length binarization method. The second binary string may be a suffix (suffix), and the second inverse binary method may be an inverse binary method corresponding to the truncated unary code binary method.
Alternatively, the entropy decoding unit 105 may obtain, from the bitstream, information indicating a coordinate value in one direction of a horizontal direction of a significant transform coefficient pixel located on the rightmost side among all significant transform coefficients in the current block or a coordinate value in a vertical direction of a significant transform coefficient pixel located on the lowermost side among all significant transform coefficients in the current block, and information indicating a difference (difference) between the coordinate value in the one direction and the coordinate values in the remaining directions. The entropy decoding unit 105 may determine the one direction based on the height and width of the current block.
The entropy decoding unit 105 may obtain flag information indicating whether information indicating a difference between coordinate values of one direction and coordinate values of the remaining directions is obtained from the bitstream. When the flag information indicates that information indicating a difference between the coordinate values of one direction and the coordinate values of the remaining directions is obtained from the bitstream, the entropy decoding unit 105 may obtain, from the bitstream, information indicating one of the coordinate values of the horizontal direction of the significant transform coefficient pixel located at the rightmost side among all the significant transform coefficients in the current block (or the coordinate value of the horizontal direction of the last significant transform coefficient pixel) or the coordinate value of the vertical direction of the significant transform coefficient pixel located at the lowermost side among all the significant transform coefficients in the current block (or the coordinate value of the vertical direction of the last significant transform coefficient pixel), and information indicating a difference between the coordinate value of the one direction and the coordinate value of the remaining directions.
When the flag information indicates that information indicating a difference between the coordinate values of one direction and the coordinate values of the remaining directions is not obtained from the bitstream, the entropy decoding unit 105 may obtain, from the bitstream, information indicating a horizontal-direction coordinate value of a significant transform coefficient pixel located at the rightmost side among all significant transform coefficients in the current block and information indicating a vertical-direction coordinate value of a significant transform coefficient pixel located at the bottommost side among all significant transform coefficients in the current block.
In addition, the entropy decoding unit 105 may determine whether to obtain flag information indicating whether to obtain information indicating a difference between coordinate values in one direction and coordinate values in the remaining direction from the bitstream, based on the width and height of the current block. For example, when the width and height of the current block are different (i.e., in the case of a rectangle), the entropy decoding unit 105 may determine to obtain flag information indicating whether information indicating a difference between coordinate values of one direction and coordinate values of the remaining directions is obtained from the bitstream.
For example, the entropy decoding unit 105 may obtain a coordinate value SR _ x indicating a horizontal direction and a coordinate value SR _ y indicating a vertical direction from the next pseudo code (pseudo code)1 in order to specify a scanning region.
[ pseudo code 1]
Figure BDA0002634979820000141
According to the pseudo code 1, the entropy decoding unit 105 may initialize a variable isXfirst indicating whether or not decoding is first performed on information related to coordinate values in the horizontal direction and an isYfirst value indicating whether or not decoding is first performed on information related to coordinate values in the vertical direction to 0. In addition, the entropy decoding unit 105 may initialize flag information srDeltaFlag indicating whether information indicating a difference between coordinate values of one direction and coordinate values of the remaining directions is obtained to 0.
When the width W of the current block is greater than the height H of the current block or the height H of the current block is greater than the width W of the current block, the entropy decoding unit 105 may obtain srDeltFlag from the bitstream and perform decoding on the srDeltFlag.
In the case where the value of the decoded srDeltaFlag is 1 (i.e., when it is instructed to obtain information indicating a difference between the coordinate values of one direction and the coordinate values of the remaining directions), the entropy decoding unit 105 may determine the value of IsXfirst as 1 when the width W of the current block is less than the height H of the current block.
In the case where the value of the decoded srDeltaFlag is 1 (i.e., when it is instructed to receive information indicating a difference between the coordinate values of one direction and the coordinate values of the remaining directions), the entropy decoding unit 105 may determine the value of IsYfirst as 1 when the width W of the current block is greater than the height H of the current block.
When the value of IsXfirst is 1 (when it is instructed that decoding is first performed on information related to coordinate values in the horizontal direction), the entropy decoding unit 105 can obtain information Sr _ x indicating coordinate values in the horizontal direction and information (Sr _ delta) (Sr _ y-Sr _ x) indicating a difference between coordinate values in the vertical direction and coordinate values in the horizontal direction from the bitstream and decode the obtained information. At this time, the coordinate value Sr _ y of the vertical direction may be determined as Sr _ x + Sr _ delta.
When the value of IsYfirst is 1 (when it is instructed that decoding is first performed on information related to coordinate values in the vertical direction), the entropy decoding unit 105 may obtain information Sr _ y indicating coordinate values in the vertical direction and information (Sr _ delta) (Sr _ x-Sr _ y) indicating a difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction from the bitstream, and decode the obtained information. At this time, the coordinate value Sr _ x in the vertical direction may be determined as Sr _ y + Sr _ delta.
When the value of the decoded srDeltaFlag is 0 (i.e., when it is instructed that information indicating the difference between the coordinate values of one direction and the coordinate values of the remaining directions is not obtained), the entropy decoding unit 105 may obtain information Sr _ x indicating the coordinate values of the horizontal direction and information Sr _ y indicating the coordinate values of the vertical direction from the bitstream and decode the obtained information.
The entropy decoding unit 105 may determine a context model used in binary arithmetic decoding of all syntax element information for coefficient decoding (coeffient decoding) based on at least one of a size of the current block and a shape (shape) of the current block. For example, the size (size) of the current block may be determined according to at least one of a minimum value and a maximum value according to the height and width of the current block. The shape (shape) of the current block may be determined according to whether the width and the height of the current block are the same. All syntax element information used for coefficient decoding may include syntax element information for specifying a scan region and information related to transform coefficients in the scan region.
For example, the entropy decoding unit 105 may determine the information size _ tu1 regarding the size of the current block based on equation 1 below.
[ EQUATION 1 ]
size_tu1=Min(log2_width,log2_height)
At this time, log2_ width may be a value of log2 for the width W of the current block, and log2_ height may be a value of log2 for the height H of the current block.
The entropy decoding unit 105 may determine a context model corresponding to the information size _ tu1 regarding the size of the current block and determine a context model regarding syntax element information for coefficient decoding, and binary arithmetic-decode the syntax element information for coefficient decoding using the context model.
Alternatively, the video decoding apparatus 100 may determine the information size _ tu2 regarding the size of the current block based on equation 2 below.
[ EQUATION 2 ]
size_tu2=Max(log2_width,log2_height)
The entropy decoding unit 105 may determine a context model based on the information size _ tu2 regarding the size of the current block and determine a context model regarding syntax element information for coefficient decoding, and binary arithmetic decode the syntax element information for coefficient decoding using the context model.
Alternatively, the entropy decoding unit 105 may determine a context model based on the information size _ tu1 and size _ tu2 regarding the size of the current block and determine a context model regarding syntax element information for coefficient decoding, and bi-level arithmetic decode the syntax element information for coefficient decoding using the context model.
The entropy decoding unit 105 may determine which of a minimum value and a maximum value of a size and a height of the current block is, determine a context model based on the minimum value and the maximum value of the size and the height of the current block, determine a context model related to syntax element information for coefficient decoding, and perform binary arithmetic decoding on the syntax element information for coefficient decoding using the context model.
In addition, the entropy decoding unit 105 may determine a context model used in binary arithmetic decoding of all syntax elements for coefficient decoding based on the shape of the current block.
For example, the entropy decoding unit 105 may determine information shape _ tu regarding the shape of the current block based on equation 3 below.
[ EQUATION 3]
shape_tu=width>height?2:(width<height?1:0)
According to [ equation 3], the entropy-decoding unit 105 may determine shape _ tu to be 2 when the width of the current block is greater than the height, to determine shape _ tu to be 1 when the width of the current block is less than the height, and to determine shape _ tu to be 0 when the width of the current block is equal to the height. In other words, shape _ tu may be determined to be 2 in the case of a rectangle having a width greater than its height, 1 in the case of a rectangle having a height greater than its width, and 0 in the case of a square.
The entropy decoding unit 105 may determine a context model based on the information shape _ tu regarding the shape of the current block and determine a context model regarding syntax element information for coefficient decoding, and perform binary arithmetic decoding on the syntax element information for coefficient decoding using the context model.
The entropy decoding unit 105 may determine a context model related to syntax element information for coefficient decoding based on the size of the current block and the shape of the current block. For example, the video decoding apparatus 100 may determine a context model related to syntax element information for coefficient decoding based on at least one of the information size _ tu1 and size _ tu2 related to the size of the current block and the information shape _ tu related to the shape of the current block, and binary arithmetic decode the syntax element information for coefficient decoding using the context model.
When the height and the width of the current block are different, i.e., when one of the height and the width is large, the entropy-decoding unit 105 may change the height and the width of the current block from each other. In other words, the coordinates in the horizontal direction and the coordinates in the vertical direction of the pixels included in the current block may be interchanged with each other (swap). For example, when the width of the current block is greater than the height, the entropy-decoding unit 105 may interchange the height and the width of the current block with each other. In other words, the horizontal direction coordinate value and the vertical direction coordinate value of the pixel included in the current block may be interchanged with each other. And, when the width of the current block is not greater than the height, the entropy decoding unit 105 may not exchange the horizontal-direction coordinates and the vertical-direction coordinates of the pixels included in the current block. But is not limited thereto, when the height of the current block is greater than the width, the entropy-decoding unit 105 may interchange the height and the width of the current block with each other. In other words, the coordinate values in the horizontal direction and the coordinate values in the vertical direction of the pixels included in the current block may be interchanged with each other. When the horizontal direction coordinates and the vertical direction coordinates of the pixels included in the current block are interchanged with each other, the entropy decoding unit 105 may obtain information on the horizontal direction coordinates and the vertical direction coordinates of the designated scanning area from the bitstream and may interchange the horizontal direction coordinates and the vertical direction coordinates of the designated scanning area. The entropy decoding unit 105 may determine a first scan region in the interchanged (swapped) current block based on coordinates of the interchanged designated scan region. The entropy decoding unit 105 may scan information on transform coefficients included in the first scan region, and obtain a first transform coefficient of the interchanged current block (swapped current block) based on the scanned information on transform coefficients. When the horizontal-direction coordinates and the vertical-direction coordinates of the pixels included in the current block are interchanged with each other (swap), the entropy decoding unit 105 may obtain the second transform coefficient in the current block by interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the first transform coefficient in the interchanged current block. The entropy decoding unit 105 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the second transform coefficient of the current block.
For example, the entropy decoding unit 105 may interchange the coordinates Sr _ x or last _ x in the horizontal direction and the coordinates Sr _ y or last _ y in the vertical direction of the designated scanning area with each other according to the pseudo code 2.
[ pseudo code 2]
Figure BDA0002634979820000181
According to the pseudo code 2, when a width TU _ width of a Transform Unit (TU: Transform Unit) as the current block is greater than a height TU _ height of the TU of the current block, the entropy decoding Unit 105 may interchange the width TU _ width of the TU of the current block and the height TU _ height of the TU of the current block with each other. In the process of interchanging the height and width of the TU with each other, the coordinates in the horizontal direction and the coordinates in the vertical direction of the four corners determined by the height and width based on the TU may be interchanged with each other. Further, the coordinates in the horizontal direction and the coordinates in the vertical direction of the pixels included in the TU may be interchanged with each other (swap). At this time, the entropy decoding unit 105 may determine a value of swap _ flag indicating whether the height and width of the TU are interchanged with each other as 1.
When the width TU _ width of the TU as the current block is not greater than the height TU _ height of the TU as the current block, the entropy decoding unit 105 may not interchange the width TU _ width of the TU as the current block and the height TU _ height of the TU as the current block with each other.
At this time, the entropy decoding unit 105 may determine a value of swap _ flag indicating whether the height and width of the TU are interchanged with each other as 0.
To specify a scanning area, the entropy decoding unit 105 may parse information on coordinates [ Sr _ x, Sr _ y ] for specifying a quadrangular scanning area from the bitstream or may parse information on coordinates [ last _ x, last _ y ] of a significant transform coefficient scanned last in the TU according to a positive direction scanning order.
When the value of swap _ flag is 1, the entropy decoding unit 105 may interchange coordinates [ Sr _ x, Sr _ y ] for specifying a quadrangle scanning area with each other, or may interchange coordinates [ last _ x, last _ y ] of an effective transform coefficient last scanned by a scanning order according to a positive direction in a TU with each other.
For example, the entropy decoding unit 105 may interchange the coordinates Sr _ x or last _ x in the horizontal direction and the coordinates Sr _ y or last _ y in the vertical direction of the designated scanning area with each other according to the pseudo code 3.
[ pseudo code 3]
Figure BDA0002634979820000191
According to the pseudo code 3, when a width TU _ width of a TU (transform unit) as the current block is greater than a height TU _ height of the TU as the current block, the entropy decoding unit 105 may interchange the width TU _ width of the TU as the current block and the height TU _ height of the TU as the current block with each other. In the process of interchanging the height and width of the TU with each other, the coordinates in the horizontal direction and the coordinates in the vertical direction of the four corners determined by the height and width based on the TU may be interchanged with each other. Further, the coordinates in the horizontal direction and the coordinates in the vertical direction of the pixels included in the TU may be interchanged with each other. At this time, the entropy decoding unit 105 may determine a value of swap _ flag indicating whether the height and width of the TU are interchanged with each other as 1.
When the width TU _ width of the TU as the current block is not greater than the height TU _ height of the TU as the current block, the entropy decoding unit 105 may not interchange the width TU _ width of the TU as the current block and the height TU _ height of the TU as the current block with each other. At this time, the entropy decoding unit 105 may determine a value of swap _ flag indicating whether the height and width of the TU are interchanged with each other as 0.
The entropy decoding unit 105 may parse a flag deltaXYfla indicating whether to obtain coordinate values in the horizontal direction and coordinate values in the vertical direction for specifying the scanning area from the bitstream by using difference information between the coordinate values in the horizontal direction and the coordinate values in the vertical direction for specifying the scanning area. In the video encoding apparatus, the flag deltaXYflag may be generated to have a value of 1 when the coordinate in the vertical direction is larger than the coordinate in the horizontal direction, and may be generated to have a value of 0 otherwise. When deltaXYflag is 0, the entropy decoding unit 105 may separately obtain information on the coordinate values in the horizontal direction and information on the coordinate values in the vertical direction and perform entropy decoding on the obtained information, and may obtain coordinates for specifying the scanning area based on the entropy-decoded information.
When the value of deltaXYflag is 1, the entropy-decoding unit 105 may parse coordinate information for specifying a scan area from the bitstream. For example, the entropy decoding unit 105 may parse, from the bitstream, information Sr _ x regarding coordinate values in the horizontal direction and information Sr _ xy _ delta regarding a difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction for specifying a quadrangular scanning area. Alternatively, in order to specify the scanning area, the entropy decoding unit 105 may parse information last _ x regarding coordinates in the horizontal direction of the last scanned significant transform coefficient in the TU according to the positive direction scanning order and information last _ xy _ delta regarding a difference between the coordinates in the horizontal direction and the coordinate values in the vertical direction.
The entropy decoding unit 105 may determine coordinate values Sr _ x for specifying the horizontal direction of the quadrangular scanning area as information Sr _ x related to coordinates in the horizontal direction parsed from the bitstream. The entropy decoding unit 105 may determine the coordinate value Sr _ y for specifying the vertical direction of the quadrangular scanning area as the sum of the information Sr _ xy _ delta parsed from the bitstream and the information Sr _ x parsed from the bitstream in relation to the coordinate value in the horizontal direction.
Alternatively, when the value of deltaXYflag is 1, the entropy decoding unit 105 may determine a horizontal direction coordinate value last _ x of a significant transform coefficient last scanned in the scanning order in the positive direction in the TU for specifying a scanning area as information last _ x about the coordinate value in the horizontal direction parsed from the bitstream. The entropy decoding unit 105 may determine a vertical direction coordinate value last _ y of a significant transform coefficient last scanned in a positive direction scanning order in a TU for specifying a scanning area as a sum of information last _ xy _ delta parsed from the bitstream and information last _ x parsed from the bitstream regarding coordinate values in a horizontal direction.
When the value of swap _ flag is 1, the entropy decoding unit 105 may interchange coordinates [ Sr _ x, Sr _ y ] for specifying a quadrangular scanning area with each other, or may interchange coordinates [ last _ x, last _ y ] of significant transform coefficients last scanned in the TU in a positive direction scanning order for specifying a scanning area with each other.
The entropy decoding unit 105 may perform context model-based binary arithmetic decoding on information related to coordinates specifying a quadrangular scanning area. The entropy decoding unit 105 can obtain inverse binarization information regarding coordinates specifying a quadrangular scanning area by performing inverse binarization on the binary arithmetically decoded information based on an inverse binarization method corresponding to a predetermined binarization method, and obtain the coordinates specifying the quadrangular scanning area from the inverse binarization information regarding the coordinates. At this time, the context model may be determined based on at least one of a size of the current block, a color component (color component) of the current block, and a binary index (binindex). The color components may include a luminance component and a color difference component. The binary index may be information indicating a position of a current binary arithmetically decoded binary (bin) in a binary string (bin string) related to the syntax element. The inverse binarization method corresponding to the predetermined binarization method may be at least one of a fixed length (fixedlength) inverse binarization method and a truncated unary (truncated unary) inverse binarization method. For example, the entropy decoding unit 105 may obtain first inverse-binarization information by performing inverse binarization using a fixed-length inverse-binarization method on a first binary string in the binary arithmetic decoded information, and may obtain second inverse-binarization information by performing inverse binarization using a truncated unary-code inverse-binarization method on a second binary string in the binary arithmetic decoded information. The entropy decoding unit 105 can obtain the coordinates specifying the quadrangular scanning area based on the first inverse binarization information and the second inverse binarization information.
The entropy decoding unit 105 may obtain binary arithmetic decoded information by performing binary arithmetic decoding based on information about transform coefficients scanned in a scan region in the current block. At this time, binary arithmetic decoding may be performed by using a context model determined based on at least one of the size and the shape (shape) of the current block.
The entropy decoding unit 105 may obtain information related to a transform coefficient of the current block by performing inverse binarization on the binary arithmetic decoded information.
The entropy decoding unit 105 may obtain the transform coefficient of the current block by performing at least one of binary arithmetic decoding and inverse binarization based on a context model related to the transform coefficient based on information related to the transform coefficient scanned in the scan region.
When the information related to the transform coefficient is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, the remaining level absolute value information, and the sign information of the current transform coefficient, the entropy decoding unit 105 may perform context model-based binary arithmetic decoding on the scanned information related to the transform coefficient. The entropy decoding unit 105 may obtain the transform coefficient of the current block by performing inverse binarization on the binary arithmetic decoded information on the transform coefficient. When the first information related to the transform coefficient is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, the remaining level absolute value information, and the sign information of the current transform coefficient, and the second information related to the transform coefficient is binarization parameter information related to the current transform coefficient, the entropy decoding unit 105 may perform context model-based binary arithmetic decoding on the first information related to the transform coefficient.
The entropy decoding unit 105 may perform inverse binarization based on binarization parameter information included in the second information on the binary arithmetic decoded first information to obtain transform coefficients of the current block. The binarization Parameter information may be Rice Parameter (Rice Parameter) information regarding the transform coefficients. The rice parameter may be information for determining the length of the prefix included in the binary string. However, without being limited thereto, the binarization parameter information may be various kinds of binarization parameter information related to the current transform coefficient.
When the first information on the transform coefficient is the remaining level absolute value information of the current transform coefficient, the entropy decoding unit 105 may obtain a value on the remaining level absolute value of the current transform coefficient by using an inverse binarization method corresponding to a (truncated) rice binarization method and an inverse binarization method corresponding to an exponential golomb binarization method for the remaining level absolute value information of the current transform coefficient. For example, the entropy decoding unit 105 may obtain a first value related to a remaining level absolute value of the current transform coefficient by performing inverse binarization using an inverse binarization method corresponding to a rice binarization method based on a rice parameter on a prefix (prefix) of a binary string of remaining level absolute value information of the current transform coefficient, obtain a second value related to the remaining level absolute value of the current transform coefficient by performing inverse binarization using an inverse binarization method corresponding to an exponential golomb binarization method on a suffix (suffix) of the binary string of remaining level absolute value information, and obtain a value related to the remaining level absolute value of the current block based on the first value related to the remaining level absolute value of the current transform coefficient and the second value related to the remaining level absolute value of the current transform coefficient.
A context model related to a first transform coefficient of the context models related to the transform coefficients may be determined by one of: information on at least one second transform coefficient previously scanned in a predetermined scan order, a position and a color component of a first transform coefficient in a current block, information on a neighboring transform coefficient located at the right side or lower side, and a scan position of the first transform coefficient.
For example, the context model related to the flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the number of transform coefficients located on the right or lower side of the predetermined position whose absolute value is greater than 0.
However, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the number of significant transform coefficients whose absolute values are greater than 0 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
Alternatively, the context model relating to flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the position of the first transform coefficient in the corresponding coefficient group and the corresponding adjacent significant coefficient group flag located on the right or lower side.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on a position of the first transform coefficient in the current block. For example, when the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred3, the entropy decoding unit 105 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on at least one of: the size of the scan area, the number of transform coefficients that have been scanned in the scan area, the relative position of the first transform coefficient in the scan area, and whether the first transform coefficient is the coefficient of the first position that is scanned in a predetermined scan order.
For example, the entropy decoding unit 105 may determine the size _ sr of the quadrangular scanning area based on equation 4 below. In other words, the size _ sr of the quadrangle scanning area may represent the number of transform coefficients included in the quadrangle scanning area.
[ EQUATION 4 ]
size_sr=(sr_x+1)*(sr_y+1)
However, it is not limited thereto. When a scan area is specified by the coordinates of the last significant transform coefficient pixel, the size _ sr may be the number of transform coefficient pixels included in the scan area.
The entropy decoding unit 105 may determine the number cnt _ pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area. At this time, cnt _ pos may indicate a position of a first transform coefficient among all transform coefficients within a scanning area scanned in a predetermined scanning order.
When cnt _ pos is less than the predetermined threshold thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4 × size _ sr.
When cnt _ pos is less than the predetermined threshold thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, thred2 may be 1/4 × size _ sr. Alternatively, thred2 may be 1/2 × size _ sr.
When the cnt _ pos is not less than the predetermined thresholds thred1 and thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset3 and determine a context model based on the increased context index. However, the thresholds thred1 and thred2 are merely examples, and those skilled in the art can easily understand that various values may be determined based on the size _ sr.
Entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on a relative position of the first transform coefficient in the scan region.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on the coordinate values pos _ x and pos _ y of the horizontal direction and the vertical direction of the first transform coefficient in the current block and the coordinates Sr _ x and Sr _ y specifying the quadrangular scan area.
When pos _ x is less than thred1_ x and pos _ y is less than thred1_ y, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, [ thred1_ x, thred1_ y ] may be [1,1 ]. Alternatively, [ thred1_ x, thred1_ y ] may be [ sr _ x/4, sr _ y/4] or [ (sr _ x +1)/4, (sr _ y +1)/4 ].
When pos _ x is less than thred2_ x and pos _ y is less than thred2_ y, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, [ thred2_ x, [ thred2_ y ] or [ thred1_ x, [ thred1_ y ] may be [ sr _ x/2, [ sr _ y/2] or [ (sr _ x +1)/2, (sr _ y +1)/2 ].
However, the thresholds thred1_ x, thred1_ y, and thred2_ y, thred2_ y are only examples, and those skilled in the art can easily understand that various values can be determined based on sr _ x and sr _ y.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on whether the first transform coefficient is a transform coefficient of a first position scanned in an inverse direction scan order. In other words, the entropy decoding unit 105 may determine a first context model related to flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is a first position scanned in an inverse direction scan order, and may determine a second context model related to flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is not a first position scanned in an inverse direction scan order. At this time, the transform coefficient of the pixel located at the right lower end of the quadrangular scanning area may be the transform coefficient of the first position scanned in the reverse direction scanning order.
Alternatively, flag information indicating whether the first transform coefficient is greater than 0 (GT0 flag information) may be determined based on at least one of: GT0 flag information of n (n is a positive integer) transform coefficients previously scanned in a predetermined scan order and GT0 flag information of a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at an initial position in the scan order in the scan area, and whether the first transform coefficient is a transform coefficient at a final position in the scan area in the scan order.
The context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients to the right or lower side whose absolute value is greater than 1 among the transform coefficients to the right or lower side of the predetermined position.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on a position of the first transform coefficient in the current block. For example, when the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index.
When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred3, the entropy decoding unit 105 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index. At this time, the offsets 1, 2, and 3 and the predetermined thresholds thred1, thred2, and thred3 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 1 may be different from the offsets 1, offset2, and offset3 and the predetermined thresholds thred1, thred2, and thred3 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on at least one of: the size of the scan area, the number of transform coefficients that have been scanned in the scan area, the relative position of the first transform coefficient in the scan area, and whether the first transform coefficient is the transform coefficient of the first position other than 0 that is scanned in a predetermined scan order.
For example, the entropy decoding unit 105 may determine the size _ sr of the quadrangular scanning area based on equation 5 below. In other words, the size _ sr of the quadrangle scanning area may represent the number of transform coefficients included in the quadrangle scanning area.
[ EQUATION 5 ]
size_sr=(sr_x+1)*(sr_y+1)
The entropy decoding unit 105 may determine the number cnt _ pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area. At this time, cnt _ pos may indicate a position of a first transform coefficient among all transform coefficients within a scan region scanned in a predetermined scan order. However, without being limited thereto, the cnt _ pos may be the number of all transform coefficients greater than 0 that are scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area.
When cnt _ pos is less than the predetermined threshold thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4 × size _ sr.
When cnt _ pos is less than the predetermined threshold thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, thred2 may be 1/4 × size _ sr. Alternatively, thred2 may be 1/2 × size _ sr.
When the cnt _ pos is not less than the predetermined thresholds thred1 and thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset3 and determine a context model based on the increased context index.
However, the thresholds thred1 and thred2 are only examples, and those skilled in the art can easily understand that various values can be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0.
Entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on a relative position of the first transform coefficient in the scan region.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on the coordinate values pos _ x and pos _ y of the horizontal direction and the vertical direction of the first transform coefficient in the current block and the coordinates Sr _ x and Sr _ y specifying the quadrangular scan area.
When pos _ x is less than thred1_ x, and pos _ y is less than thred1_ y, the video decoding device 100 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, [ thred1_ x, thred1_ y ] may be [1,1 ]. Alternatively, [ thred1_ x, thred1_ y ] may be [ sr _ x/4, sr _ y/4] or [ (sr _ x +1)/4, (sr _ y +1)/4 ].
When pos _ x is less than thred2_ x, and pos _ y is less than thred2_ y, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, [ thred2_ x, [ thred2_ y ] or [ thred1_ x, [ thred1_ y ] may be [ sr _ x/2, [ sr _ y/2] or [ (sr _ x +1)/2, (sr _ y +1)/2 ].
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values can be determined based on sr _ x and sr _ y.
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values may be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x, and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x, and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on whether the first transform coefficient is a first position transform coefficient among transform coefficients greater than 0 that are scanned in a scanning order in an inverse direction. In other words, the video decoding apparatus 100 may determine the first context model related to the flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is the first position in the transform coefficients greater than 0 that are scanned in the scan order in the reverse direction, and determine the second context model related to the flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is not the first position in the transform coefficients greater than 0 that are scanned in the scan order in the reverse direction.
However, without being limited thereto, the context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients whose absolute values are greater than 1 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
Alternatively, the context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on the previously decoded GT1 flag information in the corresponding coefficient group and the GT1 flag information in the previously decoded coefficient group.
Alternatively, flag information (GT1 flag information) indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on at least one of: GT1 flag information for n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order, GT1 flag information for a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at an initial position in a scanning area, and whether the first transform coefficient is a transform coefficient at a final position in the scanning area.
The context model related to flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients located on the right or lower side whose absolute value is greater than 2.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on a position of the first transform coefficient in the current block. For example, when the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred3, the entropy decoding unit 105 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index. At this time, the offsets 1, 2, and 3 and the predetermined thresholds thred1, 2, and 3 associated with the context model regarding the flag information indicating whether the first transform coefficient is greater than 2 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1, 2, and 3 associated with the context model regarding the flag information indicating whether the first transform coefficient is greater than 0 and 1.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on at least one of: the size of the scan area, the number of transform coefficients that have been scanned in the scan area, the relative position of the first transform coefficient in the scan area, and whether the first transform coefficient is the transform coefficient at the first position other than 0 (or, at the first position in transform coefficients greater than 1) that is scanned in a predetermined scan order.
For example, the entropy decoding unit 105 may determine the size _ sr of the quadrangular scanning area based on equation 6 below. In other words, the size _ sr may represent the number of transform coefficients included in the quadrangle-scanned area.
[ EQUATION 6 ]
size_sr=(sr_x+1)*(sr_y+1)
The entropy decoding unit 105 may determine the number cnt _ pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area. At this time, cnt _ pos may indicate a position of a first transform coefficient among all transform coefficients within a scan region scanned in a predetermined scan order. However, without being limited thereto, the cnt _ pos may be the number of all transform coefficients that are scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area and have an absolute value greater than 1.
When cnt _ pos is less than the predetermined threshold thred1, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4 × size _ sr.
When cnt _ pos is less than the predetermined threshold thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, thred2 may be 1/4 × size _ sr. Alternatively, thred2 may be 1/2 × size _ sr.
When the cnt _ pos is not less than the predetermined thresholds thred1 and thred2, the entropy decoding unit 105 may increase the context index by a predetermined context offset3 and determine a context model based on the increased context index.
However, the thresholds thred1 and thred2 are only examples, and those skilled in the art can easily understand that various values can be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0 or 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0 or 1.
Entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 2 based on a relative position of the first transform coefficient in the scan region.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 2 based on the coordinate values pos _ x and pos _ y of the horizontal direction and the vertical direction of the first transform coefficient in the current block and the coordinates Sr _ x and Sr _ y specifying the quadrangular scan area.
When pos _ x is less than thred1_ x and pos _ y is less than thred1_ y, the entropy decoding unit 105 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, [ thred1_ x, thred1_ y ] may be [1,1 ]. Alternatively, [ thred1_ x, thred1_ y ] may be [ sr _ x/4, sr _ y/4] or [ (sr _ x +1)/4, (sr _ y +1)/4 ].
When pos _ x is less than thred2_ x and pos _ y is less than thred2_ y, the entropy decoding unit 105 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, [ thred2_ x, [ thred2_ y ] or [ thred1_ x, [ thred1_ y ] may be [ sr _ x/2, [ sr _ y/2] or [ (sr _ x +1)/2, (sr _ y +1)/2 ].
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values can be determined based on sr _ x and sr _ y.
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values may be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x, and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0 or 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x, and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0.
The entropy decoding unit 105 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 2 based on whether the first transform coefficient is a first position transform coefficient among transform coefficients greater than 0 that are scanned in a scanning order in an inverse direction. In other words, the entropy decoding unit 105 may determine the first context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is a transform coefficient of a first position in transform coefficients greater than 0 that are scanned in an inverse direction scan order, and determine the second context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is not a transform coefficient of a first position in transform coefficients greater than 0 that are scanned in an inverse direction scan order.
However, without being limited thereto, the entropy decoding unit 105 may determine the context model related to flag information indicating whether the first transform coefficient is greater than 2 based on whether the first transform coefficient is the first-position transform coefficient among transform coefficients greater than 1 that are scanned in the inverse direction scan order. In other words, the entropy decoding unit 105 may determine the first context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is a transform coefficient of a first position in transform coefficients greater than 1 that are scanned in the inverse direction scan order, and determine the second context model related to flag information indicating whether the first transform coefficient is greater than 2 when the first transform coefficient is not a transform coefficient of a first position in transform coefficients greater than 1 that are scanned in the inverse direction scan order.
However, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients whose absolute values are greater than 2 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
Alternatively, the context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on the previously decoded GT2 flag information in the corresponding coefficient group and the GT2 flag information in the previously decoded coefficient group.
Alternatively, flag information indicating whether the absolute value of the first transform coefficient is greater than 2 (hereinafter referred to as GT2 flag information) may be determined based on at least one of: GT2 flag information for n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order and GT2 flag information for a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at an initial position in a scanning area, and whether the first transform coefficient is a transform coefficient at a final position in the scanning area.
Alternatively, flag information (hereinafter referred to as GTm flag information) indicating whether the absolute value of the first transform coefficient is greater than m (m is an integer greater than 2) may be determined based on at least one of: GTm flag information of n (n is a positive integer) transform coefficients previously scanned in a predetermined scan order and GTm flag information of a position of a first transform coefficient in the current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at a first position in the scan area, and whether the first transform coefficient is a transform coefficient at a final position in the scan area.
In addition, binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on the level absolute values of neighboring significant transform coefficients to the right or lower side of the first transform coefficient.
For example, binarization parameter information regarding the remaining level absolute values of the first transform coefficient may be determined based on the sum of the level absolute values of predetermined surrounding significant transform coefficients to the right or lower side of the first transform coefficient.
Alternatively, binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on a previously encoded level value.
Alternatively, the binarization parameter information related to the remaining level absolute value of the first transform coefficient may be determined based on at least one of: a level of n (n is an integer) transform coefficients previously scanned in a predetermined scan order, a position of a first transform Coefficient in a current block, a color component, and a level of n (n is a positive integer) transform coefficients adjacent to a right side or a lower side, whether the first transform Coefficient is a transform Coefficient of an initial position in a scan area in the scan order, whether the first transform Coefficient is a transform Coefficient of a final position in the scan area in the scan order, and whether the first transform Coefficient is a Coefficient of an initial position in a Coefficient Group (Coefficient Group) in the scan order.
When the position of the transform coefficient currently scanned in the scan region is [ SRx, 0] (SRx is an integer, SRx indicates a coordinate value in the horizontal direction of a right boundary pixel of the scan region with reference to the coordinate of the upper left corner of the scan region), and the transform coefficients located at positions [ SRx, Y ] (Y is an integer greater than 0 and less than or equal to SRy, SRy indicates a coordinate value in the vertical direction of a lower boundary pixel of the scan region with reference to the coordinate of the upper left corner of the scan region) previously scanned in a predetermined scan order are all 0, the entropy decoding unit 105 may not obtain the GT0 flag information of the transform coefficient currently scanned from the bitstream and may determine the value of the GT0 flag information to be 1.
Likewise, when the position of the transform coefficient currently scanned in the scan region is [0, SRy ] (SRy is an integer, SRy indicates a coordinate value in the vertical direction of the lower boundary pixel of the reference scan region with the coordinate of the upper left corner of the scan region), and the transform coefficients located at positions [ X, SRy ] (X is an integer greater than 0 and less than or equal to SRx indicating a coordinate value in the vertical direction of the right boundary pixel of the reference scan region with the coordinate of the upper left corner of the scan region) previously scanned in a predetermined scan order are all 0, the entropy decoding unit 105 may not obtain the GT0 flag information of the transform coefficient currently scanned from the bitstream but may determine the value of the GT0 flag information to be 1.
In addition, the entropy decoding unit 105 may determine the maximum number of GT1 flag information for significant transform coefficients in the current block, and receive GT1 flag information in the current block from the bitstream within the determined maximum coefficient of the significant transform coefficients. In other words, when the entropy decoding unit 105 receives the GT1 flag information of the maximum number of significant transform coefficients from the bitstream, the entropy decoding unit 105 may not confirm any more thereafter whether the GT1 flag information of the significant transform coefficients exists in the bitstream.
The entropy decoding unit 105 may determine all the significant transform coefficients, which are not 0, as the maximum number of GT1 flag information in the current block. Alternatively, the entropy decoding unit 105 may determine the maximum amount of GT1 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 may determine the maximum number of GT1 flag information MaxCount _ GT1 based on equation 7 below.
[ EQUATION 7 ]
Figure BDA0002634979820000321
At this time, the sizeSR may represent the size (area) of the quadrangular scanning region, and the sizeSR may be (Sr _ x +1) × (Sr _ y + 1). Sr _ x may represent the horizontal coordinate of the rightmost significant transform coefficient pixel with reference to the coordinate of the upper left corner edge of the scan region. In other words, Sr _ x may represent the horizontal coordinate of the right boundary pixel with reference to the coordinate of the left upper end corner of the scan region. Sr _ y may represent a coordinate in the vertical direction of the lowermost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ y may represent the coordinate of the vertical direction of the lower side boundary pixel with reference to the coordinate of the left upper end corner of the scan region.
K1 may be the adjustment factor between the size of the scan area and the GT1 flag. For example, it may be an integer greater than 1. Th1 may be a predetermined threshold. For example, Th1 may be 16, 8. However, without being limited thereto, one skilled in the art may easily understand that K1 and Th1 may have various values.
The entropy decoding unit 105 may determine the maximum amount of GT2 flag information in the current block and receive GT2 flag information in the current block from the bitstream within the determined maximum coefficient of the significant transform coefficient. In other words, when the entropy decoding unit 105 receives the GT2 flag information of the maximum number of significant transform coefficients from the bitstream, the entropy decoding unit 105 may not confirm any more thereafter whether the GT2 flag information of the significant transform coefficients exists in the bitstream.
The entropy decoding unit 105 may determine all the significant transform coefficients, which are not 0, as the maximum number of GT2 flag information in the current block. Alternatively, the entropy decoding unit 105 may determine the maximum amount of GT2 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 may determine the maximum number of GT2 flag information MaxCount _ GT2 based on equation 8 below.
[ equation 8]
Figure BDA0002634979820000331
At this time, the sizeSR may represent the size (area) of the quadrangular scanning region, and the sizeSR may be (Sr _ x +1) × (Sr _ y + 1). Sr _ x may represent the horizontal-direction coordinate of the rightmost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ x may represent the horizontal coordinate of the right boundary pixel with reference to the coordinate of the left upper end corner of the scan region. Sr _ y may represent a coordinate in the vertical direction of the lowermost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ y may represent the coordinate of the vertical direction of the lower side boundary pixel with reference to the coordinate of the left upper end corner of the scan region. K2 may be the adjustment factor between the size of the scan area and the GT1 flag. For example, it may be an integer greater than 1. K2 may be a predetermined threshold. For example, Th2 may be 16, 8. However, without being limited thereto, one skilled in the art may easily understand that K2 and Th2 may have various values.
The entropy decoding unit 105 may obtain information on the coefficient group in the current block from the bitstream. Here, the information on the coefficient group may be flag information indicating whether at least one significant transform coefficient is included in the coefficient group (or whether only a transform coefficient as 0 is included in the coefficient group). The flag information may be referred to as significant coefficient group flag (significant coefficient group flag) information. The entropy decoding unit 105 may scan information on transform coefficients in the current coefficient group based on information on the current coefficient group obtained from the bitstream. For example, when the information related to the coefficient group indicates that at least one significant transform coefficient is not included in the coefficient group, the entropy decoding unit 105 may derive the value of the transform coefficient in the coefficient group to 0 without scanning the information related to the transform coefficient. When the information related to the coefficient group indicates that at least one significant transform coefficient is included in the coefficient group, the entropy decoding unit 105 may scan the information related to the transform coefficients in a predetermined scan order to obtain the transform coefficients in the coefficient group.
At this time, for the transform coefficients included in the scan area, the entropy decoding section entropy decoding unit 105 may determine one coefficient group from each of predetermined K (K is an integer) transform coefficients that are scanned in a predetermined scan order. That is, one coefficient group may include K transform coefficients. At this time, the scanning order may be a forward direction scanning order in a direction opposite to the scanning order of the predetermined reverse direction.
Accordingly, the entropy decoding unit 105 may determine the coefficient group by scanning in the positive direction scanning order from the DC coefficient that is a coefficient adjacent to the left upper end corner in the current block. At this time, when the number of transform coefficients included in the current block is not an integer multiple of K, the final coefficient group among the coefficient groups scanned in the positive direction scanning order may include a transform coefficient whose number is less than K.
However, without being limited thereto, those skilled in the art can easily understand that the entropy decoding unit 105 may determine the coefficient group by scanning in an inverse direction scanning order from the coefficient at the lower right end among the transform coefficients included in the current block to the coefficient at the upper left end among the transform coefficients included in the current block.
However, without being limited thereto, those skilled in the art may easily understand that the entropy decoding unit 105 may not obtain information on the coefficient group in the current block from the bitstream and may determine the coefficient group in a predetermined scan order. The reason why the coefficient group is determined is that the entropy decoding unit 105 performs an operation (e.g., an operation of sign data Hiding (SignData Hiding) or the like) according to the coefficient group processing. When one coefficient group among coefficient groups scanned in a predetermined scanning order includes only one transform coefficient, the entropy decoding unit 105 may obtain GTO flag information from the bitstream without obtaining information on the corresponding coefficient group from the bitstream.
The entropy decoding unit 105 may determine whether a sign (sign) of at least one transform coefficient is concealed for each coefficient group included in the current block. For example, the entropy decoding unit may determine, according to circumstances, signs that hide one or two transform coefficients for each coefficient group included in the current block.
The entropy decoding unit 105 may scan information about transform coefficients in a quadrangular scanning area in a predetermined scanning order. The predetermined scan order may include a zigzag scan order in the reverse direction, a diagonal scan order in the reverse direction, and a vertical scan order and a horizontal scan order in the reverse direction. However, it can be easily understood by those skilled in the art that the predetermined scan order is not limited to the above-described reverse direction scan order, but includes various reverse direction scan orders.
The entropy decoding unit 105 may obtain the transform coefficient of the current block based on the scanned information about the transform coefficient.
The image restoring unit 120 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficient of the current block.
The image restoring unit 120 may restore the current block based on the residual block of the current block.
The image restoring unit 120 may perform inter prediction or intra prediction on the current block to generate a prediction block of the current block. The image restoring unit 120 may restore the current block based on the prediction block of the current block and the residual block of the current block. In other words, the image restoring unit 120 restores the values of the pixels included in the current block by adding the values of the pixels included in the predicted block and the values of the pixels included in the residual block.
The entropy decoding unit 105 may perform context model-based binary arithmetic decoding on information related to coordinates specifying a quadrangular scanning area. The entropy decoding unit 105 can obtain inverse binarization information related to coordinates specifying a quadrangular scanning area by performing inverse binarization using a predetermined inverse binarization method on the binary arithmetic decoded information, and obtain the coordinates specifying the quadrangular scanning area based on the inverse binarization information related to the coordinates. At this time, the context model may be determined based on the size of the current block and at least one of the color component and the binarization index of the current block. The color components may include a luminance component and a color difference component. The binary index may be information indicating a position of a current binary arithmetically decoded binary (bin) in a binary string (binning) related to the syntax element. Here, the predetermined inverse binarization method may be at least one of a fixed length inverse binarization and a truncated unary code inverse binarization method.
The entropy decoding unit 105 may obtain the transform coefficient of the current block by performing at least one of binary arithmetic decoding and inverse binarization based on a context model related to the significant transform coefficient based on information related to the scanned significant transform coefficient. When the information on the significant transform coefficient is information indicating whether the absolute value of the current significant transform coefficient is greater than a predetermined value, the residual level information, and the sign information of the current significant transform coefficient, the entropy decoding unit 105 may perform context model-based binary arithmetic decoding on the scanned information on the significant transform coefficient. The entropy decoding unit 105 may obtain the transform coefficient of the current block by performing inverse binarization on the binary arithmetic decoded information on the significant transform coefficient. When the first information on the significant transform coefficient is information indicating whether the absolute value of the current significant transform coefficient is greater than a predetermined value, the remaining level information, and the sign information of the current significant transform coefficient, and the second information on the significant transform coefficient is binarization parameter information, the entropy decoding unit 105 may perform context model-based binary arithmetic decoding on the first information on the significant transform coefficient. The entropy decoding unit 105 may perform inverse binarization based on binarization parameter information including second information on the binary arithmetic decoded first information to obtain transform coefficients of the current block. The binarization Parameter information may be Rice Parameter (Rice Parameter) information regarding the transform coefficients. A context model related to the first transform coefficient among the context models related to the flag information of the transform coefficients may be determined based on at least one of: information on at least one second transform coefficient previously scanned in a predetermined scan order, a position and color component of the first transform coefficient in the current block, information on surrounding transform coefficients on the right or lower side, and a scan position of the first transform coefficient.
The context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 0 may be determined based on the number of significant transform coefficients located on the right or lower side whose absolute value is greater than 0.
However, without being limited thereto, the context model related to flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the number of significant transform coefficients whose absolute values are greater than 0 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
Alternatively, flag information indicating whether the first transform coefficient is greater than 0 (hereinafter referred to as GT0 flag information) may be determined based on at least one of: GT0 flag information for n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order, GT0 flag information for a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at a first position in a scanning area, and whether the first transform coefficient is a transform coefficient at a final position in the scanning area.
The context model related to the flag information indicating whether the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients on the right and lower sides whose absolute values are greater than 1.
However, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients whose absolute values are greater than 1 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
Alternatively, flag information indicating whether the first transform coefficient is greater than 1 (hereinafter referred to as GT1 flag information) may be determined based on at least one of: GT1 flag information for n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order, GT1 flag information for a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at a first position in a scanning area, and whether the first transform coefficient is a transform coefficient at a final position in the scanning area.
The context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients on the right or lower side of which the absolute value is greater than 2. At this time, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients whose absolute values are greater than 2 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
Alternatively, flag information indicating whether the first transform coefficient is greater than 2 (hereinafter referred to as GT2 flag information) may be determined based on at least one of: GT1 flag information for n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order, GT1 flag information for a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at a first position in a scanning area, and whether the first transform coefficient is a transform coefficient at a final position in the scanning area.
Alternatively, flag information (hereinafter referred to as GTm flag information) indicating whether the absolute value of the first transform coefficient is greater than m (m is an integer greater than 2) may be determined based on at least one of: GTm flag information of n (n is a positive integer) transform coefficients previously scanned in a predetermined scan order, GTm flag information of a position of a first transform coefficient in a current block, a color component, and adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is a transform coefficient at a first position in a scan area, and whether the first transform coefficient is a transform coefficient at a final position in the scan area.
In addition, binarization parameter information regarding a remaining level absolute value of the first transform coefficient may be determined based on level absolute values of adjacent significant transform coefficients to the right and lower sides of the first transform coefficient.
For example, binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on the sum of the level absolute values of adjacent significant transform coefficients located on the right side or the lower side of the first transform coefficient.
However, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients whose absolute values are greater than 2 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
The context model related to the flag information indicating whether the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients on the right and lower sides whose absolute values are greater than 1.
The context model related to the flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients on the right or lower side of which the absolute value is greater than 2.
In addition, binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on the level absolute values of adjacent significant transform coefficients to the right and lower sides of the first transform coefficient. For example, binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on the sum of the level absolute values of adjacent significant transform coefficients to the right or to the lower side of the first transform coefficient.
The binarization parameter information related to the remaining level absolute value of the first transform coefficient may be determined based on at least one of: a level of n (n is an integer) transform coefficients previously scanned in a predetermined scan order, a position of a first transform Coefficient in a current block, a color component, and a level of n (n is a positive integer) transform coefficients adjacent to a right side or a lower side, whether the first transform Coefficient is a transform Coefficient of a first position in a scan area in the scan order, whether the first transform Coefficient is a transform Coefficient of a final position in the scan area in the scan order, and whether the first transform Coefficient is a Coefficient of a first position in a Coefficient Group (Coefficient Group) in the scan order.
When the position of the transform coefficient currently scanned in the scan region is [ SRx, 0] (SRx is an integer, SRx indicates a horizontal-direction coordinate value of a right-side boundary pixel of the scan region with reference to the coordinate of a left-side upper end corner of the scan region), and the transform coefficients of the positions [ SRx, Y ] (Y is an integer greater than 0 and less than or equal to SRy, SRy indicates a vertical-direction coordinate value of a lower-side boundary pixel of the scan region with reference to the coordinate of a left-side upper end corner of the scan region) previously scanned in a predetermined scan order are all 0, the entropy decoding unit 105 may not obtain the GT0 flag information of the transform coefficient currently scanned from the bitstream and may determine the value of the GT0 flag information to be 1.
Likewise, when the position of the transform coefficient currently scanned separately in the scan area is [0, SRy ] (SRy is an integer, SRy indicates a vertical coordinate value of a lower boundary pixel of the scan area with reference to the coordinate of the left upper end corner of the scan area), and the transform coefficients of the positions [ X, SRy ] (X is an integer greater than 0 and less than or equal to SRx indicating a vertical coordinate value of a right boundary pixel of the scan area with reference to the coordinate of the left upper end corner of the scan area) previously scanned in the predetermined scan order are all 0, the entropy decoding unit 105 may not obtain the GT0 flag information of the transform coefficient currently scanned from the bitstream but may determine the value of the GT0 flag information to be 1.
In addition, the entropy decoding unit 105 may determine the maximum number of GT1 flag information for significant transform coefficients in the current block, and receive GT1 flag information in the current block from the bitstream within the determined maximum coefficient of the significant transform coefficients. In other words, when the entropy decoding unit 105 receives the GT1 flag information of the maximum number of significant transform coefficients from the bitstream, the entropy decoding unit 105 may not confirm any more thereafter whether the GT1 flag information of the significant transform coefficients exists in the bitstream.
The entropy decoding unit 105 may determine all the significant transform coefficients, which are not 0, as the maximum number of GT1 flag information in the current block. Alternatively, the entropy decoding unit 105 may determine the maximum amount of GT1 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 may determine the maximum number of GT1 flag information MaxCount _ GT1 based on equation 9 below.
[ EQUATION 9 ]
Figure BDA0002634979820000381
At this time, the sizeSR may represent the size (area) of the quadrangular scanning region, and the sizeSR may be (Sr _ x +1) × (Sr _ y + 1). Sr _ x may represent the horizontal-direction coordinate of the rightmost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ x may represent the horizontal coordinate of the right boundary pixel with reference to the coordinate of the left upper end corner of the scan region. Sr _ y may represent a coordinate in the vertical direction of the lowermost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ y may represent the coordinate of the vertical direction of the lower side boundary pixel with reference to the coordinate of the left upper end corner of the scan region. K1 may be the adjustment factor between the size of the scan area and the GT1 flag. For example, it may be an integer greater than 1. Th1 may be a predetermined threshold. For example, Th1 may be 16, 8. However, it is not limited thereto. One skilled in the art can easily understand that K1 and Th1 may have various values.
The entropy decoding unit 105 may determine the maximum amount of GT2 flag information in the current block and receive GT2 flag information in the current block from the bitstream within the determined maximum coefficient of the significant transform coefficient. In other words, when the entropy decoding unit 105 receives the GT2 flag information of the maximum number of significant transform coefficients from the bitstream, the entropy decoding unit 105 may not confirm any more thereafter whether the GT2 flag information of the significant transform coefficients exists in the bitstream.
The entropy decoding unit 105 may determine all the significant transform coefficients, which are not 0, as the maximum number of GT2 flag information in the current block. Alternatively, the entropy decoding unit 105 may determine the maximum amount of GT2 flag information in the current block based on the size of the scan area. For example, the entropy decoding unit 105 may determine the maximum number of GT2 flag information MaxCount _ GT2 based on equation 10 below.
[ EQUATION 10 ]
Figure BDA0002634979820000391
At this time, the sizeSR may represent the size (area) of the quadrangular scanning region, and the sizeSR may be (Sr _ x +1) × (Sr _ y + 1). Sr _ x may represent the horizontal-direction coordinate of the rightmost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ x may represent the horizontal coordinate of the right boundary pixel with reference to the coordinate of the left upper end corner of the scan region. Sr _ y may represent a coordinate in the vertical direction of the lowermost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ y may represent the coordinate of the vertical direction of the lower side boundary pixel with reference to the coordinate of the left upper end corner of the scan region. K2 may be an adjustment factor. For example, K2 may be an integer greater than 1. K2 may be a predetermined threshold. For example, Th2 may be 16, 8. However, without being limited thereto, one skilled in the art may easily understand that K2 and Th2 may have various values.
The entropy decoding unit 105 may obtain information on the coefficient group in the current block from the bitstream. The information related to the coefficient group may be flag information indicating whether the coefficient group includes at least one significant transform coefficient. At this time, for the transform coefficients included in the scan area, the entropy decoding section entropy decoding unit 105 may determine one coefficient group from each of predetermined K (K is an integer) transform coefficients that are scanned in a predetermined scan order. That is, one coefficient group may include K transform coefficients. At this time, the scanning order may be a forward direction scanning order in a direction opposite to the scanning order of the predetermined reverse direction. Here, the scan order of the predetermined reverse direction may represent an order of scanning from a coefficient located at a lower right end among transform coefficients included in the current block to a coefficient located at an upper left end among transform coefficients included in the current block.
Accordingly, the entropy decoding unit 105 may determine the coefficient group by scanning in the positive direction scanning order from the DC coefficient that is a coefficient adjacent to the left upper end corner in the current block. At this time, when the number of transform coefficients included in the current block is not an integer multiple of K, a final coefficient group among the groups of coefficients scanned in the positive direction scanning order may include a number of transform coefficients less than K. However, without being limited thereto, those skilled in the art may easily understand that the entropy decoding unit 105 may determine the coefficient group by scanning according to an inverse direction scanning order from a coefficient at the lower right end among transform coefficients included in the current block to a coefficient at the upper left end among transform coefficients included in the current block.
When the final coefficient group among the coefficient groups scanned in the predetermined scanning order includes only one transform coefficient, the entropy decoding unit 105 may not obtain information on the coefficient group from the bitstream, but may obtain only GTO flag information from the bitstream.
The entropy decoding unit 105 may determine whether to conceal a sign (sign) of at least one transform coefficient for each coefficient group included in the current block. For example, the entropy decoding unit may determine, according to circumstances, signs that hide one or two transform coefficients for each coefficient group included in the current block.
The entropy decoding unit 105 may scan information about the significant transform coefficients in the quadrangle scanning area in a predetermined scanning order. The predetermined scan order may include a zigzag scan order in the reverse direction, a diagonal scan order in the reverse direction, and a vertical scan order and a horizontal scan order in the reverse direction. However, it can be easily understood by those skilled in the art that the predetermined scan order is not limited to the above-described reverse direction scan order, but includes various reverse direction scan orders.
The entropy decoding unit 105 may obtain the transform coefficient of the current block based on the scanned information about the transform coefficient.
The image restoring unit 120 may generate a residual block of the current block by performing inverse quantization and inverse transformation on the transform coefficient of the current block.
The image restoring unit 120 may restore the current block based on the residual block of the current block.
The image restoring unit 120 may perform inter prediction or intra prediction on the current block to generate a prediction block of the current block. The image restoring unit 120 may restore the current block based on the prediction block of the current block and the residual block of the current block. In other words, the image restoring unit 120 restores the values of the pixels included in the current block by adding the values of the pixels included in the predicted block and the values of the pixels included in the residual block. The optical flow will be described later in the description with respect to fig. 3 a.
The video decoding apparatus 100 may include an image decoding unit (not shown), and the image decoding unit (not shown) may include an entropy decoding unit 105 and an image restoration unit 120. The image decoding unit will be described with reference to fig. 1 e. Fig. 1b shows a flow diagram of a video decoding method according to various embodiments.
In step S105, the video decoding apparatus 100 may determine a scan area including all significant transform coefficients in the current block. At this time, when scanning is performed in a predetermined forward direction scanning order from the transform coefficient at the upper left end of the scanning area, the scanning area may be an area including transform coefficients up to the last scanned significant transform coefficient (hereinafter referred to as the last significant transform coefficient). At this time, the coordinates of the designated scanning area may be the coordinates of the effective transform coefficient pixel that was scanned last. The video decoding apparatus 100 may obtain information on coordinates indicating the last significant transform coefficient from the bitstream, and may determine the scan area based on the obtained information on coordinates indicating the last significant transform coefficient.
Alternatively, the scan region may be a quadrangular scan region, and the quadrangular scan region may be a region specified by the horizontal-direction coordinates of the significant transform coefficient pixels located on the rightmost side among all the significant transform coefficients in the current block and the vertical-direction coordinates of the significant transform coefficient pixels located on the lowermost side in the current block. The video decoding apparatus 100 may obtain information on the coordinates specifying the quadrangular scanning area from the bitstream, and determine the quadrangular scanning area based on the obtained information on the coordinates specifying the quadrangular scanning area.
In step S110, the video decoding apparatus 100 may scan information on the transform coefficients in the scan area in a predetermined scan order. The predetermined scan order may be a zigzag scan order in the reverse direction or a diagonal scan order in the reverse direction. The zigzag scan order may include a vertical-first zigzag scan order or a horizontal-first zigzag scan order. In step S115, the video decoding device 100 may generate binary arithmetic decoded information by performing binary arithmetic decoding based on the scanned information on the transform coefficients. At this time, the video decoding apparatus 100 may perform binary arithmetic decoding using a context model determined based on at least one of the size and the shape of the current block.
In the S120 step, the video decoding apparatus 100 may scan information on the transform coefficients included in the scan area in a predetermined scan order and perform inverse binarization on the binary arithmetically decoded information to obtain information on the transform coefficients of the current block.
In step S125, the video decoding device 100 generates a residual block of the current block by performing inverse quantization and inverse transform based on information related to the transform coefficient of the current block. In other words, the video decoding apparatus 100 may obtain the transform coefficient of the current block based on the information on the transform coefficient of the current block, and perform inverse quantization and inverse transform on the transform coefficient of the current block to generate the residual block of the current block.
In S130 step, the video decoding apparatus 100 may restore the current block based on the residual block. The video decoding apparatus 100 may generate the prediction block of the current block by performing inter prediction or intra prediction, and the video decoding apparatus 100 may generate the pixel value of the restored block of the current block by adding the pixel value included in the prediction block of the current block and the pixel value of the residual block.
Fig. 1c shows a block diagram of a video encoding device 150 according to various embodiments.
Video encoding apparatus 150 according to various embodiments includes entropy encoding unit 155 and bitstream generation unit 170.
The entropy-encoding unit 155 may entropy-encode a syntax element related to a transform coefficient in the current block. The entropy encoding unit 155 may generate one-dimensional arrangement information on the transform coefficients in the current block by scanning the two-dimensional arrangement information on the transform coefficients in the current block in a predetermined scanning order, and perform entropy encoding on the one-dimensional arrangement information on the transform coefficients in the current block.
The syntax element related to the transform coefficient may be a flag indicating whether the transform coefficient is greater than a predetermined value. At this time, the predetermined value may be a value greater than or equal to 0. For example, it may be 0, 1 or 2. Also, it may be a syntax element indicating an absolute value of a remaining level (remaining level) related to the transform coefficient. In other words, the residual level absolute value may indicate a difference in absolute value between the absolute value of the transform coefficient and a predetermined absolute value determined based on whether it is greater than a predetermined value. Further, the syntax element related to the significant transform coefficient may be a syntax element related to a symbol of the significant transform coefficient.
First, the entropy encoding unit 155 may generate a binary string (binding) by performing binarization on the syntax element and perform binary arithmetic coding on the binary string to generate entropy-encoded information for the syntax element. At this time, binarization may be performed by the binarization unit 160, and binary arithmetic coding may be performed by the binary arithmetic coding unit 165.
The binarization unit 160 may perform binarization for a predetermined syntax element to generate a binary string. The binarization unit 160 may perform binarization on a predetermined syntax element based on a predetermined binarization method. The predetermined binarization methods may include a Fixed Length (Fixed Length) binarization method, a Rice (Rice) binarization method, an Exponential-Golomb (explicit Golomb) binarization method, and a Golomb-Rice (Golomb-Rice) binarization method. Alternatively, the predetermined binarization method may be a binarization method that combines the first binarization method and the second binarization method. For example, the binarization unit 160 may perform binarization on a portion of the syntax elements based on a first binarization method to generate a first binary string (bin string), and perform binarization on another portion of the syntax elements based on a second binarization method to generate a second binary string. At this time, the first binary string may be a part of a binary string of the syntax element, and the second binary string may be another part of the binary string of the syntax element. Part of the binary string may be a prefix (prefix) or suffix (suffix).
The binary arithmetic coding unit 165 may perform binary arithmetic coding based on a predetermined context model on a binary string related to a predetermined syntax element. Alternatively, the binary arithmetic coding unit 165 may perform binary arithmetic coding on a binary string related to a predetermined syntax element without a predetermined context model. At this time, the probability of 0 or 1 occurring for a binary (bin) currently being binary arithmetic coded is fixed to 0,5, and binary arithmetic coding is performed based on the probability.
The entropy encoding unit 155 may obtain a transform coefficient of the current block. In other words, the video encoding apparatus 150 may generate a prediction block of the current block by performing inter prediction or intra prediction, and generate a residual block of the current block based on the original block of the current block and the prediction block of the current block. The video encoding apparatus 150 may generate the transform coefficient of the current block by performing transform and quantization on the residual block of the current block. The entropy encoding unit 155 may obtain the generated transform coefficient of the current block.
The entropy encoding unit 155 may determine information related to the transform coefficient of the current block, generate one-dimensional arrangement information related to the transform coefficient of the current block by scanning the information related to the transform coefficient of the current block in a predetermined scan order, and perform entropy encoding on the one-dimensional arrangement information. The predetermined scan order may be an order of zigzag scanning according to a reverse direction or an order of diagonal scanning according to a reverse direction. However, without being limited thereto, a plurality of scanning orders may be possible, such as an order of horizontal scanning according to the reverse direction and an order of vertical scanning according to the reverse direction. The predetermined scan order may be determined by based on at least one of a horizontal-direction coordinate of a significant transform coefficient pixel located at the rightmost side in the current block and a vertical-direction coordinate of a significant transform coefficient pixel located at the lowermost side in the current block. The entropy encoding unit 155 may determine the predetermined scanning order based on the magnitude of the coordinate values in the horizontal direction and the magnitude of the coordinate values in the vertical direction. For example, when the coordinate values in the horizontal direction are greater than the coordinate values in the vertical direction, the entropy encoding unit 155 may determine the vertical scanning order in the reverse direction as a predetermined scanning order. When the coordinate values in the vertical direction are greater than the coordinate values in the horizontal direction, the entropy encoding unit 155 may determine the horizontal scanning order in the reverse direction as a predetermined scanning order.
Alternatively, when the coordinate values in the horizontal direction are greater than the coordinate values in the vertical direction, the entropy encoding unit 155 may determine the vertical-priority zigzag scanning order in the reverse direction as a predetermined scanning order. When the coordinate values in the vertical direction are greater than the coordinate values in the horizontal direction, the entropy encoding unit 155 may determine the horizontal-priority zigzag scanning order in the reverse direction as a predetermined scanning order. When the coordinate values in the vertical direction are equal to the coordinate values in the horizontal direction, the entropy encoding unit 155 may determine one of a vertical priority zigzag scanning order and a horizontal priority zigzag scanning order in the reverse direction as a predetermined scanning order.
Alternatively, when the coordinate values in the horizontal direction are greater than the coordinate values in the vertical direction, the entropy encoding unit 155 may determine the horizontal-priority zigzag scanning order in the reverse direction as a predetermined scanning order. When the coordinate value in the horizontal direction is not greater than the coordinate value in the vertical direction, the entropy encoding unit 155 may determine a horizontal-priority zigzag scanning order (horizontal first zigzag scanning order) in the reverse direction as a predetermined scanning order.
First, the entropy encoding unit 155 may determine a scan area including all significant transform coefficients in the current block. At this time, all significant transform coefficients in the current block may be included in the scan area, and the remaining area of the current block excluding the scan area may include only transform coefficients that are not significant transform coefficients and have a value of 0. At this time, when scanning is performed in a predetermined forward direction scanning order from the transform coefficient at the upper left end of the scanning area, the scanning area may be an area including transform coefficients up to the last scanned significant transform coefficient (hereinafter referred to as the last significant transform coefficient). The coordinates specifying the scan area may be the coordinates of the last scanned active transform coefficient pixel.
The entropy encoding unit 155 may generate information on coordinates indicating the last significant transform coefficient. For example, the entropy decoding unit 105 may generate syntax element information indicating coordinate values of a horizontal direction of the last significant transform coefficient and syntax element information indicating coordinate values of a vertical direction of the last significant transform coefficient. At this time, the entropy encoding unit 155 may generate a binary string by binarizing a syntax element indicating the coordinate value of the horizontal direction of the last significant transform coefficient and a syntax element indicating the coordinate value of the vertical direction of the last significant transform coefficient, and perform binary arithmetic decoding on the binary string to generate syntax element information indicating the coordinate value of the horizontal direction of the last significant transform coefficient and syntax element information indicating the coordinate value of the vertical direction of the last significant transform coefficient.
The entropy encoding unit 155 may generate the first binary string by performing a first binarization method on a first value that is a part of the syntax element values, and generate the second binary string by performing a second binarization method on a second value that is another part of the syntax element values. A binary string including the first binary string and the second binary string may be generated. At this time, the first binary string may be a prefix (prefix), and the first binarization method may be a fixed-length binarization method. The second binary string may be a suffix (suffix), and the second inverse binarization method may be a truncated unary code binarization method.
Alternatively, the entropy encoding unit 155 may generate information indicating a coordinate value of one direction of the horizontal direction coordinate value of the last significant transform coefficient pixel or the vertical direction coordinate value of the last significant transform coefficient pixel among all the significant transform coefficients in the current block and information indicating a difference (difference) between the coordinate value of the one direction and the coordinate values of the remaining directions.
Alternatively, the scan region may be a quadrangular scan region, and the quadrangular scan region may be a region specified by the horizontal-direction coordinates of the significant transform coefficient pixels located on the rightmost side among all the significant transform coefficients in the current block and the vertical-direction coordinates of the significant transform coefficient pixels located on the lowermost side in the current block.
The entropy encoding unit 155 may generate syntax element information related to coordinates specifying a quadrangular scanning area. For example, the entropy encoding unit 155 may generate syntax element information indicating the horizontal-direction coordinate values of the rightmost significant transform coefficient pixels among all the significant transform coefficients in the current block and syntax element information indicating the vertical-direction coordinate values of the lowermost significant transform coefficient pixels among all the significant transform coefficients in the current block. At this time, the entropy encoding unit 155 may generate a binary string by performing binarization on a syntax element indicating the horizontal-direction coordinate value of the significant transform coefficient pixel located at the rightmost side among all the significant transform coefficients in the current block and a syntax element indicating the vertical-direction coordinate value of the significant transform coefficient pixel located at the lowermost side among all the significant transform coefficients in the current block, and perform binary arithmetic decoding on the binary string to generate syntax element information indicating the horizontal-direction coordinate value of the last significant transform coefficient and syntax element information indicating the vertical-direction coordinate value of the last significant transform coefficient.
The entropy encoding unit 155 may generate the first binary string by performing a first binarization method on a first value that is a part of the syntax element values, and generate the second binary string by performing a second binarization method on a second value that is another part of the syntax element values. A binary string including the first binary string and the second binary string may be generated. At this time, the first binary string may be a prefix (prefix), and the first binarization method may be a fixed-length binarization method. The second binary string may be a suffix (suffix), and the second inverse binarization method may be a truncated unary code binarization method.
Alternatively, the entropy encoding unit 155 may generate information indicating a coordinate value in one direction of the horizontal direction of a pixel of a significant transform coefficient located on the rightmost side among all the significant transform coefficients in the current block and a coordinate value in the vertical direction of a pixel of a significant transform coefficient located on the lowermost side among all the significant transform coefficients in the current block, and information indicating a difference (difference) between the coordinate value in the one direction and the coordinate values in the remaining directions. The entropy encoding unit 155 may determine the one direction based on the height and width of the current block.
The entropy encoding unit 155 may generate flag information indicating whether information indicating a difference between the coordinate values in one direction and the coordinate values in the remaining direction is obtained.
In addition, the entropy encoding unit 155 may determine whether to generate flag information indicating whether to obtain information indicating a difference between the coordinate values in one direction and the coordinate values in the remaining direction based on the width and the height of the current block. For example, when the width and height of the current block are different (i.e., in the case of a rectangle), the entropy encoding unit 155 may determine to generate flag information indicating whether difference information indicating the difference between the coordinate values in one direction and the coordinate values in the remaining direction is obtained and generate the flag information.
The entropy encoding unit 155 may determine a context model used to bi-level arithmetic encode all syntax elements for coefficient encoding (coefficient encoding) based on at least one of a size of the current block and a shape (shape) of the current block. For example, the size (size) of the current block may be determined according to at least one of a minimum value and a maximum value of the height and width of the current block. The shape of the current block may be determined according to whether the width and the height of the current block are the same. All syntax elements used for coefficient coding may include syntax elements used to specify the scan region and syntax elements related to transform coefficients in the scan region.
For example, the entropy encoding unit 155 may determine the information size _ tu1 regarding the size of the current block based on equation 11 below.
[ EQUATION 11 ]
size_tu1=Min(log2_width,log2_height)
The entropy encoding unit 155 may determine a context model corresponding to the information size _ tu1 regarding the size of the current block and determine a context model regarding the syntax element for coefficient encoding, and perform binary arithmetic encoding on the syntax element for coefficient encoding by using the context model.
Alternatively, the entropy encoding unit 155 may determine the information size _ tu2 regarding the size of the current block based on equation 12 below.
[ EQUATION 12 ]
size_tu2=Max(log2_width,log2_height)
The entropy encoding unit 155 may determine a context model based on the information size _ tu2 regarding the size of the current block and determine a context model regarding the syntax element for coefficient encoding, and perform binary arithmetic encoding on the syntax element for coefficient encoding by using the context model.
Alternatively, the entropy encoding unit 155 may determine a context model based on the information size _ tu1 and size _ tu2 regarding the size of the current block and determine a context model regarding the syntax element for coefficient encoding, and perform binary arithmetic encoding on the syntax element for coefficient encoding by using the context model.
The entropy encoding unit 155 may determine which of the minimum value and the maximum value of the size and the height of the current block is, determine a context model based on the minimum value and the maximum value of the size and the height of the current block, determine a context model related to a syntax element for coefficient encoding, and perform binary arithmetic encoding on the syntax element for coefficient encoding by using the context model.
The entropy encoding unit 155 may determine a context model used in binary arithmetic coding of all syntax elements for coefficient encoding based on the shape (shape) of the current block.
For example, the entropy encoding unit 155 may determine the information shape _ tu regarding the shape of the current block based on equation 13 below.
[ EQUATION 13 ]
shape_tu=width>height?2:(width<height?1:0)
According to equation 13, the entropy encoding unit 155 determines shape _ tu to be 2 when the width of the current block is greater than the height, determines shape _ tu to be 1 when the width of the current block is less than the height, and determines shape _ tu to be 0 when the width of the current block is equal to the height. In other words, shape _ tu may be determined to be 2 in the case of a rectangle having a width greater than the height, 1 in the case of a rectangle having a height greater than the width, and 0 in the case of a square.
The entropy encoding unit 155 may determine a context model based on the information shape _ tu regarding the shape of the current block and determine a context model regarding the syntax element for coefficient encoding, and perform binary arithmetic encoding on the syntax element for coefficient encoding by using the context model.
The entropy encoding unit 155 may determine a context model related to a syntax element for coefficient encoding based on the size of the current block and the shape of the current block. For example, the entropy encoding unit 155 may determine a context model related to a syntax element for coefficient encoding based on at least one of the information size _ tu1 and size _ tu2 related to the size of the current block and the information shape _ tu related to the shape of the current block, and perform binary arithmetic encoding on the syntax element for coefficient encoding by using the context model.
When the height and width of the current block are different from each other, i.e., when one of the height and width is large, the entropy encoding unit 155 may interchange the height and width of the current block with each other. In other words, the horizontal direction coordinates and the vertical direction coordinates of the pixels included in the current block may be interchanged with each other (swap). For example, when the width of the current block is greater than the height, the entropy encoding unit 155 may interchange the height and width of the current block with each other. In other words, the horizontal direction coordinates and the vertical direction coordinates values of the pixels included in the current block may be interchanged with each other. Also, when the width of the current block is not greater than the height, the entropy encoding unit 155 may not interchange the horizontal direction coordinates and the vertical direction coordinates of the pixels included in the current block. But is not limited thereto, when the height of the current block is greater than the width, the entropy encoding unit 155 may interchange the height and the width of the current block with each other. In other words, the coordinate values in the horizontal direction and the coordinate values in the vertical direction of the pixels included in the current block may be interchanged with each other. When the horizontal direction coordinates and the vertical direction coordinates of the pixels included in the current block are interchanged with each other, the entropy encoding unit 155 may exchange the horizontal direction coordinates and the vertical direction coordinates of the scan area specifying the current block with each other. The entropy encoding unit 155 may determine the first scan region in the interchanged current block based on the coordinates of the interchanged (swapped) designated scan region. The entropy encoding unit 155 may scan information on the transform coefficients included in the first scanning area and perform entropy encoding on the scanned information on the transform coefficients. The entropy encoding unit 155 may determine coordinates for specifying the quadrangular scanning area and entropy encode information on the coordinates for specifying the quadrangular scanning area. In other words, the entropy encoding unit 155 may generate a binary string (bin string) by performing binarization based on a predetermined binarization method on syntax elements related to coordinates for specifying a quadrangular scanning area. Here, the predetermined binarization method may be at least one of a fixed length binarization method and a truncated unary code binarization method.
The entropy encoding unit 155 may perform context model-based binary arithmetic encoding on a binary string related to a syntax element regarding coordinates for specifying a quadrangular scanning area. At this time, the context model may be determined based on at least one of the size of the current block, the color component of the current block, and the binary index. The color components may include a luminance component and a color difference component. The binary index may be information indicating a position of a binary (bin) currently binary arithmetic coded in a binary string related to the syntax element.
The entropy encoding unit 155 may generate entropy-encoded information by performing at least one of binary arithmetic encoding based on a context model related to binarization and a transform coefficient based on information related to a scanned transform coefficient.
When the first information related to the transform coefficient is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, the remaining level absolute value information, and the sign information of the current transform coefficient, and the second information related to the transform coefficient is binarization parameter information of the remaining level absolute value, the entropy encoding unit 155 may generate a binary string (bin string) regarding the first information by performing binarization based on the second information on the first information related to the transform coefficient. The entropy encoding unit 155 may generate entropy-encoded information by performing binary arithmetic encoding on a binary string related to the first information.
The second information may be determined based on at least one of: at least one of information related to a second transform coefficient previously scanned in a predetermined scan order, a position of a first transform coefficient in a current block, a color component, information related to a neighboring transform coefficient located at a right side or a lower side, and a scan position of the first transform coefficient. For example, binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on the level absolute values of neighboring significant transform coefficients to the right or lower side of the first transform coefficient. Binarization parameter information regarding the remaining level absolute value of the first transform coefficient may be determined based on the sum of the level absolute values of the surrounding significant transform coefficients to the right or lower side of the first transform coefficient.
Alternatively, the binarization parameter information related to the remaining level absolute value of the first transform coefficient may be determined based on at least one of: the level of n (n is an integer) transform coefficients previously scanned in a predetermined scan order, the position of the first transform coefficient in the current block, the level of the color component and the adjacent right or lower n (n is a positive integer) transform coefficients, whether the first transform coefficient is the transform coefficient at the initial position in the scan area in the scan order, whether the first transform coefficient is the transform coefficient at the final position in the scan area in the scan order, and whether the first transform coefficient is the coefficient at the first position in the coefficient group in the scan order.
When the information related to the transform coefficient is information indicating whether the absolute value of the current transform coefficient is greater than a predetermined value, remaining level absolute value information, and sign information of the current transform coefficient, the entropy encoding unit 155 may perform binarization on the information related to the transform coefficient to generate a binary string (bin string). The entropy encoding unit 155 may generate binary arithmetic encoded information by performing binary arithmetic encoding based on a context model related to the transform coefficient on the binary string. A context model related to a first transform coefficient of the context models related to the transform coefficients may be determined based on at least one of: at least one of information related to a second transform coefficient previously scanned in a predetermined scan order, a position of a first transform coefficient in a current block, a color component, information related to a neighboring transform coefficient on a right side or a lower side, and a scan position of the first transform coefficient.
The context model related to flag information indicating whether the absolute value of the first transform coefficient is greater than 0 may be determined based on the number of significant transform coefficients on the right or lower side whose absolute value is greater than 0.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on the position of the first transform coefficient in the current block. For example, when the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. When the sum of the coordinate value pos _ x in the horizontal direction of the first transform coefficient in the current block and the position pos _ y in the vertical direction in the current block is less than the predetermined threshold thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred3, the entropy encoding unit 155 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on at least one of a size of the scan area, a number of transform coefficients that have been scanned in the scan area, a relative position of the first transform coefficient in the scan area, and whether the first transform coefficient is a coefficient of a first position that is scanned in a predetermined scan order.
For example, the entropy encoding unit 155 may determine the size _ sr of the quadrangular scanning area by based on the following equation 14. In other words, the size _ sr of the quadrangle scanning area may represent the number of transform coefficients included in the quadrangle scanning area.
[ EQUATION 14 ]
size_sr=(sr_x+1)*(sr_y+1)
However, without being limited thereto, when the scan area is a scan area specified by the coordinates of the last significant transform coefficient pixel, the size _ sr may refer to the number of transform coefficients included in the scan area.
The entropy encoding unit 155 may determine the number cnt _ pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area. At this time, cnt _ pos may indicate a position of a first transform coefficient among all transform coefficients within a scan region scanned in a predetermined scan order.
When cnt _ pos is less than the predetermined threshold thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4 × size _ sr.
When cnt _ pos is less than the predetermined threshold thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, thred2 may be 1/4 × size _ sr. Alternatively, thred2 may be 1/2 × size _ sr.
When the cnt _ pos is not less than the predetermined thresholds thred1 and thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index. However, the thresholds thred1 and thred2 are only examples, and those skilled in the art can easily understand that various values can be determined based on the size _ sr.
The entropy-encoding unit 155 may determine the context model related to flag information indicating whether the first transform coefficient is greater than 0 by determining a relative position of the first transform coefficient in the scan area based on the first transform coefficient.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0, by based on the coordinate value pos _ x of the horizontal direction and the coordinate value pos _ y of the vertical direction of the first transform coefficient in the current block and the coordinates Sr _ x and Sr _ y specifying the quadrangular scan area.
When pos _ x is less than thred1_ x and pos _ y is less than thred1_ y, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. At this time, [ thred1_ x, thred1_ y ] may be [1, 1 ]. Alternatively, [ thred1_ x, thred1_ y ] may be [ sr _ x/4, sr _ y/4] or [ (sr _ x +1)/4, (sr _ y +1)/4]
When pos _ x is less than thred2_ x and pos _ y is less than thred2_ y, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. At this time, [ thred2_ x, [ thred2_ y ] or [ thred1_ x, [ thred1_ y ] may be [ sr _ x/2, [ sr _ y/2] or [ (sr _ x +1)/2, (sr _ y +1)/2 ].
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values can be determined based on sr _ x and sr _ y.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 0 based on whether the first transform coefficient is a transform coefficient of a first position scanned in an inverse direction scan order. In other words, the entropy encoding unit 155 may determine the first context model related to flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is a transform coefficient of a first position scanned in an inverse direction scan order, and determine the second context model related to flag information indicating whether the first transform coefficient is greater than 0 when the first transform coefficient is not a transform coefficient of a first position scanned in an inverse direction scan order. At this time, the transform coefficient of the pixel located at the right lower end corner of the quadrangular scanning area may be the transform coefficient of the first position scanned in the scanning order of the inverse direction.
However, without being limited thereto, the context model related to flag information indicating whether the first transform coefficient is greater than 0 may be determined based on the number of significant transform coefficients whose absolute values are greater than 0 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
The context model related to flag information indicating whether the absolute value of the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients on the right or lower side of which the absolute value is greater than 1.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on the position of the first transform coefficient in the current block. For example, when the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index.
When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred3, the entropy encoding unit 155 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index. At this time, the offsets 1, 2, and 3 and the predetermined thresholds thred1, 2, and 3 associated with the context model with respect to the flag information indicating whether the first transform coefficient is greater than 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1, 2, and 3 associated with the context model with respect to the flag information indicating whether the first transform coefficient is greater than 0.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on at least one of a size of the scan area, a number of transform coefficients that have been scanned in the scan area, a relative position of the first transform coefficient in the scan area, and whether the first transform coefficient is a transform coefficient of a first position other than 0 that is scanned in a predetermined scan order.
For example, the entropy encoding unit 155 may determine the size _ sr of the quadrangular scanning area based on the following equation 15. In other words, the size _ sr of the quadrangle scanning area may represent the number of transform coefficients included in the quadrangle scanning area.
[ EQUATION 15 ]
size_sr=(sr_x+1)*(sr_y+1)
The entropy encoding unit 155 may determine the number cnt _ pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area. At this time, cnt _ pos may indicate a position of a first transform coefficient among all transform coefficients within a scan region scanned in a predetermined scan order. However, without being limited thereto, the cnt _ pos may be the number of all transform coefficients greater than 0 that are scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area.
When cnt _ pos is less than the predetermined threshold thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4 × size _ sr.
When cnt _ pos is less than the predetermined threshold thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, thred2 may be 1/4 × size _ sr. Alternatively, thred2 may be 1/2 × size _ sr.
When the cnt _ pos is not less than the predetermined thresholds thred1 and thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index.
However, the thresholds thred1 and thred2 are only examples, and those skilled in the art can easily understand that various values can be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model with respect to flag information indicating whether the first transform coefficient is greater than 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model with respect to flag information indicating whether the first transform coefficient is greater than 0.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on a relative position of the first transform coefficient in the scan area.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on the coordinate value pos _ x of the horizontal direction and the coordinate value pos _ y of the vertical direction of the first transform coefficient in the current block and the coordinates Sr _ x and Sr _ y specifying the quadrangular scan area.
When pos _ x is less than thred1_ x and pos _ y is less than thred1_ y, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. At this time, [ thred1_ x, thred1_ y ] may be [1, 1 ]. Alternatively, [ thred1_ x, thred1_ y ] may be [ sr _ x/4, sr _ y/4] or [ (sr _ x +1)/4, (sr _ y +1)/4 ].
When pos _ x is less than thred2_ x and pos _ y is less than thred2_ y, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. At this time, [ thred2_ x, [ thred2_ y ] or [ thred1_ x, [ thred1_ y ] may be [ sr _ x/2, [ sr _ y/2] or [ (sr _ x +1)/2, (sr _ y +1)/2 ].
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values can be determined based on sr _ x and sr _ y.
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values may be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2 and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 1 may be different from the offsets 1, 2 and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 1 based on whether the first transform coefficient is a first position transform coefficient among transform coefficients greater than 0 that are scanned in a scanning order in an inverse direction. In other words, the video decoding apparatus 100 may determine the first context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is the transform coefficient of the first position in the transform coefficients greater than 0 that are scanned in the inverse direction scan order, and determine the second context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is not the transform coefficient of the first position in the transform coefficients greater than 0 that are scanned in the inverse direction scan order.
However, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 1 may be determined based on the number of significant transform coefficients whose absolute values are greater than 1 among n (n is a positive integer) transform coefficients previously scanned in a predetermined scanning order.
The context model related to flag information indicating whether the absolute value of the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients on the right or lower side whose absolute value is greater than 2.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 2 based on the position of the first transform coefficient in the current block. For example, when the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. When the sum of the horizontal-direction coordinate value pos _ x of the first transform coefficient in the current block and the vertical-direction position pos _ y in the current block is less than the predetermined threshold thred3, the entropy encoding unit 155 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index. At this time, the offsets 1, 2, and 3 and the predetermined thresholds thred1, 2, and 3 associated with the context model regarding the flag information indicating whether the first transform coefficient is greater than 2 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1, 2, and 3 associated with the context model regarding the flag information indicating whether the first transform coefficient is greater than 0 and 1.
The entropy encoding unit 155 may determine the context model related to flag information indicating whether the first transform coefficient is greater than 1 based on at least one of a size of the scan area, a number of transform coefficients that have been scanned in the scan area, a relative position of the first transform coefficient in the scan area, and whether the first transform coefficient is a transform coefficient of a position that is the first not 0 (or, a first position in the transform coefficients greater than 1) scanned in a predetermined scan order.
For example, the entropy encoding unit 155 may determine the size _ sr of the quadrangular scanning area based on equation 16 below. In other words, the size _ sr of the quadrangle scanning area may represent the number of transform coefficients included in the quadrangle scanning area.
[ EQUATION 16 ]
size_sr=(sr_x+1)*(sr_y+1)
The entropy encoding unit 155 may determine the number cnt _ pos of all transform coefficients scanned before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area. At this time, cnt _ pos may indicate a position of a first transform coefficient among all transform coefficients within a scan region scanned in a predetermined scan order. However, without being limited thereto, the cnt _ pos may be the number of all transform coefficients whose absolute values are scanned more than 1 before scanning the first transform coefficient among the transform coefficients within the quadrangular scanning area.
When cnt _ pos is less than the predetermined threshold thred1, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine a context model based on the increased context index. At this time, thred1 may be 1. Alternatively, thred1 may be 1/4 × size _ sr.
When cnt _ pos is less than the predetermined threshold thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine a context model based on the increased context index. At this time, thred2 may be 1/4 × size _ sr. Alternatively, thred2 may be 1/2 × size _ sr.
When the cnt _ pos is not less than the predetermined thresholds thred1 and thred2, the entropy encoding unit 155 may increase the context index by a predetermined context offset3 and determine the context model based on the increased context index.
However, the thresholds thred1 and thred2 are only examples, and those skilled in the art can easily understand that various values can be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0 or 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1 and thred2 associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0 or 1.
The entropy-encoding unit 155 may determine the context model related to flag information indicating whether the first transform coefficient is greater than 2 by determining a relative position of the first transform coefficient in the scan area based on the first transform coefficient.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 2, by based on the coordinate value pos _ x of the horizontal direction and the coordinate value pos _ y of the vertical direction of the first transform coefficient in the current block and the coordinates Sr _ x and Sr _ y specifying the quadrangular scan area.
When pos _ x is less than thred1_ x and pos _ y is less than thred1_ y, the entropy encoding unit 155 may increase the context index by a predetermined context offset1 and determine the context model based on the increased context index. At this time, [ thred1_ x, thred1_ y ] may be [1, 1 ]. Alternatively, [ thred1_ x, thred1_ y ] may be [ sr _ x/4, sr _ y/4] or [ (sr _ x +1)/4, (sr _ y +1)/4 ].
When pos _ x is less than thred2_ x and pos _ y is less than thred2_ y, the entropy encoding unit 155 may increase the context index by a predetermined context offset2 and determine the context model based on the increased context index. At this time, [ thred2_ x, [ thred2_ y ] or [ thred1_ x, [ thred1_ y ] may be [ sr _ x/2, [ sr _ y/2] or [ (sr _ x +1)/2, (sr _ y +1)/2 ].
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values can be determined based on sr _ x and sr _ y.
However, the thresholds thred1_ x, thred1_ y, and thred2_ x, thred2_ y are only examples, and those skilled in the art can easily understand that various values may be determined based on the size _ sr. At this time, those skilled in the art can easily understand that the offsets 1, 2, and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x, and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0 or 1 may be different from the offsets 1, 2, and 3 and the predetermined thresholds thred1_ x, thred1_ y, thred2_ x, and thred2_ y associated with the context model regarding flag information indicating whether the first transform coefficient is greater than 0.
The entropy encoding unit 155 may determine a context model related to flag information indicating whether the first transform coefficient is greater than 2 based on whether the first transform coefficient is a first position transform coefficient among transform coefficients greater than 0 that are scanned in an inverse direction scan order. In other words, the entropy encoding unit 155 may determine the first context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is the first position in the transform coefficients greater than 0 that are scanned in the scanning order of the inverse direction, and determine the second context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is not the first position in the transform coefficients greater than 0 that are scanned in the scanning order of the inverse direction.
However, without being limited thereto, the entropy encoding unit 155 may determine the context model related to flag information indicating whether the first transform coefficient is greater than 2 based on whether the first transform coefficient is the first-position transform coefficient among transform coefficients greater than 1 that are scanned in the scanning order in the reverse direction. In other words, the entropy encoding unit 155 determines the first context model related to flag information indicating whether the first transform coefficient is greater than 1 when the first transform coefficient is the first position in the transform coefficients greater than 1 that are scanned in the scanning order of the inverse direction, and determines the second context model related to flag information indicating whether the first transform coefficient is greater than 2 when the first transform coefficient is not the first position in the transform coefficients greater than 1 that are scanned in the scanning order of the inverse direction. However, without being limited thereto, the context model related to the flag information indicating whether the first transform coefficient is greater than 2 may be determined based on the number of significant transform coefficients whose absolute values are greater than 2 among n (n is a positive integer) transform coefficients previously scanned according to a predetermined scanning order.
When the position of the transform coefficient currently scanned in the scan region is [ SRx, 0] (SRx is an integer, SRx indicates a horizontal-direction coordinate value of a right-side boundary pixel of the scan region with reference to the coordinates of a left-side upper-end corner of the scan region), and the transform coefficients of the positions previously scanned in a predetermined scan order [ SRx, Y ] (Y is an integer greater than 0 and less than or equal to SRy, SRy indicates a vertical-direction coordinate value of a lower-side boundary pixel of the scan region with reference to the coordinates of a left-side upper-end corner of the scan region) are all 0, the entropy encoding unit 155 may not generate the GT0 flag information of the transform coefficient currently scanned.
Likewise, when the position of the transform coefficient currently scanned in the scan region is [0, SRy ] (SRy is an integer, SRy indicates a vertical coordinate value of a lower boundary pixel of the scan region with reference to the coordinate of the left upper end corner of the scan region), and the transform coefficients of the positions [ X, SRy ] (X is an integer greater than 0 and less than or equal to SRx indicating a vertical coordinate value of a right boundary pixel of the scan region with reference to the coordinate of the left upper end corner of the scan region) previously scanned in a predetermined scan order are all 0, the entropy encoding unit 155 may not generate GT0 flag information of the transform coefficient currently scanned.
The entropy encoding unit 155 may determine the maximum number of GT1 flag information of the significant transform coefficient in the current block and generate GT1 flag information in the current block within the determined maximum coefficient of the significant transform coefficient. In other words, when the entropy encoding unit 155 generates the GT1 flag information of the maximum number of significant transform coefficients, the entropy encoding unit 155 may not generate the GT1 flag information of significant transform coefficients any more thereafter.
The entropy encoding unit 155 may determine all the significant transform coefficients other than 0 as the maximum number of GT1 flag information in the current block. Alternatively, the entropy encoding unit 155 may determine the maximum amount of GT1 flag information in the current block by based on the size of the scan area. For example, the entropy encoding unit 155 may determine the maximum number of GT1 flag information, MaxCount _ GT1, based on equation 17 below.
[ EQUATION 17 ]
Figure BDA0002634979820000571
At this time, the sizeSR may represent the size (area) of the quadrangular scanning region, and the sizeSR may be (Sr _ x +1) × (Sr _ y + 1). Sr _ x may represent the horizontal-direction coordinate of the rightmost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ x may represent the horizontal coordinate of the right boundary pixel with reference to the coordinate of the left upper end corner of the scan region. Sr _ y may represent a coordinate in the vertical direction of the lowermost significant transform coefficient pixel with reference to the coordinate of the upper-left corner of the scan area. In other words, Sr _ y may represent the coordinate of the vertical direction of the lower side boundary pixel with reference to the coordinate of the left upper end corner of the scan region. K1 may be the adjustment factor between the size of the scan area and the GT1 flag. For example, K1 may be an integer greater than 1. Th1 may be a predetermined threshold. For example, Th1 may be 16, 8. However, it is not limited thereto. One skilled in the art can easily understand that K1 and Th1 may have various values.
The entropy encoding unit 155 may determine the maximum amount of GT2 flag information in the current block and generate GT2 flag information in the current block within the determined maximum coefficient of the significant transform coefficient. In other words, when the entropy encoding unit 155 generates the GT2 flag information of the maximum number of significant transform coefficients, the entropy encoding unit 155 may not generate the GT2 flag information of significant transform coefficients any more thereafter.
The entropy encoding unit 155 may determine all the significant transform coefficients other than 0 as the maximum number of GT2 flag information in the current block. Alternatively, the entropy encoding unit 155 may determine the maximum amount of GT2 flag information in the current block based on the size of the scan area. For example, the entropy encoding unit 155 may determine the maximum number of GT2 flag information MaxCount _ GT2 based on equation 18 below.
[ EQUATION 18 ]
Figure BDA0002634979820000581
At this time, the sizeSR may represent the size (area) of the quadrangular scanning region, and the sizeSR may be (Sr _ x +1) × (Sr _ y + 1). Sr _ x may represent the horizontal-direction coordinates of the rightmost significant transform coefficient pixel with reference to the coordinates based on the left-upper-end corner of the scan area. In other words, Sr _ x may represent the horizontal coordinate of the right boundary pixel with reference to the coordinate of the left upper end corner of the scan region. Sr _ y may represent the vertical-direction coordinate of the lowermost significant transform coefficient pixel with reference to the left-side upper-end corner of the scan area. In other words, Sr _ y may represent the coordinate of the vertical direction of the lower side boundary pixel with reference to the coordinate of the left upper end corner of the scan region. K2 may be the adjustment factor between the size of the scan area and the GT1 flag. For example, K2 may be an integer greater than 1. Th2 may be a predetermined threshold. For example, Th2 may be 16, 8. However, it is not limited thereto. One skilled in the art can easily understand that K2 and Th2 may have various values.
The entropy encoding unit 155 may generate information on a coefficient group in the current block. The information related to the coefficient group may be flag information indicating whether the coefficient group includes at least one significant transform coefficient. At this time, for the transform coefficients included in the scan area, the entropy encoding unit 155 may determine one coefficient group from every predetermined K (K is an integer) transform coefficients that are scanned in the scan order. That is, one coefficient group may include K transform coefficients. At this time, the scanning order may be a forward direction scanning order in a direction opposite to a predetermined reverse direction scanning order. Here, the predetermined reverse direction scan order may be scanned from a coefficient located at a lower right end among transform coefficients included in the current block to an order of a coefficient located at an upper left end among transform coefficients included in the current block.
Accordingly, the entropy encoding unit 155 may determine the coefficient group by scanning in the positive direction scanning order from the DC coefficient that is a coefficient adjacent to the upper left corner in the current block. At this time, when the number of transform coefficients included in the current block is not an integer multiple of K, the final coefficient group among the coefficient groups in the scanning order according to the positive direction may include a transform coefficient whose number is less than K. However, without being limited thereto, those skilled in the art may easily understand that the entropy encoding unit 155 may determine the coefficient group by scanning according to an inverse direction scanning order from the coefficient at the lower right end among the transform coefficients included in the current block to the coefficient at the upper left end among the transform coefficients included in the current block.
When one coefficient group among coefficient groups scanned in a predetermined scanning order includes only one transform coefficient, the entropy encoding unit 155 may directly generate the GT0 flag information without generating information related to the coefficient group.
The entropy encoding unit 155 may determine whether to conceal the sign of at least one transform coefficient for each coefficient group included in the current block. For example, the entropy encoding unit 155 may determine the sign of concealing one or two transform coefficients for each coefficient group included in the current block according to circumstances.
The entropy encoding unit 155 may scan information on the transform coefficients in the quadrangle scanning area in a predetermined scanning order. The predetermined scan order may include a zigzag scan order in the reverse direction, a diagonal scan order in the reverse direction, and a vertical scan order and a horizontal scan order in the reverse direction. However, the predetermined scan order is not limited to the above-described reverse direction scan order, which can be easily understood by those skilled in the art to include various reverse direction scan orders.
The bitstream generation unit 170 may generate a bitstream including entropy-encoded information. In other words, the bitstream generation unit 170 may generate a bitstream including entropy-encoded information that scans information related to transform coefficients in the entropy encoding unit 160 and is based on the scanned information related to transform coefficients.
The bitstream generation unit 170 may generate a bitstream including information related to coordinates specifying a scanning area for scanning an area of the information related to the transform coefficients.
The video encoding apparatus 150 may include a picture encoding unit (not shown), and the picture encoding unit (not shown) may include an entropy encoding unit 155 and a bitstream generation unit 170. The image encoding unit will be described with reference to 1 f.
Fig. 1d shows a flow diagram of a video encoding method according to various embodiments.
Referring to fig. 1d, in step S150, the video encoding apparatus 150 may obtain transform coefficients of the current block. The current block may be a data unit that may be used in the process of performing encoding/decoding on an image described by referring to fig. 10 to 23. The video encoding apparatus 150 may generate a prediction block of the current block by performing inter prediction or intra prediction, and generate a residual block of the current block based on the original block of the current block and the prediction block of the current block. The video encoding apparatus 150 may generate the transform coefficient of the current block by performing transform and quantization on the residual block of the current block.
In S155 step, the video encoding apparatus 150 may determine the scan regions of all significant transform coefficients included in the current block. At this time, all significant transform coefficients in the current block may be included in the scan area, and the remaining area other than the scan area within the current block may include only 0's that are not significant transform coefficients.
In step S160, the video encoding apparatus 150 may scan information on the transform coefficients in the scan area in a predetermined scan order. The information related to the transform coefficient may include flag information indicating whether the transform coefficient is greater than a predetermined value. At this time, the predetermined value may be at least one of 0, 1, and 2. At least one of remaining level information on an absolute value of the transform coefficient, sign information of the transform coefficient, and binarization parameter information of the remaining level absolute value may be included. The predetermined scan order may include a zigzag scan order in the reverse direction, a diagonal scan order in the reverse direction, and a vertical scan order and a horizontal scan order in the reverse direction. However, the predetermined scan order is not limited to the above-described reverse direction scan order, which can be easily understood by those skilled in the art to include various reverse direction scan orders.
In step S165, the video encoding device 150 may perform binarization based on the information on the scanned transform coefficients to generate binarized information.
In S170 step, the video encoding device 150 may generate entropy-encoded information by performing binary arithmetic encoding on the binarized information. At this time, the video encoding apparatus 150 may perform binary arithmetic encoding using a context model determined by at least one of a size and a shape based on the current block.
In step S175, the video encoding apparatus 150 may generate a bitstream including the entropy-encoded information. Video encoding device 150 may generate a bitstream that includes entropy encoded information that scans information related to transform coefficients in entropy encoding unit 160 and is based on the scanned information related to transform coefficients. Video encoding device 150 may generate a bitstream that includes information related to coordinates that specify a scan area for scanning an area of information related to transform coefficients.
Fig. 1e shows a block diagram of an image decoding unit 6000 according to various embodiments.
The image decoding unit 6000 according to various embodiments performs an operation of encoding image data by an image decoding unit (not shown) of the video decoding apparatus 100.
Referring to fig. 1e, the entropy decoding unit 6150 may parse encoded image data as a decoding object and encoding information required for decoding from the bitstream 6050. The encoded image data is quantized transform coefficients, and the inverse quantization unit 6200 and the inverse transform unit 6250 may restore residual data from the quantized transform coefficients. The entropy decoding unit 6150 of fig. 1e may correspond to the entropy decoding unit 105 of fig. 1 a.
The intra prediction unit 6400 performs intra prediction by block. The inter prediction unit 6350 may perform inter prediction using the block-by-block reference image obtained from the restored picture buffer 6300. The data of the spatial domain of the block of the current picture 6050 may be restored by adding prediction data by block and residual data generated from the intra prediction unit 6400 or the inter prediction unit 6350, and the deblocking unit 6450 and the Sample Adaptive Offset (SAO) performing unit 6500 may output the filtered restored picture 6600 by performing loop filtering on the restored data of the spatial domain. Further, the restored image stored in the restored picture buffer 6300 may be output as a reference image.
In order to perform decoding on image data in a decoding unit (not shown) of the video decoding apparatus 100, the operation of each step of the image decoding unit 6000 according to various embodiments may be performed on each block.
FIG. 1f shows a block diagram of an image encoding unit according to various embodiments.
Image encoding unit 7000 according to various embodiments performs operations through which image data is encoded by an image encoding unit (not shown) of video encoding apparatus 150.
In other words, the intra prediction unit 7200 performs intra prediction on the current image 7050 by block, and the inter prediction unit 7150 may perform inter prediction using the current image 7050 and a reference image obtained from the restored picture buffer 7100 by block.
Residual data may be generated by subtracting prediction data for each block, which is output from the intra prediction unit 7200 or the inter prediction unit 7150, from data for a coded block of the current image 7050, and the transform unit 7250 and the quantization unit 7300 may output transform coefficients quantized by blocks by performing transform and quantization on the residual data. The inverse quantization unit 7450 and the inverse transform unit 7500 may perform inverse quantization and inverse transform on the quantized transform coefficients to restore residual data of a spatial domain. The restored residual data of the spatial domain may be added to prediction data regarding each block output from the intra prediction unit 7200 or the inter prediction unit 7150 to restore data regarding the spatial domain of the block of the current image 7050. The deblocking unit 7550 and the SAO performing unit generate a filtered restored image by performing loop filtering on the restored data of the spatial domain. The generated restored image is stored in the restored picture buffer 7100. The restored image stored in the restored picture buffer 7100 can be used as a reference image for inter prediction of other images. The entropy encoding unit 7350 performs entropy encoding on the quantized transform coefficients, and the entropy-encoded coefficients may be output to the bitstream 7400. Entropy encoding unit 7350 of fig. 1f may correspond to entropy encoding unit 155 of fig. 1 c.
In order to apply the image encoding unit 7000 according to the various embodiments to the video encoding apparatus 150, the operation of each step of the image encoding unit 7000 according to the various embodiments may be performed in blocks.
Hereinafter, a method of scanning a transform coefficient in a block is described in detail on the assumption that "0" and "1" shown in pixels in the current block of fig. 2 and 3a to 3b are values of a significant transform coefficient flag (a flag indicating whether an absolute value of a coefficient is greater than 0).
Fig. 2 shows a schematic diagram for explaining a method of scanning transform coefficients within a block according to an embodiment.
Referring to fig. 2, a current block 200 is a block including a plurality of transform coefficients. The current block 200 is a data unit that performs an inverse transform operation, and may be a block of size M × N (M, N is a positive integer). For example, as shown in fig. 2, the current block 200 may be a block having a size of 16 × 16.
The video decoding apparatus 100 may divide the current block 200 into coefficient groups (or sub-blocks) 205 having a predetermined size. The coefficient group may be a block of size X × Y (X, Y is a positive integer). For example, as shown in fig. 2, the coefficient group 205 may be a block having a size of 4 × 4.
The video decoding apparatus 100 may obtain, from the bitstream, information of coordinates of a pixel 210 of a final significant transform coefficient among all significant transform coefficients scanned in scanning the current block 200 in the positive direction scan order from the transform coefficient located at the upper left end to the transform coefficient located at the lower right end. The information on the coordinates of the pixel 210 of the final significant transformation coefficient may include information on the coordinates of the pixel of the final significant transformation coefficient in the horizontal direction and information on the coordinates of the pixel of the final significant transformation coefficient in the vertical direction.
The video decoding apparatus 100 may obtain the coordinates of the pixel 210 of the final significant transform coefficient based on the information on the coordinates of the pixel 210 of the final significant transform coefficient, and scan the information of the transform coefficients from the significant transform coefficient with respect to the final significant transform coefficient 210 in a predetermined inverse direction scan order 215 based on the coordinates of the pixel 210 of the final significant transform coefficient. For example, as shown in fig. 2, the predetermined reverse direction scan order 215 may be a diagonal scan order of the reverse direction.
The video decoding apparatus 100 may scan the coefficient groups 205 in a predetermined scan order, and may scan each coefficient group 205 in the predetermined scan order. The video decoding apparatus 100 may scan the coefficient groups for information related to the coefficient groups in a predetermined scan order. Information about the coefficient groups may be obtained or derived from the bitstream. The information relating to coefficient groups may be derived to indicate that the first coefficient group and the final coefficient group scanned in the forward (reverse) direction scan order include at least one significant transform coefficient. In other words, the information on the coefficient groups may be excluded from the bit stream for the first coefficient group and the final coefficient group that are scanned in the forward (reverse) direction scanning order.
At this time, the video decoding apparatus 100 may determine the predetermined reverse direction scan order based on at least one of the size of the block and the prediction mode. For example, when the size of the current block is 4 × 4 and the prediction mode of the current block is the intra prediction mode, the video decoding apparatus 100 may determine one of a horizontal scan order, a vertical scan order, or a diagonal scan order as a predetermined reverse direction scan order. Further, when the size of the current block is 8 × 8 and the prediction mode of the current block is the intra prediction mode, the video decoding apparatus 100 may determine one of a horizontal scan order, a vertical scan order, or a diagonal scan order as a predetermined reverse direction scan order.
When the size of the current block is not 4 × 4 or 8 × 8 or the prediction mode of the current block is not the inter prediction mode, the video decoding apparatus 100 may determine the diagonal scan order in the reverse direction as the predetermined scan order.
When the information on the coefficient group 205 indicates that at least one significant coefficient is included in the coefficient group 205, the video decoding apparatus 100 may scan the information on the significant coefficients in the coefficient group 205 in a predetermined scan order 215 in the reverse direction.
In addition, the video decoding apparatus 100 may determine whether to conceal a sign (sign) of at least one of the significant transform coefficients included in each coefficient group 205.
Fig. 3a shows a schematic diagram for explaining a method of scanning transform coefficients within a block, according to another embodiment.
Referring to fig. 3a, a current block 300 is a block including a plurality of transform coefficients. The current block 300 is a data unit that performs an inverse transform operation, and may be a block of size M × N (M, N is a positive integer). For example, as shown in fig. 3, the current block 300 may be a block having a size of 16 × 16.
Referring to fig. 3a, the video decoding apparatus 100 may determine a quadrangular scanning area 340 including all significant transform coefficients present in the current block 300. At this time, the quadrangular scanning area 340 may be determined by the coordinates of the pixels 330 located at the right lower end of the quadrangular scanning area 340. The horizontal-direction coordinates of the pixel 330 located at the right-lower end of the scan area 340 may be the horizontal-direction coordinates of the pixel 320 of the rightmost significant transform coefficient among all the significant transform coefficients located in the current block 300. The vertical-direction coordinates of the pixel 330 located at the right-lower end of the scan area 340 may be the vertical-direction coordinates of the lowest significant transform coefficient pixel 310 among all the significant transform coefficients located in the current block 300. The information on the pixel 330 may include information on a corner position of the upper left side of the pixel 330. However, without being limited thereto, the information on the pixel 330 may include information on the position of the right lower end corner of the pixel 330.
The video decoding apparatus 100 may receive information on coordinates of the pixels 330 for specifying the quadrangular scanning area 340 from the bitstream, and may determine the quadrangular scanning area 340 based on the received information on the pixels 330. The video decoding apparatus 100 may scan the information on the transform coefficients from the number of pictures 330 to the number of pictures 345 located at the left upper end of the quadrangular scanning area 340 in a predetermined reverse direction scanning order. At this time, every K (K is a positive integer) scan coefficients scanned in the positive direction scan order from the transform coefficient located at the upper left end of the quadrangular scan area 340 may be determined as a coefficient group. However, without being limited thereto, it can be easily understood by those skilled in the art that every K (K is a positive integer) scan coefficients scanned in the inverse direction scan order from the transform coefficient located at the lower right end of the quadrangular scan area 340 can be determined as a coefficient group. Details of the coefficient groups will be described later with reference to fig. 3 b.
The video decoding apparatus 100 may determine that a sign for at least one significant transform coefficient is concealed for each coefficient group, and may restore a sign (sign) for the concealed at least one transform coefficient. The operation of restoring the hidden symbol performed for each coefficient group will be described later with reference to fig. 3B.
Fig. 3b shows a schematic diagram for explaining the operation of determining coefficient groups (sub-blocks) in a block and the operation performed in accordance with the coefficient groups according to an embodiment.
The video decoding apparatus 100 may determine every K (K is a positive integer) transform coefficient pixels in a predetermined scan order in the positive direction in the current block 350 as a coefficient group. Video decoding device 100 may determine a coefficient group that includes K transform coefficient pixels. For example, as shown in fig. 3B, the video decoding apparatus 1000 may determine the coefficient group 360 every 16 pixels.
The video decoding apparatus 100 may determine that a sign (sign) for at least one significant transform coefficient is concealed for each coefficient group 360, and may determine that a sign (sign) for at least one significant transform coefficient is concealed for each coefficient group 360. For example, video decoding apparatus 100 may determine that a sign (sign) for at least one significant transform coefficient is hidden for a current coefficient group based on a distance of previously decoded significant transform coefficients in the current coefficient group. Specifically, the video decoding apparatus 100 may determine that the sign for at least one significant transform coefficient is hidden for the current coefficient group based on a distance between the first significant transform coefficient and the final significant transform coefficient that are scanned in a predetermined inverse direction scan order. At this time, the distance may be a difference between positions of coefficients scanned in the reverse direction scanning order.
For example, when a distance between an initial significant transform coefficient and a final significant transform coefficient scanned in a predetermined inverse direction scan order is greater than a predetermined value, the video decoding apparatus 100 may determine that a sign (sign) for at least one significant transform coefficient is hidden for a current coefficient group. At this time, the predetermined value may be various integer values. For example, the predetermined value may be 3.
When it is determined that at least one symbol for at least one significant transform coefficient is hidden for the current coefficient group, the video decoding apparatus 100 may recover the hidden symbol for the at least one significant transform coefficient in the current coefficient group without obtaining information about the symbol from the bitstream for the current coefficient group. For example, when parity sum for the level of a significant transform coefficient in the current coefficient group is odd or even, the video decoding apparatus 100 may determine the sign of at least one significant transform coefficient to be 0 or 1. At this time, the sign of the restored significant transform coefficient may include a sign related to the last significant transform coefficient scanned in the inverse direction scan order. However, without being limited thereto, those skilled in the art can easily understand that the symbols located at predetermined positions in the coefficient group can be restored in a predetermined scan order.
The video decoding apparatus 100 may obtain information on the corresponding coefficient group from the bitstream in an inverse direction predetermined scanning order, and may scan the information on the transform coefficients in the corresponding coefficient group when the information on the corresponding coefficient group indicates that at least one transform coefficient is included in the coefficient group. When the information on the corresponding coefficient group indicates that only the transform coefficient having a value of 0 is included in the coefficient group, all the transform coefficients in the corresponding coefficient group may be determined to be 0.
In addition, when the number of transform coefficients included in the quadrangular scanning area in the current block 300 is not an integer multiple of K, the number of transform coefficient pixels may be less than K in determining the coefficient group located at the last in the scanning order in the positive direction. In this case, the video decoding apparatus 100 may determine the coefficient group 365 including the transform coefficient pixels whose number is smaller than K. For example, as shown in fig. 3b, video decoding apparatus 100 may determine coefficient group 365 that includes two transform coefficients.
The video decoding apparatus 100 may obtain information about the coefficient groups 355 and 360 from the bitstream. Here, the information related to the coefficient groups 355 and 360 may be flag information (significant coefficient group flag information) indicating whether at least one of the transform coefficients included in the coefficient groups 355 and 360 is a significant transform coefficient or whether only a transform coefficient as 0 is included in the coefficient groups 355 and 360.
In addition, when determining a coefficient group including only one transform coefficient, the video decoding apparatus 100 may obtain information related to one transform coefficient without obtaining information related to the coefficient group (e.g., significant coefficient group flag information) from a bitstream.
The video decoding apparatus 100 may determine a context model for performing binary arithmetic decoding on information related to a current coefficient group based on information related to the coefficient group of a coefficient group scanned before the current coefficient group in a predetermined scanning order 355 in the reverse direction.
Fig. 4 shows a schematic diagram for explaining a process of determining a context model for performing context-based binary arithmetic coding on information related to transform coefficients according to an embodiment.
Referring to fig. 4, the video decoding apparatus 100 may determine a context model of information related to a transform coefficient pixel 405 currently being scanned by based on a surrounding transform coefficient image number 410. In fig. 4, the surrounding transform coefficient pixel count 405 may be five pixels existing at predetermined positions on the right side or the lower side of the transform coefficient pixel 405 currently being scanned. However, without being limited thereto, those skilled in the art can easily understand that the surrounding transform coefficient pixel count 405 may be n (n is a positive integer) pixels existing at predetermined positions on the right side or lower side of the transform coefficient pixel 405 currently being scanned.
For example, the video decoding apparatus 100 may determine the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 405 currently being scanned is greater than 0, based on the number of coefficient pixels whose level absolute value is greater than 0 among the surrounding transform coefficient pixel numbers 410.
Further, the video decoding apparatus 100 may determine a context model of flag information indicating whether the level absolute value of the transform coefficient pixel 405 currently being scanned is greater than 1 based on the number of coefficient pixels whose level absolute value is greater than 1 among the surrounding transform coefficient pixel numbers 410.
Further, the video decoding apparatus 100 may determine the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 405 currently being scanned is greater than 2, by determining the number of coefficient pixels whose level absolute value is greater than 2 among the surrounding transform coefficient pixel numbers 410.
The video decoding apparatus 100 may determine the context model of the flag information indicating whether the level absolute value of the currently scanned transform coefficient pixel 405 is greater than N (N is an integer greater than 2) based on the number of coefficient pixels whose level absolute value is greater than N in the surrounding transform coefficient pixel number 410.
The video decoding apparatus 100 may determine a parameter for performing binarization on the remaining level absolute value of the transform coefficient pixel 405 currently being scanned by determining a sum of the level absolute values based on the surrounding transform coefficient image numbers 410. At this time, the binarization parameter may be a rice parameter.
Fig. 5 shows a schematic diagram for explaining a process of determining a context model for performing context-based binary arithmetic coding on information related to transform coefficients according to an embodiment.
Referring to fig. 5, the video decoding apparatus 100 may determine a context model of information about a transform coefficient pixel 505 currently being scanned based on a transform coefficient pixel 510 previously scanned in a predetermined inverse direction scan order. As shown in fig. 5, the transform coefficient pixels 510 may be five pixels that were previously scanned in a predetermined inverse direction scan order 515 compared to the transform coefficient pixels 505 that are currently scanned. However, without being limited thereto, those skilled in the art can readily appreciate that the transform coefficient pixel 510 may be n pixels (n is a positive integer) previously scanned in a predetermined inverse direction scan order 515. As shown in fig. 5, the predetermined reverse direction scan order 515 may be a zigzag scan order of the reverse direction, but is not limited thereto, and a person skilled in the art can easily understand that the predetermined reverse direction scan order 515 may include a horizontal scan order, a vertical scan order, a diagonal scan order, and the like. In particular, the predetermined reverse direction scanning order may be determined as one of the plurality of scanning orders based on the magnitude of the coordinate values in the horizontal direction and the magnitude of the coordinate values in the vertical direction of the designated scanning area.
For example, the video decoding apparatus 100 may determine the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 505 currently being scanned is greater than 0, based on the number of coefficient pixels whose level absolute value is greater than 0 among the surrounding transform coefficient pixels 510.
Further, the video decoding apparatus 100 may determine the context model of the flag information indicating whether the level absolute value of the currently scanned transform coefficient pixel 505 is greater than 1 based on the number of coefficient pixels whose level absolute value is greater than 1 in the surrounding transform coefficient pixel number 510.
The video decoding apparatus 100 may determine the context model of the flag information indicating whether the level absolute value of the transform coefficient pixel 505 currently being scanned is greater than 2 based on the number of coefficient pixels whose level absolute value is greater than 2 among the surrounding transform coefficient pixels 510.
The video decoding apparatus 100 may determine a context model of flag information indicating whether the level absolute value of the transform coefficient pixel 505 currently being scanned is greater than N (N is an integer greater than 2) based on the number of coefficient pixels whose level absolute value is greater than N in the surrounding transform coefficient pixel number 510.
The video decoding apparatus 100 may determine a parameter for performing binarization on the remaining level absolute values of the transform coefficient pixels 505 currently being scanned, based on the sum of the level absolute values of the surrounding transform coefficient pixels 510. At this time, the binarization parameter may be a rice parameter.
Fig. 6a shows a schematic diagram for explaining a zig-zag scanning order for scanning information about significant transform coefficients in a block, according to an embodiment.
Referring to fig. 6a, the video decoding apparatus 100 may scan, in a zigzag scanning order 602, transform coefficient pixels located at the lower right end of the current block 600 to transform coefficient pixels located at the upper left end of the current block 600 to scan information related to transform coefficients of the current block 600.
Specifically, in the zigzag scanning order 602, the video decoding apparatus 100 scans the left-side pixel 606 of the pixel 604 after scanning the transform coefficient pixel 604 at the lower right end, and scans the pixel 608 in the diagonal direction at the upper right end thereof after scanning the number of pixels 606. The video decoding device 100 scans the number of pixels 610 adjacent to the upper side of the number of pixels 608. The video decoding apparatus 100 scans the number of pixels 612 in the diagonal direction located at the right lower end of the pixel. The video decoding device 100 scans the number of pixels 614, which are located on the left side of the pixels adjacent to the boundary of the current block 600 among the pixels 612. In a similar manner, the video decoding apparatus 100 may scan information about the remaining transform coefficient pixels in the zig-zag scan order 602.
Since the zig-zag scan order 602 according to an embodiment scans the left direction image number 606 next to it in the horizontal direction after the image number 604, the zig-zag scan order 602 may be referred to as a horizontal-first zig-zag scan order.
Fig. 6b shows a schematic diagram for explaining a vertical prioritized zig-zag scanning order for scanning information relating to transform coefficients in a block, according to another embodiment.
Referring to fig. 6b, the video decoding apparatus 100 may scan the transform coefficient pixels located at the lower right end of the current block 600 to the transform coefficient pixels located at the upper left end of the current block 600 in the zigzag scanning order 616 to scan information related to the transform coefficients of the current block 600.
Specifically, in the zigzag scanning order 616, the video decoding apparatus 100 scans the pixel 620 on the upper side of the pixel 618 after scanning the transform coefficient pixel 618 on the lower right side, and scans the pixel 622 in the diagonal direction on the lower left side thereof after scanning the number of pixels 620. Video decoding device 100 scans pixel 624, which is adjacent to the left side of pixel 622. The video decoding apparatus 100 scans the number of pixels 626 in the diagonal direction located at the upper right end of the pixel. The video decoding apparatus 100 scans a number of images 628 located at an upper side of pixels adjacent to a boundary of the current block 600 among the pixels 626. In a similar manner, the video decoding apparatus 100 may scan information regarding the remaining transform coefficient pixels in a zig-zag scan order 616.
Since the zig-zag scan order 616 according to one embodiment scans the upper side direction image number 620 located immediately in the vertical direction after the image number 618, the zig-zag scan order 616 may be referred to as a vertical-first zig-zag scan order.
Fig. 6c shows a schematic diagram for explaining a horizontal scanning order for scanning information on transform coefficients in a block according to an embodiment.
Referring to fig. 6c, the video decoding apparatus 100 may scan, in the horizontal scanning order 630, from a transform coefficient pixel at the lower right end of the current block 600 to a transform coefficient pixel at the upper left end of the current block 600 to scan information related to a transform coefficient of the current block 600.
Specifically, in the horizontal scanning order 630, the video decoding apparatus 100 scans the number of pictures 634 located in the left direction as its horizontal direction in sequence after scanning the number of transform coefficient pictures 632 at the lower right end, and scans the rightmost number of pictures 636 located one line immediately above it after scanning pixels adjacent to the left boundary of the current block 600 among the pixels 634. The video decoding apparatus 100 scans the number of images 638 located in the left direction as the horizontal direction in the same manner as the pixels 634 in the previous line are scanned. In a similar manner, video decoding apparatus 100 may scan information about the remaining transform coefficient pixels in horizontal scan order 630.
Fig. 6d shows a schematic diagram for explaining a vertical scanning order for scanning information related to transform coefficients in a block according to an embodiment.
Referring to fig. 6d, the video decoding apparatus 100 may scan, in the vertical scanning order 640, from a transform coefficient pixel located at the lower right end of the current block 600 to a transform coefficient pixel located at the upper left end of the current block 600 to scan information related to a transform coefficient of the current block 600.
Specifically, in the vertical scanning order 640, the video decoding apparatus 100 sequentially scans the number of pixels 644 located in the upper side direction as its vertical direction after scanning the number of transform coefficient pixels 642 at the right lower end, and scans the lowermost number of pixels 646 located in the column immediately to the left thereof after scanning the pixels adjacent to the upper side boundary of the current block 600 among the pixels 644. The video decoding apparatus 100 scans the number of pictures 648 located in the upper direction as the vertical direction in the same manner as the pixels 644 in the previous column. In a similar manner, in vertical scan order 640, video decoding apparatus 100 may scan information about the remaining transform coefficient pixels.
Fig. 6e shows a schematic diagram for explaining a diagonal scanning order for scanning information about transform coefficients in a block according to an embodiment.
Referring to fig. 6e, the video decoding apparatus 100 may scan from a transform coefficient pixel located at the lower right end of the current block 600 to a transform coefficient pixel located at the upper left end of the current block 600 according to the diagonal scan order 650 to scan information regarding the transform coefficients of the current block 600.
Specifically, according to the diagonal scan order 650, the video decoding apparatus 100 scans the pixel 654 located on the upper side of the pixel 652 after scanning the transform coefficient pixel 652 on the lower right end, and scans the pixel 656 located on the diagonal direction on the lower left end thereof after scanning the number of pixels 654. The video decoding device 100 scans the pixel 658 adjacent to the upper side of the pixel 654. The video decoding apparatus 100 scans the number of pixels 660 in the diagonal direction located at the left lower end of the pixel 658. In a similar manner, video decoding apparatus 100 may scan information about the remaining transform coefficient pixels in diagonal scan order 650.
With reference to fig. 6a to 6e, various scanning orders for scanning information relating to significant transform coefficients within a block have been described. The scanning order described with reference to fig. 6a to 6e is not limited to the scanning order in the reverse direction, and a person skilled in the art can easily understand the scanning order in the forward direction of sequential scanning opposite to the scanning order in the reverse direction.
Fig. 7a shows a schematic diagram for explaining a process of changing a scanning area by interchanging (swap) coordinates of a horizontal direction and a vertical direction of transform coefficient pixels in the scanning area according to an embodiment.
Referring to FIG. 7a, the current block 700 may be a rectangle having a width greater than a height.
The video decoding apparatus 100 may obtain a flag indicating that an operation of interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the transform coefficient pixels to be included in the current block 700 with each other is activated. When the flag indicates that an operation of interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the transform coefficient pixels included in the current block 700 with each other is activated, the video decoding apparatus 100 may determine whether the width of the current block 700 is greater than the height.
When the width of the current block is greater than the height, the video decoding device 100 may determine the interchanged block 710 by interchanging the width and the height of the current block with each other.
In other words, the video decoding apparatus 100 may determine the pixel position of the transform coefficient included in the interchanged block 710 by interchanging the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block 700 with each other.
The video decoding apparatus 100 can obtain information on coordinates for specifying the quadrangular scanning area 705 including all the significant transform coefficients from the bitstream. Here, the horizontal-direction coordinates for specifying the coordinates of the quadrangular scanning area 705 may be the horizontal-direction coordinates of the pixel of the significant transform coefficient located on the rightmost side among all the significant transform coefficients in the current block. The vertical-direction coordinates for specifying the coordinates of the quadrangular scanning area 705 may be the vertical-direction coordinates of the pixel of the significant transform coefficient located at the lowermost side among all the significant transform coefficients in the current block. The information on the coordinates for specifying the quadrangular scanning area 705 may include information on the horizontal-direction coordinate value of the rightmost significant transform coefficient pixel among all significant transform coefficients in the current block and information on the vertical-direction coordinate value of the lowermost significant transform coefficient pixel among all significant transform coefficients in the current block. Alternatively, the information on the coordinates for specifying the quadrangular scanning area 705 may include information on one of the coordinate values in the horizontal direction of the significant transform coefficient pixel located on the rightmost side among all the significant transform coefficients and the coordinate value in the vertical direction of the significant transform coefficient pixel located on the lowermost side among all the significant transform coefficients of the current block, and information indicating the difference between the one coordinate value and the other coordinate value.
When the width and the height of the current block are different from each other, the video decoding apparatus 100 can obtain flag information (hereinafter referred to as delta flag (delta flag) information) indicating whether information on coordinates for specifying the quadrangular scanning area 705 includes information indicating a difference between coordinate values in the horizontal direction and coordinate values in the vertical direction for specifying the quadrangular scanning area 705, from the bitstream. The video decoding apparatus 100 can obtain, from the bitstream, information indicating one of the coordinate values for specifying the horizontal direction and the vertical direction of the quadrangular scanning area 705 and information indicating the difference between the one coordinate value and the other coordinate value based on the incremental flag information.
The video decoding apparatus 100 can obtain the coordinates for specifying the quadrangular scanning area 705 including all the significant transform coefficients based on the information on the coordinates for specifying the quadrangular scanning area 705 obtained from the bitstream. At this time, the coordinates for specifying the quadrangular scanning area 705 obtained by the video decoding apparatus 100 are the coordinates for specifying the quadrangular scanning area 705 in the current block 700, and by interchanging the coordinate values in the horizontal direction and the coordinate values in the vertical direction for specifying the coordinates of the quadrangular scanning area 705 with each other, the video decoding apparatus 100 can obtain the coordinate values for specifying the quadrangular scanning area 715 of the interchanged block 710.
The video decoding apparatus 100 may scan information related to transform coefficients in a predetermined scan order based on the quadrangular scan area 715 of the interchanged block 710. At this time, the predetermined scan order may be a scan order corresponding to a predetermined scan order with respect to the current block 700, and is a scan order based on coordinate values in which horizontal direction coordinate values and vertical direction coordinate values of transform coefficient pixels, which are sequentially exchanged with each other in the predetermined scan order with respect to the current block 700, are exchanged with each other. For example, when the coordinate values of the transform coefficient pixels scanned in the predetermined scan order for the current block 700 are (4,4) - > (3,4) - > (4,3) - >.
The video decoding apparatus 100 may perform binary arithmetic decoding on information related to the transform coefficients scanned in the interchanged block 710 based on a predetermined context model, and may obtain the transform coefficients of the interchanged block 710 by inverse binarization. The video decoding apparatus 100 may obtain the transform coefficient of the current block 700 by interchanging the coordinate value of the horizontal direction and the coordinate value of the vertical direction of the interchanged transform coefficient of the block 710 with each other.
When the width of the current block is greater than the height, the video decoding apparatus 100 may perform entropy decoding on information related to the scanned transform coefficient by interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the transform coefficient pixels included in the current block with each other and scanning the information related to the transform coefficient in the interchanged block 710, so that entropy decoding may be always performed on information related to the transform coefficient of a block in which the height of the current block is greater than or equal to the width. Accordingly, a separate context model may not be used for a case where the width of the current block is greater than the height, but only a context model for a block where the height of the current block is greater than or equal to the width may be used to reduce complexity of entropy decoding.
The content of the delta flag information obtained by the video decoding apparatus 100 when the width and the height of the current block are different has been described above, but, without being limited thereto, it can be easily understood by those skilled in the art that, when the current block has different widths and heights, the video encoding apparatus 150 and the video decoding apparatus 100 can obtain information indicating the difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction of the transform coefficient for specifying the quadrangular scanning area 715 from the bitstream without obtaining the delta flag information.
However, it is not limited thereto. Those skilled in the art can easily understand that the video decoding apparatus 100 can obtain information indicating a difference between coordinate values in a horizontal direction and coordinate values in a vertical direction of a transform coefficient regardless of whether the width and height of the current block are the same or different without generating delta flag information.
It has been described hereinabove that the video encoding apparatus 150 generates the interchange flag, and the video decoding apparatus 100 determines whether to interchange the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block with each other based on the flag indicating activation of the operation of interchanging the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block with each other, but, without being limited thereto, the video decoding apparatus 100 may always interchange the horizontal direction coordinates and the vertical direction coordinates with each other when the width of the current block is greater than the height, as can be readily understood by those skilled in the art.
It has been described hereinabove that the video decoding apparatus 100 exchanges the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block with each other when the width of the current block is greater than the height, otherwise, they are not exchanged, but those skilled in the art can easily understand that the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block can be exchanged with each other when the height of the current block is greater than the width, on the contrary, instead.
The contents in which the video decoding apparatus 100 scans information related to the transform coefficient by interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the transform coefficient of the current block and interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the transform coefficient of the scan region and performs entropy decoding on the scanned information related to the transform coefficient to obtain the transform coefficient in the current block and interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the obtained transform coefficient have been described above, but, not limited thereto, those skilled in the art can easily understand that the video decoding apparatus 100 can interchange only the horizontal-direction coordinate and the vertical-direction coordinate of the transform coefficient of the scan region and perform scanning and entropy decoding on the information related to the transform coefficient in the scan region to obtain the transform coefficient in the scan region without interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the current block, and obtains the transform coefficient in the current block by interchanging the coordinates in the horizontal direction and the coordinates in the vertical direction of the transform coefficient in the scan area.
The video decoding apparatus 100 has been described hereinabove as a content in which the information on the transform coefficient is scanned by interchanging the coordinates in the horizontal direction and the coordinates in the vertical direction of the transform coefficient of the current block and interchanging the coordinates in the horizontal direction and the coordinates in the vertical direction of the transform coefficient of the scan area, and the entropy decoding is performed on the scanned information on the transform coefficient to obtain the transform coefficient in the current block, and the coordinates in the horizontal direction and the coordinates in the vertical direction of the obtained transform coefficient are interchanged, but, not limited thereto, it may be easily understood by those skilled in the art that only the coordinates in the horizontal direction and the coordinates in the vertical direction of the transform coefficient of the scan area are interchanged with each other and the decoding is performed, and the transform coefficient in the scan area is obtained by performing the scanning and the entropy decoding on the information on the transform coefficient in the scan area, and obtains transform coefficients in the current block.
In other words, when the width of the current block is greater than the height, the video encoding apparatus 150 may interchange the horizontal direction coordinates and the vertical direction coordinates of the transform coefficients of the scan area of the current block with each other and transmit information indicating the same. At this time, since the width of the scan area is generally greater than the height when the width of the current block is greater than the height, the horizontal-direction coordinates of the transform coefficients specifying the scan area are greater than the vertical-direction coordinates, and when the coordinates are interchanged with each other, the vertical-direction coordinates of the interchanged transform coefficients are smaller than the horizontal-direction coordinates of the interchanged transform coefficients. Accordingly, the number of bits can be reduced by transmitting information on the coordinate values in the horizontal direction of the interchanged transform coefficients and difference information between the coordinate values in the horizontal direction of the interchanged transform coefficients and the coordinate values in the vertical direction of the interchanged transform coefficients. However, when the height of the scan area is greater than the width in the case where the width of the current block is greater than the height, the video encoding device 150 may transmit the coordinate value information of the horizontal direction of the interchanged transform coefficient and the coordinate value information of the horizontal direction and the interchanged vertical direction as they are. That is, the difference information may not be transmitted. This is because the horizontal coordinate values of the interchanged transform coefficients are larger than the vertical coordinate values of the interchanged transform coefficients.
Video encoding device 150 may send a flag together indicating whether to send difference information. When the width of the current block is greater than the height, the video decoding apparatus 100 may determine to interchange the horizontal direction coordinate values and the vertical direction coordinate values of the transform coefficients specifying the scan area with each other, and obtain a flag from the bitstream, and may obtain information on the horizontal direction coordinate values of the interchanged transform coefficients and difference information on the horizontal direction coordinate values and the interchanged vertical direction coordinate values of the interchanged transform coefficients when the value of the flag is 1 (indicating that difference information is transmitted), and may obtain the coordinate values specifying the interchanged scan area based on the difference information.
When the value of the flag is 0 (indicating that no difference information is transmitted), information on the coordinate values in the horizontal direction of the interchanged transform coefficients and information on the coordinate values in the vertical direction of the interchanged transform coefficients may be obtained, and the coordinate values specifying the interchanged scanning area are obtained based on the obtained information.
The video decoding apparatus 100 can specify the final scanning area and scan information of the transform coefficients in the scanning area by interchanging the obtained coordinate values of the transform coefficients in the horizontal direction and the coordinate values of the vertical direction with each other.
However, it is not limited to the case where the width of the current block is greater than the height, and even when the height of the current block is greater than the width, those skilled in the art can easily understand that similar operations can be performed.
Fig. 7b shows a schematic diagram for explaining a process of changing a scanning area by interchanging (swap) coordinates of a horizontal direction and a vertical direction of transform coefficient pixels in a quadrangular scanning area according to another embodiment.
Referring to FIG. 7b, the current block 720 may be a rectangle having a width greater than a height.
The video decoding apparatus 100 may obtain a flag indicating that an operation of interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the transform coefficient pixels included in the current block 720 with each other is activated. When the flag indicates that an operation of interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the transform coefficient pixels included in the current block 720 with each other is activated, the video decoding device 100 may determine whether the width of the current block 720 is greater than the height.
When the width of the current block is greater than the height, the video decoding apparatus 100 may determine a swapped (swapped) block 730 by swapping the width and the height of the current block with each other.
In other words, the video decoding apparatus 100 may determine the pixel position of the transform coefficient included in the interchanged block 730 by interchanging the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block 720 with each other.
The video decoding apparatus 100 can obtain information on coordinates for specifying the scanning area 725 including all significant transform coefficients from the bitstream. Here, the coordinates for specifying the scanning area 725 may be the coordinates in the horizontal direction and the vertical direction of the final significant transform coefficient pixel scanned in the predetermined positive direction scanning order. The information on the coordinates for specifying the scanning area 725 may include information on the coordinates in the horizontal direction and information on the coordinates values in the vertical direction of the last significant transform coefficient pixel 725. Alternatively, the information on the coordinates for specifying the scanning region 725 may include information on one coordinate value of the horizontal direction coordinates and the vertical direction coordinates of the last significant transform coefficient pixel and information indicating a difference between the coordinate value and another coordinate value.
When the width and the height of the current block are different from each other, the video decoding apparatus 100 may obtain flag information (hereinafter referred to as delta flag information) indicating whether the information on the coordinates for specifying the scan region 725 includes information indicating a difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction for specifying the scan region 725, from the bitstream. The video decoding apparatus 100 can obtain, from the bitstream, information indicating one coordinate value of the coordinate values in the horizontal direction and the coordinate values in the vertical direction for specifying the transform coefficient of the scanning region 725 and information indicating the difference between the one coordinate value and the other coordinate value, based on the increment flag information.
The video decoding apparatus 100 can obtain the coordinates for specifying the scanning region 725 based on the information on the coordinates for specifying the scanning region 725 including all the significant transform coefficients obtained from the bitstream. At this time, the coordinates of the transform coefficient for specifying the scan region 725 obtained by the video decoding apparatus 100 are the coordinates for specifying the scan region 725 in the current block 720, and by interchanging the coordinate values of the horizontal direction and the vertical direction for specifying the coordinates of the scan region 725 with each other, the video decoding apparatus 100 can obtain the coordinate values of the transform coefficient for specifying the scan region 725 of the interchanged block 730.
The video decoding apparatus 100 may scan the information related to the transform coefficients in a predetermined scan order based on the scan area 735 of the interchanged block 730. At this time, the predetermined scan order may be a scan order according to coordinate values that are interchanged with each other in the horizontal direction and the vertical direction of the transform coefficient pixels scanned in a scan order corresponding to the predetermined scan order for the current block 720. For example, when the coordinate values of the transform coefficient pixels scanned in the predetermined scan order with respect to the current block 720 are (4,4) - > (3,4) - > (4,3) - > …, the coordinate values of the transform coefficient pixels scanned in the predetermined scan order of the interchanged block 730 may be (4,4) - > (4,3) - > (3,4) - > ….
The video decoding apparatus 100 may obtain the transform coefficients of the interchanged block 730 by performing binary arithmetic decoding and inverse binarization on information on the transform coefficients scanned in the interchanged block 730 based on a predetermined context model. The video decoding apparatus 100 may obtain the transform coefficient of the current block 720 by interchanging the horizontal direction coordinate value and the vertical direction coordinate value of the interchanged transform coefficient of the block 730 with each other.
When the width of the current block is greater than the height, the video decoding apparatus 100 may perform entropy decoding on the scanned information on the transform coefficient by interchanging the horizontal-direction coordinates and the vertical-direction coordinates of the transform coefficient pixels included in the current block with each other and scanning the information on the transform coefficient in the interchanged block 710, thereby always performing entropy decoding on the information on the transform coefficient on the block in which the height of the current block is greater than or equal to the width. Accordingly, it is possible to reduce complexity of entropy decoding without using a separate context model for the case where the width of the current block is greater than the height, and only using a context model for a block where the height of the current block is greater than or equal to the width.
The content of the delta flag information obtained by the video decoding apparatus 100 when the width and height of the current block 700 are different has been described above, but, without being limited thereto, it can be easily understood by those skilled in the art that when the current block has different widths and heights, the video encoding apparatus 150 and the video decoding apparatus 100 can obtain information indicating the difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction of the transform coefficients for specifying the scan region 720 from the bitstream without obtaining the delta flag information.
However, without being limited thereto, those skilled in the art can easily understand that the video decoding apparatus 100 may obtain information indicating a difference between coordinate values in a horizontal direction and coordinate values in a vertical direction of transform coefficients, regardless of whether the width and height of the current block 700 are the same or different, without generating delta flag information.
It has been described hereinabove that the video encoding apparatus 150 generates the interchange flag, and the video decoding apparatus 150 determines whether to interchange the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block with each other based on the flag indicating activation of the operation of interchanging the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block with each other, but, without being limited thereto, the video decoding apparatus 100 may always interchange the horizontal direction coordinates and the vertical direction coordinates of the transform coefficients with each other when the width of the current block is greater than the height, as can be readily understood by those skilled in the art.
It has been described hereinabove that the video decoding apparatus 100 interchanges (swap) the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block with each other when the width of the current block is greater than the height, otherwise, the contents are not interchanged, but, not limited thereto, those skilled in the art can easily understand that, on the contrary, the horizontal direction coordinates and the vertical direction coordinates of the transform coefficient pixels included in the current block can be interchanged with each other when the height of the current block is greater than the width.
The contents in which the video decoding apparatus 100 scans information related to the transform coefficient by interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the transform coefficient of the current block and interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the transform coefficient of the scan region and performs entropy decoding on the scanned information related to the transform coefficient to obtain the transform coefficient in the current block and interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the obtained transform coefficient have been described above, but, not limited thereto, those skilled in the art can easily understand that the video decoding apparatus 100 can obtain the transform coefficient in the scan region by interchanging only the horizontal-direction coordinate and the vertical-direction coordinate of the transform coefficient of the scan region and performing scanning and entropy decoding on the information related to the transform coefficient in the scan region without interchanging the horizontal-direction coordinate and the vertical-direction coordinate of the current block, and obtains the transform coefficient in the current block by interchanging the coordinates in the horizontal direction and the coordinates in the vertical direction of the transform coefficient in the scan area.
It has been described above that the video decoding apparatus 100 scans information related to transform coefficients by interchanging coordinates of a horizontal direction and coordinates of a vertical direction of the transform coefficients of a current block and interchanging coordinates of a horizontal direction and coordinates of a vertical direction of the transform coefficients of a scan region, and performs entropy decoding on the scanned information related to transform coefficients to obtain transform coefficients in the current block, and interchanges the coordinates of the horizontal direction and the coordinates of the vertical direction of the obtained transform coefficients, but, not limited thereto, the video decoding apparatus 100 may interchange only the coordinates of the horizontal direction and the coordinates of the vertical direction of the transform coefficients of the scan region with each other and perform decoding thereon without interchanging the coordinates of the horizontal direction and the coordinates of the vertical direction of the transform coefficients, and obtain transform coefficients in the scan region by performing scanning and entropy decoding on the information related to transform coefficients in the scan region And obtains transform coefficients in the current block.
In other words, when the width of the current block is greater than the height, the video encoding apparatus 150 may interchange the horizontal direction coordinates and the vertical direction coordinates of the transform coefficients of the scan area of the current block with each other and transmit information indicating the same. At this time, in general, when the width of the current block is greater than the height, the width of the scan area is greater than the height, and the coordinates in the horizontal direction of the transform coefficient specifying the scan area are greater than the coordinates in the vertical direction, and when the coordinates are interchanged with each other, the coordinates in the vertical direction of the interchanged transform coefficient are smaller than the coordinates in the horizontal direction of the interchanged transform coefficient. Accordingly, the number of bits can be reduced by transmitting information on the interchanged horizontal direction coordinate values and difference information on the interchanged horizontal direction coordinate values and the interchanged vertical direction coordinate values. However, when the height of the scan area is greater than the width in the case where the width of the current block is greater than the height, the video encoding device 150 may transmit the coordinate value information of the horizontal direction of the interchanged transform coefficient and the coordinate value information of the vertical direction of the interchanged transform coefficient as they are. That is, the difference information may not be transmitted. This is because the horizontal coordinate values of the interchanged transform coefficients are larger than the vertical coordinate values of the interchanged transform coefficients.
Video encoding device 150 may send a flag together indicating whether to send difference information. When the width of the current block is greater than the height, the video decoding apparatus 100 may determine to interchange the horizontal direction coordinate values and the vertical direction coordinate values of the transform coefficients specifying the scan area with each other, and obtain a flag from the bitstream, and may obtain information on the horizontal direction coordinate values of the interchanged transform coefficients and difference information on a difference between the horizontal direction coordinate values of the interchanged transform coefficients and the vertical direction coordinate values of the interchanged transform coefficients when the value of the flag is 1 (indicating that difference information is transmitted), and may obtain the coordinate values specifying the interchanged scan area based on the difference information.
When the value of the flag is 0 (indicating that no difference information is transmitted), the video decoding apparatus 100 can obtain information on the coordinate values in the horizontal direction of the interchanged transform coefficient and information on the coordinate values in the vertical direction of the interchanged transform coefficient, and obtain the coordinate values specifying the interchanged scan region based on the obtained information.
The video decoding apparatus 100 can specify the final scanning area and scan information on the transform coefficient in the scanning area by interchanging the obtained coordinate values of the transform coefficient in the horizontal direction and the coordinate values of the vertical direction with each other.
However, it is not limited to the case where the width of the current block is greater than the height, and even when the height of the current block is greater than the width, those skilled in the art can easily understand that similar operations can be performed.
Fig. 8 shows a schematic diagram for explaining a process of determining a context model related to syntax element information of a transform coefficient in a current block based on at least one of a size of the current block and a shape (shape) of the current block, according to an embodiment.
Referring to fig. 8, the current block may have one shape of a first block 805, a second block 810, and a third block 815. The first block may be a rectangular block having a height greater than a width, the second block 815 may be a rectangular block having a width greater than a height, and the third block 815 may be a square block having the same width and height.
The video decoding apparatus 100 may determine a context model related to syntax element information of transform coefficients in the current block based on the size _ tu0 determined according to equation 19.
[ EQUATION 19 ]
Figure BDA0002634979820000781
Here, the log2_ width may be a value taking log2 for the width of the current block, and the log2_ height may be a value taking log2 for the height of the current block. Referring to fig. 8, when the current block is the first block 805, the size _ tu may be (log) 2a+log2b) And/2 (a and b are positive integers). When the current block is a second block 810, the size _ tu may be (log)2c+log-2d) And/2 (c and d are positive integers). When the current block is the third block 815, the size _ tu may be log2e (e is a positive integer).
Alternatively, the video decoding apparatus 100 may determine a value related to the size of the current block as an element of determining the context model based on the minimum value of the width of the current block and the height of the current block. For example, the video decoding apparatus may determine a value size _ tu1 related to the size of the current block as an element of determining the context model based on the following equation 20.
[ EQUATION 20 ]
size_tu1=Min(log2_width,log2_height)
Here, the Min () function may be a function of the minimum value among the output and input values. Referring to fig. 8, when the current block is the first block 805, the size _ tu may be log2a (a is a positive integer). When the current block is the second block 810, the size _ tu may be log-2d (d is a positive integer). When the current block is the third block 815, the size _ tu may be log2e (e is a positive integer).
The video decoding apparatus 100 may determine a context model related to syntax element information of transform coefficients in the current block based on the size _ tu1 determined according to equation 20.
Alternatively, the video decoding apparatus 100 may determine a value related to the size of the current block as an element of determining the context model based on the maximum value of the width of the current block and the height of the current block. For example, the video decoding apparatus 100 may determine the value size _ tu2 related to the size of the current block as an element of determining the context model based on the following equation 21.
[ EQUATION 21]
size_tu2=Max(log2_width,log2_height)
Here, the Max () function may be a function of the maximum value among the input values of the output function.
The video decoding device 100 may determine a context model related to syntax element information of transform coefficients in the current block based on the size _ tu2 determined according to [ equation 21 ].
If a is 4, b is 16 and e is 8, the size _ tu associated with the first block 805 and the size _ tu0 associated with the third block 815 may be equal to 3.
Even if the transform coefficients tend to be distributed on the larger side of the height and width of the current block, the video decoding apparatus 100 may determine the same context model for the first block 805 and the third block 815 based on the size _ tu 0. However, when the video decoding apparatus 100 determines the context models for the first and third blocks 805 and 815 based on the size _ tu1 or the size _ tu2, the context models thereof may be different, and thus the efficiency of binary arithmetic decoding may be improved compared to when the context models are determined based on the size _ tu 0.
The video decoding apparatus 100 may determine a value related to the size of the current block as an element of determining the context model based on the shape of the current block. For example, the video decoding apparatus 100 may determine a value shape _ tu related to the shape of the current block as an element of determining the context model based on the following equation 22.
[ EQUATION 22]
shape_tu=width>height?2:(width<height?1:0)
For example, when the current block is the first block 805, shape _ tu may be 1, and when the current block is the second block 810, shape _ tu may be 2. When the current block is the third block 815, shape _ tu may be 0. In other words, the size _ tu may be 2 when the shape of the current block is a rectangle in which the width of the current block is greater than the height, 1 when the shape of the current block is a rectangle in which the height of the current block is greater than the width, and 0 when the shape of the current block is a square in which the width and the height of the current block are the same,
in [ equation 22], the height of the current block and the width of the current block are used, but are not limited thereto, and those skilled in the art can easily understand that the determination can be made based on log2_ width and log2_ height as in [ equation 21 ]. Further, in [ equation 22], shape _ tu is determined as one value of 0 to 2, but is not limited thereto, and those skilled in the art can easily understand that shape _ tu may be assigned other values and the shape of the current block indicated by each value may also be changed.
If a is 4, b is 16 and e is 8, then the size _ tu associated with the first block 805 may be 3 and the size _ tu associated with the third block 815 may be equal to 3.
Even if the transform coefficients tend to be distributed on the larger side of the height and width of the current block, the video decoding apparatus 100 may determine the same context model for the first block and the third block based on the size _ tu 0. However, when the video decoding apparatus 100 determines the context models for the first block 805 and the third block 815 based on shape _ tu, the context models thereof may be different, and thus the efficiency of binary arithmetic decoding may be improved compared to when determining the context models based on size _ tu 0.
In addition, the video decoding apparatus 100 may determine a context model related to the transform coefficient based on a ratio between a minimum value and a maximum value of the current block, the ratio being calculated by a minimum size _ tu1 and a maximum size _ tu2 based on a height and a width of the current block. For example, when the ratio between the minimum value and the maximum value is within a predetermined value range, the video decoding apparatus 100 may determine a context index corresponding to the range and determine a context model related to the transform coefficient based on the determined context index. For example, when the height of the current block is greater than the width and the value of the ratio between the minimum value (width) and the maximum value (height) is in the range between 1 and 2, a context index corresponding to the range may be determined, and when the value of the ratio between the minimum value and the maximum value is in the range of 2 or more, a context index corresponding to the value may be determined.
Further, the video decoding apparatus 100 may determine a context model related to the transform coefficient based on the shape and size of the current block. That is, the video decoding apparatus 100 may determine the context model related to the transform coefficient based on the size of the current block and the shape of the current block.
The video decoding apparatus 100 may determine a context index related to a transform coefficient based on at least one of the values size _ tu1 and size _ tu2 related to the size of the current block and the value shape _ tu related to the shape of the current block, and may determine a context model corresponding to the determined context index.
Fig. 9a to 9c show diagrams for explaining a residual coding syntax structure according to an embodiment.
Referring to fig. 9a to 9c, the video decoding apparatus 100 may scan syntax element information related to transform coefficients and perform decoding on the transform coefficients based on the scanned syntax element information to restore the transform coefficients.
First, the video decoding apparatus 100 may obtain syntax element information scan _ region _ x and scan _ region _ y indicating coordinates for specifying a quadrangular scan area from a bitstream. At this time, the syntax element information scan _ region _ x may indicate a value of a coordinate of a horizontal direction (x-axis direction) of a significant transform coefficient located at the rightmost side in the current block with reference to a coordinate of a corner at the upper left side of the current block, and the syntax element information scan _ region _ y may indicate a value of a coordinate of a vertical direction (y-axis direction) of a significant transform coefficient located at the bottommost side in the current block with reference to a coordinate of a corner at the upper left side of the current block. The video decoding apparatus 100 may determine the coordinates srX and srY for specifying the scan region based on the syntax element information scan _ region _ x and scan _ region _ y.
The video decoding apparatus 100 may determine the scan order ScanOrder (srX +1, srY +1) by based on the coordinates srX and srY for specifying the scan region.
The video decoding apparatus 100 may determine index information lastSet indicating a coefficient group that is scanned last in the positive direction scanning order based on the coordinates srX and srY for specifying the scanning area. In other words, the video decoding apparatus 100 may determine the index information lastSet of the coefficient group scanned last by performing an operation of shifting by 4 to the right (> >4) for a value of subtracting 1 from the size value (srX +1) × (srY +1) as the scan region. That is, the output value of the operation of shifting 4 to the right may be the same as the quotient determined by the operation of dividing by 16. In other words, since the video decoding apparatus 100 determines each 16 transform coefficients as one coefficient group, when dividing the total transform coefficient scanned in the scanning area by 16, the total number of coefficient groups may be determined (or, a value of adding 1 to the index value indicating the coefficient group scanned last in the positive direction scanning order).
The video decoding apparatus 100 may determine the position lastScanPos of the coefficient last scanned in the positive direction scan order based on the coordinates srX and srY for specifying the scan region, and determine the position Pos of the current transform coefficient as the position lastScanPos of the coefficient last scanned in the positive direction scan order.
The video decoding apparatus 100 may initialize i to lastset, subtract i by 1 when i is greater than 0, and perform the operation included in the loop sentence (for sentence) 905. The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) 905 until becoming a value smaller than 0. At this time, i may be an index indicating a coefficient group. In other words, the video decoding apparatus 100 can perform an operation for one coefficient group each time the operation included in the loop sentence (for sentence) 905 is performed.
The video decoding apparatus 100 may determine setPos by performing an operation of multiplying i by 16 (i < < 4). setPos may indicate index information of a transform coefficient located at the first of a transform group.
The video decoding apparatus 100 may determine n as a value (lastScanPos-setPos) of subtracting setPos from lastScanPos when i is the last coefficient group (i ═ lastSet), otherwise determine n as 15, and when n is greater than or equal to 0, may reduce i by 1 and perform an operation included in the loop statement (for statement) 910. The video decoding apparatus 100 may perform the operation (operation related to sig _ flag) included in the loop sentence (for sentence) 910 until becoming a value smaller than 0. At this time, n may be index information indicating the position of the transform coefficient in the coefficient group in the scanning order in the positive direction.
For example, when the total number of transform coefficients included in a scanning area is not an integer multiple of 16, the value of setPos subtracted from lastScanPos regarding a coefficient group (i ═ lastset) scanned last in the positive direction scanning order may be greater than or equal to 0 and less than or equal to 15, and the value may be determined to be n, and the operation of the loop sentence (for sentence) 910 may be performed.
The video decoding apparatus 100 may determine the position blkpos of the current transform coefficient as a value obtained by adding index information setPos indicating the position of the first coefficient of the current coefficient group in the ScanOrder arrangement to n. The ScanOrder arrangement may be an arrangement indicating the positions of transform coefficients in the scanning order in the positive direction.
The video decoding apparatus 100 can determine the value sx of the coordinate in the square direction (x-axis direction) currently being scanned based on the position blkpos of the current transform coefficient and the width of the scanning area. Further, the video decoding apparatus 100 can determine the value sy of the coordinate in the vertical direction (y-axis direction) based on the position blkpos of the transform coefficient currently being decoded and the width log2width of the scanning area.
When sx is 0, sy is srY, and is _ last _ y is 0 (sx ═ 0& & sy & & srY & & is _ last _ y ═ 0), or when sy is 0, sx is srX, and is _ last _ x is 0 (sy ═ 0& & sx & & srX & & is _ last _ x ═ 0), the video decoding apparatus 100 may not obtain a valid transform coefficient flag sig _ flag related to the current transform coefficient from the bitstream (sig _ flag [ blkpos ]) and determine the value of sig _ flag related to the current transform coefficient as 1. Here, is _ last _ x may be a value indicating whether there is a significant transform coefficient having an absolute value greater than 0 among transform coefficients scanned before the current transform coefficient among transform coefficients included in the lowermost row of the scan region. is _ last _ y may be a value indicating whether there is a significant transform coefficient having an absolute value greater than 0 among transform coefficients scanned before the current transform coefficient among transform coefficients included in the rightmost column of the scan area.
When sx is 0, sy is srY, and is _ last _ y is 0 (sx ═ 0& & sy & & srY & & is _ last _ y ═ 0), or when sy is 0, sx is srX, and is _ last _ x is 0 (sy &0 & & sx & & srX & & is _ last _ x ═ 0), the video decoding apparatus 100 may obtain an effective transform coefficient flag sig _ flag [ blkpos ] regarding a currently decoded transform coefficient from the bitstream.
The video decoding apparatus 100 may set the is _ last _ x to 1 when the significant transform coefficient flag sig _ flag of the current transform coefficient is 1 and the coordinate value sx of the current transform coefficient in the x-axis direction is equal to srX (sx ═ srX), and set the is _ last _ y to 1 when the coordinate value sy of the current transform coefficient in the y-axis direction is equal to srY (sy ═ srY).
Further, when lastSigScanPos is-1 (i.e., is an initial value), the video decoding apparatus 100 may determine lastSigScanPos as n. In other words, since the index n indicating the position where the first significant transform coefficient in the reverse direction scanning order of the coefficient group exists is determined as lastSigScanPos, lastSigScanPos may be a position indicating the position where the last significant transform coefficient in the forward direction scanning order in the coefficient group exists. In addition, the video decoding apparatus 1000 may determine firstSigScanPos as n. When the significant transform coefficient flag sig _ flag of the current transform coefficient is 1, since the value of firstSigScanPos is continuously updated to n as index information indicating the position of the current transform coefficient, when an operation is finally performed on the transform coefficients included in the specific coefficient group i, firstSigScanPos may be index information indicating the position where the first significant transform coefficient in the coefficient group in the inverse direction scanning order exists.
The video decoding apparatus 100 increases cnt _ nz by 1. In other words, cnt _ nz, which indicates the number of coefficients having a value other than 0 in the current block (or scan area), is updated every time the current transform coefficient is a significant transform coefficient. Further, the video decoding apparatus 100 increases cg _ nz [ i ] indicating the number of coefficients having a value other than 0 in the current coefficient group i by 1. In other words, cg _ nz [ i ] indicating the number of coefficients in the current coefficient group i having a value other than 0 is updated every time the current transform coefficient is a significant transform coefficient.
The video decoding apparatus 100 may determine n as a value (lastScanPos-setPos) of subtracting setPos from lastScanPos when i is the last coefficient group (i ═ lastSet), otherwise determine n as 15, and when n is greater than or equal to 0, may reduce i by 1 and perform an operation included in a loop statement (for statement) 915. The video decoding apparatus 100 may perform the operations (operations related to coeff _ abs _ level _ grease 1_ flag and coeff _ abs _ level _ grease 2_ flag) included in the loop sentence (for sentence) 915 until becoming a value less than 0.
The video decoding apparatus 100 may determine the position blkpos of the current transform coefficient as a value obtained by adding index information (setPos) indicating the position of the first coefficient of the current coefficient group in the ScanOrder arrangement to n.
The video decoding device 100 may obtain the absolute value abs _ coef related to the current transform coefficient based on the information gt0 flag, gt1flag, gt2flag, and remaining _ absolute value level related to the current transform coefficient.
When the significant transform coefficient flag sig _ flag [ blkpos ] of a transform coefficient is 1, when the sum of cnt _ gl (i.e., the number of transform coefficients whose absolute values are greater than 1 among the transform coefficients included in the previously scanned coefficient group) and c1 (i.e., the number of transform coefficients whose absolute values are obtained coeff _ abs _ level _ granularity 1_ flag from the bitstream among the previously scanned transform coefficients in the current coefficient group) is less than num _ gtl (i.e., the maximum number of transform coefficients whose coeff _ abs _ level _ granularity _ flag can be obtained from the bitstream among the transform coefficients whose absolute values are greater than 1), the video decoding apparatus 100 may obtain coeff _ abs _ level _ granularity _ flag 1_ blkpos that is related to the current transform coefficient from the bitstream. coeff _ abs _ level _ header 1_ flag may be a flag indicating whether the absolute value of the current transform coefficient is greater than 1. The video decoding apparatus 100 may determine a flag gt1_ flag (gt1flag [ blkpos ]) for the current transform coefficient based on coeff _ abs _ level _ granularity 1_ flag obtained from the bitstream.
When the value of the flag gt1_ flag of the current transform coefficient is 1, the video decoding apparatus 100 may increase c1 by 1. When the flag gt1_ flag of the current transform coefficient is 1, since the value of c1 is increased by 1 so that the value of c1 is updated, c1 may indicate the number of transform coefficients, among the transform coefficients previously scanned in the current coefficient group, for which coeff _ abs _ level _ granularity 1_ flag is obtained from the bitstream, when a loop statement (for statement) () operation is performed on the next transform coefficient.
When the significant transform coefficient flag sig _ flag [ blkpos ] of the current transform coefficient is 1, the video decoding apparatus 100 may obtain coeff _ abs _ level _ header 2_ flag regarding the current transform coefficient from the bitstream in the case where the sum of cnt _ g2 (i.e., the number of transform coefficients whose absolute values of transform coefficients in the previously scanned coefficient group are greater than 2) and c2 (i.e., the number of transform coefficients whose absolute values in the current coefficient group are previously scanned to obtain coeff _ abs _ level _ header 2_ flag from the bitstream) is less than num _ 2 (i.e., the maximum number of transform coefficients whose absolute values of transform coefficients are greater than 2 to obtain coeff _ abs _ level _ header _ flag from the bitstream). coeff _ abs _ level _ header 2_ flag may be a flag indicating whether the absolute value of the current transform coefficient is greater than 2. The video decoding device 100 may determine a flag gt2_ flag for the current transform coefficient based on coeff _ abs _ level _ header 2_ flag obtained from the bitstream.
When the value of the flag gt2_ flag of the current transform coefficient is 1, the video decoding apparatus 100 may increase the number c2 of the current gt2flag by 1. When the flag gt2_ flag of the current transform coefficient is 1, the value of c2 is updated since the value of c2 is increased by 1, so when a loop statement (for statement) () operation is performed for the next transform coefficient, c2 may indicate the number of transform coefficients, among the transform coefficients previously scanned in the current coefficient group, for which coeff _ abs _ level _ greater1_ flag is obtained from the bitstream.
Further, the video decoding apparatus 100 may determine escapeDataPresent as 1. The escapeDataPresent may be information indicating that there is an additional acquisition required to determine the value of the transform coefficient in the current transform group (e.g., remaining level absolute value information coeff _ abs _ level _ remaining).
When the flag sig _ flag [ blkpos ] of the significant transform coefficient of the current transform coefficient is 1, the video decoding apparatus 100 may determine escapeDataPresent to be 1 when the sum of cnt _ g2 (i.e., the number of transform coefficients whose absolute values are greater than 2 among the transform coefficients in the previously scanned coefficient group) and c2 (i.e., the number of transform coefficients whose absolute values are greater than 2 among the transform coefficients in the current coefficient group to obtain coeff _ abs _ level _ header 2_ flag from the bitstream previously scanned) is not less than num _ 2 (i.e., the maximum number of transform coefficients whose absolute values are greater than 2 among the transform coefficients from the bitstream to obtain coeff _ abs _ level _ header _ flag).
When the sum of cnt _ g1 (i.e., the number of transform coefficients whose absolute values are greater than 1 among the transform coefficients included in the previously scanned coefficient group) and c1 (i.e., the number of transform coefficients whose absolute values are coeff _ abs _ level _ greater1_ flag are obtained from the bitstream among the transform coefficients previously scanned in the current coefficient group) is not less than num _ gt1 (i.e., the maximum number of transform coefficients whose absolute values are greater than 1 from the bitstream, the coeff _ abs _ level _ greater _ flag can be obtained), the video decoding apparatus 100 may determine escapeDataPresent to be 1.
When escapeDataPresent is 1, the video decoding apparatus 100 may determine n as a value (lastScanPos-setPos) of subtracting setPos from lastScanPos when i indicates the last coefficient group (i ═ lastSet), otherwise determine n as 15, and when n is greater than or equal to 0, may decrease i by 1 and perform an operation included in the loop sentence (for sentence) 920. The video decoding apparatus 100 may perform the operation (operation related to coeff _ abs _ level _ learning) included in the loop sentence (for sentence) 920 until becoming a value less than 0.
The video decoding apparatus 100 may determine the position blkpos of the current transform coefficient as a value obtained by adding index information (setPos) indicating the position of the first coefficient of the current coefficient group in the ScanOrder arrangement to n.
When the absolute value of the current transform coefficient is greater than 1 (sig _ flag [ blkpos ]), the video decoding apparatus 100 may determine the base level. When cnt _ gt1 (i.e., the number of transform coefficients whose absolute values of transform coefficients scanned before the current transform coefficient in the current coefficient group are greater than 1) is less than num _ gt1 (i.e., the maximum number of transform coefficients whose absolute values are coeff _ abs _ level _ gather _ flag are obtainable from the bitstream among transform coefficients whose absolute values are greater than 2), the video decoding apparatus 100 may determine the basic level to be 3 in the case where cnt _ gt2 (i.e., the number of transform coefficients whose absolute values of transform coefficients are greater than 2 among transform coefficients scanned before the current transform coefficient in the current coefficient group) is less than num _ gt2 (i.e., the maximum number of transform coefficients whose absolute values are greater than 2 among transform coefficients whose absolute values are obtainable from the bitstream). When cnt _ gt1 is smaller than num _ gt1 that can be obtained from the bitstream, the video decoding apparatus 100 may determine the basic level as 2 in the case where cnt _ gt2 is smaller than num _ gt 2. When cnt _ gt1 is not less than num _ gt1, the video decoding apparatus 100 may determine the basic level as 1.
The video decoding apparatus 100 may determine the absolute value level abs _ coef of the current transform coefficient as a value of gtlflag plus a value of gt2flag plus 1 for the current transform coefficient. When the absolute value of the current transform coefficient has the same value as the base level (abs _ coef [ blkpos ] ═ base _ level), the video decoding apparatus 100 may obtain the remaining absolute value level coeff _ abs _ level _ remaining, which is related to the current transform coefficient, from the bitstream. The video decoding apparatus 100 may determine the absolute value level abs _ coef related to the current transform coefficient by adding the remaining absolute value level coeff _ abs _ level _ remaining related to the current transform coefficient to abs _ coef.
When the absolute value level abs _ coef related to the current transform coefficient is greater than 2, the video decoding apparatus 100 may increase cnt _ gt2 by 1. Further, when the absolute value level abs _ coef related to the current transform coefficient is greater than 1, the video decoding apparatus 100 may increase cnt _ gt1 by 1.
When escapeDataPresent is 0, in the case where i indicates the last coefficient group (i ═ lastSet), n may be determined as a value obtained by subtracting setPos from lastScanPos (lastScanPos-setPos), otherwise n is determined as 15, and when n is greater than or equal to 0, i is decreased by 1, and the operation included in the loop sentence (for sentence) 925 is performed. The video decoding apparatus 100 may perform the operation (operation related to abs _ coef) included in the loop sentence (for sentence) 925. The value of the index information setPos plus n, which indicates the position of the first coefficient of the current coefficient group in the ScanOrder arrangement, may be determined.
When the flag of the significant transform coefficient of the current transform coefficient is 1, the video decoding apparatus 100 may increase cnt _ gt2 by 1 in the case where abs _ coef, which is an absolute value related to the current transform coefficient, is greater than or equal to 2. When the flag of the significant transform coefficient related to the current transform coefficient is 1, the video decoding apparatus 100 may add 1 to cnt _ gt1 in the case where abs _ coef, which is an absolute value related to the current transform coefficient, is greater than or equal to 1.
When the difference between the position lastsigscan pos of the last significant transform coefficient and the position firstsigscan pos of the first significant transform coefficient in the coefficient group i scanned in the positive direction scan order is greater than 3, the video decoding apparatus 100 may determine the value signHidden [ i ] of signHidden, which indicates that at least one symbol is hidden in the current coefficient group i, to be 1. When the difference between the position lastSigScanPos of the last significant transform coefficient and the position firstSigScanPos of the first significant transform coefficient in the current coefficient group scanned in the positive direction scan order is not greater than 3, the video decoding apparatus 100 may determine the value signHidden [ i ] of signHidden, which indicates that at least one symbol is hidden in the current coefficient group i, to be 0.
The video decoding apparatus 100 may initialize i to 0, and when i is less than or equal to lastSet, increase i by 1, and perform the operation included in the loop sentence (for sentence) 930. The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) 930 until i becomes a value greater than lateSet. At this time, i may be an index indicating a coefficient group. In other words, the video decoding apparatus 100 may perform an operation for one coefficient group each time an operation included in the loop sentence (for sentence) 930 is performed once.
When rsp (residual sign prediction) is applied (rsp _ apply), in the case where i is the last coefficient group (i ═ lastSet), the video decoding device 100 may determine n as a value (lastScanPos-setPos) by which setPos is subtracted from lastScanPos, otherwise determine n as 15, and in the case where n is greater than or equal to 0, reduce i by 1, and perform the operation included in the loop statement (for statement) 935. The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) 935 until becoming a value smaller than 0.
The video decoding apparatus 100 can determine the position blkpos of the currently decoded transform coefficient as the value of the index information setPos indicating the position of the first coefficient of the current coefficient group in the ScanOrder arrangement in the positive direction scan order plus the current n.
When the position blkpos of the currently decoded transform coefficient is not rsp _ pos, the video decoding apparatus 100 may determine information sign [ blkpos ] on the sign of the currently decoded transform coefficient as information hidden _ sign on the sign of the concealed transform coefficient when the sign of the transform coefficient is the position hidden _ pos of the concealed transform coefficient.
When the sign of the transform coefficient is not the position hidden _ pos of the concealed transform coefficient, the video decoding apparatus 100 may obtain information sign [ blkpos ] about the sign of the currently decoded transform coefficient from the bitstream.
When the position blkpos of the currently decoded transform coefficient is rsp _ pos, the video decoding apparatus 100 may obtain information sign _ rsp [ blkpos ] about the rsp symbol of the currently decoded transform coefficient from the bitstream.
When rsp is not applied, in the case where i is the last coefficient group (i ═ lastSet), the video decoding device 100 may determine n as a value (lastScanPos-setPos) by which setPos is subtracted from lastScanPos, otherwise determine n as 15, and reduce i by 1 when n is greater than or equal to 0, and perform the operation included in the loop sentence (for sentence) 940. The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) 940 until becoming a value smaller than 0.
The video decoding apparatus 100 can determine the position blkpos of the current transform coefficient as the value of the index information setPos indicating the position of the first coefficient of the current coefficient group in the ScanOrder arrangement in the positive direction scan order plus the current n.
When the value of the significant transform coefficient flag of the current transform coefficient is 1 and the value of the flag sign _ data _ decoding _ enabled _ flag indicating whether to activate concealment symbol data is 0, or there is no symbol concealed for the current block! sign Hidden [ i ], or information sign [ blkpos ] relating to the sign of the current transform coefficient may be obtained from the bit stream when the position of the current transform coefficient in the current coefficient group in the forward direction scan order is not the first significant transform coefficient firstSigScanPos.
Fig. 9d to 9f show diagrams for explaining a structure of a residual coding syntax according to another embodiment.
Referring to fig. 9d to 9f, the video decoding apparatus 100 may scan syntax element information related to transform coefficients and perform decoding on the transform coefficients based on the scanned syntax element information to restore the transform coefficients.
First, the video decoding apparatus 100 may obtain syntax element information last _ sig _ coeff _ x and last _ sig _ coeff _ y, which indicate coordinates for specifying a scan area, from a bitstream. At this time, the syntax element information last _ sig _ coeff _ x may indicate a coordinate value of a horizontal direction (x-axis direction) of the last significant transform coefficient in the scanning order in the positive direction with reference to a coordinate located at the upper left corner of the current block, and the syntax element information last _ sig _ coeff _ y may indicate a coordinate value of a vertical direction (y-axis direction) of the last significant transform coefficient in the scanning order in the positive direction with reference to a coordinate located at the upper left corner of the current block. The video decoding apparatus 100 may determine coordinates lastsigcoeff x and lastsigcoeff y for specifying the scan area based on the syntax element information last _ sig _ coeff _ x and last _ sig _ coeff _ y.
The video decoding apparatus 100 may initialize the position lastScanPos of the last significant transform coefficient in the sub-block in the positive direction scan order to 16. The video decoding apparatus 100 may initialize lastSubBlock indicating a sub-block in which a last significant transform coefficient is located in a positive direction scan order among the sub-blocks. At this time, the initialized value may indicate a sub-block located at the last among sub-blocks of the current block that is scanned in the positive direction scan order. In other words, lastSubBlock may be initialized to a value indicating the last sub-block among the sub-blocks scanned in the positive direction scan order based on the height and width of the current block.
The video decoding apparatus 100 may perform the operation in the Do-while loop statement 950 when the position xC in the horizontal direction of the current coefficient is not LastSigcoeffX or the position yC in the vertical direction of the current coefficient is not LastSigcoeffY, and not perform the operation in the Do-while loop statement 950 when xC is LastSigcoeffX and the position yC in the vertical direction of the current coefficient is LastSigcoeffY.
When lastScanPos is 0, video decoding device 100 may determine lastScanPos as 16 and subtract 1 from lastsub. In other words, when scanning in the reverse direction scanning order in one sub-block is completed (when lastScanPos is 0), lastScanPos may be initialized to 16 to scan the next sub-block in the reverse direction scanning order and lastsub lock is subtracted by 1 to scan the next sub-block. The video decoding apparatus 100 may scan the transform coefficients in the current sub-block lastsub-block in the reverse direction scan order while subtracting 1 from lastsub-block.
The video decoding apparatus 100 may determine a horizontal direction position xS and a vertical direction position yS of the current sub-block. The video decoding apparatus 100 may determine the position of the current sub-block based on the ScanOrder arrangement determined in the positive direction scan order for the current block. In other words, the video decoding apparatus 100 may determine the position of the current sub-block based on the height log2height and the width log2width of the current block, a scan index scanIdx indicating a predetermined scan order, and a value lastSubBlock indicating the current sub-block. At this time, xS and yS may be sub-block positions when the sub-block is regarded as one pixel, not actual sub-block positions. In other words, the width and height of the sub-blocks may not be considered, and the difference between the horizontal direction and the vertical direction of the sub-blocks between adjacent sub-blocks may be 1.
Further, the video decoding apparatus 100 can determine the position xC in the horizontal direction and the position yC in the vertical direction of the current transform coefficient based on the ScanOrder determined in the predetermined positive direction scanning order for the current subblock. In other words, video decoding device 100 may be based on the height log of the current sub-block24 ═ 2 and width log2The position (xC, yC) of the current transform coefficient is determined by 4 ═ 2, a scan index scanIdx indicating a predetermined scan order, a position (xS, yS) of the current sub-block, and a value lastScanPos indicating the position of the current transform coefficient in the current sub-block.
When the position yC in the vertical direction of the current transform coefficient is LastSigcoeffY, the video decoding apparatus 100 does not perform the operation in the do-while loop statement 950 any more, and thus lastScanPos determined by the do-while loop statement 950 may be index information indicating the position of the last significant transform coefficient in a subblock including the last significant transform coefficient in the current block scanned in the forward direction scanning order, and lastSubBlock may be index information indicating a subblock in which the last significant transform coefficient in the current block is located.
The video decoding device 100 may initialize i to lastSubBlock and reduce i by 1 when i is greater than 0, and perform the operations included in the loop statement (for statement) 960. The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) 960 until becoming a value smaller than 0. At this time, i may be an index indicating a coefficient group. In other words, the video decoding apparatus 100 may perform an operation for one sub-block whenever the operation included in the loop sentence (for sentence) 960 is performed once.
The video decoding apparatus 100 may determine a horizontal direction position xS and a vertical direction position yS of the current sub-block.
The video decoding apparatus 100 may obtain a coded _ sub _ block _ flag [ xS ] [ yS ] related to the current subblock i when i indicating the current subblock indicates a subblock having a value less than a value lastSubBlock of a subblock in which a last significant transform coefficient is located or indicates a subblock having a value greater than a value (0) indicating a subblock including a DC coefficient. The coded _ sub _ block _ flag [ xS ] [ yS ] may be flag information indicating whether at least one significant transform coefficient is included in the current sub-block i.
The video decoding apparatus 100 may initialize n to lastScanPos-1 when the current sub-block is a sub-block lastSubBlock including the last significant transform coefficient, otherwise initialize n to 15, and reduce n by 1 when n is greater than or equal to 0, and perform an operation included in a loop statement (for statement) (). The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) 960 until n becomes a value less than 0. At this time, n may be an index indicating the position of the current transform coefficient in the sub-block. In other words, the video decoding apparatus 100 may perform an operation for one coefficient group each time an operation included in a loop statement (for statement) () is performed once. In other words, the video decoding apparatus 100 may perform an operation (an operation related to sig _ coeff _ flag) for one subblock each time an operation included in the loop sentence (for sentence) 960 is performed once.
The video decoding apparatus 100 may determine the positions xC and yC of the current transform coefficient n.
When coded _ sub _ block _ flag [ xS ] [ yS ] related to the current subblock is 1 and n is greater than 0 or inferSbDcSigCoeffFlag is 0, the video decoding apparatus 100 may obtain a flag sig _ coeff _ flag [ xC ] [ yC ] related to the current transform coefficient from the bitstream. sig _ coeff _ flag [ xC ] [ yC ] may be a flag indicating whether the current transform coefficient is a significant transform coefficient.
When the value of sig _ coeff _ flag [ xC ] [ yC ] is 1, inferSbDcSigCoeffFlag may be determined to be 0.
The video decoding apparatus 100 may initialize the value of the position firstScanPos of the transform coefficient scanned first in the forward direction scanning order in the current subblock, and initialize the value of the position lastSigScanPos of the transform coefficient scanned last in the forward direction scanning order in the current subblock. The video decoding apparatus 100 may initialize the value of numGreater1Flag indicating the number of Greater1Flag, and initialize the value of last position lastGreater1ScanPos at which Greater1Flag is obtained in the forward direction scanning order.
The video decoding apparatus 100 may initialize cg _ nz [ i ] indicating the number of transform coefficients that are not 0 in the sub-block i.
The video decoding apparatus 100 may initialize n to 15, and when n is greater than or equal to 0, may perform an operation included in a loop sentence (for sentence) 965 while decreasing n by 1 until the value of n is less than 0.
The video decoding apparatus 100 may determine the positions xC and yC of the current transform coefficient n.
When the Flag sig _ coeff _ Flag for the significant transform coefficient of the current transform coefficient is 1, in the case where numGreater1Flag is less than 8, the video decoding device 100 may obtain coeff _ level _ grease 1_ Flag [ n ] for the current transform coefficient n, and increase the value of numGreater1Flag by 1. coeff _ level _ header 1_ flag [ n ] may be flag information indicating whether the absolute value of the level of the transform coefficient n is greater than 1. The video decoding device 100 may determine the Greater1Flag [ n ] by based on coeff _ level _ Greater1_ Flag [ n ].
When the value of coeff _ abs _ level _ larger _ flag related to the current transform coefficient is 1 and the value of lastlarger 1ScanPos is an initial value, the video decoding device 100 may determine lastlarger 1ScanPos as the position n of the current transform coefficient in the current subblock. Thus, lastgreat 1ScanPos may be index information indicating a position of a coefficient having a value of coeff _ abs _ level _ great _ flag located last in the current subblock in the positive direction scanning order. Otherwise (when the value of coeff _ abs _ level _ greater1_ flag related to the current transform coefficient is 1 and the value of lastreater1ScanPos is not an initial value), the video decoding apparatus 100 may determine escapeDataPresent to be 1 in the case where coeff _ abs _ level _ greater1_ flag is 1.
When numGreater1Flag is not less than 8, the video decoding apparatus 100 may determine escapeDataPresent as 1.
When lastSigScanPos indicating the position of the last significant transform coefficient in the positive direction scanning order in the current subblock has an initial value, the video decoding apparatus 100 may determine lastSigScanPos as the position n of the transform coefficient in the current subblock.
The video decoding apparatus 100 may determine, as the position n of the transform coefficient in the current subblock, a firstSigScanPos indicating the position of the significant transform coefficient located first in the forward direction scanning order in the current subblock. When the significant transform coefficient flag sig _ coeff _ flag [ xC ] [ yC ] of the current transform coefficient is 1, since the value of the firstSigScanPos is continuously updated to the index information n indicating the position of the current transform coefficient in the current subblock, the firstSigScanPos may be index information indicating the position where the first significant transform coefficient exists in the subblock in the positive direction scanning order when the operation is finally performed on the transform coefficients included in the current subblock i.
The video decoding apparatus 100 may determine the sigHidden value to be 1 when the difference between lastSigScanPos and firstSigScanPos is greater than 3, and determine the sigHidden value to be 0 when the difference between lastSigScanPos and firstSigScanPos is not greater than 3. At this time, sigHidden may be a value indicating a sign of concealing at least one transform coefficient for the current subblock.
When the position lastGreater1ScanPos of the transform coefficient of the coeff _ abs _ level _ granularity 1_ Flag (granularity 1Flag) obtained last from the coeff _ abs _ level _ granularity 1_ Flag related to the transform coefficient obtained from the bitstream scanned in the forward direction scanning order is not an initial value (i.e., when at least one granularity 1Flag is obtained from the bitstream in the current subblock), the video decoding apparatus 100 may obtain a Flag coeff _ abs _ level _ granularity 2_ Flag [ lastGreater1ScanPos ] related to the transform coefficient at the lastGreater1ScanPos position from the bitstream. coeff _ abs _ level _ header 2_ flag may be a flag indicating whether the absolute value of a transform coefficient is greater than 2. When the value of flag coeff _ abs _ level _ larger 2_ flag [ lastlarger 1ScanPos ] related to the transform coefficient of the lastlarger 1ScanPos position is 1, the video decoding apparatus 100 may determine escapeDataPresent to be 1. The video decoding device 100 may determine the Greater2Flag [ n ] based on coeff _ level _ Greater2_ Flag [ n ].
The video decoding apparatus 100 may initialize numSigCoeff. At this time, numshigcoeff may indicate the number of significant transform coefficients among transform coefficients scanned before the current transform coefficient in the inverse direction scan order.
The video decoding apparatus 100 may initialize n to 15, and when n is greater than or equal to 0, reduce n by 1 and perform the operation included in the for sentence 970, and when n is less than 0, may not perform the operation included in the for sentence 970 any more. The video decoding apparatus 100 may perform an operation of scanning information on transform coefficients in a current sub-block in an inverse direction scan order, and the like.
The video decoding apparatus 100 may determine the position xC and yC of the current transform coefficient based on the position n of the current transform coefficient in the current subblock.
When the value of the flag sig _ coeff _ flag [ xC ] [ yC ] of the significant transform coefficient of the current transform coefficient is 1, the video decoding apparatus 100 may determine a value, which is the sum of the value of the flag coeff _ abs _ level _ header 1_ flag for the current transform coefficient and the value of the flag coeff _ abs _ level _ header 2_ flag for the current transform coefficient plus 1, as the base level baseLevel.
When numSigCoeff is less than 8 and the position n of the current transform coefficient is lastgreat 1ScanPos, the video decoding apparatus 100 may obtain the remaining level value information coeff _ abs _ level _ remaining [ n ] regarding the current transform coefficient n from the bitstream in the case where the base level basevelel is 3.
When numSigCoeff is less than 8 and the position n of the current transform coefficient is lastgreat 1ScanPos, the video decoding apparatus 100 may obtain the remaining level value information coeff _ abs _ level _ remaining [ n ] regarding the current transform coefficient n from the bitstream in the case where the base level baselevel is 2. When numSigCoeff is greater than 8 and the base level baselev is 1, the video decoding apparatus 100 may obtain the residual level value information coeff _ abs _ level _ remaining [ n ] regarding the current transform coefficient n from the bitstream.
The video decoding apparatus 100 may determine a level value of the current transform coefficient in the current block, i.e., TransCoeffLevel [ x0] [ y0] [ cIdx ] [ xC ] [ yC ], by adding a base level related to the current transform coefficient and a remaining level value related to the current transform coefficient. Here, the cIdx may be an index indicating a color component.
The video decoding apparatus 100 may perform the operation included in the loop sentence (for sentence) until i increases by 1 from 0 and becomes a value less than or equal to lastSubBlock. At this time, i may be an index indicating the subblock. In other words, the video decoding apparatus 100 can perform an operation for one coefficient group each time a sentence included in the loop sentence (for sentence) 975 is executed.
In the case where the flag coded _ sub _ block _ flag [ xS ] [ yS ] for the current subblock i is 1, the video decoding apparatus 100 may determine n as 15 when rsp is applied (rsp _ apply), and perform the operation in the for statement 980 when n is greater than or equal to 0, and may perform the operation in the for statement 980 again when n is greater than or equal to 0 after reducing n by 1. When n is less than 0, the operation in the for statement 980 may no longer be performed.
The video decoding apparatus 100 may determine the position xC and yC of the horizontal direction and the vertical direction of the current transform coefficient corresponding to the position n of the current transform coefficient in the current sub-block. The video decoding apparatus 100 can determine the position blkpos of the current transform coefficient based on xC and yC.
When the position blkpos of the current transform coefficient is not rsp _ pos, the video decoding apparatus 100 may determine the symbol of the current transform coefficient as the symbol hidden _ sign of the hidden transform coefficient in the case where the position hidden _ pos of the transform coefficient of the symbol is hidden.
Otherwise (when it is not the position hidden _ pos of the transform coefficient in which the symbol is hidden), the video decoding apparatus 100 may obtain information sign [ xC ] [ yC ] about the symbol of the current transform coefficient from the bitstream.
When the position of the current transform coefficient is rsp _ pos, the video decoding apparatus 100 may obtain information sign _ rsp [ xC ] [ yC ] about the rsp symbol of the current transform coefficient from the bitstream.
When rsp is not applied, the video decoding apparatus 100 may determine n as 15, and perform the operation in the for sentence 985 when n is greater than 0, and perform the operation in the for sentence 985 again when n is also greater than or equal to 0 after decreasing n by 1, and not perform the operation in the for sentence 985 when n is less than 0.
The video decoding apparatus 100 may determine the position xC and yC of the horizontal direction and the vertical direction of the current transform coefficient corresponding to the position n of the current transform coefficient in the current sub-block. The video decoding apparatus 100 can determine the position blkpos of the current transform coefficient based on xC and yC.
When the value of the significant transform coefficient flag sig _ coeff _ flag [ xC ] [ yC ] of the current transform coefficient is 1, and the value of the flag sign _ data _ suppressing _ enabled _ flag indicating whether to activate concealment symbol data is 0, or a symbol not concealed for the current subblock (| signHidden [ i ]), or a position firstscanpos where the position of the current transform coefficient in the current subblock in the scanning order in the positive direction is not the first significant transform coefficient is not 0, the video decoding apparatus 100 may obtain symbol information sign [ xC ] [ yC ] of the current transform coefficient from the bitstream.
Hereinafter, a method of determining a data unit that may be used in a process in which the video decoding apparatus 100 according to an embodiment performs decoding on an image will be described with reference to fig. 10 to 23. The operation of video encoding device 150 may be similar to or opposite of the various embodiments of the operation of video decoding device 100 described below.
Fig. 10 illustrates a process of determining at least one coding unit by dividing a current coding unit, performed by the video decoding apparatus 100, according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine the shape of the coding unit by using the block shape information, and may determine what shape the coding unit is to be divided into by using the division shape information. In other words, the partition method of the coding unit indicated by the partition shape information may be determined according to the block shape indicated by the block shape information used by the video decoding apparatus 100.
According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is a square shape. For example, the video decoding apparatus 100 may determine whether to divide a square coding unit, whether to divide the square coding unit vertically, whether to divide the square coding unit horizontally, or whether to divide the square coding unit into four coding units according to the division shape information. Referring to fig. 10, when the block shape information of the current coding unit 1000 indicates a square shape, the video decoding apparatus 100 may determine that a coding unit 1010a having the same size as the current coding unit 1000 is not divided according to the division shape information indicating that division is not performed, or may determine divided coding units 1010b, 1010c, 1010d, and the like based on the division shape information indicating a predetermined division method.
Referring to fig. 10, according to an embodiment, the video decoding apparatus 100 may determine two coding units 1010b obtained by dividing the current coding unit 1000 in the vertical direction based on the division shape information indicating that the division is performed in the vertical direction. The video decoding apparatus 100 may determine two coding units 1010c obtained by dividing the current coding unit 1000 in the horizontal direction based on the division shape information indicating that the division is performed in the horizontal direction. The video decoding apparatus 100 may determine four coding units 1010d obtained by dividing the current coding unit 1000 in the vertical direction and the horizontal direction based on the division shape information indicating that the division is performed in the vertical direction and the horizontal direction. However, the dividing method of the square coding unit is not limited to the above-described dividing method, and the division shape information may indicate various methods. Hereinafter, a predetermined division method of dividing a square coding unit will be described in detail through various embodiments.
Fig. 11 illustrates a process performed by the video decoding apparatus 100 to determine at least one coding unit by dividing a non-square coding unit according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is a non-square shape. The video decoding apparatus 100 may determine whether to divide the non-square-shaped current coding unit or whether to divide the non-square-shaped current coding unit by using a predetermined division method according to the division shape information. Referring to fig. 11, when the block shape information of the current coding unit 1100 or 1150 indicates a non-square shape, the video decoding apparatus 100 may determine that the coding unit 1110 or 1160 having the same size as the current coding unit 1100 or 1150 is not divided according to the division shape information indicating that division is not performed, or determine divided coding units 1120a, 1120b, 1130a, 1130b, 1130c, 1170a, 1170b, 1180a, 1180b, and 1180c according to the division shape information indicating a predetermined division method. Hereinafter, a predetermined division method of dividing a non-square coding unit will be described in detail through various embodiments.
According to an embodiment, the video decoding apparatus 100 may determine the shape in which the coding unit is divided using the division shape information, and in this case, the division shape information may indicate the number of one or more coding units generated by dividing the coding unit. Referring to fig. 11, when the partition shape information indicates to partition the current coding unit 1100 or 1150 into two coding units, the video decoding apparatus 100 may determine two coding units 1120a and 1120b or 1170a and 1170b included in the current coding unit 1100 or 1150 by partitioning the current coding unit 1100 or 1150 based on the partition shape information.
According to an embodiment, when the video decoding apparatus 100 divides the non-square-shaped current coding unit 1100 or 1150 based on the division shape information, the current coding unit 1100 or 1150 may be divided in consideration of the position of the long side of the non-square current coding unit 1100 or 1150. For example, the video decoding apparatus 100 may determine a plurality of coding units by dividing the previous coding unit 1100 or 1150 in a direction of dividing a long side of the current coding unit 1100 or 1150 in consideration of the shape of the current coding unit 1100 or 1150.
According to an embodiment, when the division shape information indicates that the coding unit is divided into odd blocks, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 1100 or 1150. For example, when the division shape information indicates that the current coding unit 1100 or 1150 is divided into three coding units, the video decoding apparatus 100 may divide the current coding unit 1100 or 1150 into three coding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180 c. According to an embodiment, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 1100 or 1150, and not all of the determined coding units may have the same size. For example, the size of a predetermined code unit 1130b or 1180b of the determined odd number of code units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c may be different from the sizes of the other code units 1130a, 1130c, 1180a, and 1180 c. In other words, the coding unit that can be determined by dividing the current coding unit 1100 or 1150 may have various sizes, and the odd number of coding units 1130a, 1130b, 1130c, 1180a, 1180b, and 1180c may have different sizes according to circumstances.
According to an embodiment, when the division shape information indicates that the coding unit is divided into odd blocks, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 1100 or 1150, and may apply a predetermined restriction to at least one of the odd number of coding units generated by dividing the current coding unit 1100 or 1150. Referring to fig. 11, the video decoding apparatus 100 may allow the decoding methods of the coding units 1130b and 1180b to be different from the decoding methods of the other coding units 1130a, 1130c, 1180a, and 1180c, wherein the coding units 1130b and 1180b are located at central positions among three coding units 1130a, 1130b, and 1130c or 1180a, 1180b, and 1180c generated by dividing the current coding unit 1100 or 1150. For example, unlike the other coding units 1130a, 1130c, 1180a, and 1180c, the video decoding apparatus 100 may restrict the coding units 1130b and 1180b located at the central position from being divided any more or only a predetermined number of times.
Fig. 12 illustrates a process of dividing a coding unit based on at least one of block shape information and division shape information performed by the video decoding apparatus 100 according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine whether to divide the square first coding unit 1200 into coding units or not based on at least one of the block shape information and the division shape information. According to an embodiment, when the division shape information indicates that the first encoding unit 1200 is divided in the horizontal direction, the video decoding apparatus 100 may determine the second encoding unit 1210 by dividing the first encoding unit 1200 in the horizontal direction. According to an embodiment, the first coding unit, the second coding unit and the third coding unit used are terms used to understand the relationship before and after dividing the coding unit. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. In the following, the used relationship between the first coding unit, the second coding unit and the third coding unit follows the above description.
According to an embodiment, the video decoding apparatus 100 may determine whether to divide the determined second encoding unit 1210 into encoding units based on at least one of block shape information and division shape information. Referring to fig. 12, the video decoding apparatus 100 may divide the non-square second coding unit 1210 determined by dividing the first coding unit 1200 into at least one third coding unit 1220a, 1220b, 1220c, and 1220d or not divide the second coding unit 1210 based on at least one of the block shape information and the division shape information. The video decoding apparatus 100 may obtain at least one of block shape information and division shape information, and the video decoding apparatus 100 divides the first encoding unit 1200 based on the obtained at least one of the block shape information and the division shape information to divide a plurality of differently shaped second encoding units (e.g., 1210), and may divide the second encoding unit 1210 based on the at least one of the block shape information and the division shape information by using a dividing method of the first encoding unit 1200. According to an embodiment, when the first encoding unit 1200 is divided into the second encoding units 1210 based on at least one of block shape information and division shape information regarding the first encoding unit 1200, the second encoding units 1210 may also be divided into the third encoding units 1220a, 1220b, 1220c, and 1220d based on at least one of block shape information and division shape information regarding the second encoding units 1210. In other words, the coding units may be recursively divided based on at least one of the block shape information and the division shape information of each coding unit. Accordingly, a square-shaped coding unit may be determined from a non-square-shaped coding unit, and a non-square-shaped coding unit may be determined by recursively dividing the square-shaped coding unit. Referring to fig. 12, a predetermined coding unit (e.g., a coding unit located at a central position or a coding unit of a square shape) among an odd number of third coding units 1220b, 1220c, and 1220d determined by dividing the non-square-shaped second coding unit 1210 may be recursively divided. According to an embodiment, the square-shaped third encoding unit 1220c, which is one of the odd number of third encoding units 1220b, 1220c, and 1220d, may be divided into a plurality of fourth encoding units by being divided in the horizontal direction. The non-square shaped fourth encoding unit 1240 of one of the plurality of fourth encoding units may be divided into a plurality of encoding units again. For example, the non-square shaped fourth encoding unit 1240 may be subdivided into an odd number of encoding units 1250a, 1250b, and 1250 c.
A method for recursively dividing coding units will be described below by various embodiments.
According to an embodiment, the video decoding apparatus 100 may determine to divide each of the third coding units 1220a, 1220b, 1220c, and 1220d into coding units or not to divide the second coding unit 1210 based on at least one of the block shape information and the partition shape information. According to an embodiment, the video decoding apparatus 100 may divide the non-square-shaped second coding unit 1210 into an odd number of third coding units 1220b, 1220c, and 1220 d. The video decoding apparatus 100 may apply a predetermined restriction to a predetermined third encoding unit among the odd number of third encoding units 1220b, 1220c, and 1220 d. For example, the video decoding apparatus 100 may limit the third encoding unit 1220c located at the center among the odd number of third encoding units 1220b, 1220c, and 1220d to no longer be divided or to be divided a settable number of times. Referring to fig. 12, the video decoding apparatus 100 may restrict the third coding unit 1220c located at a center position among odd number of third coding units 1220b, 1220c, and 1220d included in the non-square-shaped second coding unit 1210 to be no longer divided, to be divided into a predetermined division shape (e.g., to be divided into only four coding units or to be divided into shapes corresponding to the shapes into which the second coding unit 1210 is divided), or to be divided only a predetermined number of times (e.g., to be divided only n times (where n > 0)). However, the above-described limitation on the third encoding unit 1220c located at the center position is only a simple embodiment, and should not be construed as being limited to the above-described embodiment and may include various limitations for decoding the third encoding unit 1220c located at the center position differently from the other third encoding units 1220b and 1220 d.
According to an embodiment, the video decoding apparatus 100 may obtain at least one of block shape information and division shape information for dividing the current coding unit from a predetermined position in the current coding unit.
Fig. 13 illustrates a method for the video decoding apparatus 100 to determine a predetermined coding unit from an odd number of coding units according to an embodiment. Referring to fig. 13, at least one of block shape information and division shape information of the current coding unit 1300 may be obtained from a sample of a predetermined position (e.g., a sample 1340 of a center position) among a plurality of samples included in the current coding unit 1300. However, the predetermined position in the current coding unit 1300 at which at least one of the block shape information and the division shape information can be obtained should not be construed as being limited to the center position in fig. 13, and may include various positions included in the current coding unit 1300 (e.g., uppermost, lowermost, left, right, left upper, left lower, right upper and right lower positions, etc.). The video decoding apparatus 100 obtains at least one of block shape information and division shape information obtainable from a predetermined position, and determines whether to divide a current coding unit into coding units of various shapes and various sizes or not to divide.
According to an embodiment, the video decoding apparatus 100 may select one of the coding units when the current coding unit is divided into a predetermined number of coding units. The method for selecting one of the plurality of coding units may be various, and such a method will be described later by various embodiments.
According to an embodiment, the video decoding apparatus 100 may divide a current coding unit into a plurality of coding units and may determine a coding unit of a predetermined position.
Fig. 13 illustrates a method for the video decoding apparatus 100 to determine a coding unit of a predetermined position from an odd number of coding units according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine a coding unit located at a center position among the odd number of coding units using information indicating a position of each of the odd number of coding units. Referring to fig. 13, the video decoding apparatus 100 may determine odd-numbered coding units 1320a, 1320b, and 1320c by dividing a current coding unit 1300. The video decoding apparatus 100 may determine the coding unit 1320b located at the center position by using information on the positions of the odd-numbered coding units 1320a to 1320 c. For example, the video decoding apparatus 100 may determine the coding unit 1320b of the central position by determining the positions of the coding units 1320a, 1320b, and 1320c based on information indicating the positions of predetermined samples included in the coding units 1320a, 1320b, and 1320 c. Specifically, the video decoding apparatus 100 may determine the coding unit 1320b located at the center position by determining the positions of the coding units 1320a, 1320b, and 1320c based on the information indicating the positions of the upper left side samples 1330a, 1330b, and 1330c of the coding units 1320a, 1320b, and 1320 c.
According to an embodiment, the information indicating the positions of the left upper end samples 1330a, 1330b, and 1330c respectively included in the coding units 1320a, 1320b, and 1320c may include information about the positions or coordinates of the coding units 1320a, 1320b, and 1320c in the picture. According to an embodiment, the information indicating the positions of the left upper end samples 1330a, 1330b, and 1330c respectively included in the coding units 1320a, 1320b, and 1320c may include information indicating the width or height of the coding units 1320a, 1320b, and 1320c included in the current coding unit 1300, and such width or height may correspond to information indicating the difference between the coordinates of the coding units 1320a, 1320b, and 1320c in the picture. In other words, the video decoding apparatus 100 may determine the coding unit 1320b located at the center position by directly using information on the positions or coordinates of the coding units 1320a, 1320b, and 1320c in the picture or by using information on the width or height of the coding unit corresponding to the difference between the coordinates.
According to an embodiment, the information indicating the position of the left upper end sample 1330a of the upper end coding unit 1320a may include coordinates (xa, ya), the information indicating the position of the left upper end sample 1330b of the middle coding unit 1320b may include coordinates (xb, yb), and the information indicating the position of the left upper end sample 1330c of the lower end coding unit 1320c may include coordinates (xc, yc). The video decoding apparatus 100 may determine the middle coding unit 1320b by using coordinates of left upper end samples 1330a, 1330b, and 1330c included in the coding units 1320a, 1320b, and 1320c, respectively. For example, when the coordinates of the left upper end samples 1330a, 1330b, and 1330c are arranged in an ascending or descending order, the coding unit 1320b including the coordinates (xb, yb) of the sample 1330b located at the center position may be determined as the coding unit located at the center position among the coding units 1320a, 1320b, and 1320c determined by dividing the current coding unit 1300. However, the coordinates indicating the positions of the left upper end samples 1330a, 1330b, and 1330c may include coordinates indicating an absolute position in the screen, or coordinates (dxb, dyb) indicating the relative position of the left upper end sample 1330b of the middle coding unit 1320b and coordinates (dxc, dyc) indicating the relative position of the left upper end sample 1330c of the lower end coding unit 1320c may be used with reference to the position of the left upper end sample 1330a of the upper end coding unit 1320 a. In addition, the method of determining the coding unit located at a predetermined position by using the coordinates of the corresponding samples as the information indicating the positions of the samples included in the coding unit should not be construed as being limited to the above-described method, but should be construed to include various arithmetic methods capable of using the coordinates of the samples.
According to an embodiment, the video decoding apparatus 100 may divide the current coding unit 1300 into a plurality of coding units 1320a, 1320b, and 1320c, and may select a coding unit of the coding units 1320a, 1320b, and 1320c based on a predetermined criterion. For example, the video decoding apparatus 100 may select the coding unit 1320b different in size from the coding units 1320a, 1320b, and 1320 c.
According to an embodiment, the video decoding apparatus 100 may determine the width or height of each of the coding units 1320a, 1320b, and 1320c by using coordinates (xa, ya) indicating the position of the left upper end sample 1330a of the upper end coding unit 1320a, coordinates (xb, yb) indicating the position of the left upper end sample 1330b of the middle coding unit 1320b, and coordinates (xc, yc) indicating the position of the left upper end sample 1330c of the lower end coding unit 1320 c. The video decoding apparatus 100 may determine the size of each of the coding units 1320a, 1320b, and 1320c by using coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 1320a, 1320b, and 1320 c.
According to an embodiment, the video decoding apparatus 100 may determine the width of the upper end coding unit 1320a as xb-xa and the height thereof as yb-ya. According to an embodiment, the video decoding apparatus 100 may determine the width of the intermediate coding unit 1320b as xc-xb and the height thereof as yc-yb. According to an embodiment, the video decoding apparatus 100 may determine the width or height of the lower coding unit by using the width or height of the current coding unit and the widths or heights of the upper coding unit 1320a and the middle coding unit 1320 b. The video decoding apparatus 100 may determine a coding unit having a size different from other coding units based on the determined widths and heights of the coding units 1320a, 1320b, and 1320 c. Referring to fig. 13, the video decoding apparatus 100 may determine a middle coding unit 1320b having a size different from the sizes of the upper and lower end coding units 1320a and 1320b as a coding unit of a predetermined position. However, the process of determining a coding unit having a size different from other coding units performed by the video decoding apparatus 100 corresponds to only one embodiment of determining a coding unit at a predetermined position by using a coding unit size determined based on the coordinates of a sample, and thus various methods of determining a coding unit located at a predetermined position by comparing the sizes of coding units determined according to the coordinates of a predetermined sample may be used.
However, the sample position considered for determining the position of the coding unit should not be construed as being limited to the above-described upper left end, and information on an arbitrary position of the sample included in the coding unit may be used.
According to an embodiment, the video decoding apparatus 100 may select a coding unit located at a predetermined position among an odd number of coding units determined by dividing the current coding unit in consideration of the shape of the current coding unit. For example, when the current coding unit has a non-square shape having a width longer than a height, the video decoding apparatus 100 may determine a coding unit of a predetermined position in the horizontal direction. In other words, the video decoding apparatus 100 can determine one of the coding units having different positions in the horizontal direction and impose a restriction on the coding unit. When the current coding unit has a non-square shape with a height longer than a width, the video decoding apparatus 100 may determine a coding unit of a predetermined position in the vertical direction. In other words, the video decoding apparatus 100 may determine one of the coding units having different positions in the vertical direction, and may impose a restriction on the coding unit.
According to an embodiment, the video decoding apparatus 100 may determine the coding unit of the predetermined position among the even number of coding units using information indicating the respective position of each of the even number of coding units. The video decoding apparatus 100 may determine an even number of coding units by dividing the current coding unit, and may determine a coding unit of a predetermined position by using information on positions of the even number of coding units. The specific process related thereto may correspond to a process of determining a coding unit of a predetermined position (e.g., a center position) among an odd number of coding units, which has been described in detail in fig. 13 described above, and thus a detailed description thereof will be omitted.
According to an embodiment, when a current coding unit of a non-square shape is divided into a plurality of coding units, in order to determine a coding unit of a predetermined position among the plurality of coding units, predetermined information about the coding unit of the predetermined position may be used in the dividing process. For example, the video decoding apparatus 100 may determine a centrally located coding unit from among a plurality of coding units determined by dividing the current coding unit using at least one of block shape information and division shape information stored in samples included in the centrally located coding unit in the dividing.
Referring to fig. 13, the video decoding apparatus 100 may divide a current coding unit 1300 into a plurality of coding units 1320a, 1320b, and 1320c based on at least one of block shape information and division shape information, and may determine a centrally located coding unit 1320b among the plurality of coding units 1320a, 1320b, and 1320 c. Further, the video decoding apparatus 100 may determine the coding unit 1320b located at the center position in consideration of the position at which at least one of the block shape information and the partition shape information is obtained. In other words, at least one of block shape information and division shape information of the current coding unit 1300 may be obtained from a sample 1340 at a center position of the current coding unit 1300, and when the current coding unit 1300 is divided into a plurality of coding units 1320a, 1320b, and 1320c based on at least one of the block shape information and the division shape information, the coding unit 1320b including the sample 1340 may be determined as the coding unit at the center position. However, the information for determining the coding unit located at the center position should not be construed as being limited to at least one of the block shape information and the division shape information, and various types of information may be used for determining the coding unit located at the center position.
According to an embodiment, the predetermined information for identifying the coding unit located at the predetermined position may be obtained from predetermined samples included in the coding unit to be determined. Referring to fig. 13, the video decoding apparatus 100 may determine a coding unit of a predetermined position (e.g., a centrally located coding unit among a plurality of coding units) among a plurality of coding units 1320a, 1320b, and 1320c determined by dividing the current coding unit 1300, using at least one of block shape information and division shape information obtained from a sample of the predetermined position (e.g., a centrally located sample of the current coding unit 1300) in the current coding unit 1300. In other words, the video decoding apparatus 100 may determine the samples located at the predetermined position by considering the block shape of the current coding unit 1300, and the video decoding apparatus 100 determines the coding unit 1320b that divides the samples from which the predetermined information (e.g., at least one of the block shape information and the division shape information) is available among the plurality of coding units 1320a, 1320b, and 1320c determined by the current coding unit 1300, and may apply a predetermined restriction thereto. Referring to fig. 13, according to an embodiment, the video decoding apparatus 100 may determine a sample 1340 located at a center of a current coding unit 1300 as a sample at which predetermined information is available, and the video decoding apparatus 100 may apply a predetermined limit to a coding unit 1320b including the sample 1340 in a decoding process. However, the position of the sample where the predetermined information is obtainable should not be construed as being limited to the above-described position, and may be construed as a sample of an arbitrary position included in the encoding unit 1320b determined to impose a limitation.
According to an embodiment, the positions of samples where predetermined information is available may be determined according to the shape of the current coding unit 1300. According to an embodiment, the block shape information may indicate whether the current coding unit is a square shape or a non-square shape, and a position of a sample where the predetermined information is obtainable may be determined according to the shape. For example, the video decoding apparatus 100 may determine samples located on a boundary for bisecting at least one of the width and the height of the current coding unit as samples for which the predetermined information is obtainable, by using at least one of the information on the width and the information on the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the video decoding apparatus 100 may determine one of samples adjacent to a boundary for halving the long side of the current coding unit as a sample from which the predetermined information is obtainable.
According to an embodiment, when a current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 may determine a coding unit of a predetermined position among the plurality of coding units using at least one of block shape information and division shape information. According to an embodiment, the video decoding apparatus 100 may obtain at least one of block shape information and division shape information from samples of a predetermined position included in the coding unit, and the video decoding apparatus 100 divides the plurality of coding units generated by dividing the current coding unit by using at least one of the division shape information and the block shape information obtained from samples of the predetermined position in each of the plurality of coding units. In other words, the coding units may be recursively divided using at least one of block shape information and division shape information obtained from samples of predetermined positions included in each coding unit. The process of recursively dividing the coding units has been described above through fig. 12, and thus a detailed description thereof will be omitted.
According to an embodiment, the video decoding apparatus 100 may determine one or more coding units by dividing a current coding unit, and may determine an order of decoding the one or more coding units based on a predetermined block (e.g., the current coding unit).
Fig. 14 illustrates an order in which the plurality of coding units are processed when the video decoding apparatus 100 determines the plurality of coding units by dividing the current coding unit according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine the second encoding units 1410a and 1410b by dividing the first encoding unit 1400 in the vertical direction, determine the second encoding units 1430a and 1430b by dividing the first encoding unit 1400 in the horizontal direction, or determine the second encoding units 1450a to 1450d by dividing the first encoding unit 1400 in the vertical direction and the horizontal direction, according to the block shape information and the division shape information.
Referring to fig. 14, the video decoding apparatus 100 may determine the order to process the second coding units 1410a and 1410b in the horizontal direction 1410c, the second coding units 1410a and 1410b being determined by dividing the first coding unit 1400 in the vertical direction. The video decoding apparatus 100 may determine the order as processing the second encoding units 1430a and 1430b in the vertical direction 1430c, the second encoding units 1430a and 1430b being determined by dividing the first encoding unit 1400 in the horizontal direction. The video decoding apparatus 100 may determine to process the second coding unit 1450a, 1450b, 1450c, 1450d, which is determined by dividing the first coding unit 1400 in the vertical direction and the horizontal direction, in a predetermined order (e.g., in a raster scan order (raster scan order) or a Z scan order (zscan order)1450e) for processing the coding units in the next row after processing the coding units in one row.
According to an embodiment, the video decoding apparatus 100 may recursively divide the coding units. Referring to fig. 14, the video decoding apparatus 100 may determine a plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d by dividing the first coding unit 1400, and may recursively divide each of the determined plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450 d. The division method of the plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may correspond to the division method of the first coding unit 1400. Accordingly, each of the plurality of coding units 1410a, 1410b, 1430a, 1430b, 1450a, 1450b, 1450c, and 1450d may be independently divided into a plurality of coding units. Referring to fig. 14, the video decoding apparatus 100 may determine the second coding units 1410a and 1410b by dividing the first coding unit 1400 in the vertical direction, and may determine whether to divide or not to divide each of the second coding units 1410a and 1410b individually.
According to an embodiment, the video decoding apparatus 100 may divide the left second encoding unit 1410a in the horizontal direction to determine the third encoding units 1420a and 1420b, and may not divide the right second encoding unit 1410 b.
According to an embodiment, the processing order of the coding units may be determined based on a division process of the coding units. In other words, the processing order of the divided coding units may be determined based on the processing order of the coding units before division. The video decoding apparatus 100 may determine the processing order of the third encoding units 1420a and 1420b determined by dividing the left-side second encoding unit 1410a, independently of the right-side second encoding unit 1410 b. Since the third encoding units 1420a and 1420b are determined by dividing the left second encoding unit 1410a in the horizontal direction, the third encoding units 1420a and 1420b may be processed in the vertical direction 1420 c. In addition, since the order in which the left second encoding unit 1410a and the right second encoding unit 1410b are processed corresponds to the horizontal direction 1410c, the right second encoding unit 1410b may be processed after the third encoding units 1420a and 1420b included in the left second encoding unit 1410a are processed in the vertical direction 1420 c. The above is for explaining a process in which the respective coding units determine the processing order based on the coding units before being divided, and should be construed as not being limited to the above-described embodiment, but should be construed that the coding units divided and determined into various shapes may be independently processed in a predetermined order using various methods.
Fig. 15 illustrates a process in which the video decoding apparatus 100 determines that a current coding unit is to be divided into an odd number of coding units when the coding units cannot be processed in a predetermined order according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine whether the current coding unit is to be divided into an odd number of coding units based on the obtained block shape information and division shape information. Referring to fig. 15, a square-shaped first encoding unit 1500 may be divided into non-square-shaped second encoding units 1510a and 1510b, and the second encoding units 1510a and 1510b may be independently divided into third encoding units 1520a and 1520b and 1520c, 150d, and 1520 e. According to an embodiment, the video decoding apparatus 100 may determine the plurality of third coding units 1520a and 1520b by dividing the left second coding unit 1510a in the horizontal direction, and may divide the right second coding unit 1510b into an odd number of third coding units 1520c, 150d, and 1520 e.
According to an embodiment, the video decoding apparatus 100 may determine whether there are coding units divided into an odd number by determining whether the third coding units 1520a and 1520b and 1520c, 150d, and 1520e can be processed in a predetermined order. Referring to fig. 15, the video decoding apparatus 100 may determine the third coding units 1520a and 1520b and 1520c, 1520d and 1520e by recursively dividing the first coding unit 1500. The video decoding apparatus 100 may determine whether the first, second, and third encoding units 1500, 1510a and 1510b, 1520a and 1520b, and 1520c, 1520d, and 1520e divide the divided shape into an odd number of encoding units based on at least one of the block shape information and the division shape information. For example, a coding unit located at the right side among the second coding units 1510a, 1510b may be divided into odd number of third coding units 1520c, 1520d, and 1520 e. The order in which the plurality of coding units included in the first coding unit 1500 are processed may be a predetermined order (e.g., the Z-scan order 1530), and the video decoding apparatus 100 may determine whether the third coding units 1520c, 1520d, and 1520e determined by dividing the right-side second coding unit 1510b into odd number of coding units satisfy a condition for processing in the predetermined order.
According to an embodiment, the video decoding apparatus 100 may determine whether the third encoding units 1520a and 1520b and 1520c, 1520d, and 1520e included in the first encoding unit 1500 satisfy a condition for processing in a predetermined order, and the condition relates to whether at least one of the width and height of the second encoding units 1510a and 1510b is divided in half along the boundary of the third encoding units 1520a and 1520b and 1520c, 1520d, and 1520 e. For example, the third coding units 1520a and 1520b determined by dividing the height of the left-side second coding unit 1510a of a non-square shape by half satisfy the condition, however, since the boundaries of the third coding units 1520c, 1520d, and 1520e determined by dividing the right-side second coding unit 1510b into three coding units do not divide the width or height of the right-side second coding unit 1510b by half, it may be determined that the third coding units 1520c, 1520d, and 1520e do not satisfy the condition, and when the condition is not satisfied, the video decoding apparatus 100 may determine discontinuity (disconnect) of the scan order and determine that the right-side second coding unit 1510b is divided into odd number of coding units based on the result of the determination. According to an embodiment, when a coding unit is divided into an odd number of coding units, the video decoding apparatus 100 may apply a predetermined restriction to a coding unit located at a predetermined position among the divided coding units, the restriction or the predetermined position, etc., having been described above through various embodiments, and thus a detailed description thereof will be omitted.
Fig. 16 illustrates a process in which the video decoding apparatus 100 divides the first coding unit 1600 to determine at least one coding unit according to an embodiment. According to an embodiment, the video decoding apparatus 100 may divide the first encoding unit 1600 based on at least one of the block shape information and the division shape information obtained by the obtaining part 110. The square-shaped first coding unit 1600 may be divided into four coding units having a square shape, or may be divided into a plurality of non-square-shaped coding units. For example, referring to fig. 16, when the block shape information indicates that the first coding unit 1600 is a square shape and the division shape information indicates a coding unit to be divided into non-square shapes, the video decoding apparatus 100 may divide the first coding unit 1600 into a plurality of non-square shaped coding units. Specifically, when the division shape information indicates that an odd number of coding units are determined by dividing the first coding unit 1600 in the horizontal direction or the vertical direction, the video decoding apparatus 100 may divide the square-shaped first coding unit 1600 into the odd number of coding units, for example, by the second coding units 1610a, 1610b, and 1610c divided in the vertical direction, or by the second coding units 1620a, 1620b, and 1620c divided in the horizontal direction.
According to an embodiment, the video decoding apparatus 100 may determine whether the second coding units 1610a, 1610b, 1610c, 1620a, 1620b and 1620c included in the first coding unit 1600 satisfy a condition for processing in a predetermined order, and the condition relates to whether at least one of the width and the height of the first coding unit 1600 is divided in half along the boundary of the second coding units 1610a, 1610b, 1610c, 1620a, 1620b and 1620 c. Referring to fig. 16, since the boundaries of the second coding units 1610a, 1610b and 1610c determined by dividing the square first coding unit 1600 in the vertical direction do not divide the width of the first coding unit 1600 in half, it may be determined that the first coding unit 1600 does not satisfy the condition for performing the processing in the predetermined order. Further, since the boundaries of the second encoding units 1620a, 1620b, and 1620c determined by dividing the square first encoding unit 1600 in the horizontal direction do not divide the width of the first encoding unit 1600 in half, it may be determined that the first encoding unit 1600 does not satisfy the condition for performing the processing in the predetermined order. When the condition is not satisfied, the video decoding apparatus 100 may determine discontinuity (disconnection) of the scan order, and may determine that the first encoding unit 1600 is divided into an odd number of encoding units based on a result of the determination. According to an embodiment, when divided into an odd number of coding units, the video decoding apparatus 100 may apply a predetermined restriction to a coding unit of a predetermined position among the divided coding units, the restriction or the predetermined position, etc., having been described above through various embodiments, and thus a detailed description thereof will be omitted.
According to an embodiment, the video decoding apparatus 100 may determine the coding units of various shapes by dividing the first coding unit.
Referring to fig. 16, the video decoding device 100 may divide a square-shaped first coding unit 1600 or a non-square-shaped first coding unit 1630 or 1650 into coding units of various shapes.
Fig. 17 illustrates that shapes in which the second coding unit can be divided are limited when the non-square-shaped second coding unit determined by the video decoding apparatus 100 dividing the first coding unit 1700 satisfies a predetermined condition according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine to divide the square-shaped first encoding unit 1700 into the non-square-shaped second encoding units 1710a, 1710b, 1720a, and 1720b based on at least one of the block shape information and the division shape information obtained by the obtaining section 105. The second encoding units 1710a, 1710b, 1720a, and 1720b may be independently divided. Accordingly, the video decoding apparatus 100 may determine to be divided into a plurality of coding units or not to divide based on at least one of the block shape information and the division shape information of each of the second coding units 1710a, 1710b, 1720a and 1720 b. According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 1712a and 1712b by dividing the non-square-shaped left second encoding unit 1710a in the horizontal direction, the non-square-shaped left second encoding unit 1710a being determined by dividing the first encoding unit 1700 in the vertical direction. Only, when the left second encoding unit 1710a is divided in the horizontal direction, the video decoding apparatus 100 may impose a restriction such that the right second encoding unit 1710b cannot be divided in the horizontal direction in which the left second encoding unit 1710a is divided in the same direction. When the third encoding units 1714a and 1714b are determined by dividing the right second encoding unit 1710b in the same direction, the left second encoding unit 1710a and the right second encoding unit 1710b may be independently divided in the horizontal direction to determine the third encoding units 1712a, 1712b, 1714a, and 1714b, respectively. However, this has the same result as the video decoding apparatus 100 divides the first encoding unit 1700 into the four square-shaped second encoding units 1730a, 1730b, 1730c, and 1730d based on at least one of the block shape information and the division shape information, and may be inefficient in image decoding.
According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 1722a, 1722b, 1724a, and 1724b by dividing the non-square shaped second encoding unit 1720a or 1720b in the vertical direction, which is determined by dividing the first encoding unit 1700 in the horizontal direction. In addition, when one of the second encoding units (e.g., the upper-end second encoding unit 1720a) is divided in the vertical direction, the video decoding apparatus 100 may set a restriction such that the other second encoding unit (e.g., the lower-end second encoding unit 1720b) cannot be divided in the vertical direction, which is the same as the direction in which the upper-end second encoding unit 1720a is divided, for the above-described reason.
Fig. 18 illustrates a process in which the video decoding apparatus 100 divides a coding unit of a square shape when the division shape information does not indicate the coding unit divided into four square shapes according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 1800 to determine the second coding units 1810a, 1810b, 1820a, 1820b, and so on based on at least one of the block shape information and the division shape information. The division shape information may include information on various shape methods in which the coding unit may be divided, but the information on various shapes may not include information for the coding unit divided into four square shapes. According to such division shape information, the video decoding apparatus 100 cannot divide the square-shaped first coding unit 1800 into the four square-shaped second coding units 1830a, 1830b, 1830c, and 1830 d. The video decoding apparatus 100 may determine the non-square-shaped second coding units 1810a, 1810b, 1820a, 1820b, and so on based on the partition shape information.
According to an embodiment, the video decoding apparatus 100 may independently divide the non-square shaped second coding units 1810a, 1810b, 1820a, 1820b, and so on. Each of the second encoding units 1810a, 1810b, 1820a, 1820b, and so on may be recursively divided in a predetermined order, and such a dividing method may correspond to a method of dividing the first encoding unit 1800 based on at least one of the block shape information and the divided shape information.
For example, the video decoding apparatus 100 may determine the square-shaped third coding units 1812a and 1812b by dividing the left second coding unit 1810a in the horizontal direction, and may determine the square-shaped third coding units 1814a and 1814b by dividing the right second coding unit 1810b in the horizontal direction. Also, the video decoding apparatus 100 may determine the square-shaped third encoding units 1816a, 1816b, 1816c, and 1816d by dividing both the left second encoding unit 1810a and the right second encoding unit 1810b in the horizontal direction. In this case, the same shape of the coding units as the four square-shaped second coding units 1830a, 1830b, 1830c, and 1830d into which the first coding unit 1800 is divided may be determined.
As another example, the video decoding apparatus 100 may determine the square-shaped third encoding units 1822a and 1822b by dividing the upper-end second encoding unit 1820a in the vertical direction, and may determine the square-shaped third encoding units 1824a and 1824b by dividing the lower-end second encoding unit 1820b in the vertical direction. Also, the video decoding apparatus 100 may determine the square-shaped third encoding units 1822a, 1822b, 1824a, and 1824b by dividing both the upper second encoding unit 1820a and the lower second encoding unit 1820b in the vertical direction. In this case, the same shape of the coding units as the four square-shaped second coding units 1830a, 1830b, 1830c, and 1830d into which the first coding unit 1800 is divided may be determined.
Fig. 19 illustrates that the processing order among a plurality of coding units may be changed according to the process of dividing the coding units according to an embodiment.
According to an embodiment, the video decoding apparatus 100 divides the first encoding unit 1900 based on the block shape information and the division shape information. When the block shape information indicates a square shape and the division shape information indicates that the first encoding unit 1900 is divided in at least one of the horizontal direction and the vertical direction, the video decoding apparatus 100 may determine the second encoding units 1910a, 1910b, 1920a, 1920b, 1930a, 1930b, 1930c, 1930d, and the like by dividing the first encoding unit 1900. Referring to fig. 19, non-square-shaped second encoding units 1910a, 1910b, 1920a and 1920b determined by dividing the first encoding unit 1900 only in the horizontal direction or the vertical direction may be independently divided based on block shape information and division shape information of each encoding unit. For example, the video decoding apparatus 100 may determine the third encoding units 1916a, 1916b, 1916c, and 1916d by dividing the second encoding units 1910a and 1910b generated by dividing the first encoding unit 1900 in the vertical direction in the horizontal direction, and may determine the third encoding units 1926a, 1926b, 1926c, and 1926d by dividing the second encoding units 1920a and 1920b generated by dividing the first encoding unit 1900 in the horizontal direction in the vertical direction. The process of dividing the second encoding units 1910a, 1910b, 1920a and 1920b has been described above through fig. 17, and thus a detailed description thereof will be omitted.
According to an embodiment, the video decoding apparatus 100 may process the coding units in a predetermined order. The feature of processing the encoding units in a predetermined order has been described above through fig. 14, and thus a detailed description thereof is omitted. Referring to fig. 19, the video decoding apparatus 100 may determine four square-shaped third coding units 1916a, 1916b, 1916c, and 1916d and 1926a, 1926b, 1926c, and 1926d by dividing the square-shaped first coding unit 1900. According to an embodiment, the video decoding apparatus 100 may determine the processing order of the third coding units 1916a, 1916b, 1916c, and 1916d and 1926a, 1926b, 1926c, and 1926d according to the shape in which the first coding unit 1900 is divided.
According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 1916a, 1916b, 1916c, and 1916d by dividing the second encoding units 1910a and 1910b generated by dividing the first encoding unit 1900 in the vertical direction, and the video decoding apparatus 100 may process the third encoding units 1916a and 1916c included in the left-side second encoding unit 1910a first in the vertical direction and then process the third encoding units 1916b and 1916d included in the right-side second encoding unit 1910b in the vertical direction in the order 1917.
According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 1926a, 1926b, 1926c, and 1926d by dividing the second encoding units 1920a and 1920b generated by dividing the first encoding unit 1900 in the horizontal direction in the vertical direction, and the video decoding apparatus 100 may process the third encoding units 1926a and 1926b included in the upper-end second encoding unit 1920a in the horizontal direction first and then process the third encoding units 1926c and 1926d included in the lower-end second encoding unit 1920b in the horizontal direction in order 1927.
Referring to fig. 19, square-shaped third encoding units 1916a, 1916b, 1916c, and 1916d and 1926a, 1926b, 1926c, and 1926d may be determined by dividing the second encoding units 1910a, 1910b, 1920a, and 1920b, respectively. Although the second coding units 1910a and 1910b determined by division in the vertical direction and the second coding units 1920a and 1920b determined by division in the horizontal direction are different shapes from each other, according to the third coding units 1916a, 1916b, 1916c, and 1916d and 1926a, 1926b, 1926c, and 1926d determined later, the result is a division result of the first coding unit 1900 into coding units of the same shape. Accordingly, the video decoding apparatus 100 recursively divides the coding units in different manners based on at least one of the block shape information and the division shape information, and even if the coding units of the same shape are determined as a result, a plurality of coding units determined to be the same shape can be processed in different orders.
Fig. 20 illustrates a process of determining a depth of a coding unit as a shape and a size of the coding unit change when the coding unit is recursively divided to determine a plurality of coding units according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit is divided into 2n times (n >0) the length of the long side of the current coding unit before division, the video decoding apparatus 100 may determine that the depth of the current coding unit is increased by n more than the depth of the coding unit before division. In the following description, a coding unit having an increased depth is expressed as a coding unit of a deeper depth.
Referring to fig. 20, according to an embodiment, the video decoding apparatus 100 may determine the second encoding unit 2002 and the third encoding unit 2004 of the lower depth based on block shape information indicating a SQUARE shape (for example, the block shape information may be expressed as "0: SQUARE") dividing the first encoding unit 2000 of the SQUARE shape. Assuming that the size of the square first coding unit 2000 is 2N × 2N, the second coding unit 2002 determined by dividing the width and height of the first coding unit 2000 into 1/21 may have a size of N × N. Further, the third encoding unit 2004 determined by dividing the width and height of the second encoding unit 2002 into 1/2 may have a size of N/2 × N/2. In this case, the width and height of the third encoding unit 2004 are 1/22 times the width and height of the first encoding unit 2000. When the depth of the first coding unit 2000 is D, the depth of the second coding unit 2002 having a width and height 1/21 times that of the first coding unit 2000 may be D +1, and the depth of the third coding unit 2004 having a width and height 1/22 times that of the first coding unit 2000 may be D + 2.
According to an embodiment, the video decoding apparatus 100 may determine the second coding unit 2012 or 2022 and the third coding unit 2014 or 2024 of the lower depth by dividing the first coding unit 2010 or 2020 of the non-square shape based on block shape information indicating the non-square shape (e.g., the block shape information may be expressed as "1: NS _ VER" indicating a non-square shape having a height longer than a width, or "2: NS _ HOR" indicating a non-square shape having a width longer than a height).
The video decoding apparatus 100 may determine the second encoding units 2002, 2012, and 2022, etc. by dividing at least one of the width and the height of the first encoding unit 2010 having a size of N × 2N. In other words, the video decoding apparatus 100 may determine the second encoding unit 2002 of size N × N or the second encoding unit 2022 of size N × N/2 by dividing the first encoding unit 2010 in the horizontal direction, or may determine the second encoding unit 2012 of size N/2 × N by dividing the first encoding unit 2010 in the horizontal direction and the vertical direction.
According to an embodiment, the video decoding apparatus 100 may determine the second encoding units 2002, 2012, 2022, etc. by dividing at least one of the width and the height of the first encoding unit 2020 having a size of 2N × N. In other words, the video decoding apparatus 100 may determine the second encoding unit 2002 of size N × N or the second encoding unit 2012 of size N/2 × N by dividing the first encoding unit 2020 in the vertical direction, or may determine the second encoding unit 2022 of size N × N/2 by dividing the first encoding unit 2020 in the horizontal direction and the vertical direction.
According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 2004, 2014, 2024, and the like by dividing at least one of the width and the height of the second encoding unit 2002 of size N × N. In other words, the video decoding apparatus 100 determines the third encoding unit 2004 of size N/2 × N/2, the third encoding unit 2014 of size N/22 × N/2, or the third encoding unit 2024 of size N/2 × N/22 by dividing the second encoding unit 2002 in the vertical direction and the horizontal direction.
According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 2004, 2014, 2024, and the like by dividing at least one of the width and the height of the second encoding unit 2012 of size N/2 × N. In other words, the video decoding apparatus 100 may determine the third coding unit 2004 of size N/2 × N/2 or the third coding unit 2024 of size N/2 × N/22 by dividing the second coding unit 2012 in the horizontal direction, or may determine the third coding unit 2014 of size N/22 × N/2 by dividing the second coding unit 2012 in the vertical direction and the horizontal direction.
According to an embodiment, the video decoding apparatus 100 may determine the third encoding units 2004, 2014, 2024, and the like by dividing at least one of the width and the height of the second encoding unit 2022 having a size of N × N/2. In other words, the video decoding apparatus 100 may determine the third encoding unit 2004 of size N/2 × N/2 or the third encoding unit 2014 of size N/22 × N/2 by dividing the second encoding unit 2022 in the vertical direction, or may determine the third encoding unit 2024 of size N/2 × N/22 by dividing the second encoding unit 2022 in the vertical direction and the horizontal direction.
According to an embodiment, the video decoding apparatus 100 may divide the square encoding units 2000, 2002, and 2004 in a horizontal direction or a vertical direction. For example, the video decoding apparatus 100 may determine the first coding unit 2010 of size N × 2N by dividing the first coding unit 2000 of size 2N × 2N in the vertical direction, or may determine the first coding unit 2020 of size 2N × N by dividing the first coding unit 2000 in the horizontal direction. According to an embodiment, when determining the depth based on the length of the longest side of the coding unit, the depth of the coding unit determined by dividing the first coding unit 2000, 2002, or 2004 having the size of 2N × 2N in the horizontal direction or the vertical direction may be the same as the depth of the first coding unit 2000, 2002, or 2004.
According to an embodiment, the width and height of the third encoding unit 2014 or 2024 may be 1/22 times the width and height of the first encoding unit 2010 or 2020. When the depth of the first coding unit 2010 or 2020 is D, the depth of the second coding unit 2012 or 2014 having a width and height 1/2 times that of the first coding unit 2010 or 2020 may be D +1, and the depth of the third coding unit 2014 or 2024 having a width and height 1/22 times that of the first coding unit 2010 or 2020 may be D + 2.
Fig. 21 illustrates a depth that can be determined based on the shape and size of a coding unit and a partial index (hereinafter, referred to as PID) for distinguishing the coding unit according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine the second coding units of various shapes by dividing the first coding unit 2100 of a square shape. Referring to fig. 21, the video decoding apparatus 100 may determine the second encoding units 2102a and 2102b, 2104a and 2104b, and 2106a, 2106b, 2106c, and 2106d by dividing the first encoding unit 2100 in at least one of a vertical direction and a horizontal direction according to the division shape information. In other words, the video decoding apparatus 100 can determine the second encoding units 2102a and 2102b, 2104a and 2104b, and 2106a, 2106b, 2106c, and 2106d based on the division shape information of the first encoding unit 2100.
According to an embodiment, the depths of the second encoding units 2102a and 2102b, 2104a and 2104b, and 2106a, 2106b, 2106c, and 2106d, which are determined according to the division shape information of the square first encoding unit 2100, may be determined based on the lengths of long sides thereof. For example, the length of one side of the square-shaped first encoding unit 2100 is equal to the length of the longer sides of the non-square-shaped second encoding units 2102a and 2102b and 2104a and 2104b, so the first encoding unit 2100 and the non-square-shaped second encoding units 2102a and 2102b and 2104a and 2104b may have the same depth D. However, when the video decoding apparatus 100 divides the first coding unit 2100 into four square-shaped second coding units 2106a, 2106b, 2106c and 2106D based on the division shape information, since the length of one side of the square-shaped second coding units 2106a, 2106b, 2106c and 2106D is 1/2 times the length of one side of the first coding unit 2100, the depth of the second coding units 2106a, 2106b, 2106c and 2106D may be D +1 that is 1 depth deeper than the depth D of the first coding unit 2100.
According to an embodiment, the video decoding apparatus 100 may divide the first encoding unit 2110 having a height longer than a width into a plurality of second encoding units 2112a and 2112b and 2114a, 2114b, and 2114c in the horizontal direction according to the division shape information. According to an embodiment, the video decoding apparatus 100 may divide the plurality of second encoding units 2122a and 2122b and 2124a, 2124b and 2124c by dividing the first encoding unit 2120 having a width longer than a height in a vertical direction according to the division shape information.
According to an embodiment, the depths of the second encoding units 2112a and 2112b, 2114a, 2114b and 2114c, 2122a and 2122b, 2124a, 2124b and 2124c, which are determined according to the division shape information of the non-square first encoding unit 2110 or 2120, may be determined based on the lengths of the long sides. For example, since the length of one side of the square second coding units 2112a and 2112b is 1/2 times the length of one side of the non-square-shaped first coding unit 2110 whose height is longer than its width, the depth of the square-shaped second coding units 2102a, 2102b, 2104a and 2104b is D +1 which is 1 depth deeper than the depth D of the non-square-shaped first coding unit 2110.
Also, the video decoding apparatus 100 may divide the non-square-shaped first encoding unit 2110 into odd number of second encoding units 2114a, 2114b, and 2114c based on the division shape information. The odd number of second encoding units 2114a, 2114b, and 2114c may include non-square-shaped second encoding units 2114a and 2114c and square-shaped second encoding units 2114 b. In this case, since the length of the long side of the non-square-shaped second coding units 2114a and 2114c and the length of one side of the square-shaped second coding unit 2114b are 1/2 times the length of one side of the first coding unit 2110, the depth of the second coding units 2114a, 2114b, and 2114c may be D +1 which is 1 depth deeper than the depth D of the first coding unit 2110. The video decoding apparatus 100 may determine the depth of the coding unit corresponding to the non-square-shaped first coding unit 2120 having a width longer than the height in a paradigm corresponding to the manner of determining the depth of the coding unit related to the first coding unit 2110.
According to an embodiment, when sizes of coding units divided into odd numbers are different from each other, the video decoding apparatus 100 may determine PIDs for distinguishing the divided coding units based on a size ratio between the coding units. Referring to fig. 21, the coding unit 2114b divided into the center position among the odd-numbered coding units 2114a, 2114b, and 2114c may have a width equal to the width of the other coding units 2114a and 2114c and a height twice the height of the other coding units 2114a and 2114 c. In other words, in this case, the encoding unit 2114b located at the center position may include two other encoding units 2114a and 2114 c. Therefore, when the PID of the encoding unit 2114b located at the center position is 1 according to the scanning order, the index of the encoding unit 2114c located in the next order of the encoding unit 2114b can be increased by 3 of 2. In other words, there may be discontinuity of index values. According to an embodiment, the video decoding apparatus 100 may determine whether coding units divided into odd numbers do not have equal sizes based on whether there is discontinuity in PIDs for distinguishing the divided coding units.
According to an embodiment, the video decoding apparatus 100 may determine whether to divide into a specific division shape based on a value of an index for distinguishing a plurality of coding units determined by dividing a current coding unit. Referring to fig. 21, the video decoding apparatus 100 may determine even-numbered encoding units 2112a and 2112b or odd-numbered encoding units 2114a, 2114b, and 2114c by dividing a first encoding unit 2110 having a rectangular shape with a height longer than a width. The video decoding apparatus 100 may distinguish each of the plurality of coding units using a PID indicating each coding unit. According to an embodiment, the PID may be obtained from a sample (e.g., the left upper end sample) of a predetermined position of each coding unit.
According to an embodiment, the video decoding apparatus 100 may encode a coding unit of a predetermined position in a unit by determining a partition using an index for distinguishing the coding unit. According to an embodiment, when the division shape information of the first encoding unit 2110 having a rectangular shape whose height is longer than its width indicates to be divided into three encoding units, the video decoding apparatus 100 may divide the first encoding unit 2110 into three encoding units 2114a, 2114b, and 2114 c. The video decoding apparatus 100 may assign an index to each of the three encoding units 2114a, 2114b, and 2114 c. The video decoding apparatus 100 may compare the indexes of each coding unit in order to determine a coding unit of a center position among the coding units divided into an odd number. The video decoding apparatus 100 may determine the second coding unit 2114b having an index corresponding to the center value among the indexes as a coding unit at the center position among the coding units determined by the first coding unit 2110 being divided, based on the index of the coding unit. According to an embodiment, the video decoding apparatus 100 may determine an index for distinguishing the divided coding units based on a size ratio between the coding units. Referring to fig. 21, the encoding unit 2114b generated by dividing the first encoding unit 2110 may have a width equal to the widths of the other encoding units 2114a and 2114c and a height twice the height of the other encoding units 2114a and 2114 c. In this case, when the index PID of the encoding unit 2114b located at the center position is 1, the index of the encoding unit 2114c located in the next order of the encoding unit 2114b may be 3 increased by 2. Accordingly, in the case where the increase amplitude of the index becomes different when increasing so uniformly, the video decoding apparatus 100 may determine that the current coding unit is divided into a plurality of coding units including a coding unit having a size different from other coding units. According to an embodiment, when the division shape information indicates that the coding unit is divided into an odd number of coding units, the video decoding apparatus 100 may divide the current coding unit into: a coding unit of a predetermined position (for example, a coding unit of a center position) among the odd-numbered coding units has a size different from the sizes of the other coding units. In this case, the video decoding apparatus 100 may determine the coding units having the center positions of different sizes by using the index PIDs of the coding units. However, the above-described index, the size or position of the coding unit at the predetermined position to be determined are specific for describing an embodiment, which should not be construed as being limited thereto, and various indexes and various positions and sizes of the coding unit may be used.
According to an embodiment, the video decoding apparatus 100 may use a predetermined data unit that starts recursive division of a coding unit.
Fig. 22 illustrates determining a plurality of coding units from a plurality of predetermined data units included in a picture according to an embodiment.
According to an embodiment, the predetermined data unit may be defined as a data unit for starting to recursively divide the coding unit using at least one of the block shape information and the division shape information. In other words, the predetermined data unit may correspond to a coding unit of the uppermost bit depth used in determining a plurality of coding units by dividing the current picture. In the following description, for convenience of explanation, a predetermined data unit is referred to as a reference data unit.
According to an embodiment, the reference data unit may have a predetermined size and a predetermined shape. According to an embodiment, the reference coding unit may include M × N samples. Here, M and N may be equal to each other and may be integers expressed as powers of 2. In other words, the reference data unit may have a square or non-square shape and may be divided into an integer number of coding units.
According to an embodiment, the video decoding apparatus 100 may divide a current picture into a plurality of reference data units. According to an embodiment, the video decoding apparatus 100 may divide a plurality of reference data units of a current picture by using division shape information on each of the plurality of reference data units. Such a division process of the reference data unit may correspond to a division process using a quad-tree (quad-tree) structure.
According to an embodiment, the video decoding apparatus 100 may determine in advance a minimum size that a reference data unit included in a current picture may have. Accordingly, the video decoding apparatus 100 may determine reference data units having various sizes equal to or larger than the minimum size, and may determine one or more coding units using the block shape information and the partition shape information with reference to the determined reference data units.
Referring to fig. 22, video decoding apparatus 100 may use square-shaped reference coding section 2200 or may use non-square-shaped reference coding section 2202. According to an embodiment, the shape and size of the reference coding unit may be determined according to various data units (e.g., sequence, picture, slice segment, maximum coding unit, etc.) that can include one or more reference coding units.
According to an embodiment, the obtaining section 105 of the video decoding apparatus 100 obtains at least one of shape information on a reference coding unit and size information on the reference coding unit from a bitstream in various data units. The process of determining one or more coding units included in the square-shaped reference coding unit 2200 has been described above through the operation of dividing the current coding unit 300 of fig. 10, and the process of determining one or more coding units included in the non-square-shaped reference coding unit 2202 has been described above through the process of dividing the current coding unit 1100 or 1150 of fig. 11. Therefore, a detailed description thereof will be omitted.
According to an embodiment, the video decoding apparatus 100 may use an index for identifying the size and shape of the reference coding unit to determine the size and shape of the reference coding unit from some data units previously determined based on a predetermined condition. In other words, the obtaining section 105 may obtain only an index for identifying the size and shape of the reference coding unit from the bitstream for each slice, slice segment, maximum coding unit that is a data unit of the various data units (e.g., a sequence, a picture, a slice segment, a maximum coding unit, and the like) satisfying a predetermined condition (e.g., a data unit having a size smaller than or equal to a slice). The video decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit satisfying the predetermined condition by using the index. When the shape information on the reference coding unit and the size information on the reference coding unit are obtained and used from the bitstream according to each data unit having a relatively small size, the use efficiency of the bitstream may not be high, and thus, the information on the shape of the reference coding unit and the information on the size of the reference coding unit are not directly obtained, but only the index is obtained and used. In this case, at least one of the size and the shape of the reference coding unit corresponding to an index indicating the size and the shape of the reference coding unit may be determined in advance. In other words, the video decoding apparatus 100 may select at least one of the size and the shape of the previously determined reference coding unit based on the index in order to determine at least one of the size and the shape of the reference coding unit included in the data unit as a criterion for obtaining the index.
According to an embodiment, the video decoding apparatus 100 may use at least one reference coding unit included in the maximum coding unit. In other words, the maximum coding unit of the divided image may include at least one reference coding unit, and the coding unit may be determined by a recursive division process of each reference coding unit. According to an embodiment, at least one of the width and the height of the maximum coding unit may correspond to an integer multiple of at least one of the width and the height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be equal to the size of the maximum coding unit divided n times according to the quadtree structure. In other words, the video decoding apparatus 100 may determine the reference coding unit by dividing the maximum coding unit n times according to the quadtree structure, and according to various embodiments, divide the reference coding unit based on at least one of the block shape information and the division shape information.
Fig. 23 illustrates a processing block used as a unit for determining the determination order of the reference coding unit included in the picture 2300 according to an embodiment.
According to an embodiment, the video decoding apparatus 100 may determine at least one processing block that divides a picture. The processing block is a data unit including at least one reference coding unit that divides the picture, and the at least one reference coding unit included in the processing block may be determined according to a specific order. In other words, the determination order in the at least one reference coding unit determined in each processing block may correspond to one of various orders for determining the reference coding unit, and the determination order in the reference coding unit determined in each processing block may be different according to the processing block. The determination order of the reference coding unit determined by the processing block may be one of various orders such as a raster scan order, a Z scan order, an N scan order, an upper right diagonal scan order, a horizontal scan order, a vertical scan order, and the like, but the determinable order should not be construed as being limited to the above scan order.
According to an embodiment, the video decoding apparatus 100 may obtain processing block size information and may determine a size of at least one processing block included in a picture. The video decoding apparatus 100 may obtain the processing block size information from the bitstream and may determine the size of at least one processing block included in the picture. The size of such a processing block may be a predetermined size of the data unit indicated by the processing block size information.
According to an embodiment, the obtaining section 105 of the video decoding apparatus 100 may obtain information on the size of the processing block from the bitstream according to each specific data unit. For example, information on the size of a processing block may be obtained from a bitstream in units of data such as images, sequences, pictures, slices, or slice segments. In other words, the obtaining section 105 may obtain information on the size of the processing block from the bitstream according to such several data units, and the video decoding apparatus 100 may determine the size of at least one processing block that divides the picture by using the obtained information on the size of the processing block, and the size of such processing block may be an integer multiple of the size of the reference coding unit.
According to an embodiment, the video decoding apparatus 100 may determine the size of the processing blocks 2302 and 2312 included in the picture 2300. For example, the video decoding apparatus 100 may determine the size of the processing block based on information on the size of the processing block obtained from the bitstream. Referring to fig. 23, according to an embodiment, the video decoding apparatus 100 may determine the horizontal size of the processing blocks 2302 and 2312 to be four times the horizontal size of a reference coding unit and determine the vertical size thereof to be four times the vertical size of the reference coding unit. The video decoding apparatus 100 may determine an order in which at least one reference coding unit is determined within at least one processing block.
According to an embodiment, the video decoding apparatus 100 may determine each of the processing blocks 2302 and 2312 included in the picture 2300 based on the size of the processing blocks, and determine a determination order of at least one reference coding unit included in the processing blocks 2302 and 2312. According to an embodiment, the determining of the reference coding unit may comprise determining a size of the reference coding unit.
According to an embodiment, the video decoding apparatus 100 may obtain information on a determined order of at least one reference coding unit included in at least one processing block from a bitstream, and determine an order in which at least one coding unit is determined based on the obtained information on the determined order. The information on the determined order may be defined as an order or a direction in which the reference coding unit is determined in the processing block. In other words, the order in which the reference coding units are determined can be independently determined by the processing block.
According to an embodiment, the video decoding apparatus 100 may obtain the determined order information of the reference coding unit from the bitstream in predetermined data units. For example, the obtaining section 105 obtains information on the determined order of the reference coding units from the bitstream in units of data (such as images, sequences, pictures, slices, slice segments, processing blocks, and the like). Since the information on the determined order of the reference coding units indicates the order in which the reference coding units are determined within the processing block, the information on the determined order can be obtained in a specific data unit including an integer number of the processing blocks.
According to an embodiment, the video decoding apparatus 100 may determine one or more reference coding units based on the determined determination order.
According to an embodiment, the obtaining part 105 may obtain information regarding the determined order of the reference coding units from the bitstream as information regarding the processing blocks 2302 and 2312, and the video decoding apparatus 100 may determine an order of determining at least one reference coding unit included in the processing blocks 2302 and 2312 and determine at least one reference coding unit included in the picture 2300 according to the determined order of the coding units. Referring to fig. 23, the video decoding apparatus 100 may determine the determination orders 2304 and 2314 of at least one reference coding unit respectively associated with the processing blocks 2302 and 2312. For example, when information on the determination order of the reference coding units is obtained by the processing blocks, the determination orders of the reference coding units related to the processing blocks 2302 and 2312 may be different from each other. For example, when information on the determination order of the reference coding units is obtained by the processing blocks, the determination orders of the reference coding units related to the processing blocks 2302 and 2312 may be different from each other. When the determination order 2304 related to the processing block 2302 is a raster scan order, the reference coding unit included in the processing block 2302 may be determined according to the raster scan order. In contrast, when the determination order 2314 related to the processing block 2312 is the reverse order of the raster scan order, the reference coding units included in the processing block 2312 may be determined in the reverse order of the raster scan order.
According to an embodiment, the frequency decoding apparatus 100 may decode the determined at least one reference coding unit. The video decoding apparatus 100 may decode an image based on the reference coding unit determined by the embodiment as described above. The method of decoding the reference coding unit may include various image decoding methods.
According to an embodiment, the video decoding apparatus 100 may obtain and use block shape information indicating a shape of a current coding unit or partition shape information indicating a method of partitioning the current coding unit from a bitstream. The block shape information or the division shape information may be included in a bitstream related to various data units. For example, the video decoding apparatus 100 may use block shape information or partition shape information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. In addition, the video decoding apparatus 100 may obtain and use syntax corresponding to block shape information or partition shape information from a bitstream according to a maximum coding unit, a reference coding unit, and a processing block.
The present disclosure has been described so far centering on various embodiments. Those having ordinary knowledge in the technical field to which the present disclosure pertains will appreciate that the present disclosure can be implemented in modified forms within a scope that does not depart from the essential characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered in a non-limiting sense, rather than a descriptive sense. The scope of the present disclosure is shown in the claims rather than the description set forth above, and all differences within the equivalent scope thereof should be construed as being included in the present disclosure.
Meanwhile, the foregoing embodiments of the present disclosure may be written as programs executable on a computer and may be implemented in general-use digital computers that execute the programs by using a computer readable recording medium. Examples of the computer readable recording medium include magnetic storage media (e.g., ROM, floppy disks, hard disks, etc.), optical recording media (e.g., CD-ROMs, or DVDs), and the like.

Claims (15)

1. A video decoding method, comprising the steps of:
determining a scan region including all significant transform coefficients in a current block;
scanning information related to transform coefficients in the scanning area in a predetermined scanning order;
performing binary arithmetic decoding based on the scanned information on the transform coefficients to generate binary arithmetic decoded information;
performing inverse binarization on the binary arithmetically decoded information to obtain information related to a transform coefficient of the current block;
generating a residual block of the current block by performing inverse quantization and inverse transform based on information related to transform coefficients of the current block; and
restoring the current block based on the generated residual block,
wherein the binary arithmetic decoding is performed using a context model determined based on at least one of a size and a shape of the current block.
2. The video decoding method of claim 1,
all significant transform coefficients in the current block are included in the quadrilateral scan area,
the remaining area within the current block, excluding the quadrilateral scanning area, includes only 0 s that are not significant transform coefficients.
3. The video decoding method of claim 1,
the scanning area is a quadrangular scanning area,
the step of determining the scan area comprises:
obtaining information on coordinates specifying a quadrangular scanning area from a bitstream; and
determining a quadrangular scanning area of the transform coefficients in the current block based on information on coordinates specifying the quadrangular scanning area,
wherein the coordinates in the horizontal direction specifying the quadrangular scanning area indicate the coordinates of the significant transform coefficient pixel located at the rightmost side in the current block,
the coordinates specifying the vertical direction of the quadrangular scanning area indicate the coordinates of the significant transform coefficient pixel located at the lowermost side in the current block,
including flag information in the bitstream, wherein the flag information indicates whether a difference between coordinate values in a horizontal direction and coordinate values in a vertical direction of a specified quadrangular scanning area is included in information related to coordinates specifying the quadrangular scanning area,
When the flag information indicates a difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction including the designated quadrangular scanning area, the information on the coordinates designating the quadrangular scanning area includes:
information indicating a coordinate for one direction among coordinates in a horizontal direction for a pixel of a significant transform coefficient located on the rightmost side in the current block and coordinates in a vertical direction for a pixel of a significant transform coefficient located on the lowermost side in the current block, and information indicating a difference between the coordinates for the one direction and the coordinates for the remaining directions.
4. The video decoding method of claim 1,
determining a size of the current block based on at least one of a minimum value and a maximum value of the height and the width of the current block,
the shape of the current block is determined based on whether the height and the width of the current block are the same, whether the height is greater than the width, or whether the width is greater than the height.
5. The video decoding method of claim 1,
the step of determining a scan area including all significant transform coefficients in the current block comprises:
generating an interchanged current block by interchanging a horizontal direction coordinate and a vertical direction coordinate indicating a position of a transform coefficient in the current block with each other when the height and the width of the current block are different; and
Determining a scan region including all significant transform coefficients in the interchanged current block,
wherein the step of determining a scan region comprising all significant transform coefficients in the interchanged current block comprises:
when the height and width of the current block are different, the horizontal direction coordinates and the vertical direction coordinates of the designated scanning area are interchanged with each other, and the scanning area is determined based on the interchanged horizontal direction coordinates and vertical direction coordinates.
6. The video decoding method of claim 5,
the bitstream includes information indicating whether flag information indicating whether a difference between coordinate values in a horizontal direction and coordinate values in a vertical direction of the designated scanning area is included and information related to coordinates of the designated scanning area,
the information on the coordinates of the designated scanning area includes information on the coordinates in the horizontal direction and information on the coordinates in the vertical direction of the designated scanning area,
when the flag information indicates that a difference between the coordinate values in the horizontal direction and the coordinate values in the vertical direction of the specified quadrangular scanning area is included, the information on the coordinates in the horizontal direction and the information on the coordinates in the vertical direction of the specified scanning area include: information indicating a coordinate for one direction of the coordinates for the horizontal direction and the coordinates for the vertical direction and information indicating a difference between the coordinates for the one direction and the coordinates for the remaining directions,
Wherein the step of determining a scan region comprising all significant transform coefficients in the interchanged current block comprises:
when the height and width of the current block are different from each other, the horizontal direction coordinates and the vertical direction coordinates obtained from the information on the coordinates specifying the scanning area are interchanged with each other, and the scanning area is determined based on the interchanged horizontal direction coordinates and vertical direction coordinates.
7. The video decoding method of claim 1,
a context model in the context model that relates to flag information of a current transform coefficient is determined based on at least one of: the size of the scan area, the number of coefficients that are scanned in the scan area before the current transform coefficient in a predetermined scan order, the relative position of the current transform coefficient in the scan area, and whether the current significant transform coefficient is the first transform coefficient in the scan area to be scanned in the predetermined scan order.
8. The video decoding method of claim 7,
when the context model related to the flag information of the current transform coefficient is determined based on the size of the scan area and the number of flag information of the transform coefficient scanned before the current transform coefficient in the predetermined scan order,
A context model related to flag information of a current transform coefficient is determined based on a predetermined context offset, wherein the predetermined context offset corresponds to a case where the number of flag information of transform coefficients scanned before the current coefficient is less than a predetermined value based on the size of a scan region.
9. The method of claim 7, wherein,
when determining a context model related to flag information of a current transform coefficient based on a relative position of the current transform coefficient in a scan region,
a context model related to the current transform coefficient is determined based on a predetermined context offset, wherein the predetermined context offset corresponds to a case where the coordinates of the current transform coefficient are less than a predetermined value based on the coordinates of the location of the designated scan area.
10. The video decoding method of claim 1,
the information related to the transform coefficient includes at least one of flag information indicating whether the transform coefficient is greater than a predetermined value, residual level information regarding an absolute value of a significant transform coefficient, sign information of the transform coefficient, and binarization parameter information for inverse binarization of the transform coefficient,
the predetermined value is at least one of 0, 1, and 2.
11. A video encoding method comprising the steps of:
obtaining a transformation coefficient of a current block;
determining a scan region including all significant transform coefficients in a current block;
scanning information on transform coefficients included in the scanning area in a predetermined scanning order and performing binarization based on the scanned information on the transform coefficients to generate binarized information;
performing binary arithmetic encoding on the binarized information to generate entropy-encoded information; and
generating a bitstream including the entropy-encoded information,
wherein the binary arithmetic encoding is performed using a context model determined based on at least one of a size and a shape of the current block.
12. The video coding method of claim 9,
the scanning area is a quadrangular scanning area,
the coordinates in the horizontal direction specifying the quadrangular scanning area indicate the coordinates of the significant transform coefficient pixel located at the rightmost side in the current block,
the coordinates specifying the vertical direction of the quadrangular scanning area indicate the coordinates of the significant transform coefficient pixel located at the lowermost side in the current block,
including information on coordinates specifying a quadrangular scanning area and flag information in a bitstream, wherein the flag information indicates whether a difference between coordinate values in a horizontal direction and coordinate values in a vertical direction specifying the quadrangular scanning area is included in the information on coordinates specifying the quadrangular scanning area,
Wherein, when the flag information indicates that a difference between a coordinate value in a horizontal direction and a coordinate value in a vertical direction of the specified quadrangular scanning area is included, the information on the coordinates of the specified quadrangular scanning area includes information indicating a coordinate for one direction out of a coordinate in the horizontal direction for a pixel of a significant transform coefficient located on the rightmost side in the current block and a coordinate in the vertical direction for a pixel of a significant transform coefficient located on the lowermost side in the current block, and information indicating a difference between the coordinate for the one direction and a coordinate for the remaining direction.
13. A video decoding apparatus, comprising:
an entropy decoding unit that determines a scan region including all significant transform coefficients in the current block, scans information related to the transform coefficients in the scan region in a predetermined scan order, performs binary arithmetic decoding based on the scanned information related to the transform coefficients to generate binary arithmetic decoded information, and performs inverse binarization on the binary arithmetic decoded information to obtain information related to the transform coefficients of the current block; and
an image restoring unit which generates a residual block of the current block by performing inverse quantization and inverse transformation based on information on a transform coefficient of the current block and restores the current block based on the generated residual block,
Wherein the binary arithmetic decoding is performed using a context model determined based on at least one of a size and a shape of the current block.
14. A video encoding device, comprising:
an entropy encoding unit obtaining transform coefficients of a current block, determining a scan area including all significant transform coefficients in the current block, scanning information related to the transform coefficients included in the scan area in a predetermined scan order, performing binarization based on the scanned information related to the transform coefficients to generate binarized information, and performing binary arithmetic encoding on the binarized information to generate entropy-encoded information; and
a bit stream generation unit generating a bit stream including entropy-encoded information,
wherein the binary arithmetic encoding is performed using a context model determined by at least one of a size and a shape based on the current block.
15. A computer-readable recording medium in which a program for implementing the video decoding method according to claim 1 is recorded.
CN201880089530.4A 2018-01-02 2018-03-30 Video decoding method and apparatus thereof, and video encoding method and apparatus thereof Active CN111727606B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310308625.3A CN116132694A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium
CN202310312637.3A CN116112669A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
US201862612840P 2018-01-02 2018-01-02
US62/612,840 2018-01-02
PCT/KR2018/003830 WO2019135448A1 (en) 2018-01-02 2018-03-30 Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor

Related Child Applications (2)

Application Number Title Priority Date Filing Date
CN202310312637.3A Division CN116112669A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium
CN202310308625.3A Division CN116132694A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium

Publications (2)

Publication Number Publication Date
CN111727606A true CN111727606A (en) 2020-09-29
CN111727606B CN111727606B (en) 2023-04-11

Family

ID=67143807

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202310312637.3A Pending CN116112669A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium
CN201880089530.4A Active CN111727606B (en) 2018-01-02 2018-03-30 Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
CN202310308625.3A Pending CN116132694A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310312637.3A Pending CN116112669A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202310308625.3A Pending CN116132694A (en) 2018-01-02 2018-03-30 Video decoding method, video encoding method, and computer-readable recording medium

Country Status (3)

Country Link
KR (1) KR20200096537A (en)
CN (3) CN116112669A (en)
WO (1) WO2019135448A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113068033A (en) * 2021-03-11 2021-07-02 腾讯科技(深圳)有限公司 Multimedia inverse quantization processing method, device, equipment and storage medium
WO2022174638A1 (en) * 2021-02-22 2022-08-25 腾讯科技(深圳)有限公司 Video coding method and apparatus, video decoding method and apparatus, computer readable medium, and electronic device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842916A (en) * 2019-08-27 2023-03-24 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070171985A1 (en) * 2005-07-21 2007-07-26 Samsung Electronics Co., Ltd. Method, medium, and system encoding/decoding video data using bitrate adaptive binary arithmetic coding
CN103404141A (en) * 2011-06-27 2013-11-20 英国广播公司 Video encoding and decoding using transforms
CN104247420A (en) * 2012-04-16 2014-12-24 高通股份有限公司 Transform coefficient coding
WO2017043760A1 (en) * 2015-09-08 2017-03-16 삼성전자 주식회사 Device and method for entropy encoding and decoding

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130028329A1 (en) * 2011-07-22 2013-01-31 General Instrument Corporation Device and methods for scanning rectangular-shaped transforms in video coding
US9866829B2 (en) * 2012-01-22 2018-01-09 Qualcomm Incorporated Coding of syntax elements that correspond to coefficients of a coefficient block in video coding

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070171985A1 (en) * 2005-07-21 2007-07-26 Samsung Electronics Co., Ltd. Method, medium, and system encoding/decoding video data using bitrate adaptive binary arithmetic coding
CN103404141A (en) * 2011-06-27 2013-11-20 英国广播公司 Video encoding and decoding using transforms
CN104247420A (en) * 2012-04-16 2014-12-24 高通股份有限公司 Transform coefficient coding
WO2017043760A1 (en) * 2015-09-08 2017-03-16 삼성전자 주식회사 Device and method for entropy encoding and decoding

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022174638A1 (en) * 2021-02-22 2022-08-25 腾讯科技(深圳)有限公司 Video coding method and apparatus, video decoding method and apparatus, computer readable medium, and electronic device
CN113068033A (en) * 2021-03-11 2021-07-02 腾讯科技(深圳)有限公司 Multimedia inverse quantization processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111727606B (en) 2023-04-11
CN116112669A (en) 2023-05-12
KR20200096537A (en) 2020-08-12
CN116132694A (en) 2023-05-16
WO2019135448A1 (en) 2019-07-11

Similar Documents

Publication Publication Date Title
JP6574025B2 (en) Video decoding method and video decoding apparatus
KR101974320B1 (en) Method, apparatus and medium for encoding and decoding a sub block of transform units of video data
JP7247282B2 (en) Method and apparatus for encoding or decoding coding unit of picture outline
CN110691244B (en) Method and apparatus for binarization and context adaptive coding of syntax in video coding
KR20180093950A (en) Image coding method and apparatus, image decoding method and apparatus
EP3389274A1 (en) Video decoding method and apparatus by chroma-multi-transform, and video encoding method and apparatus by chroma-multi-transform
CN113632472A (en) Extended multiple transform selection for video coding
CN111727606B (en) Video decoding method and apparatus thereof, and video encoding method and apparatus thereof
EP3503550A1 (en) Method and device for encoding or decoding luma block and chroma block
KR20180107153A (en) Image coding method and apparatus, image decoding method and apparatus
US11936870B2 (en) Image encoding method and device, and image decoding method and device
KR20040018413A (en) Lossless intraframe encoding using golomb-rice
KR20190039790A (en) METHOD AND APPARATUS FOR ENCODING / DECODING IMAGE
US7190840B2 (en) Transform coefficient compression using multiple scans
US20130195200A1 (en) Methods and devices for context modeling to enable modular processing
CN111788830B (en) Video decoding method and device, and video encoding method and device
EP2999218A1 (en) Method and apparatus for unification of significance map context selection
EP2621175A2 (en) Methods and devices for context modeling to enable modular processing
KR20240049294A (en) Extended operating range for versatile video coding
KR100359813B1 (en) Alternative Double Scan For Video Coding And Decoding
KR20180075484A (en) METHOD AND APPARATUS FOR ENCODING / DECODING IMAGE
KR19980076041A (en) Run-level symbol decoding method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant