Apparatus for entropy encoding and decoding and method thereof
By adapting entropy coding methods to different slice types in video signals using specific thresholds, the method optimizes probability modeling, improving encoding and decoding efficiency.
Patent Information
- Application Number
- CN202380032981.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-09-08
- Filing Date
- 2023-03-09
- Publication Date
- 2024-12-13
AI Technical Summary
Existing entropy coding methods in video compression, such as context-based adaptive M-ary arithmetic coding (CAMAC), do not effectively adapt to different slice types (I, B, P) in video signals, leading to suboptimal probability modeling and encoding efficiency.
Implementing a method and device that determine different scaling factors for updating symbol probabilities based on slice types (I, B, P) using specific thresholds, enhancing the entropy decoding and encoding processes.
Improves the efficiency of entropy coding by optimizing probability modeling for different slice types, thereby enhancing the overall encoding and decoding performance.
Smart Images

Figure CN119137943A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to entropy coding and decoding, and more particularly, to a method and apparatus for updating a probability model in context-based binary arithmetic coding / decoding. Background Art
[0002] In H.264, MPEG-4, etc., a video signal is hierarchically divided into sequences, frames, slices, macroblocks, and blocks, where a block is the smallest processing unit. Considering the encoding, the residual data of the block is obtained by intra-frame or inter-frame prediction. In addition, the residual data is compressed by transformation, quantization, scanning, run length coding, and entropy coding. As an entropy coding method, there is context-based adaptive M-ary arithmetic coding (CAMAC). CAMAC is an entropy coding scheme, which can be called context-based adaptive multi-symbol arithmetic coding. According to CAMAC, arithmetic coding is performed based on multiple probabilities of symbol occurrence. Summary of the invention
[0003] Solution to the problem
[0004] According to an embodiment of the present disclosure, an entropy decoding method is provided. The entropy decoding method may include obtaining information about a slice type from a bitstream. The entropy decoding method may include performing arithmetic decoding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The entropy decoding method may include determining a first scaling factor for updating the probability of occurrence of the symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The entropy decoding method may include determining a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The entropy decoding method may include updating the probability of occurrence of the symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0005] According to an embodiment of the present disclosure, an entropy decoding device is provided. The entropy decoding device may include at least one processor. The at least one processor may be configured to obtain information about a slice type from a bitstream. The at least one processor may be configured to perform arithmetic decoding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The at least one processor may be configured to determine a first scaling factor for updating the probability of occurrence of a symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The at least one processor may be configured to determine a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The at least one processor may be configured to update the probability of occurrence of a symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0006] According to an embodiment of the present disclosure, an entropy coding method is provided. The entropy coding method may include obtaining information about a slice type from a bitstream. The entropy coding method may include performing arithmetic coding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The entropy coding method may include determining a first scaling factor for updating the probability of occurrence of the symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The entropy coding method may include determining a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The entropy coding method may include updating the probability of occurrence of the symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0007] According to an embodiment of the present disclosure, an entropy coding device is provided. The entropy coding device may include at least one processor. The at least one processor may be configured to obtain information about a slice type from a bitstream. The at least one processor may be configured to perform arithmetic coding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The at least one processor may be configured to determine a first scaling factor for updating the probability of occurrence of a symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The at least one processor may be configured to determine a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The at least one processor may be configured to update the probability of occurrence of a symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] FIG. 1 a is a block diagram of an image decoding apparatus according to an embodiment of the present disclosure.
[0009] FIG. 1 b is a block diagram of an image decoder according to an embodiment of the present disclosure.
[0010] FIG. 1c is a block diagram of an image decoding apparatus according to an embodiment of the present disclosure.
[0011] FIG. 2a is a block diagram of an image encoding apparatus according to an embodiment of the present disclosure.
[0012] FIG. 2 b is a block diagram of an image encoder according to an embodiment of the present disclosure.
[0013] FIG. 2C is a block diagram of an image encoding apparatus according to an embodiment of the present disclosure.
[0014] FIG. 3 illustrates a process of determining at least one coding unit by splitting a current coding unit, which is performed by an image decoding apparatus according to an embodiment of the present disclosure.
[0015] FIG. 4 illustrates a process of determining at least one coding unit by splitting non-square coding units, which is performed by an image decoding apparatus according to an embodiment of the present disclosure.
[0016] FIG. 5 illustrates a process of partitioning a coding unit based on at least one of block shape information or partition shape mode information, performed by an image decoding device according to an embodiment of the present disclosure.
[0017] FIG. 6 illustrates a method for determining a predetermined coding unit from an odd number of coding units, performed by an image decoding apparatus according to an embodiment of the present disclosure.
[0018] FIG. 7 illustrates an order of processing a plurality of coding units when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment of the present disclosure.
[0019] FIG. 8 illustrates a process of determining that a current coding unit is to be split into an odd number of coding units, performed by an image decoding apparatus, when coding units are not processable in a predetermined order according to an embodiment of the present disclosure.
[0020] FIG. 9 illustrates a process of determining at least one coding unit by splitting a first coding unit, which is performed by an image decoding apparatus according to an embodiment of the present disclosure.
[0021] 10 shows that when a second coding unit having a non-square shape determined when an image decoding device splits a first coding unit satisfies a specific condition, shapes into which the second coding unit can be split are restricted according to an embodiment of the present disclosure.
[0022] FIG. 11 illustrates a process of partitioning a square coding unit, performed by an image decoding device according to an embodiment of the present disclosure, when partition shape pattern information fails to indicate that the square coding unit is partitioned into four square coding units.
[0023] FIG. 12 shows that a processing order among a plurality of coding units may be changed depending on a process of splitting the coding units according to an embodiment of the present disclosure.
[0024] 13 illustrates a process of determining a depth of a coding unit when a shape and a size of a coding unit are changed when a coding unit is recursively split in order to determine a plurality of coding units according to an embodiment of the present disclosure.
[0025] FIG. 14 illustrates a depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment of the present disclosure.
[0026] FIG. 15 illustrates determining a plurality of coding units based on a plurality of specific data units included in a picture according to an embodiment of the present disclosure.
[0027] FIG. 16 illustrates a processing block used as a criterion for determining an order in which reference coding units included in a picture are determined according to an embodiment of the present disclosure.
[0028] FIG. 17 is a block diagram showing a configuration of an entropy encoding apparatus according to an embodiment of the present disclosure.
[0029] FIG. 18 is a schematic diagram of a probability update process for CAMAC according to an embodiment of the present disclosure.
[0030] FIG. 19 a is a schematic diagram of a process of performing arithmetic coding based on CAMAC according to an embodiment of the present disclosure.
[0031] FIG19B is a schematic diagram of a process of performing arithmetic coding based on CAMAC according to an embodiment of the present disclosure.
[0032] FIG. 19c is a schematic diagram of a process of performing arithmetic coding based on CAMAC according to an embodiment of the present disclosure.
[0033] FIG. 20 is a schematic diagram comparing a probability update process using one scaling factor and a probability update process using multiple scaling factors.
[0034] FIG. 21 is a flowchart of a method of updating a probability by using a scaling factor according to an embodiment of the present disclosure.
[0035] FIG. 22 is a flowchart of a method of updating probabilities by using multiple scaling factors according to an embodiment of the present disclosure.
[0036] FIG. 23 is a flowchart of a method of updating occurrence probabilities of symbols by using multiple scaling factors according to an embodiment of the present disclosure.
[0037] FIG. 24 is a flowchart of a method for determining a value of a scaling factor based on a syntax element corresponding to a current symbol according to an embodiment of the present disclosure.
[0038] FIG. 25 is a flowchart of a method for determining the number of symbols based on syntax elements according to an embodiment of the present disclosure.
[0039] FIG. 26 is a flowchart of a method for determining the occurrence probability of a symbol based on a context model according to an embodiment of the present disclosure.
[0040] FIG. 27 is a block diagram showing the configuration of an entropy decoding apparatus according to an embodiment of the present disclosure.
[0041] FIG. 28 is a flowchart of a method of updating probabilities by using scaling factors according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] Throughout the disclosure, the expression "at least one of a, b, or c" means only a, only b, only c, both a and b, both a and c, both b and c, all of a, b, and c, or variations thereof.
[0043] The advantages and features of the present disclosure and their implementation methods can be clearly understood with reference to the accompanying drawings, in which one or more embodiments of the present disclosure are shown. However, the present disclosure can be implemented in many different forms and should not be construed as limited to the one or more embodiments set forth herein; on the contrary, these one or more embodiments of the present disclosure are provided to make the present disclosure thorough and complete and to fully convey the concepts of the present disclosure to those of ordinary skill in the art, and the present disclosure is limited only by the scope of the claims.
[0044] The terms used herein will be briefly described, and one or more embodiments of the present disclosure will be described in detail.
[0045] The terms used herein are general terms widely used in the art in view of the functions of the present disclosure, but the terms may vary according to the intentions of those skilled in the art, precedents, or new technologies in the art. Terms arbitrarily selected by the applicant of the present disclosure may also be used in specific cases. In this case, their meanings will be described in detail in the detailed description of the present disclosure. Therefore, the terms must be defined based on the meaning of the terms and the overall description of the present disclosure, rather than simply stating the terms themselves.
[0046] It is to be understood that the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise.
[0047] It should be understood that when a component “includes” a component, the component does not exclude another component but may further include another component unless the context clearly states otherwise.
[0048] As used herein, the term "...apparatus / thing" refers to a software or hardware component that performs a specific function. However, the term "...apparatus / thing" is not limited to software or hardware. "...apparatus / thing" may be configured in an addressable storage medium, or may be configured to run on at least one processor. Thus, for example, "...apparatus / thing" includes components, processes, functions, properties, procedures, subroutines, program code segments, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables such as software components, object-oriented software components, class components, and task components. The functions and "...apparatus / things" provided in a component may be combined into a smaller number of components and "multiple...apparatus / things", or subdivided into additional components and multiple...apparatus / things".
[0049] In one embodiment of the present disclosure, the "… device / thing" may be implemented as a processor and a memory. The term "processor" should be broadly interpreted to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, etc. In some environments, a "processor" may represent an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. The term "processor" may represent a combination of processing devices, such as a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors coupled to a DSP core, or a combination of any other similar components.
[0050] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), nonvolatile RAM (NVRAM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage devices, registers, etc. A memory is considered to be in electronic communication with a processor when the processor can read information from and / or write information to the memory. Memory that is integrated into a processor is in electronic communication with the processor.
[0051] Hereinafter, "image" may refer to: a static image, such as a still image of a video; or a moving image, ie, a dynamic image, such as a video itself.
[0052] Hereinafter, "sample", i.e., data assigned to an image sampling position, refers to data to be processed. For example, pixel values in an image in the spatial domain and transform coefficients on a transform region may be samples. A unit including at least one of such samples may be defined as a block.
[0053] One or more embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings so that a person skilled in the art can easily implement the present disclosure. In addition, in the accompanying drawings, parts not related to the description will be omitted for simplicity of description.
[0054] One or more embodiments of the present disclosure will be described in detail below with reference to FIGS. 1 to 28 .
[0055] FIG. 1 a is a block diagram of an image decoding apparatus 100 according to an embodiment of the present disclosure.
[0056] The image decoding apparatus 100 may include a receiver 110 and a decoder 120. The receiver 110 and the decoder 120 may include at least one processor. In addition, the receiver 110 and the decoder 120 may include a memory storing instructions to be executed by the at least one processor.
[0057] The receiver 110 may receive a bitstream. The bitstream includes information obtained by encoding an image by the image encoding device 150 (see FIG. 2a). In addition, the bitstream may be transmitted from the image encoding device 150. The image encoding device 150 and the image decoding device 100 may be connected by wire or wirelessly, and the receiver 110 may receive the bitstream by wire or wirelessly. The receiver 110 may receive the bitstream from a storage medium such as an optical medium or a hard disk.
[0058] The decoder 120 may reconstruct an image based on information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing an image from the bitstream. The decoder 120 may reconstruct an image based on the syntax elements.
[0059] The decoder 120 may perform entropy decoding on the syntax elements obtained from the bitstream, and as an entropy coding method, context-based adaptive M-ary arithmetic coding (CAMAC) may be used. CAMAC may be referred to as context-based adaptive multi-symbol arithmetic coding. In an embodiment of the present disclosure, the decoder 120 may determine at least one scaling factor for updating the probability of occurrence of a symbol. The decoder 120 may obtain information about the slice type from the bitstream. The decoder 120 may perform arithmetic decoding on the current symbol corresponding to the syntax element based on the probability of occurrence of the symbol. When the information about the slice type indicates an I slice, the decoder 120 may determine a first scaling factor for updating the probability of occurrence of the symbol by using a first function, wherein the value of the first function is determined based on a first threshold. When the information about the slice type indicates a B or P slice, the decoder 120 may determine a first scaling factor for updating the probability of occurrence of the symbol by using a second function, wherein the value of the second function is determined based on a second threshold. The decoder 120 may update the probability of occurrence of the symbol by using the first scaling factor.
[0060] The operation of the image decoding apparatus 100 will be described in more detail with reference to FIG. 1 b .
[0061] FIG. 1 b is a block diagram of an image decoder 6000 according to an embodiment of the present disclosure.
[0062] The image decoder 6000 according to an embodiment of the present disclosure may perform operations performed by the decoder 120 of the image decoding device 100 to decode image data.
[0063] Referring to FIG. 1b, the entropy decoder 6150 receives a bit stream 6050 including coded image data to be decoded and coding information required for decoding, and parses the coded image data and coding information. The coded image data may include quantized transform coefficients. The dequantizer 6200 and the inverse transformer 6250 may reconstruct residual data from the quantized transform coefficients.
[0064] As described below, in an embodiment of the present disclosure, the entropy decoder 6150 may determine at least one scaling factor for updating the probability of occurrence of a symbol. The entropy decoder 6150 may obtain information about a slice type from the bitstream 6050. The entropy decoder 6150 may perform arithmetic decoding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. When the information about the slice type indicates an I slice, the entropy decoder 6150 may determine a first scaling factor for updating the probability of occurrence of a symbol by using a first function, wherein the value of the first function is determined based on a first threshold. When the information about the slice type indicates a B or P slice, the entropy decoder 6150 may determine a first scaling factor for updating the probability of occurrence of a symbol by using a second function, wherein the value of the second function is determined based on a second threshold. The entropy decoder 6150 may update the probability of occurrence of a symbol by using the first scaling factor.
[0065] The intra predictor 6400 may perform intra prediction on each block. The inter predictor 6350 may perform inter prediction on each block by using a reference image obtained by the reconstructed picture buffer 6300. The prediction data of each block generated by the intra predictor 6400 or the inter predictor 6350 may be added to the residual data to reconstruct the data of the spatial domain of the block of the current image, and the deblocker 6450 and the sample adaptive offset (SAO) executor 6500 may perform loop filtering on the reconstructed data of the spatial domain to output a filtered reconstructed image 6600. In addition, the reconstructed image stored in the reconstructed picture buffer 6300 may be output as a reference image.
[0066] For the decoder 120 of the image decoding device 100 that decodes image data, the phased operation of the image decoder 6000 according to an embodiment of the present disclosure may be performed on each block.
[0067] FIG. 1c is a block diagram of an image decoding apparatus 100 according to an embodiment of the present disclosure.
[0068] The image decoding device 100 according to an embodiment of the present disclosure may include a memory 130 and at least one processor 125 connected to the memory 130. The operation of the image decoding device 100 according to an embodiment of the present disclosure may be operated as a separate processor or may be operated under the control of a central processor. In addition, the memory 130 of the image decoding device 100 may store data received from an external source and data generated by the processor.
[0069] The memory 130 of the image decoding device 100 according to an embodiment of the present disclosure may store at least one instruction, which is configured to be executable by at least one processor 125. When the at least one instruction is executed, it may be configured to enable the at least one processor 125 to obtain information about the slice type from the bitstream. When the at least one instruction is executed, it may be configured to enable the processor 125 to perform arithmetic decoding on the current symbol corresponding to the syntax element based on the probability of occurrence of the symbol. When the at least one instruction is executed, it may be configured to enable the processor 125 to determine the first scaling factor for updating the probability of occurrence of the symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. When the at least one instruction is executed, it may be configured to enable the processor 125 to determine the first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. When the at least one instruction is executed, it may be configured to enable the at least one processor 125 to update the probability of occurrence of the symbol by using the first scaling factor.
[0070] FIG. 2 a is a block diagram of an image encoding device 150 according to an embodiment of the present disclosure.
[0071] The image encoding device 150 according to an embodiment of the present disclosure may include an encoder 155 and an outputter 160 .
[0072] The encoder 155 and the outputter 160 may include at least one processor. In addition, the encoder 155 and the outputter 160 may include a memory storing instructions to be executed by at least one processor. The encoder 155 and the outputter 160 may be implemented as separate hardware components or included in one hardware component.
[0073] The encoder 155 may obtain a prediction block of the current block based on the prediction mode of the current block, and transform and quantize a residual which is a difference between the current block and the prediction block, thereby encoding the residual. The outputter 160 may generate a bitstream including information on the prediction mode of the current block, structural information for determining a data unit having a hierarchical partition shape, etc., and output the bitstream.
[0074] The encoder 155 may perform entropy coding on a syntax element as encoding information generated in the encoding process, and as an entropy coding method, a context-based adaptive M-ary arithmetic coding (CAMAC) method may be used. CAMAC may be referred to as context-based adaptive multi-symbol arithmetic coding. In an embodiment of the present disclosure, the encoder 155 may obtain information about a slice type. The encoder 155 may perform arithmetic coding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. When the information about the slice type indicates an I slice, the encoder 155 may determine a first scaling factor for updating the probability of occurrence of the symbol by using a first function, wherein the value of the first function is determined based on a first threshold. When the information about the slice type indicates a B or P slice, the encoder 155 may determine a first scaling factor by using a second function, wherein the value of the second function is determined based on a second threshold.
[0075] FIG. 2B is a block diagram of an image encoder 7000 according to an embodiment of the present disclosure.
[0076] The image encoder 7000 according to an embodiment of the present disclosure may perform operations performed by the encoder 155 of the image encoding device 150 to encode image data.
[0077] That is, the intra predictor 7200 may perform intra prediction on each block of the current image 7050 , and the inter predictor 7150 may perform inter prediction on each block by using the current image 7050 and a reference image obtained by the reconstructed picture buffer 7100 .
[0078] The prediction data of each block output from the intra predictor 7200 or the inter predictor 7150 may be subtracted from the data of the encoded block of the current image 7050 to generate residual data, and the transformer 7250 and the quantizer 7300 may perform transformation and quantization on the residual data and output a quantized transformation coefficient of each block.
[0079] The dequantizer 7450 and the inverse transformer 7500 may perform dequantization and inverse transformation on the quantized transform coefficients to reconstruct the residual data in the spatial domain. The reconstructed residual data in the spatial domain may be added to the prediction data of each block output from the intra predictor 7200 or the inter predictor 7150 to be reconstructed as the data in the spatial domain of the block of the current image 7050. The deblocker 7550 and the SAO executor 7600 may perform in-loop filtering on the reconstructed data in the spatial domain to generate a filtered reconstructed image. The generated reconstructed image is stored in the reconstructed picture buffer 7100. The reconstructed image stored in the reconstructed picture buffer 7100 may be used as a reference image for inter prediction of other images. The entropy encoder 7350 may perform entropy encoding on the quantized transform coefficients so that the entropy encoded coefficients may be output as a bitstream 7400.
[0080] As described below, in an embodiment of the present disclosure, the entropy encoder 7350 may obtain information about a slice type. The entropy encoder 7350 may perform arithmetic coding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. When the information about the slice type indicates an I slice, the entropy encoder 7350 may determine a first scaling factor for updating the probability of occurrence of the symbol by using a first function, wherein the value of the first function is determined based on a first threshold. When the information about the slice type indicates a B or P slice, the entropy encoder 7350 may determine a first scaling factor by using a second function, wherein the value of the second function is determined based on a second threshold.
[0081] In order to apply the image encoder 7000 according to an embodiment of the present disclosure to the image encoding device 150, a phased operation of the image encoder 7000 according to an embodiment of the present disclosure may be performed on each block.
[0082] FIG. 2C is a block diagram of an image encoding device 150 according to an embodiment of the present disclosure.
[0083] The image encoding device 150 according to an embodiment of the present disclosure may include a memory 165 and at least one processor 170 connected to the memory 165. The operation of the image encoding device 150 according to an embodiment of the present disclosure may be operated as a separate processor or may be operated under the control of a central processor. In addition, the memory 165 of the image encoding device 150 may store data received from an external source and data generated by the processor.
[0084] The memory 165 of the image encoding device 150 according to an embodiment of the present disclosure may include at least one instruction, which is configured to be executed by at least one processor 170. When the at least one instruction is executed, it may be configured to enable the at least one processor 170 to obtain information about the slice type. When the at least one instruction is executed, it may be configured to enable the processor 170 to perform arithmetic coding on the current symbol corresponding to the syntax element based on the probability of occurrence of the symbol. When the at least one instruction is executed, it may be configured to enable the processor 170 to determine the first scaling factor for updating the probability of occurrence of the symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. When the at least one instruction is executed, it may be configured to enable the processor 170 to determine the first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold.
[0085] The segmentation of the coding unit will be described in detail below according to an embodiment of the present disclosure.
[0086] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more maximum coding units (coding tree units (CTUs)). Compared with the maximum coding unit (CTU), there is a maximum coding block (coding tree block (CTB)) in concept.
[0087] The largest coding unit (CTB) represents an N×N block (N is an integer) including N×N samples. Each color component can be divided into one or more largest coding blocks.
[0088] When a picture has three sample arrays (sample arrays of Y, Cr, and Cb components), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and syntax elements for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and syntax elements for encoding monochrome samples. When the picture is a picture encoded in a color plane separated according to color components, the maximum coding unit includes syntax elements for encoding the picture and picture samples.
[0089] One largest coding block (CTB) can be divided into M×N coding blocks (M and N are integers) including M×N samples.
[0090] When a picture has sample arrays of Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and syntax elements for encoding luma samples and chroma samples. When a picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and syntax elements for encoding monochrome samples. When a picture is a picture encoded in a color plane separated according to color components, a coding unit includes syntax elements for encoding the picture and picture samples.
[0091] As described above, the maximum coding block and the maximum coding unit are conceptually different from each other, and the coding block and the coding unit are conceptually different from each other. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block, which includes corresponding samples and syntax elements corresponding to the (maximum) coding block. However, because a person of ordinary skill in the art understands that a (maximum) coding unit or a (maximum) coding block refers to a block of a predetermined size including a predetermined number of samples, unless otherwise described, the maximum coding block and the maximum coding unit, or the coding block and the coding unit are mentioned in the following specification without distinction.
[0092] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square of the same size. However, the present disclosure is not limited thereto.
[0093] For example, information about the maximum size of the luma coding block may be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block may be one of 16×16, 32×32, 64×64, 128×128, and 256×256.
[0094] For example, information about the luma block size difference and the maximum size of the luma coding block that can be divided into two parts can be obtained from the bitstream. The information about the luma block size difference may refer to the size difference between the luma maximum coding unit and the maximum luma coding block that can be divided into two parts. Therefore, when the information about the maximum size of the luma coding block that can be divided into two parts obtained from the bitstream and the information about the luma block size difference are combined with each other, the size of the luma maximum coding unit can be determined. The size of the chroma maximum coding unit can be determined by using the size of the luma maximum coding unit. For example, when the ratio of Y:Cb:Cr is 4:2:0 according to the color format, the size of the chroma block may be half the size of the luma block, and the size of the chroma maximum coding unit may be half the size of the luma maximum coding unit.
[0095] According to an embodiment of the present disclosure, since the maximum size information of the luma coding block that can be divided into two is obtained from the bitstream, the maximum size of the luma coding block that can be divided into two can be variably determined. On the contrary, the maximum size of the luma coding block that can be divided into three can be fixed. For example, the maximum size of the luma coding block that can be divided into three in an I picture can be 32×32, and the maximum size of the luma coding block that can be divided into three in a P picture or a B picture can be 64×64.
[0096] In addition, the maximum coding unit may be hierarchically divided into coding units based on the division shape mode information obtained from the bitstream. At least one of information indicating whether to perform four divisions, information indicating whether to perform multiple divisions, division direction information, or division type information may be obtained from the bitstream as the division shape mode information.
[0097] For example, the information indicating whether to perform four splits may indicate whether the current coding unit is to be four splits (QUAD_SPLIT) or not to be four splits.
[0098] When the current coding unit is not quad-split, the information indicating whether to perform multi-split may indicate whether the current coding unit is no longer split (NO_SPLIT) or is to be bi / tri-split.
[0099] When the current coding unit is divided into two or three, the division direction information indicates that the current coding unit is divided in one of a horizontal direction and a vertical direction.
[0100] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit is split into two or three.
[0101] The split mode of the current coding unit may be determined according to the split direction information and the split type information. The split mode when the current coding unit is split into two in the horizontal direction may be determined as a horizontal two-split mode (SPLIT_BT_HOR), the split mode when the current coding unit is split into three in the horizontal direction may be determined as a horizontal three-split mode (SPLIT_TT_HOR), the split mode when the current coding unit is split into two in the vertical direction may be determined as a vertical two-split mode (SPLIT_BT_VER), and the split mode when the current coding unit is split into three in the vertical direction may be determined as a vertical three-split mode (SPLIT_TT_VER).
[0102] The image decoding device 100 can obtain segmentation shape mode information of a binary string from a bit stream. The form of the bit stream received by the image decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. A binary string is information in a binary number. A binary string may include at least one bit. The image decoding device 100 can obtain segmentation shape mode information corresponding to the binary string based on a segmentation rule. The image decoding device 100 can determine whether to divide the coding unit into four, whether to not divide the coding unit, the segmentation direction, and the segmentation type based on a binary string.
[0103] The coding unit may be smaller than or equal to the maximum coding unit. For example, because the maximum coding unit is a coding unit having the largest size, the maximum coding unit is one of the coding units. When the segmentation shape pattern information about the maximum coding unit indicates that segmentation is not performed, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. When the segmentation shape pattern information about the maximum coding unit indicates that segmentation is performed, the maximum coding unit may be segmented into coding units. In addition, when the segmentation shape pattern information about the coding unit indicates that segmentation is performed, the coding unit may be segmented into smaller coding units. However, the segmentation of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. The segmentation of the coding unit will be described in detail with reference to FIGS. 3 to 16.
[0104] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be smaller than or equal to the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be smaller than or equal to the coding unit.
[0105] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.
[0106] In an embodiment of the present disclosure, prediction may be performed by using a coding unit as a prediction block. In addition, transformation may be performed by using a coding unit as a transformation block.
[0107] The segmentation of the coding unit will be described in detail with reference to Figures 3 to 16. The current block and the adjacent block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction block, and the transformation block. In addition, the current block of the current coding unit is a block currently being decoded or encoded or a block currently being segmented. The adjacent block may be a block reconstructed before the current block. The adjacent block may be adjacent to the current block in space or time. The adjacent block may be located at one of the lower left, left, upper left, upper, upper right, right, and lower right positions of the current block.
[0108] FIG. 3 illustrates a process of determining at least one coding unit by splitting a current coding unit, which is performed by the image decoding apparatus 100 according to an embodiment of the present disclosure.
[0109] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. In this regard, N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, a ratio of width and height, or a size of width and height of a coding unit.
[0110] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same (ie, when the block shape of the coding unit is 4N×4N), the image decoding device 100 may determine the block shape information of the coding unit as a square. The image decoding device 100 may determine the shape of the coding unit as a non-square shape.
[0111] When the lengths of the width and height of the coding unit are different from each other (i.e., when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding device 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding device 100 may determine the ratio of the width and height in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. In addition, the image decoding device 100 may determine whether the coding unit is in the horizontal direction or in the vertical direction based on the width length and height length of the coding unit. In addition, the image decoding device 100 may determine the size of the coding unit based on at least one of the width length, height length, or area of the coding unit.
[0112] According to an embodiment of the present disclosure, the image decoding device 100 may determine the shape of the coding unit by using the block shape information, and may determine the partition method of the coding unit by using the partition shape mode information. That is, the partition method of the coding unit indicated by the partition shape mode information may be determined based on the block shape indicated by the block shape information used by the image decoding device 100.
[0113] The image decoding device 100 may obtain the partition shape mode information from the bitstream. However, the present disclosure is not limited thereto, and the image decoding device 100 and the image encoding device 150 may determine the pre-agreed partition shape mode information based on the block shape information. The image decoding device 100 may determine the pre-agreed partition shape mode information about the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the partition shape mode information about the maximum coding unit as four partitions. In addition, the image decoding device 100 may determine the partition shape mode information about the minimum coding unit as "no partition". In detail, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed partition shape mode information to be four partitions. Four partitions are a partition shape mode in which both the width and height of the coding unit are equally divided into two. Based on the partition shape mode information, the image decoding device 100 may obtain a 128×128-sized coding unit from a 256×256-sized maximum coding unit. In addition, the image decoding device 100 may determine the size of the minimum coding unit to be 4×4. The image decoding device 100 may obtain partition shape mode information indicating “no partition” with respect to the minimum coding unit.
[0114] According to an embodiment of the present disclosure, the image decoding device 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding device 100 may determine whether to not split the square coding unit, whether to split the square coding unit vertically, whether to split the square coding unit horizontally, or whether to split the square coding unit into four coding units based on the segmentation shape mode information. Referring to FIG. 3, when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine a coding unit 310a having the same size as the current coding unit 300 based on the segmentation shape mode information indicating no segmentation, or may determine a segmented coding unit 310b, 310c, 310d, 310e, or 310f based on the segmentation shape mode information indicating a specific segmentation method.
[0115] 3 , according to an embodiment of the present disclosure, the image decoding device 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding device 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding device 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment of the present disclosure, the image decoding device 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that three divisions are performed in the vertical direction. The image decoding device 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that three divisions are performed in the horizontal direction. However, the division shape of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. The specific partition shapes into which the square coding unit will be partitioned will be described in detail below in conjunction with the embodiments of the present disclosure.
[0116] FIG. 4 illustrates a process of determining at least one coding unit by splitting a non-square coding unit, performed by the image decoding apparatus 100 according to an embodiment of the present disclosure.
[0117] According to an embodiment of the present disclosure, the image decoding device 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding device 100 may determine whether to segment the non-square current coding unit or whether to segment the non-square current coding unit by using a specific method based on the segmentation shape pattern information. Referring to FIG. 4 , when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding device 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the segmentation shape pattern information indicating no segmentation, or determine the segmented coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c based on the segmentation shape pattern information indicating a specific segmentation method. The specific segmentation method for segmenting the non-square coding unit will be described in detail below in conjunction with the embodiments of the present disclosure.
[0118] According to an embodiment of the present disclosure, the image decoding device 100 may determine a partitioning method of a coding unit by using partitioning shape pattern information, in which case the partitioning shape pattern information may indicate the number of one or more coding units generated by partitioning the coding unit. Referring to FIG. 4 , when the partitioning shape pattern information indicates that the current coding unit 400 or 450 is partitioned into two coding units, the image decoding device 100 may determine two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by partitioning the current coding unit 400 or 450 based on the partitioning shape pattern information.
[0119] According to an embodiment of the present disclosure, when the image decoding device 100 partitions the non-square current coding unit 400 or 450 based on the partition shape mode information, the image decoding device 100 may partition the current coding unit 400 or 450 in consideration of the position of the long side of the non-square current coding unit 400 or 450. For example, considering the shape of the current coding unit 400 or 450, the image decoding device 100 may determine a plurality of coding units by partitioning the long side of the current coding unit 400 or 450.
[0120] According to an embodiment of the present disclosure, when the partition shape mode information indicates that the coding unit is partitioned (partitioned into three) into an odd number of blocks, the image decoding device 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, when the partition shape mode information indicates that the current coding unit 400 or 450 is partitioned into three coding units, the image decoding device 100 may partition the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.
[0121] According to an embodiment of the present disclosure, the ratio of the width and height of the current coding unit 400 or 450 may be 4:1 or 1:4. When the ratio of the width and the height is 4:1, the block shape information may be a horizontal direction because the length of the width is longer than the length of the height. When the ratio of the width and the height is 1:4, the block shape information may be a vertical direction because the non-square of the width is shorter than the length of the height. The image decoding device 100 may determine to partition the current coding unit into an odd number of blocks based on the partition shape mode information. In addition, the image decoding device 100 may determine the partition direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 corresponds to the vertical direction, because the height of the current coding unit 400 is greater than the width of the current coding unit 400, the image decoding device 100 may determine the coding units 430a, 430b, and 430c by partitioning the current coding unit 400 in the horizontal direction. Also, when the current coding unit 450 corresponds to a horizontal direction, because the width of the current coding unit 450 is greater than the height of the current coding unit 450 , the image decoding device 100 may determine the coding units 480 a , 480 b , and 480 c by splitting the current coding unit 450 in a vertical direction.
[0122] According to an embodiment of the present disclosure, the image decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and not all determined coding units may have the same size. For example, a specific coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have a size different from that of other coding units 430a and 430c or 480a and 480c. That is, the coding unit determined by splitting the current coding unit 400 or 450 may have a variety of sizes, and in some cases, all odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0123] According to an embodiment of the present disclosure, when the partition shape mode information indicates that the coding unit is partitioned into an odd number of blocks, the image decoding device 100 may determine the odd number of coding units included in the current coding unit 400 or 450, and further, may impose a specific restriction on at least one of the odd number of coding units generated by partitioning the current coding unit 400 or 450. Referring to FIG. 4 , the image decoding device 100 may set a decoding process of a coding unit 430b or 480b located at a center position among three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated by partitioning the current coding unit 400 or 450 to be different from the decoding process of other coding units 430a and 430c or 480a and 480c. For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding device 100 may restrict the coding unit 430b or 480b located at a center position to not be partitioned again or to be partitioned only a specific number of times.
[0124] FIG. 5 illustrates a process of partitioning a coding unit based on at least one of block shape information or partition shape mode information, performed by the image decoding device 100 according to an embodiment of the present disclosure.
[0125] According to an embodiment of the present disclosure, based on at least one of the block shape information or the segmentation shape pattern information, the image decoding device 100 may determine whether to segment or not segment the square first coding unit 500 into coding units. According to an embodiment of the present disclosure, when the segmentation shape pattern information indicates that the first coding unit 500 is segmented in the horizontal direction, the image decoding device 100 may determine the second coding unit 510 by segmenting the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment of the present disclosure are terms for understanding the relationship before and after the segmentation of the coding unit. For example, the second coding unit may be determined by segmenting the first coding unit, and the third coding unit may be determined by segmenting the second coding unit. It will be understood that the relationship between the first coding unit, the second coding unit, and the third coding unit follows the above description.
[0126] According to an embodiment of the present disclosure, based on the segmentation shape pattern information, the image decoding device 100 may determine whether to segment or not segment the determined second coding unit 510 into coding units. Referring to FIG. 5 , the image decoding device 100 may segment the non-square second coding unit 510 determined by segmenting the first coding unit 500 into one or more third coding units 520a or 520b, 520c, and 520d based on the segmentation shape pattern information, or may not segment. The image decoding device 100 may obtain the segmentation shape pattern information, and may determine a plurality of second coding units (e.g., 510) of various shapes by segmenting the first coding unit 500 based on the obtained segmentation shape pattern information, and may segment the second coding unit 510 by using the segmentation method of the first coding unit 500 based on the segmentation shape pattern information. According to an embodiment of the present disclosure, when the first coding unit 500 is divided into the second coding unit 510 based on the division shape mode information of the first coding unit 500, the second coding unit 510 may also be divided into the third coding unit 520a or 520b, 520c and 520d based on the division shape mode information of the second coding unit 510. That is, the coding unit may be recursively divided based on the division shape mode information of each coding unit. Therefore, the square coding unit may be determined by dividing the non-square coding unit, and the non-square coding unit may be determined by recursively dividing the square coding unit.
[0127] 5, a specific coding unit among the odd third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 (e.g., a coding unit located at a central position or a square coding unit) may be recursively divided. According to an embodiment of the present disclosure, the square third coding unit 520b among the odd third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units again. For example, a non-square fourth coding unit 530b or 530d may be divided into an odd number of coding units again. A method for recursively dividing a coding unit will be described below in conjunction with an embodiment of the present disclosure.
[0128] According to an embodiment of the present disclosure, the image decoding device 100 may divide each of the third coding unit 520a or 520b, 520c, and 520d into coding units based on the segmentation shape pattern information. In addition, the image decoding device 100 may determine not to divide the second coding unit 510 based on the segmentation shape pattern information. According to an embodiment of the present disclosure, the image decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding device 100 may impose specific restrictions on a specific third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third coding unit 520c located at the center position among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or to be divided a settable number of times.
[0129] 5 , the image decoding device 100 may restrict the third coding unit 520c (which is located at the center position of the odd-numbered third coding units 520b, 520c, and 520d included in the non-square second coding unit 510) from being split any more, split using a specific splitting method (e.g., split only into four coding units or split using the splitting method of the second coding unit 510), or split only a specific number of times (e.g., split only n times (where n>0)). However, the restriction on the third coding unit 520c located at the center position is not limited to the above example, and may include various restrictions for decoding the third coding unit 520c located at the center position differently from the other third coding units 520b and 520d.
[0130] According to an embodiment of the present disclosure, the image decoding device 100 may obtain partition shape pattern information for partitioning the current coding unit from a specific position in the current coding unit.
[0131] FIG. 6 illustrates a method of determining a specific coding unit from among odd-numbered coding units, performed by the image decoding apparatus 100 according to an embodiment of the present disclosure.
[0132] 6 , partition shape pattern information of the current coding unit 600 or 650 may be obtained from a sample at a specific position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the specific position in the current coding unit 600 from which at least one piece of partition shape pattern information may be obtained is not limited to the center position in FIG. 6 , and may include various positions (e.g., upper, lower, left, right, upper left, lower left, upper right, and lower right positions) included in the current coding unit 600. The image decoding device 100 may obtain the partition shape pattern information from the specific position, and may determine whether to partition or not partition the current coding unit into coding units of various shapes and various sizes.
[0133] According to an embodiment of the present disclosure, when the current coding unit is divided into a certain number of coding units, the image decoding apparatus 100 may select one of the coding units. Various methods may be used to select one of the plurality of coding units, as will be described below in conjunction with the embodiments of the present disclosure.
[0134] According to an embodiment of the present disclosure, the image decoding apparatus 100 may split a current coding unit into a plurality of coding units, and may determine the coding units at specific locations.
[0135] According to an embodiment of the present disclosure, the image decoding device 100 may use information indicating the positions of odd-numbered coding units to determine a coding unit located at a central position from among the odd-numbered coding units. Referring to FIG. 6 , the image decoding device 100 may determine odd-numbered coding units 620a, 620b, and 620c or odd-numbered coding units 660a, 660b, and 660c by splitting the current coding unit 600 or the current coding unit 650. The image decoding device 100 may determine the intermediate coding unit 620b or the intermediate coding unit 660b by using information about the positions of the odd-numbered coding units 620a, 620b, and 620c or the odd-numbered coding units 660a, 660b, and 660c. For example, the image decoding device 100 may determine the coding unit 620b located at a central position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of specific samples included in the coding units 620a, 620b, and 620c. In detail, the image decoding device 100 may determine the coding unit 620b of the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c.
[0136] According to an embodiment of the present disclosure, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment of the present disclosure, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding device 100 can determine the coding unit 620b located at the center position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture, or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.
[0137] According to an embodiment of the present disclosure, information indicating the position of the upper left sample 630a of the upper coding unit 620a may include coordinates (xa, ya), information indicating the position of the upper left sample 630b of the middle coding unit 620b may include coordinates (xb, yb), and information indicating the position of the upper left sample 630c of the lower coding unit 620c may include coordinates (xc, yc). The image decoding device 100 may determine the middle coding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample 630b located at the center position may be determined as the coding unit located at the center position among the coding units 620a, 620b, and 620c determined by splitting the current coding unit 600. However, the coordinates indicating the positions of the upper left samples 630a, 630b, and 630c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample 630b of the middle coding unit 620b with respect to the position of the upper left sample 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample 630c of the lower coding unit 620c may be used. The method of determining the coding unit at a specific position by using the coordinates of the samples included in the coding unit as information indicating the sample positions is not limited to the above method, and may include various arithmetic methods capable of using the sample coordinates.
[0138] According to an embodiment of the present disclosure, the image decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a specific criterion. For example, the image decoding device 100 may select a coding unit 620b having a size different from that of other coding units from among the coding units 620a, 620b, and 620c.
[0139] According to an embodiment of the present disclosure, the image decoding device 100 may determine the width or height of each of the coding units 620a, 620b, and 620c by using coordinates (xa, ya), (xb, yb), and (xc, yc), where the coordinates (xa, ya) are information indicating the position of the upper left sample 630a of the upper coding unit 620a, the coordinates (xb, yb) are information indicating the position of the upper left sample 630b of the middle coding unit 620b, and the coordinates (xc, yc) are information indicating the position of the upper left sample 630c of the lower coding unit 620c. The image decoding device 100 may determine the respective sizes of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding device 100 may determine the height of the upper coding unit 620a as yb-ya. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width of the middle coding unit 620b as the width of the current coding unit 600. The image decoding device 100 may determine the height of the middle coding unit 620b as yc-yb. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 or the width or height of the upper coding unit 620a and the middle coding unit 620b. The image decoding device 100 may determine a coding unit having a size different from that of other coding units based on the determined widths and heights of the coding units 620a to 620c. 6, the image decoding device 100 may determine a middle coding unit 620b having a size different from that of the upper coding unit 620a and the lower coding unit 620c as a coding unit at a specific position. However, the above-described method of determining a coding unit having a size different from that of other coding units performed by the image decoding device 100 corresponds only to an example of determining a coding unit at a specific position by using a size of a coding unit determined based on coordinates of a sample, and thus various methods of determining a coding unit at a specific position by comparing a size of a coding unit determined based on coordinates of a specific sample may be used.
[0140] The image decoding device 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using coordinates (xd, yd) which are information indicating the position of the upper left sample 670a of the left coding unit 660a, coordinates (xe, ye) which are information indicating the position of the upper left sample 670b of the middle coding unit 660b, and coordinates (xf, yf) which are information indicating the position of the upper left sample 670c of the right coding unit 660c. The image decoding device 100 may determine the respective sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0141] According to an embodiment of the present disclosure, the image decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 or the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding device 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 660a to 660c. 6, the image decoding device 100 may determine a middle coding unit 660b having a size different from that of the left coding unit 660a and the right coding unit 660c as a coding unit at a specific position. However, the above-described method of determining a coding unit having a size different from that of other coding units performed by the image decoding device 100 corresponds only to an example of determining a coding unit at a specific position by using a size of a coding unit determined based on coordinates of a sample, and thus various methods of determining a coding unit at a specific position by comparing a size of a coding unit determined based on coordinates of a specific sample may be used.
[0142] However, it is considered that the sample position used to determine the coding unit position is not limited to the above-mentioned upper left position, and information on the position of an arbitrary sample included in the coding unit may be used.
[0143] According to an embodiment of the present disclosure, considering the shape of the current coding unit, the image decoding device 100 may select a coding unit located at a specific position from an odd number of coding units determined by splitting the current coding unit. For example, when the current coding unit has a non-square shape with a width longer than a height, the image decoding device 100 may determine the coding unit at a specific position in the horizontal direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the horizontal direction and impose restrictions on the coding unit. When the current coding unit has a non-square shape with a height longer than a width, the image decoding device 100 may determine a coding unit at a specific position in the vertical direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the vertical direction and may impose restrictions on the coding unit.
[0144] According to an embodiment of the present disclosure, the image decoding device 100 may determine a coding unit at a specific position from among the even coding units using information indicating corresponding positions of the even coding units. The image decoding device 100 may determine the even coding units by splitting (dividing into two) the current coding unit, and may determine the coding unit at a specific position by using information about the positions of the even coding units. A specific process related thereto may correspond to a process of determining a coding unit at a specific position (e.g., a center position) from among the odd coding units, which process has been described in detail above in conjunction with FIG. 6, and therefore, a detailed description thereof is not provided herein.
[0145] According to an embodiment of the present disclosure, when a non-square current coding unit is split into a plurality of coding units, specific information about a coding unit at a specific position may be used in a splitting process to determine a coding unit at a specific position from among the plurality of coding units. For example, the image decoding apparatus 100 may use at least one of block shape information or split shape pattern information stored in a sample included in a middle coding unit in the splitting process to determine a coding unit located at a center position from among the plurality of coding units determined by splitting the current coding unit.
[0146] 6, the image decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the segmentation shape pattern information, and may determine the coding unit 620b located at the center position from the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding device 100 may determine the coding unit 620b located at the center position by considering the position from which the segmentation shape pattern information is obtained. That is, the segmentation shape pattern information of the current coding unit 600 may be obtained from the sample 640 located at the center position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the segmentation shape pattern information, the coding unit 620b including the sample 640 may be determined as the coding unit located at the center position. However, the information for determining the coding unit at the center position is not limited to the segmentation shape pattern information, and various types of information may be used to determine the coding unit at the center position.
[0147] According to an embodiment of the present disclosure, specific information for identifying a coding unit at a specific position can be obtained from a specific sample included in a coding unit to be determined. Referring to FIG. 6, the image decoding device 100 can use the segmentation shape pattern information obtained from the sample at a specific position in the current coding unit 600 (for example, the sample at the center position of the current coding unit 600) to determine the coding unit at a specific position (for example, the coding unit at the center position of the multiple segmented coding units) from the multiple coding units 620a, 620b, and 620c determined by segmenting the current coding unit 600. That is, the image decoding device 100 can determine the sample at the specific position considering the block shape of the current coding unit 600, can determine the coding unit 620b including the sample from which the specific information (for example, the segmentation shape pattern information) can be obtained from the multiple coding units 620a, 620b, and 620c determined by segmenting the current coding unit 600, and can impose specific restrictions on the coding unit 620b. 6 , according to an embodiment of the present disclosure, during decoding, the image decoding device 100 may determine a sample 640 at the center position of the current coding unit 600 as a sample from which specific information may be obtained, and may impose specific restrictions on the coding unit 620b including the sample 640. However, the position of the sample from which specific information may be obtained is not limited to the above position, and may include any position of the sample included in the coding unit 620b to be determined for restriction.
[0148] According to an embodiment of the present disclosure, the position of a sample from which specific information can be obtained can be determined based on the shape of the current coding unit 600. According to an embodiment of the present disclosure, the block shape information can indicate whether the current coding unit has a square or non-square shape, and the position of the sample from which specific information can be obtained can be determined based on the shape. For example, the image decoding device 100 can determine a sample located on a boundary where at least one of the width or height of the current coding unit is divided into two halves as a sample from which specific information can be obtained by using at least one of the information about the width of the current coding unit or the information about the height of the current coding unit. As another example, when the block shape information related to the current coding unit indicates a non-square shape, the image decoding device 100 can determine one of the samples adjacent to the boundary where the long side of the current coding unit is divided into two halves as a sample from which specific information can be obtained.
[0149] According to an embodiment of the present disclosure, when a current coding unit is split into a plurality of coding units, the image decoding device 100 may determine a coding unit at a specific position from the plurality of coding units using the split shape pattern information. According to an embodiment of the present disclosure, the image decoding device 100 may obtain the split shape pattern information from a sample at a specific position in the coding unit, and may split a plurality of coding units generated by splitting the current coding unit by using the split shape pattern information obtained from the sample at a specific position in each of the plurality of coding units. That is, the coding unit may be recursively split based on the split shape pattern information obtained from the sample at a specific position in each coding unit. The process of recursively splitting the coding unit has been described above with respect to FIG. 5 , and therefore a detailed description thereof will not be provided here.
[0150] According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine one or more coding units by splitting the current coding unit based on a specific block (eg, a current coding unit), and may determine an order of decoding the one or more coding units.
[0151] FIG. 7 illustrates an order of processing a plurality of coding units when the image decoding apparatus 100 determines a plurality of coding units by splitting a current coding unit according to an embodiment of the present disclosure.
[0152] According to an embodiment of the present disclosure, based on the segmentation shape pattern information, the image decoding device 100 can determine the second coding units 710a and 710b by segmenting the first coding unit 700 in the vertical direction, can determine the second coding units 730a and 730b by segmenting the first coding unit 700 in the horizontal direction, or can determine the second coding units 750a, 750b, 750c and 750d by segmenting the first coding unit 700 in the vertical and horizontal directions.
[0153] 7 , the image decoding device 100 may determine second coding units 710a and 710b determined by splitting the first coding unit 700 in the vertical direction to be processed in a horizontal direction order 710c. The image decoding device 100 may determine second coding units 730a and 730b determined by splitting the first coding unit 700 in the horizontal direction to be processed in a vertical direction order 730c. The image decoding device 100 may determine second coding units 750a, 750b, 750c, and 750d determined by splitting the first coding unit 700 in the vertical and horizontal directions to be processed in a specific order to process coding units in one row and then process coding units in the next row (e.g., in a raster scan order or a Z scan order 750e).
[0154] According to an embodiment of the present disclosure, the image decoding device 100 may recursively split the coding unit. Referring to FIG. 7 , the image decoding device 100 may determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d by splitting the first coding unit 700, and may recursively split each of the plurality of determined coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d. The splitting method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may correspond to the splitting method of the first coding unit 700. Therefore, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may be independently split into a plurality of coding units. Referring to FIG. 7 , the image decoding apparatus 100 may determine second coding units 710a and 710b by splitting the first coding unit 700 in the vertical direction, and may determine whether to split or not split each of the second coding units 710a and 710b independently.
[0155] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in the horizontal direction, and may not split the right second coding unit 710b.
[0156] According to an embodiment of the present disclosure, the processing order of the coding units may be determined based on the process of splitting the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before being split. The image decoding device 100 may determine the processing order of the third coding units 720a and 720b determined by splitting the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by splitting the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical direction order 720c. Since the left and right second coding units 710a and 710b are processed in a horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in a vertical direction order 720c. The process of determining the processing order of coding units based on the coding units before being split is not limited to the above example, and various methods may be used to independently process coding units that are split and determined into various shapes in a specific order.
[0157] FIG. 8 illustrates a process of determining that a current coding unit is to be divided into an odd-numbered coding unit, performed by the image decoding apparatus 100 , when coding units are not processable in a specific order according to an embodiment of the present disclosure.
[0158] According to an embodiment of the present disclosure, based on the obtained segmentation shape pattern information, the image decoding device 100 can determine that the current coding unit is segmented into an odd number of coding units. Referring to Figure 8, the square first coding unit 800 can be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b can be independently divided into third coding units 820a and 820b, and 820c, 820d and 820e. According to an embodiment of the present disclosure, the image decoding device 100 can determine a plurality of third coding units 820a and 820b by segmenting the left second coding unit 810a in the horizontal direction, and can segment the right second coding unit 810b into an odd number of third coding units 820c to 820e.
[0159] According to an embodiment of the present disclosure, the image decoding device 100 can determine whether any coding unit is divided into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a specific order. Referring to FIG. 8, the image decoding device 100 can determine the third coding units 820a and 820b and 820c to 820e by recursively splitting the first coding unit 800. The image decoding device 100 can determine whether any one of the first coding unit 800, the second coding units 810a and 810b, the third coding units 820a and 820b, and 820c to 820e is split into an odd number of coding units based on at least one of the block shape information or the split shape mode information. For example, the right second coding unit 810b of the second coding units 810a and 810b can be split into an odd number of third coding units 820c to 820e. The processing order of the multiple coding units included in the first coding unit 800 may be a specific order (e.g., a Z scan order 830), and the image decoding device 100 may determine whether the third coding units 820c, 820d, and 820e determined by splitting the right second coding unit 810b into an odd number of coding units satisfy a condition for processing in a specific order.
[0160] According to an embodiment of the present disclosure, the image decoding device 100 may determine whether the third coding units 820a and 820b and 820c to 820e included in the first coding unit 800 satisfy a condition for processing in a specific order, and the condition relates to whether at least one of the width or height of the second coding units 810a and 810b is divided into two halves along the boundary of the third coding units 820a and 820b and 820c to 820e. For example, the third coding units 820a and 820b determined when the height of the non-square left second coding unit 810a is divided into two halves may satisfy the condition. However, because the boundary of the third coding units 820c to 820e determined when the right second coding unit 810b is divided into three coding units cannot divide the width or height of the right second coding unit 810b into two halves, it may be determined that the third coding units 820c to 820e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding device 100 may determine the disconnection of the scanning order, and may determine that the right second coding unit 810b is divided into an odd number of coding units based on the result of the determination. According to an embodiment of the present disclosure, when the coding unit is divided into an odd number of coding units, the image decoding device 100 may impose specific restrictions on the coding units at specific positions in the divided coding units. The restrictions or specific positions have been described above with respect to the embodiments of the present disclosure, and therefore, a detailed description thereof will not be provided here.
[0161] FIG. 9 illustrates a process of determining at least one coding unit by splitting a first coding unit 900 , which is performed by the image decoding apparatus 100 according to an embodiment of the present disclosure.
[0162] According to an embodiment of the present disclosure, the image decoding device 100 may split the first coding unit 900 based on the segmentation shape pattern information obtained by the receiver (not shown). The square first coding unit 900 may be split into four square coding units, or may be split into a plurality of non-square coding units. For example, referring to FIG. 9, when the segmentation shape pattern information indicates that the first coding unit 900 is split into non-square coding units, the image decoding device 100 may split the first coding unit 900 into a plurality of non-square coding units. In detail, when the segmentation shape pattern information indicates that an odd number of coding units is determined by splitting the first coding unit 900 in the horizontal direction or the vertical direction, the image decoding device 100 may split the square first coding unit 900 into an odd number of coding units, for example, second coding units 910a, 910b, and 910c determined by splitting the square first coding unit 900 in the vertical direction, or second coding units 920a, 920b, and 920c determined by splitting the square first coding unit 900 in the horizontal direction.
[0163] According to an embodiment of the present disclosure, the image decoding device 100 may determine whether the second coding units 910a, 910b, and 910c and 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a specific order, and the condition relates to whether at least one of the width or height of the first coding unit 900 is divided into two halves along the boundary of the second coding units 910a, 910b, and 910c and 920a, 920b, and 920c. Referring to FIG. 9, since the boundary of the second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in the vertical direction cannot divide the width of the first coding unit 900 into two halves, it may be determined that the first coding unit 900 does not satisfy the condition for processing in a specific order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction cannot divide the width of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the conditions sufficient for processing in a specific order. When the conditions are not met as described above, the image decoding device 100 can determine the disconnection of the scanning order, and can determine that the first coding unit 900 is divided into an odd number of coding units based on the determined result. According to an embodiment of the present disclosure, when a coding unit is divided into an odd number of coding units, the image decoding device 100 can impose specific restrictions on the coding units at specific positions in the divided coding units. The restrictions or specific positions have been described above with respect to the embodiments of the present disclosure, and therefore, a detailed description thereof will not be provided here.
[0164] According to an embodiment of the present disclosure, the image decoding device 100 may determine coding units of various shapes by splitting a first coding unit.
[0165] 9 , the image decoding device 100 may divide a square first coding unit 900 or a non-square first coding unit 930 or 950 into coding units of various shapes.
[0166] 10 shows that when a second coding unit having a non-square shape determined when the image decoding device 100 splits the first coding unit 1000 satisfies a specific condition, shapes into which the second coding unit can be split are restricted according to an embodiment of the present disclosure.
[0167] According to an embodiment of the present disclosure, the image decoding device 100 may determine to split the square first coding unit 1000 into non-square second coding units 1010a and 1010b or 1020a and 1020b based on the split shape pattern information obtained by the receiver (not shown). The second coding units 1010a and 1010b or 1020a and 1020b may be split independently. Therefore, the image decoding device 100 may determine to split or not split each of the second coding units 1010a and 1010b or 1020a and 1020b into a plurality of coding units based on the split shape pattern information of each of the second coding units 1010a and 1010b or 1020a and 1020b. According to an embodiment of the present disclosure, the image decoding device 100 may determine the third coding units 1012a and 1012b by splitting the non-square left second coding unit 1010a determined by splitting the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is split in the horizontal direction, the image decoding device 100 may restrict the right second coding unit 1010b from being split in the horizontal direction in which the left second coding unit 1010a is split. When the third coding units 1014a and 1014b are determined by splitting the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently split in the horizontal direction, the third coding units 1012a and 1012b or 1014a and 1014b may be determined. However, this case also serves as a case in which the image decoding device 100 splits the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the split shape pattern information, and may be inefficient in terms of image decoding.
[0168] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third coding unit 1022a and 1022b or 1024a and 1024b by vertically splitting the non-square second coding unit 1020a or 1020b, which is determined by horizontally splitting the first coding unit 1000. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, the image decoding device 100 may restrict other second coding units (e.g., the lower second coding unit 1020b) from being split in the vertical direction in which the upper second coding unit 1020a is split for the above-mentioned reasons.
[0169] FIG. 11 illustrates a process of splitting a square coding unit when partition shape pattern information fails to indicate that the square coding unit is split into four square coding units, performed by the image decoding device 100 according to an embodiment of the present disclosure.
[0170] According to an embodiment of the present disclosure, the image decoding device 100 may determine the second coding units 1110a and 1110b or 1120a and 1120b by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding device 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding device 100 may determine the non-square second coding units 1110a and 1110b or 1120a and 1120b based on the division shape pattern information.
[0171] According to an embodiment of the present disclosure, the image decoding device 100 may independently partition the non-square second coding units 1110a and 1110b or 1120a and 1120b. Each of the second coding units 1110a and 1110b or 1120a and 1120b may be recursively partitioned in a specific order, and the partitioning method may correspond to the method of partitioning the first coding unit 1100 based on the partition shape pattern information.
[0172] For example, the image decoding device 100 may determine square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and may determine square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding device 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0173] As another example, the image decoding device 100 may determine square third coding units 1122a and 1122b by dividing the upper second coding unit 1120a in the vertical direction, and may determine square third coding units 1124a and 1124b by dividing the lower second coding unit 1120b in the vertical direction. In addition, the image decoding device 100 may determine square third coding units 1126a, 1126b, 1126c, and 1126d by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0174] FIG. 12 shows that a processing order among a plurality of coding units according to an embodiment of the present disclosure may be changed depending on a process of splitting the coding units.
[0175] According to an embodiment of the present disclosure, the image decoding device 100 may partition the first coding unit 1200 based on the partition shape pattern information. When the block shape indicates a square and the partition shape pattern information indicates that the first coding unit 1200 is partitioned in at least one of the horizontal direction or the vertical direction, the image decoding device 100 may determine the second coding units 1210a and 1210b or 1220a and 1220b by partitioning the first coding unit 1200. Referring to FIG. 12 , the non-square second coding units 1210a and 1210b or 1220a and 1220b determined by partitioning the first coding unit 1200 only in the horizontal direction or the vertical direction may be independently partitioned based on the partition shape pattern information of each coding unit. For example, the image decoding device 100 may determine third coding units 1216a, 1216b, 1216c, and 1216d by splitting in the horizontal direction the second coding units 1210a and 1210b generated by splitting in the vertical direction the first coding unit 1200, and may determine third coding units 1226a, 1226b, 1226c, and 1226d by splitting in the vertical direction the second coding units 1220a and 1220b generated by splitting in the horizontal direction the first coding unit 1200. The process of splitting the second coding units 1210a and 1210b or 1220a and 1220b has been described above with respect to FIG. 11, and therefore, a detailed description thereof will not be provided here.
[0176] According to an embodiment of the present disclosure, the image decoding device 100 may process the coding units in a specific order. The operation of processing the coding units in a specific order has been described above with respect to FIG. 7, and therefore, a detailed description thereof will not be provided here. Referring to FIG. 12, the image decoding device 100 may determine four square third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment of the present disclosure, the image decoding device 100 may determine the processing order of the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d based on the division method of the first coding unit 1200.
[0177] According to an embodiment of the present disclosure, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c and 1216d by splitting the second coding units 1210a and 1210b generated by splitting the first coding unit 1200 in the vertical direction, and can process the third coding units 1216a, 1216b, 1216c and 1216d according to the processing order 1217, and the processing order 1217 is used to initially process the third coding units 1216a and 1216c included in the left second coding unit 1210a in the vertical direction, and then process the third coding units 1216b and 1216d included in the right second coding unit 1210b in the vertical direction.
[0178] According to an embodiment of the present disclosure, the image decoding device 100 can determine the third coding units 1226a, 1226b, 1226c and 1226d by splitting the second coding units 1220a and 1220b generated by splitting the first coding unit 1200 in the horizontal direction, and can process the third coding units 1226a, 1226b, 1226c and 1226d according to the processing order 1227, and the processing order 1227 is used to initially process the third coding units 1226a and 1226b included in the upper second coding unit 1220a in the horizontal direction, and then process the third coding units 1226c and 1226d included in the lower second coding unit 1220b in the horizontal direction.
[0179] 12, square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d can be determined by splitting the second coding units 1210a and 1210b and 1220a and 1920b, respectively. Although the second coding units 1210a and 1210b are determined by splitting the first coding unit 1200 in the horizontal direction, the second coding units 1210a and 1210b are determined by splitting the first coding unit 1200 in the vertical direction, but the third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d split therefrom finally show the same shape of coding units split from the first coding unit 1200. Therefore, by recursively splitting the coding unit in different processes based on the split shape information, the image decoding device 100 can process a plurality of coding units in different orders even when the coding units are finally determined to be the same shape.
[0180] 13 illustrates a process of determining a depth of a coding unit when a shape and a size of a coding unit are changed when a coding unit is recursively split in order to determine a plurality of coding units according to an embodiment of the present disclosure.
[0181] According to an embodiment of the present disclosure, the image decoding device 100 may determine the depth of the coding unit based on a specific criterion. For example, the specific criterion may be the length of the long side of the coding unit. When the length of the long side of the current coding unit before segmentation is 2n times (n>0) the length of the long side of the current coding unit after segmentation, the image decoding device 100 may determine that the depth of the current coding unit has increased by n from the depth of the coding unit before segmentation. In the following, a coding unit with an increased depth is denoted as a coding unit of a deeper depth.
[0182] 13 , according to an embodiment of the present disclosure, the image decoding device 100 may determine a second coding unit 1302 and a third coding unit 1304 of a deeper depth by dividing a square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as “0: SQUARE”). Assuming that the size of the square first coding unit 1300 is 2N×2N, the size of the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 into 1 / 2 may be N×N. In addition, the size of the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may be N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 times that of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 times that of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 times that of the first coding unit 1300 may be D+2.
[0183] According to an embodiment of the present disclosure, the image decoding device 100 can determine the second coding unit 1312 or 1322 and the third coding unit 1314 or 1324 having a deeper depth by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information can be represented as "1: NS_VER" indicating a non-square shape whose height is longer than the width or as "2: NS_HOR" indicating a non-square shape whose width is longer than the height).
[0184] The image decoding device 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width or the height of the first coding unit 1310 having a size of N×2N. That is, the image decoding device 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1322 having a size of N×N / 2 by splitting the first coding unit 1310 in the horizontal direction, or may determine the second coding unit 1312 having a size of N / 2×N by splitting the first coding unit 1310 in the horizontal and vertical directions.
[0185] According to an embodiment of the present disclosure, the image decoding device 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width and the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding device 100 may determine the second coding unit 1302 having an N×N size or the second coding unit 1312 having an N / 2×N size by splitting the first coding unit 1320 in the vertical direction, or may determine the second coding unit 1322 having an N×N / 2 size by splitting the first coding unit 1320 in the horizontal and vertical directions.
[0186] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third coding unit 1304, 1314, or 1324 by splitting at least one of the width or the height of the second coding unit 1302 having a size of N×N. That is, the image decoding device 100 may determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by splitting the second coding unit 1302 in the vertical and horizontal directions.
[0187] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding device 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1312 in the horizontal direction, or may determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in the vertical and horizontal directions.
[0188] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding device 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1322 in the vertical direction, or may determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in the vertical and horizontal directions.
[0189] According to an embodiment of the present disclosure, the image decoding device 100 may split the square coding unit 1300, 1302, or 1304 in a horizontal or vertical direction. For example, the image decoding device 100 may determine a first coding unit 1310 having an N×2N size by splitting the first coding unit 1300 having a 2N×2N size in a vertical direction, or may determine a first coding unit 1320 having a 2N×N size by splitting the first coding unit 1300 in a horizontal direction. According to an embodiment of the present disclosure, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a 2N×2N size in a horizontal or vertical direction may be the same as the depth of the first coding unit 1300.
[0190] According to an embodiment of the present disclosure, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 times the width and height of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322 whose width and height are 1 / 2 times the width and height of the first coding unit 1310 or 1320 may be D+1, and the depth of the third coding unit 1314 or 1324 whose width and height are 1 / 4 times the width and height of the first coding unit 1310 or 1320 may be D+2.
[0191] FIG. 14 illustrates a depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment of the present disclosure.
[0192] According to an embodiment of the present disclosure, the image decoding device 100 may determine second coding units of various shapes by dividing a square first coding unit 1400. Referring to FIG. 14, the image decoding device 100 may determine second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of a vertical direction or a horizontal direction based on the division shape pattern information. That is, the image decoding device 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.
[0193] According to an embodiment of the present disclosure, the depth of the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d determined based on the segmentation shape mode information of the square first coding unit 1400 can be determined based on the length of its long side. For example, because the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 2100 and the non-square second coding units 1402a and 1402b and 1404a and 1404b can have the same depth, such as D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the segmentation shape pattern information, because the length of the side of the square second coding unit 1406a, 1406b, 1406c or 1406d is 1 / 2 times the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1, which is 1 deeper than the depth D of the first coding unit 1400.
[0194] According to an embodiment of the present disclosure, the image decoding device 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b and 1414c by splitting the first coding unit 1410 having a height longer than a width in a horizontal direction based on the split shape pattern information. According to an embodiment of the present disclosure, the image decoding device 100 may determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b and 1424c by splitting the first coding unit 1420 having a width longer than a height in a vertical direction based on the split shape pattern information.
[0195] According to an embodiment of the present disclosure, the depth of the second coding units 1412a and 1412b, 1414a, 1414b and 1414c or 1422a and 1422b, 1424a, 1424b and 1424c determined based on the segmentation shape mode information of the non-square first coding unit 1410 or 1420 may be determined based on the length of its long side. For example, because the length of the side of the square second coding units 1412a and 1412b is 1 / 2 times the length of the long side of the first coding unit 1410 having a non-square shape, and the height of the first coding unit 1410 is longer than the width, the depth of the square second coding units 1412a and 1412b is D+1, which is 1 deeper than the depth D of the non-square first coding unit 1410.
[0196] In addition, the image decoding device 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the partition shape pattern information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 times the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1, which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding device 100 may determine the depth of the coding unit split from the first coding unit 1420 having a non-square shape whose width is longer than the height by using the above-described method of determining the depth of the coding unit split from the first coding unit 1410 .
[0197] According to an embodiment of the present disclosure, when the odd-numbered split coding units do not have equal sizes, the image decoding device 100 may determine the PID for identifying the split coding units based on the size ratio between the coding units. Referring to FIG. 14 , the width of the coding unit 1414b at the center position among the odd-numbered split coding units 1414a, 1414b, and 1414c may be equal to the width of the other coding units 1414a and 1414c, and its height is twice that of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two of the other coding units 1414a and 1414c. Therefore, when the PID of the coding unit 1414b at the center position based on the scanning order is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may be increased by 2, and thus may be 3. That is, there may be discontinuity in the PID value. According to an embodiment of the present disclosure, the image decoding device 100 may determine whether odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in a PID for identifying the divided coding units.
[0198] According to an embodiment of the present disclosure, the image decoding device 100 may determine whether to use a specific segmentation method based on a PID value for identifying a plurality of coding units determined by segmenting a current coding unit. Referring to FIG. 14 , the image decoding device 100 may determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by segmenting a first coding unit 1410 having a rectangular shape, the height of the first coding unit 1410 being longer than the width. The image decoding device 100 may identify each coding unit using a PID indicating each coding unit. According to an embodiment of the present disclosure, the PID may be obtained from a sample at a specific position of each coding unit (e.g., an upper left sample).
[0199] According to an embodiment of the present disclosure, the image decoding device 100 may determine a coding unit at a specific position from the segmented coding units by using a PID for distinguishing coding units. According to an embodiment of the present disclosure, when the segmentation shape mode information of the first coding unit 1410 having a rectangular shape indicates that the coding unit is segmented into three coding units, the image decoding device 100 may segment the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c, wherein the height of the first coding unit 1410 is longer than the width. The image decoding device 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may compare the PIDs of the odd-numbered segmented coding units to determine a coding unit located at a central position from the coding units. The image decoding device 100 may determine a coding unit 1414b having a PID corresponding to an intermediate value in the PIDs of the coding units as a coding unit located at a central position from the coding units determined by segmenting the first coding unit 1410. According to an embodiment of the present disclosure, when the split coding units do not have equal sizes, the image decoding device 100 may determine a PID for distinguishing the split coding units based on a size ratio between the coding units. Referring to FIG. 14 , a coding unit 1414b generated by splitting the first coding unit 1410 may have a width equal to that of other coding units 1414a and 1414c and a height twice that of other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b located at the center is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may increase by 2 and may thus be 3. When the PID does not increase uniformly as described above, the image decoding device 100 may determine that the coding unit is divided into a plurality of coding units, the plurality of coding units including a coding unit having a size different from that of other coding units. According to an embodiment of the present disclosure, when the segmentation shape mode information indicates that the coding unit is segmented into an odd number of coding units, the image decoding device 100 may segment the current coding unit in such a manner that the coding unit at a specific position among the odd number of coding units (e.g., the coding unit at the center position) has a size different from that of other coding units. In this case, the image decoding device 100 may determine the coding unit with different sizes located at the center position by using the PID of the coding unit. However, the PID and the size or the position of the coding unit at the specific position are not limited to the above examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0200] According to an embodiment of the present disclosure, the image decoding device 100 may start recursively splitting a specific data unit using a coding unit.
[0201] FIG. 15 illustrates determining a plurality of coding units based on a plurality of specific data units included in a picture according to an embodiment of the present disclosure.
[0202] According to an embodiment of the present disclosure, a specific data unit may be defined as a data unit that starts recursively splitting a coding unit by using segmentation shape pattern information. That is, the specific data unit may correspond to a coding unit of the highest depth, which is used to determine a plurality of coding units split from a current picture. Hereinafter, for convenience of description, the specific data unit is referred to as a reference data unit.
[0203] According to an embodiment of the present disclosure, the reference data unit may have a specific size and a specific size shape. According to an embodiment of the present disclosure, the reference data unit may include M×N samples. In this regard, M and N may be equal to each other and may be an integer expressed as a power of 2. That is, the reference data unit may have a square or non-square shape and may be divided into an integer number of coding units.
[0204] According to an embodiment of the present disclosure, the image decoding device 100 may divide the current picture into a plurality of reference data units. According to an embodiment of the present disclosure, the image decoding device 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information of each reference data unit. The process of dividing the reference data unit may correspond to a division process using a quadtree structure.
[0205] According to an embodiment of the present disclosure, the image decoding device 100 may predetermine the minimum size allowed for the reference data unit included in the current picture. Therefore, the image decoding device 100 may determine various reference data units whose sizes are greater than or equal to the minimum size, and may determine one or more coding units by using the partition shape mode information with reference to the determined reference data unit.
[0206] 15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment of the present disclosure, the shape and size of the reference coding unit may be determined based on various data units (e.g., sequences, pictures, slices, slice segments, tiles, tile groups, maximum coding units, etc.) that may include one or more reference coding units.
[0207] According to an embodiment of the present disclosure, a receiver (not shown) of the image decoding device 100 may obtain at least one of reference coding unit shape information or reference coding unit size information about each of various data units from a bitstream. The process of splitting the square reference coding unit 1500 into one or more coding units has been described above with respect to the process of splitting the current coding unit 300 of FIG. 3 , and the process of splitting the non-square reference coding unit 1502 into one or more coding units has been described above with respect to the process of splitting the current coding unit 400 or 450 of FIG. 4 . Therefore, a detailed description thereof will not be provided here.
[0208] According to an embodiment of the present disclosure, the image decoding device 100 may use a PID for identifying the size and shape of a reference coding unit to determine the size and shape of the reference coding unit according to some data units predetermined based on a specific condition. That is, a receiver (not shown) may obtain only a PID from a bitstream, which is used to identify the size and shape of a reference coding unit with respect to each slice, slice segment, tile, tile group, or maximum coding unit that is a data unit (e.g., a data unit whose size is less than or equal to a slice) that satisfies a specific condition among various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.). The image decoding device 100 may determine the size and shape of a reference data unit by using a PID with respect to each data unit that satisfies a specific condition. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding device 100 may determine at least one of the size or shape of a reference coding unit included in a data unit serving as a unit for obtaining a PID by selecting at least one of the size or shape of a previously determined reference coding unit based on the PID.
[0209] According to an embodiment of the present disclosure, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit segmented from the picture may include one or more reference coding units, and the coding unit may be determined by recursively segmenting each reference coding unit. According to an embodiment of the present disclosure, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment of the present disclosure, the size of the reference coding unit may be obtained by segmenting the maximum coding unit n times based on a quadtree structure. That is, according to an embodiment of the present disclosure, the image decoding device 100 may determine the reference coding unit by segmenting the maximum coding unit n times based on a quadtree structure, and may segment the reference coding unit based on at least one of block shape information or segmentation shape pattern information.
[0210] FIG. 16 illustrates processing blocks used as a criterion for determining an order in which reference coding units included in a picture 1600 are determined according to an embodiment of the present disclosure.
[0211] According to an embodiment of the present disclosure, the image decoding device 100 may determine at least one processing block for partitioning a picture. The processing block may be a data unit including at least one reference coding unit of the partitioned image, and the at least one reference coding unit included in the processing block may be determined in a specific order. That is, the order of determining at least one reference coding unit determined for each processing block may be one of various order types for determining the reference coding unit, and different processing blocks may determine the reference coding unit in different orders. The order of determining the reference coding unit determined for each processing block may be one of various orders, such as raster scanning, Z scanning, N scanning, upper right diagonal scanning, horizontal scanning, vertical scanning, etc. Although not limited to the above scanning order.
[0212] According to an embodiment of the present disclosure, the image decoding device 100 may obtain information about the size of a processing block to determine the size of at least one processing block included in the image. The image decoding device 100 may obtain information about the size of a processing block from a bitstream to determine the size of at least one processing block included in the image. The size of the processing block may be a specific size of a data unit indicated by the information about the size of the processing block.
[0213] According to an embodiment of the present disclosure, a receiver (not shown) of the image decoding device 100 can obtain information about the size of a processing block for each specific data unit from a bitstream. For example, information about the size of a processing block can be obtained from a bitstream for each data unit, such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, etc. That is, a receiver (not shown) can obtain information about the size of a processing block for each of the above-mentioned various data units from a bitstream, and the image decoding device 100 can determine the size of at least one processing block of a partitioned picture by using the obtained information about the size of the processing block. The size of a processing block may be a size that is a multiple of a reference coding unit.
[0214] According to an embodiment of the present disclosure, the image decoding device 100 may determine the size of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding device 100 may determine the size of the processing block 1602 or 1612 based on information about the size of the processing block obtained from the bitstream. Referring to FIG. 16 , according to an embodiment of the present disclosure, the image decoding device 100 may determine the horizontal size of the processing blocks 1602 and 1612 to be four times the horizontal size of the reference coding unit, and determine the vertical size of the processing blocks 1602 and 1612 to be four times the vertical size of the reference coding unit. The image decoding device 100 may determine the order in which at least one reference coding unit is determined in at least one processing block.
[0215] According to an embodiment of the present disclosure, the image decoding device 100 may determine the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing block, and determine the determination order of at least one reference coding unit included in the processing blocks 1602 and 1612. According to an embodiment of the present disclosure, determining the reference coding unit may include determining the size of the reference coding unit.
[0216] According to an embodiment of the present disclosure, the image decoding device 100 may obtain information about determining the order of at least one reference coding unit included in at least one processing block from a bitstream, and determine the order of at least one reference coding unit based on the obtained information about the determination order. The information about the determination order may be defined as the order or direction of determining the reference coding unit in the processing block. That is, the order of determining the reference coding unit may be determined independently for each processing block.
[0217] According to an embodiment of the present disclosure, the image decoding device 100 can obtain information about the determination order of the reference coding unit of each specific data unit from the bitstream. For example, a receiver (not shown) can obtain information about the determination order of the reference coding unit of each data unit (such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, a processing block, etc.) from the bitstream. Because the information about the determination order of the reference coding unit indicates the order in which the reference coding unit is determined in the processing block, the information about the determination order can be obtained for each specific data unit including an integer number of processing blocks.
[0218] According to an embodiment of the present disclosure, the image decoding device 100 may determine at least one reference coding unit based on a determination order.
[0219] According to an embodiment of the present disclosure, a receiver (not shown) may obtain information about a determination order of reference coding units from a bitstream as information related to processing blocks 1602 and 1612, and the image decoding device 100 may determine the order of at least one reference coding unit included in the processing blocks 1602 and 1612, and determine at least one reference coding unit included in the picture 1600 according to the determination order of the reference coding units. Referring to FIG. 16 , the image decoding device 100 may determine a determination order 1604 and 1614 of at least one reference coding unit related to each processing block 1602 and 1612. For example, when information about a determination order of reference coding units is obtained for each processing block, each processing block 1602 and 1612 may have a different determination order of reference coding blocks related to each processing block 1602 and 1612. When the determination order 1604 of the reference coding units related to the processing block 1602 is a raster scan order, the reference coding units included in the processing block 1602 may be determined in a raster scan order. In contrast, when the determination order 1614 of the reference coding units related to other processing blocks 1612 is the reverse order of the raster scan order, the reference coding units included in the processing blocks 1612 may be determined in the reverse order of the raster scan order.
[0220] According to an embodiment of the present disclosure, the image decoding device 100 may decode at least one determined reference coding unit. The image decoding device 100 may decode an image based on the reference coding unit determined by the above-mentioned embodiment of the present disclosure. The method of decoding the reference coding unit may include various methods of decoding an image.
[0221] According to an embodiment of the present disclosure, the image decoding device 100 can obtain block shape information indicating the shape of the current coding unit or segmentation shape mode information indicating the segmentation method of the current coding unit from the bitstream, and can use the obtained information. The segmentation shape mode information can be included in the bitstream associated with various data units. For example, the image decoding device 100 can use the segmentation shape mode information included in the sequence parameter set, the picture parameter set, the video parameter set, the slice header, the slice segment header, the tile header, or the tile group header. In addition, the image decoding device 100 can obtain the syntax elements corresponding to the block shape information or the segmentation shape mode information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and can use the obtained syntax elements.
[0222] The method for determining segmentation rules according to an embodiment of the present disclosure will be described in detail below.
[0223] The image decoding device 100 may determine a segmentation rule of the image. The segmentation rule may be predetermined between the image decoding device 100 and the image encoding device 150. The image decoding device 100 may determine the segmentation rule of the image based on information obtained from a bitstream. The image decoding device 100 may determine the segmentation rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, or a tile group header. The image decoding device 100 may determine the segmentation rule differently according to a frame, a slice, a temporal layer, a maximum coding unit, or a coding unit.
[0224] The image decoding device 100 may determine the segmentation rule based on the block shape information of the coding unit. The block shape may include the size, shape, ratio of width and height, and direction of the coding unit. The image encoding device 150 and the image decoding device 100 may predetermine the segmentation rule based on the block shape of the coding unit. However, the present disclosure is not limited thereto. The image decoding device 100 may determine the segmentation rule based on information obtained from the bit stream received from the image encoding device 150.
[0225] The shape of the coding unit may include a square shape and a non-square shape. When the lengths of the width and height of the coding unit are equal, the image decoding device 100 may determine the shape of the coding unit as a square shape. In addition, when the lengths of the width and height of the coding unit are not equal, the image decoding device 100 may determine the shape of the coding unit as a non-square shape.
[0226] The size of the coding unit may include various sizes, such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, . . . , and 256x256. The size of the coding unit may be classified based on the length of the long side, the length of the short side, or the area of the coding unit. The image decoding device 100 may apply the same segmentation rule to the coding units classified into the same group. For example, the image decoding device 100 may classify the coding units having the same long side length as having the same size. In addition, the image decoding device 100 may apply the same segmentation rule to the coding units having the same long side length.
[0227] The ratio of the width to the height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, etc. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the length of the width of the coding unit is longer than the length of its height. The vertical direction may indicate a case where the length of the width of the coding unit is shorter than the length of its height.
[0228] The image decoding device 100 may adaptively determine the segmentation rule based on the size of the coding unit. The image decoding device 100 may differently determine the allowable segmentation shape mode based on the size of the coding unit. For example, the image decoding device 100 may determine whether to allow segmentation based on the size of the coding unit. The image decoding device 100 may determine the segmentation direction according to the size of the coding unit. The image decoding device 100 may determine the allowable segmentation type according to the size of the coding unit.
[0229] Determining the partition rule based on the size of the coding unit may be a partition rule determined in advance between the image encoding device 150 and the image decoding device 100. In addition, the image decoding device 100 may determine the partition rule based on information obtained from a bitstream.
[0230] The image decoding apparatus 100 may adaptively determine a partition rule based on the position of the coding unit. The image decoding apparatus 100 may adaptively determine a partition rule based on the position of the coding unit in the image.
[0231] In addition, the image decoding device 100 may determine a segmentation rule so that the coding units generated by different segmentation paths do not have the same block shape. However, the present disclosure is not limited thereto, and the coding units generated by different segmentation paths have the same block shape. The coding units generated by different segmentation paths may have different decoding process orders. Since the decoding process order has been described above with reference to FIG. 12, a detailed description thereof is not provided.
[0232] Hereinafter, a process of performing entropy encoding and decoding according to one or more embodiments disclosed in the present specification will be described in detail with reference to FIGS. 17 to 28. The process of entropy encoding and decoding according to an embodiment of the present disclosure may be performed by the decoder 120 of the image decoding device 100 shown in FIG. 1a and the encoder 155 of the image encoding device 150 shown in FIG. 2a, or by the processor 125 of the image decoding device 100 shown in FIG. 1c and the processor 170 of the image encoding device 150 shown in FIG. 2c. In detail, the process of entropy encoding and decoding according to an embodiment of the present disclosure may be performed by the entropy decoder 6150 of the image decoder 6000 shown in FIG. 1b and the entropy encoder 7350 of the image encoder 7000 shown in FIG. 2b.
[0233] As described above, the image encoding device 150 according to an embodiment of the present disclosure can perform encoding by using the coding unit generated by hierarchically partitioning the maximum coding unit. The entropy encoder 7350 can perform entropy encoding on the encoding information (e.g., syntax elements such as quantized transform coefficients, prediction modes of prediction units, quantization parameters, motion vectors, etc.) generated during the encoding process. As an entropy encoding method, CAMAC can be used.
[0234] FIG. 17 is a block diagram of a configuration of an entropy encoding apparatus 1700 according to an embodiment of the present disclosure.
[0235] 17 , according to an embodiment of the present disclosure, an entropy encoding apparatus 1700 includes a symbol representation unit 1710 , a context modeler 1720 , and an arithmetic coder 1730 . According to an embodiment, the arithmetic coder 1730 may include a regular coding engine 1732 and a bypass coding engine 1734 .
[0236] According to an embodiment of the present disclosure, the syntax element input to the entropy encoding device 1700 may not be a symbol. The symbol may include at least one of a number or a letter. For example, when the prediction mode is an intra prediction mode or an inter prediction mode, the symbol may be represented by the number "0" or "1", respectively. Or, for example, the symbol may be represented by the character "intra" or "inter", respectively. However, it is not limited to this, and the symbol may be represented in various ways, such as a combination of numbers and letters or a number represented in binary. In the following, for the convenience of description, the case where the symbol is a number will be described as an example. When the syntax element is not a symbol, the symbol representation unit 1710 outputs the syntax element as one of M symbols. For example, when the input syntax element is not a symbol, the symbol representation unit 1710 may determine the corresponding symbol from symbols 0 to M-1. Each syntax element may indicate a different M value. Each symbol is encoded by CAMAC.
[0237] The symbol output from the symbol representation unit 1710 is arithmetically encoded by the regular coding engine 1732 or the bypass coding engine 1734. When the frequencies of the symbols of the syntax element are consistent, that is, when the frequencies of symbols 0 to M-1 are the same, the symbol is output to the bypass coding engine 1734 that does not use the probability value, and is encoded via the bypass coding engine 1734. Whether the current symbol will be arithmetically encoded by the regular coding engine 1732 or the bypass coding engine 1734 may be predetermined according to the type of the syntax element. According to an embodiment of the present disclosure, the symbol representation unit 1710 may be referred to as an M-ary representation unit.
[0238] The conventional compilation engine 1732 performs arithmetic coding on the symbol based on the probability model determined by the context modeler 1720. The context modeler 1720 provides the probability model of the current symbol to the conventional compilation engine 1732. The context modeler 1720 can determine the occurrence probability of the symbol based on the previously encoded symbol, update the occurrence probability previously used to encode the symbol, and output the probability to the conventional compilation engine 1732. According to an embodiment of the present disclosure, the context modeler 1720 can determine a context model by using the context index ctxIdx. According to an embodiment of the present disclosure, a context index can be determined for each symbol. The context modeler 1720 can determine the occurrence probability of the symbol of the context model.
[0239] According to an embodiment of the present disclosure, the context modeler 1720 may determine at least one scaling factor for updating the occurrence probability of a symbol. The context modeler 1720 may update the occurrence probability of a symbol according to the current symbol by using at least one scaling factor. The detailed process of updating the occurrence probability of a symbol will be described below.
[0240] The conventional compilation engine 1732 performs arithmetic coding based on the current symbol and the symbol occurrence probability provided from the context modeler 1720. According to an embodiment of the present disclosure, based on the occurrence probability of the symbol provided from the context modeler 1720, the conventional compilation engine 1732 can determine the cumulative probability c(0) of the occurrence of symbol "0" and the cumulative probability c(1) of the occurrence of symbol "1" to the cumulative probability c(M-1) of the occurrence of symbol "M-1". The cumulative probability c(k) of the occurrence of symbol "k" indicates the sum of the probabilities of the occurrence of symbols "0" to "k". That is, c(k) = P(0) + P(1) +…+ P(k), where P(k) is the occurrence probability of symbol k. According to an embodiment of the present disclosure, the conventional compilation engine 1732 can determine the occurrence probability P(0) of symbol "0" and the occurrence probability P(1) of symbol "1" to the occurrence probability P(M-1) of symbol "M-1" based on the occurrence probability of the symbol provided from the context modeler 1720. For the convenience of description, the cumulative occurrence probability of a symbol and the occurrence probability of a symbol are distinguished. However, according to an embodiment of the present disclosure, the occurrence probability of a symbol may refer to the cumulative occurrence probability of the symbol.
[0241] Arithmetic coding is performed by dividing a range representing a probability interval according to the probability c(0) to c(M-1) of the current symbol and the determined symbol occurrence, and outputting binary values of representative values belonging to the divided intervals.
[0242] FIG. 18 is a diagram of a probability update process for CAMAC according to an embodiment of the present disclosure.
[0243] 18, a context model may be defined as a specific preset probability state corresponding to a specific number of symbols and a specific scaling factor. The context modeler 1720 may determine the probability state by using the context model for a specific scaling factor and a specific number of symbols. Each probability state may be determined based on a state index. For example, the probability state of symbol m may be determined based on the state index probability function i Cm When the probability is updated, a preset state transition table can be used to indicate which probability state will be converted from the current probability state. The probability state changes according to the symbol currently being arithmetically encoded. For example, when the symbol currently being arithmetically encoded is greater than m, the probability state i of symbol m is Cm In the forward state i Cm +1 change, positive state i Cm +1 is the direction in which the probability of occurrence of the symbol decreases, and when the current arithmetic coded symbol is less than or equal to m, the probability state i of symbol m is Cm In the reverse state i Cm -1 changes, reverse state i Cm -1 is the direction in which the probability of occurrence of a symbol increases. k{} indicates the direction of probability state transition after arithmetic coding when the symbol to be arithmetically coded is k.
[0244] When updating probabilities or dividing probability intervals, in the case of using dense probability values, the amount of multiplication increases, which may increase the hardware load. Therefore, a probability model can be used in which the probability C shown in FIG. 18 is rounded off by the rounding operation or the like. m Map to specific values to change the probability value in a step-wise manner.
[0245] According to an embodiment of the present disclosure, the context modeler 1720 may calculate the probability of a symbol. The probability of a symbol may be updated based on the probability of a previously determined symbol. For example, the probability of a symbol may be calculated based on the probability of a previously updated symbol and a scaling factor, rather than calculated according to a preset table. As the number of symbols and the number of context models increase, it may be effective to calculate based on the previously updated symbol probability, rather than calculating according to a preset table.
[0246] Figure 19a is a schematic diagram of a process for performing arithmetic coding based on CAMAC according to an embodiment of the present disclosure. Figure 19b is a schematic diagram of a process for performing arithmetic coding based on CAMAC according to an embodiment of the present disclosure. Figure 19c is a schematic diagram of a process for performing arithmetic coding based on CAMAC according to an embodiment of the present disclosure.
[0247] Referring to FIG. 19a, the context modeler 1720 provides the occurrence probability of the symbol, for example, c(1) to c(M-1), to the conventional compilation engine 1732. The conventional compilation engine 1732 performs arithmetic coding by dividing the probability interval into considerations of the probability of the input symbol. In FIG. 19a, it is assumed that the occurrence probability of the symbol "0" is c(1)=0.1, the occurrence probability of the symbol "1" is c(1)=0.2, the occurrence probability of the symbol "k-1" is c(k-1)=0.6, and the occurrence probability of the symbol "k" is c(k)=0.8. In this regard, c(k) may represent the cumulative occurrence probability. Because the first input symbol S 1 is k, so the conventional compilation engine 1732 selects (0.6, 0.8) from the interval (0, 1), which is the probability interval of the value "k". Then, the conventional compilation engine 1732 selects 0.75 as the representative value representing the interval (0.6, 0.8), and outputs "11" after the decimal point in the binary value 0.11 corresponding to 0.75 in the bit stream. That is, the input symbol "k" is mapped to "11" and output.
[0248] 19b, the context modeler 1720 may encode a plurality of symbols. Although the case where c(0) to c(M-1) are fixed is described for convenience of description, as described above, the values of c(0) to c(M-1) may be updated each time a symbol is encoded.
[0249] The conventional compilation engine 1732 selects (0.6, 0.8) from the interval (0, 1), which is the probability interval of the value "k" because the first input symbol S 1 For k; select (0.62, 0.64) from the interval (0.6, 0.8), which is the probability interval corresponding to "1" because the next input binary data (bin) S 2 The value of is 1; finally, (0.62, 0.622) is selected from the interval (0.62, 0.64), which is the probability interval corresponding to "0" because the last input binary data S 3 The value of is 0. Then, the conventional compilation engine 1732 selects 0.62109375 as the representative value representing the interval (0.62, 0.622), and outputs "1001111" after the decimal point corresponding to the binary value 0.1001111 of 0.62109375 in the bit stream. That is, the input symbols "k", "1", and "0" are mapped to "10011111" and output.
[0250] Referring to FIG. 19c, the current available range Rs and the lower boundary value r of the current available range Rs can be updated. 1 and the upper boundary value r 2 To perform the binary arithmetic coding process according to CAMAC. At the beginning of arithmetic coding, set Rs = 510, r 1 = 0 and r 2 =510. When the current symbol is k, the range Rs is changed to R k , and the lower boundary value r 1 and the upper boundary value r 2 can be updated to indicate R k As in the above-described example of FIG. 19b , in the arithmetic coding process, the specific interval Rs is updated according to the current symbol, and a binary value indicating the updated interval is output.
[0251] The process of updating the probability model performed by the context modeler 1720 will be described in detail below.
[0252] The probability update process used in CAMAC can be performed according to the following Equation 1.
[0253] [Equation 1]
[0254] c m (t) = (1- α i ) * c m (t-1), m ∈ [0, symbol)
[0255] c m (t) = c m(t-1) + α i * (1- c m (t-1)), m ∈ [symbol, M-1)
[0256] In equation 1, c m (t) and c m (t-1) is the probability of a symbol appearing, for example, the probability of symbol m appearing, and represents the updated probability and the previous probability, respectively, expressed as a real number between 0 and 1. i (0≤α i ≤1, where α i is a real number) represents the inverse of the scaling factor. i represents an integer value indicating the number of scaling factors.
[0257] According to an embodiment of the present disclosure, the probability value can be expressed as an integer range rather than a real number range between 0 and 1 to simplify the operation. k Integer C between i (k is an integer), probability c i With c i = C i / 2 k In addition, the scaling factor Shift i The inverse of α i It can also be set to have the value shown in the following equation; by using powers of 2, α i =1 / (2^Shift i )(Shift i is an integer). In this case, the multiplication operation included in Equation 1 expressed above may be replaced with a shift operation such as the following Equation 2. In Equation 2, ">>" is a right shift operator.
[0258] [Equation 2]
[0259] C m (t) = C m (t-1) - (C m (t-1) >> Shift i ), m ∈ [0, symbol)
[0260] C m (t) = C m (t-1) + (2 k >> Shift i ) - (C m (t-1) >> Shift i ), m ∈ [symbol,M-1)
[0261] In Equation 2, C m (t) and C m (t-1) is the probability of occurrence of symbol m, which represents the updated probability and the previous probability, expressed as 0 and 2 respectively. k Integer between Shift i represents a scaling factor in a logarithmic scale. In this regard, i is an integer value representing the number of scaling factors.
[0262] Scaling Factor Shift i The window size (N) may correspond to the number of symbols encoded before the current symbol. i =2^Shift i ). That is, by using the scaling factor Shift i To update the probability, it can be said that the previously encoded N is considered when updating the probability of the current symbol. i The value of a symbol.
[0263] The scaling factor determines the sensitivity and robustness. Sensitivity refers to how sensitive the probability updates used in CAMAC are, and robustness refers to how robust the probabilities used in CAMAC are to errors. For example, when the scaling factor Shift i When the scaling factor Shift is small, that is, when a short window is used, the probability changes rapidly to converge to an appropriate value quickly, but it is prone to fluctuations due to its sensitivity to individual data. i When is large, that is, when a long window is used, fluctuations may occur less frequently while the updated probabilities converge to appropriate values, although the probabilities do not change rapidly, making stable operation possible without causing sensitive responses to errors, noise, etc.
[0264] In order to strike a balance between sensitivity and robustness, the context modeler 1720 according to an embodiment of the present disclosure may generate multiple updated probabilities by using multiple different scaling factors when updating the probability, and determine the final updated probability by using the multiple updated probabilities.
[0265] As the number of scaling factors used increases, the computational complexity may increase accordingly, although the accuracy of the predicted probability may increase. Therefore, in the following description, the case where i is 1 or 2, that is, the case where the probability is updated by using one or two scaling factors, will be described. However, the probability updating method according to the present disclosure can also be applied to the case where the probability is updated by using three or more scaling factors.
[0266] In an embodiment of the present disclosure, when two scaling factors are used, the context modeler 1720 may obtain two updated probabilities according to the following equation 3 or 4, and determine the final updated probability according to the two updated probabilities. According to an embodiment of the present disclosure, the final updated probability may be determined by weighted summing the two updated probabilities. According to an embodiment of the present disclosure, the final updated probability may be a simple sum of the two updated probabilities.
[0267] [Equation 3]
[0268] c1 m (t) = (1- α i ) * c1 m (t-1), m ∈ [0, symbol)
[0269] c1 m (t) = c1 m1 (t-1) + α i * (1- c1 m (t-1)), m ∈ [symbol, M-1)
[0270] c2 m (t) = (1- α i ) * c2 m (t-1), m ∈ [0, symbol)
[0271] c2 m (t) = c2 m1 (t-1) + α i * (1- c2 m (t-1)), m ∈ [symbol, M-1)
[0272] c m (t) = (a * c1 m (t) + b * c2 m (t) + (a+b)>>1 ) / (a+b)
[0273] [Equation 4]
[0274] C1 m (t) = C1 m (t-1) - (C1 m (t-1) >> Shift i ), m ∈ [0, symbol)
[0275] C1 m (t) = C1 m (t-1) + (2k >> Shift i ) - (C1 m (t-1) >> Shift i ), m ∈[symbol, M-1)
[0276] C2 m (t) = C2 m (t-1) - (C2 m (t-1) >> Shift i ), m ∈ [0, symbol)
[0277] C2 m (t) = C2 m (t-1) + (2 k >> Shift i ) - (C2 m (t-1) >> Shift i ), m ∈[symbol, M-1)
[0278] C m (t) = (a * C1 m (t) + b * C2 m (t) + (2 k * (a+b))>>1 ) / (a+b)
[0279] According to an embodiment of the present disclosure, the division operation may also be implemented through a shift operation.
[0280] The probability updating method using multiple scaling factors will be described in detail below with reference to Figures 20 to 24.
[0281] FIG. 20 is a schematic diagram comparing a probability update process using one scaling factor and a probability update process using multiple scaling factors.
[0282] In the CAMAC encoding / decoding process, entropy reset can be performed for each specific data unit. For example, entropy reset can be performed for each slice unit or each coding unit. Entropy reset means discarding the current probability value and newly performing CAMAC based on a predetermined probability value. In the probability update process performed after the entropy reset, the probability value set to the initial value may not be the optimal value, and converges to the predetermined probability value after the probability update process is performed several times.
[0283] FIG. 20 shows the results of probability updates performed by two methods based on the same symbol sequence and initial value. Graph 2010 represents the probability when a scaling factor corresponding to a short window is used, and graph 2020 represents the probability when two scaling factors corresponding to a short window and a long window are used, respectively. In FIG. 20 , the x-axis represents the number of updates, and the y-axis represents the probability value. Referring to FIG. 20 , in the case 2010 of updating the probability using a scaling factor, as the number of updates of the probability increases, the probability can change rapidly to converge quickly to an appropriate value, but large fluctuations may occur with repeated updates. In contrast, according to an embodiment of the present disclosure, in the case 2020 of updating the probability using multiple scaling factors, although the probability does not change rapidly, fluctuations may occur less when the updated probability converges to an appropriate value, making stable operation possible without causing sensitive responses to errors, noise, and the like.
[0284] Therefore, considering the probability update process of the case where one scaling factor is used and the case where a plurality of scaling factors are used, the context modeler 1720 may determine whether to update the probability by using a plurality of scaling factors.
[0285] FIG. 21 is a flowchart of a method of updating a probability by using a scaling factor according to an embodiment of the present disclosure.
[0286] 21, in operation 2110, the context modeler 1720 may obtain information about a slice type from a bitstream. The slice type may include an I slice, a B slice, or a P slice. The information about the slice type may be included in a slice header. The context modeler 1720 may obtain information about a slice header in the form of a bitstream.
[0287] In operation 2120, the context modeler 1720 may perform arithmetic coding on the current symbol based on the occurrence probability of the symbol. The symbol representation unit 1710 may determine that the current symbol corresponds to a syntax element. According to an embodiment of the present disclosure, the occurrence probability of the symbol may be a cumulative occurrence probability. For example, the occurrence probability of symbol k may be the sum of the occurrence probabilities of each symbol 0 to k. According to an embodiment of the present disclosure, the occurrence probability of the symbol may be the occurrence probability of each symbol, which is the probability that the symbol may appear.
[0288] According to an embodiment of the present disclosure, the occurrence probability of a symbol can be independently determined for each of the multiple context models corresponding to the syntax element. For example, the context modeler 1720 can obtain multiple scaling factor indexes shiftldx specified for each context model, and determine the value corresponding to each scaling factor index as the scaling factor.
[0289] In order to specify the scaling factor according to the context model, additional memory space for presetting the scaling factor table may be required. That is, when n bits are required to represent each scaling factor Shift i When the value of may be n*2*[number of context models] bits of memory may be required to define two scaling factors for each context model. For example, when the scaling factor is represented by 4 bits and 400 context models are provided, a table specifying two scaling factors for each context model may require 3200 (4*2*400 = 3200) bits of ROM.
[0290] Therefore, the context modeler 1720 according to an embodiment of the present disclosure may determine all or some of the multiple scaling factors based on values that are independent of the context model, thereby saving memory required to determine the scaling factors.
[0291] According to an embodiment of the present disclosure, only some context models may be set to use a scaling factor specified for the context model. For example, only a context model used for coefficient coding may have a specified scaling factor. In addition, according to another example, in addition to the context model used for coefficient coding, only other context models may have a specified scaling factor. When a context model does not have a specified value for a scaling factor, the context modeler 1720 may determine a plurality of scaling factors as predetermined reference values.
[0292] According to an embodiment of the present disclosure, at least one of the multiple scaling factors may be determined as a predetermined value that is independent of the context model. For example, the context modeler 1720 may shift the first scaling factor corresponding to the short window of the two scaling factors to 1 Determine as a fixed value M for all context models, and shift the second scaling factor corresponding to the long window 2 is determined to be a value specified according to the context model. Alternatively, the context modeler 1720 may shift the second scaling factor 2 Determine it as a fixed value and shift the first scaling factor 1 Determines the value specified by the context model.
[0293] When the probability C i Represented as 0 to 2 k When the number of scaling factors is an integer between , k bits of memory may be required to represent the probability, as shown in Equation 4. Therefore, when two scaling factors are used for each context model, two probabilities may need to be updated, and thus k*2*[number of context models] bits of memory may be required. For example, when C i By less than or equal to 2 15When an integer representation is provided and 400 context models are provided, it may be necessary to ensure 12000 (15*2*400 = 12000) bits of RAM to update the probability.
[0294] Therefore, in order to reduce the memory required to represent the probability, the context modeler 1720 according to an embodiment of the present disclosure may determine whether to update the probability by using all of the multiple scaling factors, or whether to update the probability by using only some of the multiple scaling factors instead of using all of the multiple scaling factors, based on the context model. In an embodiment of the present disclosure, when the context modeler 1720 determines to update the probability by using some of the multiple scaling factors, the context modeler 1720 may update the probability by using only one of the multiple scaling factors. In this case, because the probability (e.g., P 1 ), so the memory required to represent the probability can be reduced.
[0295] In an embodiment of the present disclosure, some context models may be set to update probabilities by using multiple scaling factors. For example, only the context model for coefficient coding may be set to update probabilities by using multiple scaling factors, while other context models may be set to update probabilities by using only one scaling factor. Or, conversely, only other context models other than the context model for coefficient coding may be set to update probabilities by using multiple scaling factors, and the context model for coefficient coding may be set to update probabilities by using only one scaling factor.
[0296] In operation 2130, when the information about the slice type indicates an I slice, the context modeler 1720 may determine a first scaling factor by using a function having a value determined based on a first threshold. For example, when the first threshold is th1, the first scaling factor shift i The value of can be determined as shift i = b1 + I(count>th1). b1 may be a predetermined constant, and the function I(count>th1) may indicate a value greater than 0 when count is greater than th1, and may indicate 0 when count is less than or equal to th1. For example, when count is greater than th1, the function I(count>th1) may be 1, and when count is less than or equal to th1, the function I(count>th1) may be 0.
[0297] According to an embodiment of the present disclosure, count may be the number of times a symbol is arithmetically encoded. According to an embodiment of the present disclosure, when multiple context models are provided, count may be the number of times a symbol is arithmetically encoded based on each context model. According to an embodiment of the present disclosure, b1 may be a value of 2 to 7. For the convenience of description, it has been described that the first scaling factor shift is determined by a threshold value. i , but the present disclosure is not limited thereto. i The value of can be determined based on multiple thresholds. In addition, other variables can be further considered to determine the first scaling factor shift i For example, the first scaling factor shift may be determined based on the number of symbols. i The value of .
[0298] In operation 2140, when the information about the slice type indicates a B or P slice, the context modeler 1720 may determine the first scaling factor by using a function having a value determined based on the second threshold. For example, when the second threshold is th2, the first scaling factor shift i The value of can be determined as shift i = b2+I(count>th2). b2 may be a predetermined constant, and the function I(count>th2) may indicate a value greater than 0 when count is greater than th2, and indicate 0 when count is less than or equal to th2. According to an embodiment of the present disclosure, b2 may be a value from 2 to 7. The first threshold may be greater than or equal to the second threshold. In addition, b2 may be greater than or equal to b1. When the first threshold is greater than or equal to the second threshold, the value of the scaling factor determined based on the first threshold may be less than the value of the scaling factor determined based on the second threshold. In the above example, the value of the scaling factor when the slice type is an I slice may be less than the value of the scaling factor when the slice type is a B or P slice. Because there is a relatively small amount of data to be encoded between slices than within a slice, the value of the scaling factor in the I slice may be less than the value of the scaling factor in the B or P slice, so that the probability of occurrence of the symbol in the I slice converges relatively quickly. The bit rate can be saved by determining the scaling factor based on the slice type.
[0299] In operation 2150, the context modeler 1720 may update the occurrence probability of the symbol by using the first scaling factor. According to an embodiment of the present disclosure, the context modeler 1720 may perform arithmetic coding and updating based on the occurrence probability of a symbol. As described above, the context modeler 1720 may perform arithmetic coding and updating based on the probability of multiple occurrences of the symbol. As shown in Equations 3 and 4, the context modeler 1720 may update each of the multiple occurrence probabilities of the symbol, perform weighted summation on the multiple updated occurrence probabilities of the symbol, and finally update the occurrence probability of the symbol. According to an embodiment of the present disclosure, the context modeler 1720 may finally update the occurrence probability of the symbol by averaging the multiple updated occurrence probabilities of the symbol.
[0300] According to an embodiment of the present disclosure, the context modeler 1720 may determine to use a function of a first threshold as the first scaling factor, and determine the value of the first scaling factor according to a predetermined condition. According to an embodiment of the present disclosure, the context modeler 1720 may determine to use a function of a second threshold as the first scaling factor, and determine the value of the first scaling factor according to a predetermined condition. According to an embodiment of the present disclosure, the context modeler 1720 may determine to use a function of at least one of the first threshold or the second threshold as the first scaling factor, and determine the value of the first scaling factor according to a predetermined condition.
[0301] 22 is a flowchart of a method of updating a probability by using a plurality of scaling factors according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, operation 2210 may be performed after operation 2120 of FIG. 21 .
[0302] 22 , in operation 2210 , when the information about the slice type indicates an I slice, the context modeler 1720 may determine the second scaling factor by using a function having a value determined based on a third threshold value.
[0303] In operation 2220, when the information about the slice type indicates a B or P slice, the context modeler 1720 may determine the second scaling factor by using a function having a value determined based on a fourth threshold value.
[0304] The method by which the context modeler 1720 determines the second scaling factor by using a function having a value determined based on the third threshold or by using a function having a value determined based on the fourth threshold may be the same as the method of determining the second scaling factor based on the first threshold or the second threshold, which has been described with reference to FIG. 21 .
[0305] In operation 2230, the context modeler 1720 may update the occurrence probability of the symbol by using the second scaling factor. According to an embodiment of the present disclosure, the context modeler 1720 may update the occurrence probability of the symbol by using the first scaling factor or the second scaling factor already obtained in FIG. 21. As described above, the occurrence probability of the symbol may be updated by weighted summing the occurrence probabilities of the symbol corresponding to a plurality of scaling factors, the occurrence probability of the symbol being updated based on the corresponding scaling factor.
[0306] According to an embodiment of the present disclosure, when the information about the slice type indicates an I slice, the weight of the probability corresponding to the scaling factor having a large value among the plurality of scaling factors may be relatively large. For example, when the information about the slice type indicates an I slice and the value of the first scaling factor is greater than or equal to the value of the second scaling factor, the weight of the first probability may be greater than or equal to the weight of the second probability. When the slice type is an I slice, it may be effective to have a large weight for the probability having a larger scaling factor.
[0307] According to an embodiment of the present disclosure, when the information about the slice type indicates a B or P slice, the weight of the probability corresponding to the scaling factor having a large value among the plurality of scaling factors may be relatively small. For example, when the information about the slice type indicates a B or P slice and the value of the first scaling factor is greater than or equal to the value of the second scaling factor, the weight of the first probability may be less than or equal to the weight of the second probability. When the slice type is a B or P slice, it may be effective to have a small weight for the probability having a larger scaling factor.
[0308] FIG. 23 is a flowchart of a method of updating occurrence probabilities of symbols by using multiple scaling factors according to an embodiment of the present disclosure.
[0309] 23 , in operation 2310 , the context modeler 1720 determines whether information about a slice type indicates an I slice. When the information about the slice type is an I slice, operation 2320 is performed, and when the information about the slice type is not an I slice, operation 2330 is performed.
[0310] In operation 2320, the context modeler 1720 may determine the first scaling factor by using a function having a value determined based on the first threshold and the fifth threshold. For example, when the first threshold is th11 and the fifth threshold is th12, the first scaling factor shift i The value of can be determined as shift i= b1 + I(count > th11) + I(count > th12). b1 may be a predetermined constant, and functions I(count > th11) and I(count > th12) may mean that when count is greater than or equal to th11 and th12, respectively, a value greater than 0 is indicated. The constant b1, the function I(count > th), and the threshold th may be understood with reference to operation 2130 of FIG. 21 .
[0311] In operation 2330, the context modeler 1720 may determine the first scaling factor by using a function having a value determined based on the second threshold and the sixth threshold. For example, when the second threshold is th21 and the sixth threshold is th22, the first scaling factor shift i The value of can be determined as shift i = b2+ I(count > th21) + I(count > th22).
[0312] Used in operations 2320 and 2330 to determine shift i The equation is only an example, and the present disclosure is not limited thereto. Other elements may be further included to determine the shift i .
[0313] According to an embodiment of the present disclosure, the predetermined threshold, such as the first threshold, may be a fixed value, such as 31. According to an embodiment of the present disclosure, the predetermined threshold may be a value specified according to the context model. According to an embodiment of the present disclosure, the context modeler 1720 may use thresholds specified for the context models for some context models, and use pre-specified fixed values for other context models.
[0314] FIG. 24 is a flowchart of a method for determining a value of a scaling factor based on a syntax element corresponding to a current symbol according to an embodiment of the present disclosure.
[0315] In operation 2410, the context modeler 1720 may determine a count based on the number of times a syntax element corresponding to the current symbol has been previously arithmetically decoded.
[0316] According to an embodiment of the present disclosure, the context modeler 1720 may determine the number of times that the syntax element corresponding to the current symbol has been previously arithmetically decoded as a count. That is, each time the syntax element is arithmetically decoded, the count may be increased by 1. According to an embodiment of the present disclosure, when the number of times the syntax element has been previously arithmetically decoded is greater than or equal to a predetermined value, the count may be represented as a fixed value. For example, when the threshold is 31 and the number of times the syntax element has been previously arithmetically decoded is not greater than 31, the count may be the same as the number of times the syntax element has been previously arithmetically decoded. When the threshold is 31 and the number of times the syntax element has been previously arithmetically decoded is greater than or equal to 31, the count may be determined as a predetermined value. For example, the count may be fixed at 31 corresponding to the threshold or at 32 increased by 1 from the threshold. For convenience of description, the case where the threshold is 31 has been described, but the present disclosure is not limited thereto. According to the choice of a person of ordinary skill in the art, the threshold may be determined as another number, such as 63.
[0317] In operation 2420 , the context modeler 1720 may determine a value of a first scaling factor based on the count.
[0318] According to an embodiment of the present disclosure, the value of the first function determined when the number of arithmetic decoding is greater than or equal to the first threshold value may be greater than the value of the first function determined when the number of arithmetic decoding is less than the first threshold value. For example, the value of the first function determined when the number of arithmetic decoding is greater than or equal to the first threshold value may be greater than the value of the first function determined when the number of arithmetic decoding is less than the first threshold value by 1. For example, the function I (count > th1) for determining the value of the scaling factor may have a value of 1 when count is greater than th1, and may have a value of 0 when count is less than or equal to th1.
[0319] FIG. 25 is a flowchart of a method for determining the number of symbols based on syntax elements according to an embodiment of the present disclosure.
[0320] In operation 2510, the context modeler 1720 may obtain a request for a syntax element.
[0321] In operation 2520, the context modeler 1720 may determine the number of symbols based on the type of the syntax element. The number of symbols may refer to the number of symbols to which the syntax element may correspond. For example, when the number of symbols is M (M is an integer), the syntax element may correspond to one of symbols 0 to M-1. According to an embodiment of the present disclosure, the number of symbols may be different for each syntax element. The number of symbols may be predetermined. According to an embodiment of the present disclosure, the number of symbols may be 2 to 16. According to an embodiment of the present disclosure, the number of symbols may be 2 to 8.
[0322] According to an embodiment of the present disclosure, the scaling factor may be determined by using the number of symbols. For example, the scaling factor may be determined as shift i = b1 + I(count> th1) + min(log(M), 2). At this point, M represents the number of symbols. That is, the value of the scaling factor may be determined based on a result of comparing the number of symbols with a predetermined value (eg, 2).
[0323] According to an embodiment of the present disclosure, when the number of symbols is greater than or equal to a predetermined value, the value of the first scaling factor may be determined based on the predetermined value, and when the number of symbols is less than the predetermined value, the value of the first scaling factor may be determined based on the number of symbols. For example, the value of the scaling factor may be determined based on a smaller value between the predetermined value and the logarithmic value of the number of symbols.
[0324] The number of elements (eg, probabilities) associated with each symbol increases as the number of symbols increases, and thus, by changing the number of symbols per syntax element, memory efficiency may be improved.
[0325] FIG. 26 is a flowchart of a method for determining the occurrence probability of a symbol based on a context model according to an embodiment of the present disclosure.
[0326] In operation 2610 , the context modeler 1720 may obtain a request for a syntax element. Operation 2610 may correspond to operation 2510 .
[0327] In operation 2620 , the context modeler 1720 may determine a context model corresponding to a predetermined condition from among a plurality of context models corresponding to the syntax element.
[0328] In operation 2630, the context modeler 1720 may obtain the occurrence probability of the symbol from the determined context model. Multiple context models may be determined and updated independently of the occurrence probability of the symbol. That is, in operation 2620, the occurrence probability of the symbol obtained may be different according to the determined context model.
[0329] FIG. 27 is a block diagram showing a configuration of an entropy decoding apparatus 2700 according to an embodiment of the present disclosure.
[0330] 27 , an entropy decoding apparatus 2700 may include a context modeler 2710, a normal decoding engine 2720, a bypass decoding engine 2730, and a symbol decoder 2740. The entropy decoding apparatus 2700 may perform an inverse process of the entropy encoding process performed by the entropy encoding device 1700 described above.
[0331] Binary data encoded by bypass coding may be output to the bypass decoding engine 2730 and decoded, and binary data encoded by regular coding may be decoded by the regular decoding engine 2720. The regular decoding engine 2720 may perform arithmetic decoding on the current binary data provided from the context modeler 2710 by using the probability of a binary value determined based on previous binary data decoded before the current binary data is decoded.
[0332] The context modeler 2710 may provide a probability model of binary data to the regular decoding engine 2720. More specifically, the context modeler 2710 may determine a probability of a predetermined binary value based on previously decoded binary data, update the probability of the binary value used to decode the previous binary data, and output the updated probability to the regular decoding engine 2720.
[0333] The context modeler 2710 according to an embodiment of the present disclosure may determine a plurality of scaling factors for updating the probability of occurrence of a predetermined binary value of the current symbol. The context modeler 2710 updates the probability of occurrence of a predetermined binary value according to the binary value of the current symbol by using at least one of the plurality of scaling factors. The probability update process performed by the context modeler 2710 may be the same as the probability update process performed in the above-mentioned encoding process, and therefore, a detailed description thereof will be omitted.
[0334] The symbol decoder 2740 may again map the binary data string reconstructed by the regular decoding engine 2720 or the bypass decoding engine 2730 to the syntax element and reconstruct the binary data string.
[0335] FIG. 28 is a flowchart of a method for updating probabilities by using scaling factors according to an embodiment of the present disclosure.
[0336] 28, in operation 2810, the context modeler 2710 may obtain information about a slice type from a bitstream. The slice type may include an I slice, a B slice, or a P slice. The information about the slice type may be included in a slice header. The context modeler 2710 may obtain information about a slice header in the form of a bitstream.
[0337] In operation 2820, the context modeler 2710 may perform arithmetic decoding on the current symbol based on the occurrence probability of the symbol. The symbol representation unit 1710 may determine that the current symbol corresponds to a syntax element. According to an embodiment of the present disclosure, the occurrence probability of the symbol may be a cumulative occurrence probability. For example, the occurrence probability of symbol k may be the sum of the occurrence probabilities of each symbol 0 to k. According to an embodiment of the present disclosure, the occurrence probability of the symbol may be the occurrence probability of each symbol, which is the probability that the symbol may appear.
[0338] According to an embodiment of the present disclosure, the occurrence probability of a symbol can be independently determined for each of the multiple context models corresponding to the syntax element. For example, the context modeler 2710 can obtain multiple scaling factor indexes shiftldx specified for each context model, and determine the value corresponding to each scaling factor index as the scaling factor.
[0339] According to an embodiment of the present disclosure, only some context models may be set to use a scaling factor specified for the context model. For example, only a context model used for coefficient coding may have a specified scaling factor. In addition, according to another example, only context models other than the context model used for coefficient coding may have a specified scaling factor. When a context model does not have a specified value for a scaling factor, the context modeler 2710 may determine a plurality of scaling factors as predetermined reference values.
[0340] According to an embodiment of the present disclosure, at least one of the multiple scaling factors may be determined as a predetermined value that is independent of the context model. For example, the context modeler 2710 may shift the first scaling factor corresponding to the short window of the two scaling factors to the value that is independent of the context model for all context models. 1 Determine the fixed value M and shift the second scaling factor corresponding to the long window 2 is determined to be a value specified according to the context model. Alternatively, the context modeler 2710 may shift the second scaling factor 2 Determine it as a fixed value and shift the first scaling factor 1 Determines the value specified by the context model.
[0341] When the probability C i Represented as 0 and 2 k When the scaling factor is an integer between , k bits of memory may be required to represent the probability, as shown in Equation 4. Therefore, when two scaling factors are used for each context model, two probabilities may need to be updated, and accordingly, k*2*[number of context models] bits of memory may be required. For example, when C i By less than or equal to 2 15 When using integer representation and providing 400 context models, it may be necessary to ensure 12000 (15*2*400 = 12000) bits of RAM to update the probability.
[0342] Therefore, in order to reduce the memory required to represent the probability, the context modeler 2710 according to an embodiment of the present disclosure may determine, based on the context model, whether to update the probability by using all of the multiple scaling factors, or whether to update the probability by using only some of the multiple scaling factors instead of using all of the multiple scaling factors. In an embodiment of the present disclosure, when the context modeler 2710 determines to update the probability by using some of the multiple scaling factors, the context modeler 2710 may update the probability by using only one of the multiple scaling factors. In this case, because the probability needs to be updated, for example, P 1 The value of , so the memory required to represent the probability can be reduced.
[0343] In an embodiment of the present disclosure, some context models may be set to update probabilities by using multiple scaling factors. For example, a context model used only for coefficient coding may be set to update probabilities by using multiple scaling factors, while other context models may be set to update probabilities by using only one scaling factor. Or, conversely, only context models other than the context model used for coefficient coding may be set to update probabilities by using multiple scaling factors, and the context model used for coefficient coding may be set to update probabilities by using only one scaling factor.
[0344] In operation 2830, when the information about the slice type indicates an I slice, the context modeler 2710 may determine a first scaling factor by using a function having a value determined based on a first threshold. For example, when the first threshold is th1, the first scaling factor shift i The value of can be determined as shift i = b1 + I(count>th1). b1 may be a predetermined constant, and the function I(count>th1) may indicate a value greater than 0 when count is greater than th1, and may indicate 0 when count is less than or equal to th1. For example, when count is greater than th1, the function I(count>th1) may be 1, and when count is less than or equal to th1, the function I(count>th1) may be 0.
[0345] According to an embodiment of the present disclosure, the count may be the number of times the symbol is arithmetically encoded. According to an embodiment of the present disclosure, when multiple context models are provided, the count may be the number of times the symbol is arithmetically encoded based on each context model. According to an embodiment of the present disclosure, b1 may be a value of 2 to 7. For convenience of description, it has been described that the first scaling factor shift is determined by a threshold value. i , but the present disclosure is not limited thereto. iThe value of can be determined based on multiple thresholds. In addition, other variables can be further considered to determine the first scaling factor shift i For example, the first scaling factor shift may be determined based on the number of symbols. i The value of .
[0346] In operation 2840, when the information about the slice type indicates a B or P slice, the context modeler 2710 may determine the first scaling factor by using a function having a value determined based on the second threshold. For example, when the second threshold is th2, the first scaling factor shift 1 The value of can be determined as shift 1 = b2+1(count>th2). b2 may be a predetermined constant, and the function I(count>th2) may indicate a value greater than 0 when count is greater than th2, and indicate 0 when count is less than or equal to th2. According to an embodiment of the present disclosure, b2 may be a value from 2 to 7. The first threshold may be greater than or equal to the second threshold. In addition, b2 may be greater than or equal to b1. When the first threshold is greater than or equal to the second threshold, the value of the scaling factor determined based on the first threshold may be less than the value of the scaling factor determined based on the second threshold. In the above example, the value of the scaling factor when the slice type is an I slice may be less than the value of the scaling factor when the slice type is a B or P slice. Because there is a relatively small amount of data to be encoded between slices than within a slice, the value of the scaling factor in the I slice may be less than the value of the scaling factor in the B or P slice, so that the probability of occurrence of the symbol in the I slice converges relatively quickly. The bit rate can be saved by determining the scaling factor based on the slice type.
[0347] In operation 2850, the context modeler 2710 may update the occurrence probability of the symbol by using the first scaling factor. According to an embodiment of the present disclosure, the context modeler 2710 may perform arithmetic coding and updating based on the occurrence probability of a symbol. As described above, the context modeler 2710 may perform arithmetic coding and updating based on multiple occurrence probabilities of the symbol. As shown in Equations 3 and 4, the context modeler 2710 may update each of the multiple occurrence probabilities of the symbol, perform weighted summation on the multiple occurrence updated probabilities of the symbol, and finally update the occurrence probability of the symbol. According to an embodiment of the present disclosure, the context modeler 2710 may finally update the occurrence probability of the symbol by averaging the multiple updated occurrence probabilities of the symbol.
[0348] According to an embodiment of the present disclosure, the context modeler 2710 may determine a function using a first threshold as a first scaling factor, and determine a value of the first scaling factor according to a predetermined condition. According to an embodiment of the present disclosure, the context modeler 2710 may determine a function using a second threshold as a first scaling factor, and determine a value of the first scaling factor according to a predetermined condition. According to an embodiment of the present disclosure, the context modeler 2710 may determine a function using at least one of the first threshold or the second threshold as a first scaling factor, and determine a value of the first scaling factor according to a predetermined condition.
[0349] According to an embodiment of the present disclosure, an entropy decoding method is provided. The entropy decoding method may include obtaining information about a slice type from a bitstream. The entropy decoding method may include performing arithmetic decoding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The entropy decoding method may include determining a first scaling factor for updating the probability of occurrence of a symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The entropy decoding method may include determining a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The entropy decoding method may include updating the probability of occurrence of a symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0350] According to an embodiment of the present disclosure, the entropy decoding method may include determining a second scaling factor for updating the occurrence probability of a symbol by using a third function when the information about the slice type indicates an I slice, wherein the value of the third function is determined based on a third threshold. The entropy decoding method may include determining the second scaling factor by using a fourth function when the information about the slice type indicates a B or P slice, wherein the value of the fourth function is determined based on a fourth threshold. The entropy decoding method may include updating the occurrence probability of a symbol by using the first scaling factor and the second scaling factor. The third threshold may be greater than or equal to the fourth threshold.
[0351] According to an embodiment of the present disclosure, the entropy decoding method may include updating a first probability of a symbol by using a first scaling factor. The entropy decoding method may include updating a second probability of a symbol by using a second scaling factor. The entropy decoding method may include updating an occurrence probability of a symbol by using an average of the first probability and the second probability.
[0352] According to an embodiment of the present disclosure, the entropy decoding method may include updating a first probability of a symbol by using a first scaling factor. The entropy decoding method may include updating a second probability of a symbol by using a second scaling factor. The entropy decoding method may include updating an occurrence probability of a symbol by using a weighted sum of the first probability and the second probability.
[0353] According to an embodiment of the present disclosure, when the information about the slice type indicates an I slice, the value of the first scaling factor may be greater than or equal to the value of the second scaling factor. When the information about the slice type indicates an I slice, the weight of the first probability may be greater than or equal to the weight of the second probability.
[0354] According to an embodiment of the present disclosure, in the entropy decoding method, when the information about the slice type indicates a B or P slice, the value of the first scaling factor may be greater than or equal to the value of the second scaling factor. When the information about the slice type indicates a B or P slice, the weight of the first probability may be less than or equal to the weight of the second probability.
[0355] According to an embodiment of the present disclosure, the first scaling factor may be determined based on the number of times a symbol corresponding to a syntax element has been previously arithmetically decoded.
[0356] According to an embodiment of the present disclosure, a value of the first function determined when the number of arithmetic decoding is greater than or equal to the first threshold may be greater than a value of the first function determined when the number of arithmetic decoding is less than the first threshold.
[0357] According to an embodiment of the present disclosure, the value of the first function determined when the number of arithmetic decoding is greater than or equal to the first threshold is 1 greater than the value of the first function determined when the number of arithmetic decoding is less than the first threshold.
[0358] According to an embodiment of the present disclosure, an entropy decoding method may include obtaining a request for a syntax element. The entropy decoding method may include determining the number of symbols based on the type of the syntax element.
[0359] According to an embodiment of the present disclosure, the value of the first scaling factor may be determined by using the number of symbols.
[0360] According to an embodiment of the present disclosure, when the number of symbols is greater than or equal to a predetermined value, the value of the first scaling factor may be determined based on the predetermined value. When the number of symbols is less than the predetermined value, the value of the first scaling factor may be determined based on the number of symbols.
[0361] According to an embodiment of the present disclosure, when the number of symbols is M (M is an integer), the current symbol may correspond to an integer from 0 to M-1. M may have a value from 2 to 16.
[0362] According to an embodiment of the present disclosure, an entropy decoding method may include obtaining a request for a syntax element. The entropy decoding method may include determining a context model corresponding to a predetermined condition among a plurality of context models corresponding to the syntax element. The entropy decoding method may include obtaining an occurrence probability of a symbol from the determined context model.
[0363] According to an embodiment of the present disclosure, the occurrence probability of a symbol may be a cumulative distribution probability.
[0364] According to an embodiment of the present disclosure, the entropy decoding method may include determining the first scaling factor by using a function having a value determined based on the first threshold and the fifth threshold. The entropy decoding method may include determining the second scaling factor by using a function having a value determined based on the second threshold and the sixth threshold.
[0365] According to an embodiment of the present disclosure, an entropy decoding device is provided. The entropy decoding device may include at least one processor. The at least one processor may be configured to obtain information about a slice type from a bitstream. The at least one processor is configured to perform arithmetic decoding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The at least one processor may be configured to determine a first scaling factor for updating the probability of occurrence of the symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The at least one processor may be configured to determine a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The at least one processor may be configured to update the probability of occurrence of the symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0366] According to an embodiment of the present disclosure, an entropy coding method is provided. The entropy coding method may include obtaining information about a slice type from a bitstream. The entropy coding method may include performing arithmetic coding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The entropy coding method may include determining a first scaling factor for updating the probability of occurrence of the symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The entropy coding method may include determining a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The entropy coding method may include updating the probability of occurrence of the symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0367] According to an embodiment of the present disclosure, an entropy coding device is provided. The entropy coding device may include at least one processor. The at least one processor may be configured to obtain information about a slice type from a bitstream. The at least one processor may be configured to perform arithmetic coding on a current symbol corresponding to a syntax element based on the probability of occurrence of the symbol. The at least one processor may be configured to determine a first scaling factor for updating the probability of occurrence of a symbol by using a first function when the information about the slice type indicates an I slice, wherein the value of the first function is determined based on a first threshold. The at least one processor may be configured to determine a first scaling factor by using a second function when the information about the slice type indicates a B or P slice, wherein the value of the second function is determined based on a second threshold. The at least one processor may be configured to update the probability of occurrence of a symbol by using the first scaling factor. The first threshold may be greater than or equal to the second threshold.
[0368] Embodiments of the present disclosure have been described above. Those skilled in the art to which the present disclosure pertains will appreciate that modifications may be made without departing from the inherent properties of the present disclosure. Therefore, the embodiments of the present disclosure should be considered from a descriptive perspective rather than a restrictive perspective. The scope of the present disclosure is defined in the appended claims, rather than in the detailed description above, and it should be noted that all differences falling within the claims and their equivalents are included within the scope of the present disclosure.
[0369] In addition, the embodiments of the present disclosure may be written as a program executable on a computer and implemented on a general-purpose digital computer that runs the program using a computer-readable recording medium. The computer-readable recording medium may include storage media such as magnetic storage media (e.g., ROM, floppy disks, hard disks, etc.) and optical reading media (e.g., compact disk ROM (CD-ROM), digital versatile disk (DVD), etc.).
Claims
1. An entropy decoding method, comprising: Get information about the slice type from the bitstream; Performing arithmetic decoding on a current symbol corresponding to a syntax element based on the occurrence probability of the symbol; determining, based on the slice type indication I slice, a first scaling factor for updating the occurrence probability of the symbol by using a first function, wherein a value of the first function is determined based on a first threshold; determining the first scaling factor by using a second function based on the slice type indicating a B or P slice, wherein a value of the second function is determined based on a second threshold; and updating the occurrence probability of the symbol by using the first scaling factor, The first threshold is greater than or equal to the second threshold.
2. The entropy decoding method according to claim 1 further comprises: determining a second scaling factor for updating the occurrence probability of the symbol by using a third function based on the slice type indicating the I slice, in, determining a value of the third function based on a third threshold; and determining the second scaling factor by using a fourth function based on the slice type indicating a B or P slice, wherein a value of the fourth function is determined based on a fourth threshold, Wherein, updating the occurrence probability of the symbol by using the first scaling factor comprises: updating the occurrence probability of the symbol by using the first scaling factor and the second scaling factor, and The third threshold is greater than or equal to the fourth threshold.
3. The entropy decoding method according to claim 2, in, Updating the occurrence probability of the symbol by using the first scaling factor and the second scaling factor comprises: updating a first probability of the symbol by using the first scaling factor; updating a second probability of the symbol by using the second scaling factor; and The occurrence probability of the symbol is updated by using an average value of the first probability and the second probability.
4. The entropy decoding method according to any one of claims 2 to 3, in, Updating the occurrence probability of the symbol by using the first scaling factor and the second scaling factor comprises: updating a first probability of the symbol by using the first scaling factor; updating a second probability of the symbol by using the second scaling factor; and The occurrence probability of the symbol is updated by using a weighted sum of the first probability and the second probability.
5. The entropy decoding method according to claim 4, in, Based on the slice type indicating the I slice, a value of the first scaling factor is greater than or equal to a value of the second scaling factor, and a weight of the first probability is greater than or equal to a weight of the second probability.
6. The entropy decoding method according to any one of claims 4 to 5, in, When the information about the slice type indicates the B or P slice, the value of the first scaling factor is greater than or equal to the value of the second scaling factor, and the weight of the first probability is less than or equal to the weight of the second probability.
7. The entropy decoding method according to any one of claims 1 to 6, in, The first scaling factor is determined based on a number of times a symbol corresponding to the syntax element has been previously arithmetically decoded.
8. The entropy decoding method according to claim 7, in, A value of the first function determined when the number of arithmetic decoding is greater than or equal to the first threshold is greater than a value of the first function determined when the number of arithmetic decoding is less than the first threshold.
9. The entropy decoding method according to any one of claims 7 to 8, in, The value of the first function determined when the number of arithmetic decoding is greater than or equal to the first threshold is greater than the value of the first function determined when the number of arithmetic decoding is less than the first threshold by 1.
10. The entropy decoding method according to any one of claims 1 to 9, further comprising: obtaining a request for the syntax element; and Based on the type of the syntax element, the number of symbols is determined.
11. The entropy decoding method according to claim 10, in, The value of the first scaling factor is determined by using the number of symbols.
12. The entropy decoding method according to claim 11, in, determining the value of the first scaling factor based on the predetermined value based on the number of symbols being greater than or equal to a predetermined value, and Based on the number of symbols being less than the predetermined value, the value of the first scaling factor is determined based on the number of symbols.
13. The entropy decoding method according to any one of claims 1 to 12, in, When the number of symbols is M, the current symbol corresponds to an integer from 0 to M-1, where M is an integer.
14. An entropy decoding apparatus comprising at least one processor, wherein the at least one processor is configured to: Get information about the slice type from the bitstream; Performing arithmetic decoding on a current symbol corresponding to a syntax element based on the occurrence probability of the symbol; determining, based on the slice type indication I slice, a first scaling factor for updating the occurrence probability of the symbol by using a first function, wherein a value of the first function is determined based on a first threshold; when the information about the slice type indicates a B or P slice, determining the first scaling factor by using a second function, wherein a value of the second function is determined based on a second threshold; and updating the occurrence probability of the symbol by using the first scaling factor, The first threshold is greater than or equal to the second threshold.
15. An entropy coding method comprising: Get information about the slice type; Performing arithmetic coding on a current symbol corresponding to a syntax element based on an occurrence probability of the symbol; determining, based on the slice type indication I slice, a first scaling factor for updating the occurrence probability of the symbol by using a first function, wherein a value of the first function is determined based on a first threshold; determining the first scaling factor by using a second function based on the slice type indicating a B or P slice, wherein a value of the second function is determined based on a second threshold; and updating the occurrence probability of the symbol by using the first scaling factor, The first threshold is greater than or equal to the second threshold.
