Encoding device, decoding device, and bit stream generation device
The encoding device addresses challenges in video coding by limiting context adaptive encoding times, skipping coefficient flag encoding, and using Golomb-Rice encoding, resulting in improved efficiency, speed, and reduced circuit requirements.
Patent Information
- Application Number
- JP2025038867
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-06-14
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-05
- Estimated Expiration
- 2040-06-09
AI Technical Summary
Existing video coding technologies face challenges in improving encoding efficiency, image quality, reducing processing amounts, and circuit scale, while appropriately selecting elements or operations such as filters, block sizes, motion vectors, and reference pictures.
An encoding device that includes a circuit and memory, which encodes a block of an image by limiting the number of times of context adaptive encoding. It skips encoding of coefficient information flags under certain conditions and applies Golomb-Rice encoding for residual values, optimizing processing and circuit requirements.
The solution enhances encoding efficiency, simplifies the encoding/decoding process, increases processing speed, and reduces circuit scale and code amount, while maintaining image quality.
Smart Images

Figure 2025085677000001_ABST
Abstract
Description
[Technical field]
[0001] TECHNICAL FIELD This disclosure relates to video coding, such as systems, components, and methods for encoding and decoding video images. [Background technology]
[0002] Video coding technology has progressed from H.261 and MPEG-1 to H.264 / AVC (Advanced Video Coding), MPEG-LA, H.265 / HEVC (High Efficiency Video Coding), and H.266 / VVC (Versatile Video Codec). With this progress, there is a constant need to provide improvements and optimizations in video coding technology to handle the ever-increasing amount of digital video data in various applications.
[0003] Non-Patent Document 1 relates to an example of a conventional standard regarding the above-mentioned video coding technology. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] H.265(ISO / IEC 23008-2 HEVC) / HEVC(High Efficiency Video Coding) Summary of the Invention [Problem to be solved by the invention]
[0005] Regarding the above-mentioned encoding methods, it is desirable to propose new methods in order to improve encoding efficiency, improve image quality, reduce the amount of processing, reduce circuit scale, or appropriately select elements or operations such as filters, block sizes, motion vectors, reference pictures or reference blocks.
[0006] The present disclosure provides a configuration or method that can contribute to one or more of, for example, improved coding efficiency, improved image quality, reduced processing amount, reduced circuit scale, improved processing speed, and appropriate selection of elements or operations, etc. Note that the present disclosure may include a configuration or method that can contribute to benefits other than those described above. [Means for solving the problem]
[0007] For example, an encoding device according to an aspect of the present disclosure includes a circuit and a memory connected to the circuit, and in both cases where an orthogonal transform is applied and where the orthogonal transform is skipped in residual encoding of a current block, when the number of processing times of context adaptive encoding is equal to or less than a specific value, the circuit encodes a plurality of coefficient information flags related to coefficients included in the current block by the context adaptive encoding, encodes residual values of the coefficients by Golomb-Rice encoding, and when the number of processing times is not equal to or less than the specific value, skips encoding of the plurality of coefficient information flags, and when the orthogonal transform is applied, skips encoding of the plurality of coefficient information flags. when the orthogonal transform is skipped, the coefficient is transformed into a second coefficient using a poszero value determined using a plurality of surrounding coefficients located around the coefficient in the current block, and the value of the second coefficient is encoded by Golomb-Rice coding; when the orthogonal transform is skipped and encoding of the plurality of coefficient information flags is skipped, the value of the coefficient is encoded by Golomb-Rice coding without performing the transform, the plurality of coefficient information flags include a flag indicating whether the value of the coefficient is zero or non-zero and a flag indicating whether the coefficient is odd or even, and the poszero value is determined according to a sum of absolute values of the plurality of surrounding coefficients.
[0008] Some implementations of the embodiments of the present disclosure may improve encoding efficiency, simplify the encoding / decoding process, increase the encoding / decoding process speed, and / or efficiently select appropriate components / operations used in encoding and decoding, such as appropriate filters, block sizes, motion vectors, reference pictures, reference blocks, etc.
[0009] Further advantages and benefits of certain aspects of the present disclosure will become apparent from the specification and drawings, and while such advantages and / or benefits may be obtained by various embodiments and features described in the specification and drawings, not all of them necessarily need to be provided in order to obtain one or more advantages and / or benefits.
[0010] These general or specific aspects may be realized as a system, a method, an integrated circuit, a computer program, a recording medium, or any combination thereof. Effect of the Invention
[0011] A configuration or method according to an aspect of the present disclosure may contribute to one or more of, for example, improved coding efficiency, improved image quality, reduced processing amount, reduced circuit scale, improved processing speed, and appropriate selection of elements or operations. Note that a configuration or method according to an aspect of the present disclosure may contribute to benefits other than those described above. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a block diagram showing a functional configuration of an encoding device according to an embodiment. [Diagram 2] FIG. 2 is a flowchart showing an example of the overall encoding process performed by the encoding device. [Diagram 3] FIG. 3 is a conceptual diagram showing an example of block division. [Figure 4A] FIG. 4A is a conceptual diagram showing an example of a slice configuration. [Figure 4B] FIG. 4B is a conceptual diagram showing an example of a tile configuration. [Figure 5A] FIG. 5A is a table showing the transform basis functions that correspond to various transform types. [Figure 5B] FIG. 5B is a conceptual diagram showing an example of SVT (Spatially Varying Transform). [Figure 6A]FIG. 6A is a conceptual diagram showing an example of the shape of a filter used in an adaptive loop filter (ALF). [Figure 6B] FIG. 6B is a conceptual diagram showing another example of the shape of the filter used in the ALF. [Figure 6C] FIG. 6C is a conceptual diagram showing another example of the shape of the filter used in the ALF. [Figure 7] FIG. 7 is a block diagram showing an example of a detailed configuration of a loop filter unit functioning as a DBF (deblocking filter). [Figure 8] FIG. 8 is a conceptual diagram showing an example of a deblocking filter having symmetric filter characteristics with respect to block boundaries. [Figure 9] FIG. 9 is a conceptual diagram for explaining block boundaries on which deblocking filter processing is performed. [Figure 10] FIG. 10 is a conceptual diagram showing an example of the Bs value. [Figure 11] FIG. 11 is a flowchart illustrating an example of processing performed in the prediction processing unit of the encoding device. [Figure 12] FIG. 12 is a flowchart showing another example of the process performed in the prediction processing unit of the encoding device. [Figure 13] FIG. 13 is a flowchart showing another example of the process performed in the prediction processing unit of the encoding device. [Figure 14] FIG. 14 is a conceptual diagram showing an example of 67 intra prediction modes in intra prediction according to the embodiment. [Figure 15] FIG. 15 is a flowchart showing an example of the flow of basic inter prediction processing. [Figure 16] FIG. 16 is a flowchart showing an example of motion vector derivation. [Figure 17] FIG. 17 is a flowchart showing another example of motion vector derivation. [Figure 18] FIG. 18 is a flowchart showing another example of motion vector derivation. [Figure 19]FIG. 19 is a flowchart showing an example of inter prediction in the normal inter mode. [Figure 20] FIG. 20 is a flowchart showing an example of inter prediction in the merge mode. [Figure 21] FIG. 21 is a conceptual diagram for explaining an example of a motion vector derivation process in the merge mode. [Figure 22] FIG. 22 is a flowchart showing an example of a frame rate up conversion (FRUC) process. [Figure 23] FIG. 23 is a conceptual diagram for explaining an example of pattern matching (bilateral matching) between two blocks along a motion trajectory. [Figure 24] FIG. 24 is a conceptual diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. [Figure 25A] FIG. 25A is a conceptual diagram for explaining an example of derivation of a motion vector for each sub-block based on motion vectors of a plurality of adjacent blocks. [Figure 25B] FIG. 25B is a conceptual diagram for explaining an example of derivation of a motion vector for each sub-block in the affine mode having three control points. [Figure 26A] FIG. 26A is a conceptual diagram for explaining the affine merge mode. [Figure 26B] FIG. 26B is a conceptual diagram for explaining an affine merge mode having two control points. [Figure 26C] FIG. 26C is a conceptual diagram for explaining an affine merge mode having three control points. [Figure 27] FIG. 27 is a flowchart showing an example of a process in the affine merge mode. [Figure 28A] FIG. 28A is a conceptual diagram for explaining an affine inter mode having two control points. [Figure 28B]FIG. 28B is a conceptual diagram for explaining an affine inter mode having three control points. [Figure 29] FIG. 29 is a flowchart showing an example of processing in the affine inter mode. [Figure 30A] FIG. 30A is a conceptual diagram for explaining an affine inter mode in which a current block has three control points and an adjacent block has two control points. [Figure 30B] FIG. 30B is a conceptual diagram for explaining an affine inter mode in which a current block has two control points and an adjacent block has three control points. [Figure 31A] FIG. 31A is a flow chart showing a merge mode including decoder motion vector refinement (DMVR). [Figure 31B] FIG. 31B is a conceptual diagram for explaining an example of the DMVR process. [Diagram 32] FIG. 32 is a flowchart showing an example of generation of a predicted image. [Diagram 33] FIG. 33 is a flowchart showing another example of generation of a predicted image. [Diagram 34] FIG. 34 is a flowchart showing another example of generation of a predicted image. [Diagram 35] FIG. 35 is a flowchart illustrating an example of a predictive image correction process using overlapped block motion compensation (OBMC). [Diagram 36] FIG. 36 is a conceptual diagram for explaining an example of the predicted image correction process by the OBMC process. [Figure 37] FIG. 37 is a conceptual diagram for explaining generation of predicted images of two triangles. [Figure 38] FIG. 38 is a conceptual diagram for explaining a model assuming uniform linear motion. [Figure 39]FIG. 39 is a conceptual diagram for explaining an example of a predicted image generating method using luminance correction processing by LIC (local illumination compensation) processing. [Diagram 40] FIG. 40 is a block diagram showing an example of implementation of an encoding device. [Diagram 41] FIG. 41 is a block diagram showing a functional configuration of a decoding device according to an embodiment. As shown in FIG. [Diagram 42] FIG. 42 is a flowchart showing an example of the overall decoding process by the decoding device. [Diagram 43] FIG. 43 is a flowchart illustrating an example of processing performed in the prediction processing unit of the decoding device. [Diagram 44] FIG. 44 is a flowchart showing another example of the process performed in the prediction processing unit of the decoding device. [Diagram 45] FIG. 45 is a flowchart showing an example of inter prediction in the normal inter mode in the decoding device. [Figure 46] FIG. 46 is a block diagram showing an implementation example of a decoding device. [Figure 47] FIG. 47 is a flowchart showing a basic coefficient encoding method according to the first embodiment. [Figure 48] FIG. 48 is a flowchart showing the first basic encoding method according to the first aspect. [Figure 49] FIG. 49 is a flowchart showing the basic second encoding method according to the first aspect. [Figure 50] FIG. 50 is a flowchart showing a coefficient encoding method according to a first example of the first aspect. [Figure 51] FIG. 51 is a flowchart showing a coefficient encoding method according to a second example of the first aspect. [Figure 52] FIG. 52 is a flowchart showing a coefficient encoding method according to a first example of the second aspect. [Diagram 53] FIG. 53 is a flowchart showing a coefficient encoding method according to a second example of the second aspect. [Figure 54]FIG. 54 is a syntax diagram showing the first basic encoding scheme according to the third aspect. [Figure 55] FIG. 55 is a syntax diagram showing the basic second encoding scheme according to the third aspect. [Figure 56] FIG. 56 is a syntax diagram showing a second encoding scheme according to a first example of the third aspect. [Figure 57] FIG. 57 is a syntax diagram showing a second encoding scheme according to a second example of the third aspect. [Figure 58] FIG. 58 is a relationship diagram showing a basic correspondence between coefficient information flags and context numbers according to the fourth aspect. [Figure 59] FIG. 59 is a conceptual diagram showing a basic plurality of adjacent coefficients according to the fourth embodiment. [Figure 60] FIG. 60 is a conceptual diagram showing a plurality of adjacent coefficients according to a first example of the fourth aspect. [Figure 61A] FIG. 61A is a conceptual diagram showing coding target coefficients present at edge positions in the horizontal direction. [Figure 61B] FIG. 61B is a conceptual diagram showing coding target coefficients present at vertical edge positions. [Figure 62A] FIG. 62A is a conceptual diagram showing coding target coefficients adjacent to the horizontal edge positions. [Figure 62B] FIG. 62B is a conceptual diagram showing coding target coefficients adjacent to the position of an edge in the vertical direction. [Figure 63] FIG. 63 is a conceptual diagram showing the correspondence between the residual value and the Golomb-Rice code according to the third example of the fourth aspect. [Figure 64] FIG. 64 is a flowchart showing a basic coefficient encoding method according to the fifth embodiment. [Figure 65] FIG. 65 is a flowchart showing the third encoding method according to the fifth aspect. [Figure 66] FIG. 66 is a conceptual diagram showing a plurality of peripheral coefficients according to the fifth aspect. [Figure 67] FIG. 67 is a conceptual diagram showing the conversion process according to the fifth embodiment. [Figure 68]FIG. 68 is a flowchart showing a coefficient encoding method according to a first example of the fifth aspect. [Figure 69] FIG. 69 is a flowchart showing a coefficient encoding method according to a second example of the fifth aspect. [Figure 70] FIG. 70 is a flowchart showing the operation of the encoding device according to the embodiment. [Figure 71] FIG. 71 is a flowchart showing the operation of the decoding device according to the embodiment. [Figure 72] FIG. 72 is a block diagram showing the overall configuration of a content supply system that realizes a content distribution service. [Figure 73] FIG. 73 is a conceptual diagram showing an example of a coding structure in scalable coding. [Figure 74] FIG. 74 is a conceptual diagram showing an example of a coding structure in scalable coding. [Figure 75] FIG. 75 is a conceptual diagram showing an example of a display screen of a web page. [Figure 76] FIG. 76 is a conceptual diagram showing an example of a display screen of a web page. [Figure 77] FIG. 77 is a block diagram illustrating an example of a smartphone. [Figure 78] FIG. 78 is a block diagram showing an example configuration of a smartphone. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] For example, when encoding a block of an image, the encoding device may be able to convert the block into data that is easy to compress by applying an orthogonal transform to the block, whereas when encoding a block of an image, the encoding device may be able to reduce processing delay by not applying an orthogonal transform to the block.
[0014] Furthermore, the characteristics of the blocks to which the orthogonal transform has been applied are different from the characteristics of the blocks to which the orthogonal transform has not been applied, and the coding scheme used for the blocks to which the orthogonal transform has been applied may be different from the coding scheme used for the blocks to which the orthogonal transform has not been applied.
[0015] However, when an inappropriate coding method is used for a block to which orthogonal transform has been applied, or when an inappropriate coding method is used for a block to which orthogonal transform has not been applied, there is a possibility that an increase in the amount of code or an increase in processing delay may occur. Furthermore, when the coding method used for the block to which orthogonal transform has been applied is significantly different from the coding method used for the block to which orthogonal transform has not been applied, there is a possibility that the processing becomes complicated and the circuit scale increases.
[0016] Therefore, for example, an encoding device according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit, and in an operation, the circuit encodes a block of an image by limiting the number of times of context adaptive encoding, and in encoding the block, in both a case where an orthogonal transform is applied to the block and a case where an orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, encodes a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive encoding, and if the number of times of processing is not within the limited range of the number of processing, skips encoding of the coefficient information flag, and When the block is coded, residual value information for reconstructing the value of the coefficient using the coefficient information flag is coded by Golomb-Rice coding; when an orthogonal transform is applied to the block, if coding of the coefficient information flag is skipped, a transform process is performed to transform the value of the coefficient using a value determined using surrounding coefficients, which are coefficients in the vicinity of the position of the coefficient in the block, and the value of the coefficient is coded by Golomb-Rice coding; when an orthogonal transform is not applied to the block, if coding of the coefficient information flag is skipped, the transform process is not performed and the value of the coefficient is coded by Golomb-Rice coding.
[0017] As a result, regardless of whether orthogonal transform is applied, the coding of the coefficient information flag may be skipped according to the limit of the number of processing times of the context adaptive coding. Therefore, the increase in processing delay may be suppressed, and the increase in the amount of code may be suppressed. In addition, the difference between the coding method used for the block to which the orthogonal transform is applied and the coding method used for the block to which the orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.
[0018] Furthermore, by appropriately controlling whether or not to convert the coefficient value using the peripheral coefficients, it is possible to suppress an increase in processing delay and an increase in the amount of code.
[0019] Also, for example, the coefficient information flag is a flag indicating whether the value of the coefficient is greater than 1 or not.
[0020] As a result, regardless of whether orthogonal transform is applied, coding of the coefficient information flag indicating whether the coefficient value is greater than 1 may be skipped according to the limit on the number of times the context adaptive coding is performed. This may prevent an increase in processing delay and an increase in the amount of code.
[0021] Also, for example, the conversion process includes replacing the value of the coefficient with a value determined using the surrounding coefficients when the value of the coefficient is 0, and decreasing the value of the coefficient by subtracting 1 from the value of the coefficient when the value of the coefficient is greater than 0 and equal to or less than the value determined using the surrounding coefficients.
[0022] This allows the coefficient values to be appropriately converted in accordance with the surrounding coefficients, and may prevent an increase in the amount of code.
[0023] Also, for example, a decoding device according to one aspect of the present disclosure includes a circuit and a memory connected to the circuit, and in an operation, the circuit decodes a block of an image by limiting the number of times of context adaptive decoding, and in the decoding of the block, in both a case where an inverse orthogonal transform is applied to the block and a case where an inverse orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, decodes a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive decoding, and if the number of times of processing is not within the limited range of the number of processing, skips decoding of the coefficient information flag, and if the coefficient information flag is decoded, performs decoding of the coefficient information flag using the coefficient information flag. the method further comprises: decoding residual value information for reconstructing a value of a coefficient by Golomb-Rice decoding; deriving a value of the coefficient using the coefficient information flag and the residual value information; decoding the value of the coefficient by Golomb-Rice decoding when an inverse orthogonal transform is applied to the block and the decoding of the coefficient information flag is skipped; performing a transform process to transform the value of the coefficient using a value determined using surrounding coefficients that are coefficients in the vicinity of the position of the coefficient in the block, thereby deriving the value of the coefficient; and decoding the residual value information for reconstructing a value of the coefficient by Golomb-Rice decoding when an inverse orthogonal transform is not applied to the block and the decoding of the coefficient information flag is skipped; decode the value of the coefficient by Golomb-Rice decoding and deriving the value of the coefficient without performing the transform process.
[0024] As a result, regardless of whether inverse orthogonal transform is applied, the decoding of coefficient information flags may be skipped according to the limit of the number of processing times of context adaptive decoding. Therefore, the increase in processing delay may be suppressed, and the increase in the amount of code may be suppressed. In addition, the difference between the decoding method used for the block to which inverse orthogonal transform is applied and the decoding method used for the block to which inverse orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.
[0025] Furthermore, by appropriately controlling whether or not to convert the coefficient value using the peripheral coefficients, it is possible to suppress an increase in processing delay and an increase in the amount of code.
[0026] Also, for example, the coefficient information flag is a flag indicating whether the value of the coefficient is greater than 1 or not.
[0027] As a result, regardless of whether inverse orthogonal transform is applied, decoding of the coefficient information flag indicating whether the coefficient value is greater than 1 may be skipped according to the limit on the number of times context adaptive decoding is performed. Therefore, an increase in processing delay may be suppressed, and an increase in the amount of code may be suppressed.
[0028] Also, for example, the conversion process includes replacing the value of the coefficient with 0 when the value of the coefficient is equal to a value determined using the surrounding coefficients, and increasing the value of the coefficient by adding 1 when the value of the coefficient is smaller than the value determined using the surrounding coefficients.
[0029] This allows the coefficient values to be appropriately converted in accordance with the surrounding coefficients, and may prevent an increase in the amount of code.
[0030] Furthermore, for example, an encoding method according to one aspect of the present disclosure encodes a block of an image by limiting the number of times of context adaptive encoding, and in encoding the block, in both a case where an orthogonal transform is applied to the block and a case where an orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, encoding a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive encoding, and if the number of times of processing is not within the limited range of the number of processing, encoding of the coefficient information flag is skipped, and if the coefficient information flag is encoded, residual value information for reconstructing a value of the coefficient using the coefficient information flag is encoded by Golomb-Rice encoding, in a case where an orthogonal transform is applied to the block, if encoding of the coefficient information flag is skipped, a transform process is performed to transform a value of the coefficient using a value determined using surrounding coefficients that are coefficients in the vicinity of a position of the coefficient in the block, and the value of the coefficient is encoded by Golomb-Rice encoding, and if an orthogonal transform is not applied to the block, if encoding of the coefficient information flag is skipped, the transform process is not performed and the value of the coefficient is encoded by Golomb-Rice encoding.
[0031] As a result, regardless of whether orthogonal transform is applied, the coding of the coefficient information flag may be skipped according to the limit of the number of processing times of the context adaptive coding. Therefore, the increase in processing delay may be suppressed, and the increase in the amount of code may be suppressed. In addition, the difference between the coding method used for the block to which the orthogonal transform is applied and the coding method used for the block to which the orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.
[0032] Furthermore, by appropriately controlling whether or not to convert the coefficient value using the peripheral coefficients, it is possible to suppress an increase in processing delay and an increase in the amount of code.
[0033] Also, for example, a decoding method according to one aspect of the present disclosure includes: decoding a block of an image by limiting the number of times of context adaptive decoding; in the decoding of the block, in both a case where an inverse orthogonal transform is applied to the block and a case where an inverse orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, decoding a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive decoding; if the number of times of processing is not within the limited range of the number of processing, skipping decoding of the coefficient information flag; and, if the coefficient information flag is decoded, decoding residual value information for reconstructing a value of the coefficient using the coefficient information flag using a Golomb method. The method decodes the coefficient by Rice decoding, and derives the value of the coefficient using the coefficient information flag and the residual value information; when an inverse orthogonal transform is applied to the block, if the decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding, and a transform process is performed to transform the value of the coefficient using a value determined using surrounding coefficients, which are coefficients in the vicinity of the position of the coefficient in the block, to derive the value of the coefficient; when an inverse orthogonal transform is not applied to the block, if the decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding, and the value of the coefficient is derived without performing the transform process.
[0034] As a result, regardless of whether inverse orthogonal transform is applied, the decoding of coefficient information flags may be skipped according to the limit of the number of processing times of context adaptive decoding. Therefore, the increase in processing delay may be suppressed, and the increase in the amount of code may be suppressed. In addition, the difference between the decoding method used for the block to which inverse orthogonal transform is applied and the decoding method used for the block to which inverse orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.
[0035] Furthermore, by appropriately controlling whether or not to convert the coefficient value using the peripheral coefficients, it is possible to suppress an increase in processing delay and an increase in the amount of code.
[0036] Also, for example, an encoding device according to one aspect of the present disclosure includes a division unit, an intra prediction unit, an inter prediction unit, a prediction control unit, a transformation unit, a quantization unit, an entropy encoding unit, and a loop filter unit.
[0037] The division unit divides a current picture to be coded that constitutes the moving image into a plurality of blocks. The intra prediction unit performs intra prediction to generate a predicted image of a current block to be coded in the current picture by using a reference image in the current picture. The inter prediction unit performs inter prediction to generate a predicted image of the current block to be coded in the current picture by using a reference image in a reference picture different from the current picture to be coded.
[0038] The prediction control unit controls intra prediction performed by the intra prediction unit and inter prediction performed by the inter prediction unit. The conversion unit converts a prediction residual signal between the predicted image generated by the intra prediction unit or the inter prediction unit and an image of the block to be coded, to generate a transform coefficient signal of the block to be coded. The quantization unit quantizes the transform coefficient signal. The entropy coding unit codes the quantized transform coefficient signal. The loop filter unit applies a filter to the block to be coded.
[0039] Further, for example, in operation, the entropy coding unit codes a block of an image by limiting the number of times of context adaptive coding, and in coding the block, in both a case where an orthogonal transform is applied to the block and a case where an orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, coding a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive coding, and if the number of times of processing is not within the limited range of the number of processing, coding of the coefficient information flag is skipped, and if the coefficient information flag is coded, coding residual value information for reconstructing a value of the coefficient using the coefficient information flag by Golomb-Rice coding, in a case where an orthogonal transform is applied to the block, if coding of the coefficient information flag is skipped, a transformation process is performed to transform a value of the coefficient using a value determined using surrounding coefficients that are coefficients in the vicinity of a position of the coefficient in the block, and coding the value of the coefficient by Golomb-Rice coding, and if an orthogonal transform is not applied to the block, if coding of the coefficient information flag is skipped, coding the value of the coefficient by Golomb-Rice coding without performing the transformation process.
[0040] Also, for example, a decoding device according to one aspect of the present disclosure is a decoding device that decodes moving images using a predicted image, and includes an entropy decoding unit, an inverse quantization unit, an inverse transform unit, an intra prediction unit, an inter prediction unit, a prediction control unit, an adder unit (reconstruction unit), and a loop filter unit.
[0041] The entropy decoding unit decodes a quantized transform coefficient signal of a block to be decoded in a picture to be decoded that constitutes the moving image. The inverse quantization unit inverse quantizes the quantized transform coefficient signal. The inverse transform unit inversely transforms the transform coefficient signal to obtain a prediction residual signal of the block to be decoded.
[0042] The intra prediction unit performs intra prediction to generate a predicted image of the block to be decoded using a reference image in the current picture to be decoded. The inter prediction unit performs inter prediction to generate a predicted image of the block to be decoded using a reference image in a reference picture different from the current picture to be decoded. The prediction control unit controls the intra prediction performed by the intra prediction unit and the inter prediction performed by the inter prediction unit.
[0043] The adder unit reconstructs an image of the block to be decoded by adding together the predicted image generated by the intra prediction unit or the inter prediction unit and the prediction residual signal. The loop filter unit applies a filter to the block to be decoded.
[0044] Further, for example, in operation, the entropy decoding unit decodes a block of an image by limiting the number of times of context adaptive decoding, and in decoding the block, in both a case where an inverse orthogonal transform is applied to the block and a case where an inverse orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, decodes a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive decoding, if the number of times of processing is not within the limited range of the number of processing, skips decoding of the coefficient information flag, and, if the coefficient information flag is decoded, decodes residual value information for reconstructing a value of the coefficient using the coefficient information flag. The method decodes the coefficient by Golomb-Rice decoding, and derives the value of the coefficient using the coefficient information flag and the residual value information; when an inverse orthogonal transform is applied to the block, if the decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding, and a transform process is performed to transform the value of the coefficient using a value determined using surrounding coefficients that are coefficients in the vicinity of the position of the coefficient in the block, thereby deriving the value of the coefficient; when an inverse orthogonal transform is not applied to the block, if the decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding, and the value of the coefficient is derived without performing the transform process.
[0045] Furthermore, these comprehensive or specific aspects may be realized in a system, an apparatus, a method, an integrated circuit, a computer program, or a non-transitory recording medium such as a computer-readable CD-ROM, or may be realized in any combination of a system, an apparatus, a method, an integrated circuit, a computer program, and a recording medium.
[0046] Hereinafter, the embodiments will be described in detail with reference to the drawings. Note that the embodiments described below are all comprehensive or specific examples. The numerical values, shapes, materials, components, the arrangement and connection of the components, steps, and the relationship and order of the steps shown in the following embodiments are merely examples and are not intended to limit the scope of the claims.
[0047] In the following, embodiments of an encoding device and a decoding device will be described. The embodiments are examples of encoding devices and decoding devices to which the processes and / or configurations described in each aspect of the present disclosure can be applied. The processes and / or configurations can also be implemented in encoding devices and decoding devices different from the embodiments. For example, with respect to the processes and / or configurations applied to the embodiments, for example, any of the following may be implemented.
[0048] (1) Any of the multiple components of the encoding device or decoding device of the embodiments described in each aspect of the present disclosure may be replaced or combined with other components described in any of the aspects of the present disclosure.
[0049] (2) In the encoding device or decoding device of the embodiment, the functions or processes performed by some of the multiple components of the encoding device or decoding device may be changed in any way, such as by adding, replacing, deleting, etc. For example, any function or process may be replaced or combined with another function or process described in any of the aspects of the present disclosure.
[0050] (3) In the method implemented by the encoding device or decoding device of the embodiment, some of the processes included in the method may be arbitrarily changed, such as added, replaced, deleted, etc. For example, any process in the method may be replaced or combined with another process described in any of the aspects of the present disclosure.
[0051] (4) Some of the multiple components constituting the encoding device or decoding device of the embodiment may be combined with components described in any of the aspects of the present disclosure, or may be combined with components having some of the functions described in any of the aspects of the present disclosure, or may be combined with components that perform some of the processing performed by the components described in each aspect of the present disclosure.
[0052] (5) A component having part of the functionality of the encoding device or decoding device of an embodiment, or a component that performs part of the processing of the encoding device or decoding device of an embodiment, may be combined or replaced with a component described in any of the aspects of the present disclosure, a component having part of the functionality described in any of the aspects of the present disclosure, or a component that performs part of the processing described in any of the aspects of the present disclosure.
[0053] (6) In a method implemented by an encoding device or a decoding device of an embodiment, any of the multiple processes included in the method may be replaced or combined with a process described in any of the aspects of the present disclosure or with any similar process.
[0054] (7) Some of the processes among the multiple processes included in the method implemented by the encoding device or decoding device of the embodiment may be combined with the processes described in any of the aspects of the present disclosure.
[0055] (8) The manner in which the processes and / or configurations described in each aspect of the present disclosure are implemented is not limited to the encoding device or decoding device of the embodiment. For example, the processes and / or configurations may be implemented in a device used for a purpose other than the video encoding or video decoding disclosed in the embodiment.
[0056] [Encoding device] First, a coding device according to an embodiment will be described. Fig. 1 is a block diagram showing a functional configuration of a coding device 100 according to an embodiment. The coding device 100 is a video coding device that codes a video on a block-by-block basis.
[0057] As shown in FIG. 1, the encoding device 100 is a device that encodes an image on a block-by-block basis, and includes a division unit 102, a subtraction unit 104, a transformation unit 106, a quantization unit 108, an entropy encoding unit 110, an inverse quantization unit 112, an inverse transformation unit 114, an addition unit 116, a block memory 118, a loop filter unit 120, a frame memory 122, an intra prediction unit 124, an inter prediction unit 126, and a prediction control unit 128.
[0058] The encoding device 100 is realized by, for example, a general-purpose processor and a memory. In this case, when the software program stored in the memory is executed by the processor, the processor functions as the division unit 102, the subtraction unit 104, the transformation unit 106, the quantization unit 108, the entropy coding unit 110, the inverse quantization unit 112, the inverse transformation unit 114, the addition unit 116, the loop filter unit 120, the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128. The encoding device 100 may also be realized as one or more dedicated electronic circuits corresponding to the division unit 102, the subtraction unit 104, the transformation unit 106, the quantization unit 108, the entropy coding unit 110, the inverse quantization unit 112, the inverse transformation unit 114, the addition unit 116, the loop filter unit 120, the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128.
[0059] Below, the overall processing flow of the encoding device 100 will be described, and then each component included in the encoding device 100 will be described.
[0060] [Overall encoding process flow] FIG. 2 is a flowchart showing an example of the overall encoding process performed by the encoding device 100.
[0061] First, the division unit 102 of the encoding device 100 divides each picture included in an input image, which is a moving image, into a plurality of fixed-size blocks (e.g., 128×128 pixels) (step Sa_1). Then, the division unit 102 selects a division pattern (also called a block shape) for the fixed-size blocks (step Sa_2). That is, the division unit 102 further divides the fixed-size block into a plurality of blocks constituting the selected division pattern. Then, the encoding device 100 performs the process of steps Sa_3 to Sa_9 for each of the plurality of blocks (i.e., the block to be encoded).
[0062] That is, a prediction processing unit consisting of all or part of the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 generates a prediction signal (also called a prediction block) of the block to be coded (also called a current block) (step Sa_3).
[0063] Next, the subtraction unit 104 generates a difference between the encoding target block and the prediction block as a prediction residual (also called a difference block) (step Sa_4).
[0064] Next, the transform unit 106 and the quantization unit 108 perform transform and quantization on the difference block to generate a plurality of quantized coefficients (step Sa_5). Note that a block made up of a plurality of quantized coefficients is also called a coefficient block.
[0065] Next, the entropy coding unit 110 performs coding (specifically, entropy coding) on the coefficient block and the prediction parameters related to the generation of the prediction signal to generate a coded signal (step Sa_6). The coded signal is also called a coded bit stream, a compressed bit stream, or a stream.
[0066] Next, the inverse quantization unit 112 and the inverse transformation unit 114 perform inverse quantization and inverse transformation on the coefficient block to reconstruct a plurality of prediction residuals (that is, difference blocks) (step Sa_7).
[0067] Next, the adder 116 reconstructs the current block into a reconstructed image (also called a reconstructed block or a decoded image block) by adding the predicted block to the restored difference block (step Sa_8). In this way, a reconstructed image is generated.
[0068] When this reconstructed image is generated, the loop filter unit 120 performs filtering on the reconstructed image as necessary (step Sa_9).
[0069] Then, the encoding device 100 determines whether or not encoding of the entire picture is completed (step Sa_10), and if it determines that encoding is not completed (No in step Sa_10), repeats the process from step Sa_2.
[0070] In the above example, the encoding device 100 selects one division pattern for fixed-size blocks and encodes each block according to the division pattern, but it may also encode each block according to each of a plurality of division patterns. In this case, the encoding device 100 may evaluate the cost for each of the plurality of division patterns and select, for example, the encoded signal obtained by encoding according to the division pattern with the smallest cost as the encoded signal to be output.
[0071] As shown in the figure, the processes of steps Sa_1 to Sa_10 are performed sequentially by the encoding device 100. Alternatively, some of the processes may be performed in parallel, or the order of the processes may be changed.
[0072] [Divided part] The division unit 102 divides each picture included in the input video into a plurality of blocks, and outputs each block to the subtraction unit 104. For example, the division unit 102 first divides the picture into blocks of a fixed size (for example, 128x128). Other fixed block sizes may be adopted. The fixed-size blocks may be called coding tree units (CTUs). Then, the division unit 102 divides each of the fixed-size blocks into blocks of a variable size (for example, 64x64 or less) based on, for example, recursive quadtree and / or binary tree block division. That is, the division unit 102 selects a division pattern. The variable-size blocks may be called coding units (CUs), prediction units (PUs), or transform units (TUs). Note that in various processing examples, CUs, PUs, and TUs do not need to be distinguished, and some or all of the blocks in a picture may be the processing units of CUs, PUs, and TUs.
[0073] Fig. 3 is a conceptual diagram showing an example of block division according to an embodiment, in which solid lines represent block boundaries based on quadtree block division, and dashed lines represent block boundaries based on binary tree block division.
[0074] Here, the block 10 is a square block of 128x128 pixels (128x128 block). This 128x128 block 10 is first divided into four square 64x64 blocks (quadtree block division).
[0075] The top-left 64x64 block is further divided vertically into two rectangular 32x64 blocks, and the left 32x64 block is further divided vertically into two rectangular 16x64 blocks (binary tree block division). As a result, the top-left 64x64 block is divided into two 16x64 blocks 11 and 12 and a 32x64 block 13.
[0076] The top right 64x64 block is divided horizontally into two rectangular 64x32 blocks 14, 15 (binary tree block division).
[0077] The bottom left 64x64 block is divided into four square 32x32 blocks (quadtree block division). Of the four 32x32 blocks, the top left and bottom right blocks are further divided. The top left 32x32 block is divided vertically into two rectangular 16x32 blocks, and the right 16x32 block is further divided horizontally into two 16x16 blocks (binary tree block division). The bottom right 32x32 block is divided horizontally into two 32x16 blocks (binary tree block division). As a result, the bottom left 64x64 block is divided into a 16x32 block 16, two 16x16 blocks 17, 18, two 32x32 blocks 19, 20, and two 32x16 blocks 21, 22.
[0078] The bottom right 64x64 block 23 is not split.
[0079] 3, the block 10 is divided into 13 variable-sized blocks 11 to 23 based on recursive quad-tree and binary tree block division. Such division is sometimes called QTBT (quad-tree plus binary tree) division.
[0080] In Fig. 3, one block is divided into four or two blocks (quadtree or binary tree block division), but the division is not limited to this. For example, one block may be divided into three blocks (ternary tree block division). Division including such ternary tree block division is sometimes called MBT (multi type tree) division.
[0081] [Picture Composition Slices / Tiles] In order to decode pictures in parallel, the pictures may be arranged in slice units or tile units. A picture arranged in slice units or tile units may be arranged by the division unit 102.
[0082] A slice is a basic coding unit constituting a picture. A picture is made up of, for example, one or more slices. Furthermore, a slice is made up of one or more consecutive coding tree units (CTUs).
[0083] FIG. 4A is a conceptual diagram showing an example of a slice configuration. For example, a picture includes 11×8 CTUs and is divided into four slices (slices 1-4). Slice 1 includes 16 CTUs, slice 2 includes 21 CTUs, slice 3 includes 29 CTUs, and slice 4 includes 22 CTUs. Here, each CTU in a picture belongs to one of the slices. The shape of a slice is obtained by dividing a picture in the horizontal direction. The boundary of a slice does not need to be an edge of a screen, and may be any boundary of a CTU in a screen. The processing order (encoding order or decoding order) of the CTUs in a slice is, for example, a raster scan order. In addition, a slice includes header information and encoded data. The header information may describe the characteristics of the slice, such as the address of the CTU at the beginning of the slice and the slice type.
[0084] A tile is a rectangular unit that makes up a picture. Each tile may be assigned a number called a TileId in raster scan order.
[0085] FIG. 4B is a conceptual diagram showing an example of a tile configuration. For example, a picture includes 11×8 CTUs and is divided into four rectangular tiles (tiles 1-4). When tiles are used, the processing order of the CTUs is changed compared to when tiles are not used. When tiles are not used, multiple CTUs in a picture are processed in raster scan order. When tiles are used, at least one CTU is processed in raster scan order in each of multiple tiles. For example, as shown in FIG. 4B, the processing order of multiple CTUs included in tile 1 is from the left end of the first row of tile 1 to the right end of the first row of tile 1, and then from the left end of the second row of tile 1 to the right end of the second row of tile 1.
[0086] It should be noted that one tile may include one or more slices, and one slice may include one or more tiles.
[0087] [Subtraction section] The subtraction unit 104 subtracts a prediction signal (a prediction sample input from a prediction control unit 128 described below) from an original signal (original sample) input from the division unit 102 for each block divided by the division unit 102. That is, the subtraction unit 104 calculates a prediction error (also called a residual) of a block to be coded (hereinafter called a current block). Then, the subtraction unit 104 outputs the calculated prediction error (residual) to the conversion unit 106.
[0088] The original signal is an input signal to the encoding device 100, and is a signal representing an image of each picture constituting a moving image (for example, a luminance (luma) signal and two color difference (chroma) signals). Hereinafter, the signal representing the image may also be referred to as a sample.
[0089] [Conversion section] The transform unit 106 transforms the prediction error in the spatial domain into a transform coefficient in the frequency domain, and outputs the transform coefficient to the quantization unit 108. Specifically, the transform unit 106 performs a predetermined discrete cosine transform (DCT) or discrete sine transform (DST) on the prediction error in the spatial domain, for example. The predetermined DCT or DST may be determined in advance.
[0090] The transform unit 106 may adaptively select a transform type from among a plurality of transform types, and transform the prediction errors into transform coefficients using a transform basis function corresponding to the selected transform type. Such a transform may be called an explicit multiple core transform (EMT) or an adaptive multiple transform (AMT).
[0091] The multiple transform types include, for example, DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII. Figure 5A is a table showing transform basis functions corresponding to example transform types. In Figure 5A, N indicates the number of input pixels. The selection of a transform type from among the multiple transform types may depend, for example, on the type of prediction (intra prediction and inter prediction) or on the intra prediction mode.
[0092] Such information indicating whether EMT or AMT is applied (e.g., called an EMT flag or an AMT flag) and information indicating the selected transformation type are usually signaled at a CU level, but the signaling of such information does not need to be limited to the CU level and may be at other levels (e.g., a bit sequence level, a picture level, a slice level, a tile level, or a CTU level).
[0093] Furthermore, the transform unit 106 may retransform the transform coefficients (transformation results). Such retransformation may be called an adaptive secondary transform (AST) or a non-separable secondary transform (NSST). For example, the transform unit 106 performs retransformation for each subblock (e.g., 4x4 subblock) included in a block of transform coefficients corresponding to intra-prediction errors. Information indicating whether or not to apply NSST and information regarding a transform matrix used in NSST are usually signaled at a CU level. Note that signaling of these pieces of information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, or CTU level).
[0094] Separable transformation and non-separable transformation may be applied to the transformation unit 106. Separable transformation is a method of performing transformation multiple times by separating the input into directions for the number of dimensions, and non-separable transformation is a method of performing transformation collectively when the input is multidimensional, regarding two or more dimensions as one dimension.
[0095] For example, one example of a non-separable transformation is one in which, if the input is a 4x4 block, it is treated as a single array with 16 elements and a transformation process is performed on that array using a 16x16 transformation matrix.
[0096] As another example of a non-separable transformation, a 4x4 input block may be treated as a single array with 16 elements, and then a transformation (Hypercube Givens Transform) may be performed on the array by performing multiple Givens rotations.
[0097] In the transform in the transform unit 106, the type of basis for transforming into the frequency domain can be switched according to the area in the CU. One example is SVT (Spatially Varying Transform). In SVT, as shown in FIG. 5B, a CU is divided into two equal parts in the horizontal or vertical direction, and only one of the areas is transformed into the frequency domain. The type of transform basis can be set for each area, and for example, DST7 and DCT8 are used. In this example, only one of the two areas in the CU is transformed and the other is not transformed, but both areas may be transformed. In addition, the division method can be more flexible, such as not only dividing into two, but also dividing into four equal parts, or separately encoding information indicating the division and signaling it in the same way as the CU division. In addition, SVT is also called SBT (Sub-block Transform).
[0098] [Quantization section] The quantization unit 108 quantizes the transform coefficients output from the transform unit 106. Specifically, the quantization unit 108 scans the transform coefficients of the current block in a predetermined scanning order, and quantizes the transform coefficients based on a quantization parameter (QP) corresponding to the scanned transform coefficients. Then, the quantization unit 108 outputs the quantized transform coefficients of the current block (hereinafter, referred to as quantized coefficients) to the entropy coding unit 110 and the inverse quantization unit 112. The predetermined scanning order may be determined in advance.
[0099] The predetermined scanning order is an order for quantization / dequantization of transform coefficients. For example, the predetermined scanning order may be defined as an ascending order of frequency (low to high frequencies) or a descending order of frequency (high to low frequencies).
[0100] The quantization parameter (QP) is a parameter that defines the quantization step (quantization width). For example, if the value of the quantization parameter increases, the quantization step also increases. In other words, if the value of the quantization parameter increases, the quantization error increases.
[0101] In addition, a quantization matrix may be used for quantization. For example, several types of quantization matrices may be used corresponding to frequency transform sizes such as 4x4 and 8x8, prediction modes such as intra prediction and inter prediction, and pixel components such as luminance and chrominance. Note that quantization refers to digitizing values sampled at a predetermined interval in association with a predetermined level, and in this technical field, it may be referred to using other expressions such as rounding, rounding, and scaling, or rounding, rounding, and scaling may be adopted. The predetermined interval and level may be determined in advance.
[0102] There are two methods of using a quantization matrix: one is to use a quantization matrix that is directly set on the encoding device side, and the other is to use a default quantization matrix (default matrix). By directly setting a quantization matrix on the encoding device side, it is possible to set a quantization matrix according to the characteristics of an image. However, in this case, there is a disadvantage that the amount of code increases due to the encoding of the quantization matrix.
[0103] On the other hand, there is a method that does not use a quantization matrix and quantizes the coefficients of high-frequency components and low-frequency components in the same way. Note that this method is equivalent to using a quantization matrix in which all coefficients have the same value (a flat matrix).
[0104] The quantization matrix may be specified, for example, in a Sequence Parameter Set (SPS) or a Picture Parameter Set (PPS). The SPS contains parameters used for a sequence, and the PPS contains parameters used for a picture. The SPS and PPS are sometimes simply referred to as parameter sets.
[0105] [Entropy coding part] The entropy coding unit 110 generates a coded signal (coded bit stream) based on the quantized coefficients input from the quantization unit 108. Specifically, the entropy coding unit 110, for example, binarizes the quantized coefficients, arithmetically codes the binary signal, and outputs a compressed bit stream or sequence.
[0106] [Dequantization section] The inverse quantization unit 112 inverse quantizes the quantized coefficients input from the quantization unit 108. Specifically, the inverse quantization unit 112 inverse quantizes the quantized coefficients of the current block in a predetermined scanning order. Then, the inverse quantization unit 112 outputs the inverse quantized transform coefficients of the current block to the inverse transform unit 114. The predetermined scanning order may be determined in advance.
[0107] [Inverse conversion section] The inverse transform unit 114 restores the prediction error (residual) by inverse transforming the transform coefficients input from the inverse quantization unit 112. Specifically, the inverse transform unit 114 restores the prediction error of the current block by performing an inverse transform corresponding to the transform by the transform unit 106 on the transform coefficients. Then, the inverse transform unit 114 outputs the restored prediction error to the adder unit 116.
[0108] Note that the restored prediction error usually loses information due to quantization, and therefore does not match the prediction error calculated by the subtraction unit 104. That is, the restored prediction error usually contains a quantization error.
[0109] [Addition section] The adder 116 reconstructs a current block by adding the prediction error input from the inverse transformer 114 and the prediction sample input from the prediction control unit 128. The adder 116 then outputs the reconstructed block to the block memory 118 and the loop filter unit 120. The reconstructed block is sometimes called a local decoded block.
[0110] [Block memory] The block memory 118 is a storage unit for storing, for example, blocks referenced in intra prediction and in a picture to be coded (referred to as a current picture). Specifically, the block memory 118 stores the reconstructed block output from the adder 116.
[0111] [Frame memory] The frame memory 122 is a storage unit for storing reference pictures used in inter prediction, and may be called a frame buffer. Specifically, the frame memory 122 stores the reconstructed block filtered by the loop filter unit 120.
[0112] [Loop filter section] The loop filter unit 120 applies a loop filter to the block reconstructed by the adder unit 116, and outputs the filtered reconstructed block to the frame memory 122. The loop filter is a filter (in-loop filter) used in the encoding loop, and includes, for example, a deblocking filter (DF or DBF), a sample adaptive offset (SAO), and an adaptive loop filter (ALF).
[0113] In ALF, a least squared error filter is applied to remove coding artifacts. For example, for each 2x2 sub-block in the current block, one filter is selected from among multiple filters based on local gradient direction and activity.
[0114] Specifically, first, sub-blocks (e.g., 2x2 sub-blocks) are classified into a plurality of classes (e.g., 15 or 25 classes). The classification of the sub-blocks is performed based on the gradient direction and activity. For example, a classification value C (e.g., C=5D+A) is calculated using a gradient direction value D (e.g., 0 to 2 or 0 to 4) and a gradient activity value A (e.g., 0 to 4). Then, based on the classification value C, the sub-blocks are classified into a plurality of classes.
[0115] The gradient direction value D is derived, for example, by comparing gradients in multiple directions (e.g., horizontal, vertical, and two diagonal directions), and the gradient activity value A is derived, for example, by adding gradients in multiple directions and quantizing the sum.
[0116] Based on the result of such classification, a filter for the sub-block is determined from among a plurality of filters.
[0117] The shape of the filter used in the ALF is, for example, a circularly symmetric shape. FIGS. 6A to 6C are diagrams showing a number of examples of the shape of the filter used in the ALF. FIG. 6A shows a 5×5 diamond-shaped filter, FIG. 6B shows a 7×7 diamond-shaped filter, and FIG. 6C shows a 9×9 diamond-shaped filter. Information indicating the shape of the filter is usually signaled at the picture level. Note that the signaling of the information indicating the shape of the filter does not need to be limited to the picture level, and may be at other levels (for example, the sequence level, slice level, tile level, CTU level, or CU level).
[0118] The on / off of ALF may be determined, for example, at the picture level or the CU level. For example, whether or not to apply ALF for luminance may be determined at the CU level, and whether or not to apply ALF for chrominance may be determined at the picture level. Information indicating whether or not to apply ALF is usually signaled at the picture level or the CU level. Note that the signaling of information indicating whether or not to apply ALF is not limited to the picture level or the CU level, and may be at another level (for example, the sequence level, the slice level, the tile level, or the CTU level).
[0119] The coefficient sets of multiple selectable filters (e.g., up to 15 or 25 filters) are typically signaled at the picture level, although the signaling of the coefficient sets need not be limited to the picture level, but may be at other levels (e.g., sequence level, slice level, tile level, CTU level, CU level, or subblock level).
[0120] [Loop filter section > Deblocking filter] In the deblocking filter, the loop filter unit 120 reduces distortion at block boundaries of the reconstructed image by applying a filtering process to the block boundaries.
[0121] FIG. 7 is a block diagram showing an example of a detailed configuration of the loop filter unit 120 functioning as a deblocking filter.
[0122] The loop filter unit 120 includes a boundary determination unit 1201 , a filter determination unit 1203 , a filter processing unit 1205 , a processing determination unit 1208 , a filter characteristic determination unit 1207 , and switches 1202 , 1204 and 1206 .
[0123] The boundary determination unit 1201 determines whether or not a pixel to be deblocking-filtered (i.e., a target pixel) exists near a block boundary. Then, the boundary determination unit 1201 outputs the determination result to the switch 1202 and the process determination unit 1208.
[0124] When the boundary determination unit 1201 determines that the target pixel is located near the block boundary, the switch 1202 outputs the image before filtering to the switch 1204. Conversely, when the boundary determination unit 1201 determines that the target pixel is not located near the block boundary, the switch 1202 outputs the image before filtering to the switch 1206.
[0125] The filter determination unit 1203 determines whether or not to perform deblocking filter processing on the target pixel based on the pixel value of at least one surrounding pixel around the target pixel. Then, the filter determination unit 1203 outputs the determination result to the switch 1204 and the processing determination unit 1208.
[0126] When the filter determination unit 1203 determines that the deblocking filter process is to be performed on the target pixel, the switch 1204 outputs the unfiltered image acquired via the switch 1202 to the filter processing unit 1205. Conversely, when the filter determination unit 1203 determines that the deblocking filter process is not to be performed on the target pixel, the switch 1204 outputs the unfiltered image acquired via the switch 1202 to the switch 1206.
[0127] When the filtering unit 1205 acquires an unfiltered image via the switches 1202 and 1204, it executes deblocking filtering on the target pixel using the filter characteristics determined by the filter characteristics determination unit 1207. Then, the filtering unit 1205 outputs the filtered pixel to the switch 1206.
[0128] The switch 1206 selectively outputs pixels that have not been subjected to the deblocking filter process and pixels that have been subjected to the deblocking filter process by the filter processing unit 1205 under the control of the process determination unit 1208 .
[0129] The processing determination unit 1208 controls the switch 1206 based on the respective determination results of the boundary determination unit 1201 and the filter determination unit 1203. That is, when the boundary determination unit 1201 determines that the target pixel exists near a block boundary and the filter determination unit 1203 determines that the target pixel is to be subjected to deblocking filter processing, the processing determination unit 1208 causes the switch 1206 to output a pixel that has been subjected to deblocking filter processing. In addition, in cases other than the above, the processing determination unit 1208 causes the switch 1206 to output a pixel that has not been subjected to deblocking filter processing. By repeatedly outputting pixels in this manner, a filtered image is output from the switch 1206.
[0130] FIG. 8 is a conceptual diagram showing an example of a deblocking filter having symmetric filter characteristics with respect to block boundaries.
[0131] In the deblocking filter process, for example, a pixel value and a quantization parameter are used to select one of two deblocking filters with different characteristics, that is, a strong filter and a weak filter. In the strong filter, when pixels p0 to p2 and pixels q0 to q2 exist on either side of a block boundary as shown in Fig. 8, the pixel values of the pixels q0 to q2 are changed to pixel values q'0 to q'2 by performing the calculation shown in the following equation, for example.
[0132] q'0=(p1+2×p0+2×q0+2×q1+q2+4) / 8 q'1=(p0+q0+q1+q2+2) / 4 q'2=(p0+q0+q1+3×q2+2×q3+4) / 8
[0133] In the above equations, p0 to p2 and q0 to q2 are the pixel values of pixels p0 to p2 and pixels q0 to q2, respectively. Also, q3 is the pixel value of pixel q3 adjacent to pixel q2 on the opposite side of the block boundary. Also, on the right side of each equation, the coefficients by which the pixel values of each pixel used in the deblocking filter process are multiplied are filter coefficients.
[0134] Furthermore, in the deblocking filter process, a clipping process may be performed so that the pixel value after the calculation is not set to exceed the threshold. In this clipping process, the pixel value after the calculation according to the above formula is clipped to "the pixel value to be calculated ±2 × threshold" using a threshold determined from the quantization parameter. This makes it possible to prevent excessive smoothing.
[0135] Fig. 9 is a conceptual diagram for explaining block boundaries on which deblocking filter processing is performed, and Fig. 10 is a conceptual diagram showing an example of the Bs value.
[0136] The block boundary where the deblocking filter process is performed is, for example, the boundary of a PU (Prediction Unit) or TU (Transform Unit) of an 8x8 pixel block as shown in Fig. 9. The deblocking filter process can be performed in units of 4 rows or 4 columns. First, for blocks P and Q shown in Fig. 9, a Bs (Boundary Strength) value is determined as shown in Fig. 10.
[0137] According to the Bs value in FIG. 10, it is determined whether or not to perform deblocking filter processing of different strengths even for block boundaries belonging to the same image. Deblocking filter processing for the color difference signal is performed when the Bs value is 2. Deblocking filter processing for the luminance signal is performed when the Bs value is 1 or more and a predetermined condition is satisfied. The predetermined condition may be determined in advance. Note that the judgment condition for the Bs value is not limited to that shown in FIG. 10, and may be determined based on other parameters.
[0138] [Prediction processing unit (intra prediction unit, inter prediction unit, prediction control unit)] 11 is a flowchart showing an example of processing performed in the prediction processing unit of the encoding device 100. Note that the prediction processing unit is made up of all or some of the components of the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128.
[0139] The prediction processing unit generates a prediction image of the current block (step Sb_1). This prediction image is also called a prediction signal or a prediction block. The prediction signal includes, for example, an intra prediction signal or an inter prediction signal. Specifically, the prediction processing unit generates a prediction image of the current block using a reconstructed image that has already been obtained by generating a prediction block, generating a difference block, generating a coefficient block, restoring the difference block, and generating a decoded image block.
[0140] The reconstructed image may be, for example, an image of a reference picture or an image of an encoded block in a current picture, which is a picture that includes the current block. The encoded block in the current picture may be, for example, a neighboring block of the current block.
[0141] FIG. 12 is a flowchart showing another example of the processing performed by the prediction processing unit of the encoding device 100.
[0142] The prediction processing unit generates a predicted image by a first method (step Sc_1a), generates a predicted image by a second method (step Sc_1b), and generates a predicted image by a third method (step Sc_1c). The first method, the second method, and the third method are different methods for generating a predicted image, and may be, for example, an inter prediction method, an intra prediction method, and other prediction methods. In these prediction methods, the above-mentioned reconstructed image may be used.
[0143] Next, the prediction processing unit selects one of the multiple predicted images generated in steps Sc_1a, Sc_1b, and Sc_1c (step Sc_2). This selection of the predicted image, that is, the selection of the method or mode for obtaining the final predicted image, may be performed by calculating a cost for each generated predicted image and based on the cost. Alternatively, the selection of the predicted image may be performed based on parameters used in the encoding process. The encoding device 100 may signal information for identifying the selected predicted image, method, or mode in an encoding signal (also called an encoded bit stream). The information may be, for example, a flag. This allows the decoding device to generate a predicted image according to the method or mode selected in the encoding device 100 based on the information. Note that in the example shown in FIG. 12, the prediction processing unit generates a predicted image in each method and then selects one of the predicted images. However, the prediction processing unit may select a method or mode based on parameters used in the encoding process described above before generating those predicted images, and generate a predicted image according to the method or mode.
[0144] For example, the first and second methods may be intra prediction and inter prediction, respectively, and the prediction processing unit may select a final predicted image for the current block from predicted images generated according to these prediction methods.
[0145] FIG. 13 is a flowchart showing another example of the processing performed by the prediction processing unit of the encoding device 100.
[0146] First, the prediction processing unit generates a predicted image by intra prediction (step Sd_1a), and generates a predicted image by inter prediction (step Sd_1b). Note that the predicted image generated by intra prediction is also called an intra predicted image, and the predicted image generated by inter prediction is also called an inter predicted image.
[0147] Next, the prediction processing unit evaluates each of the intra-predicted image and the inter-predicted image (step Sd_2). A cost may be used for this evaluation. That is, the prediction processing unit calculates the cost C of each of the intra-predicted image and the inter-predicted image. This cost C can be calculated by an RD optimization model formula, for example, C=D+λ×R. In this formula, D is the coding distortion of the predicted image, and is represented by, for example, the sum of absolute differences between the pixel values of the current block and the pixel values of the predicted image. Furthermore, R is the generated code amount of the predicted image, and specifically, is the code amount required for coding the motion information for generating the predicted image. Furthermore, λ is, for example, Lagrange's undetermined multiplier.
[0148] Then, the prediction processing unit selects the predicted image with the smallest calculated cost C from the intra-predicted image and the inter-predicted image as the final predicted image of the current block (step Sd_3). That is, a prediction method or mode for generating a predicted image of the current block is selected.
[0149] [Intra prediction section] The intra prediction unit 124 generates a prediction signal (intra prediction signal) by performing intra prediction (also called intra-screen prediction) of the current block with reference to a block in the current picture stored in the block memory 118. Specifically, the intra prediction unit 124 generates an intra prediction signal by performing intra prediction with reference to samples (e.g., luminance values, chrominance values) of blocks adjacent to the current block, and outputs the intra prediction signal to the prediction control unit 128.
[0150] For example, the intra prediction unit 124 performs intra prediction using one of a plurality of predefined intra prediction modes. The plurality of intra prediction modes typically includes one or more non-directional prediction modes and a plurality of directional prediction modes. The plurality of predefined modes may be predefined.
[0151] The one or more non-directional prediction modes include, for example, a planar prediction mode and a DC prediction mode defined in the H.265 / HEVC standard.
[0152] The multiple directional prediction modes include, for example, 33 prediction modes defined in the H.265 / HEVC standard. The multiple directional prediction modes may include 32 prediction modes in addition to the 33 directions (a total of 65 directional prediction modes). Figure 14 is a conceptual diagram showing all 67 intra prediction modes (2 non-directional prediction modes and 65 directional prediction modes) that can be used in intra prediction. The solid arrows represent the 33 directions defined in the H.265 / HEVC standard, and the dashed arrows represent the additional 32 directions (the 2 non-directional prediction modes are not shown in Figure 14).
[0153] In various processing examples, a luminance block may be referenced in intra prediction of a chrominance block. That is, a chrominance component of a current block may be predicted based on a luminance component of the current block. Such intra prediction may be called a cross-component linear model (CCLM) prediction. An intra prediction mode of a chrominance block that references such a luminance block (e.g., called a CCLM mode) may be added as one of the intra prediction modes of the chrominance block.
[0154] The intra prediction unit 124 may correct pixel values after intra prediction based on the gradient of reference pixels in the horizontal / vertical directions. Intra prediction with such correction may be called PDPC (position dependent intra prediction combination). Information indicating whether PDPC is applied (e.g., called a PDPC flag) is usually signaled at the CU level. Note that the signaling of this information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, or CTU level).
[0155] [Inter prediction section] The inter prediction unit 126 performs inter prediction (also called inter prediction) of the current block with reference to a reference picture stored in the frame memory 122 and different from the current picture, thereby generating a prediction signal (inter prediction signal). The inter prediction is performed in units of the current block or a current sub-block (e.g., 4x4 block) in the current block. For example, the inter prediction unit 126 performs motion estimation in the reference picture for the current block or the current sub-block, and finds a reference block or sub-block that most closely matches the current block or the current sub-block. Then, the inter prediction unit 126 obtains motion information (e.g., a motion vector) that compensates for the motion or change from the reference block or sub-block to the current block or sub-block. The inter prediction unit 126 performs motion compensation (or motion prediction) based on the motion information, and generates an inter prediction signal of the current block or sub-block. The inter prediction unit 126 outputs the generated inter prediction signal to the prediction control unit 128.
[0156] The motion information used for motion compensation may be signaled as an inter prediction signal in various forms, for example, a motion vector may be signaled, or, as another example, a difference between a motion vector and a motion vector predictor may be signaled.
[0157] [Basic flow of inter prediction] FIG. 15 is a flowchart showing an example of a basic flow of inter prediction.
[0158] The inter prediction unit 126 first generates a prediction image (steps Se_1 to Se_3). Next, the subtraction unit 104 generates a difference between the current block and the prediction image as a prediction residual (step Se_4).
[0159] Here, in generating a predicted image, the inter prediction unit 126 generates the predicted image by determining a motion vector (MV) of the current block (steps Se_1 and Se_2) and performing motion compensation (step Se_3). In determining an MV, the inter prediction unit 126 selects a candidate motion vector (candidate MV) (step Se_1) and derives an MV (step Se_2) to determine the MV. The selection of the candidate MV is performed, for example, by selecting at least one candidate MV from a candidate MV list. In deriving an MV, the inter prediction unit 126 may further select at least one candidate MV from the at least one candidate MV, and determine the selected at least one candidate MV as the MV of the current block. Alternatively, the inter prediction unit 126 may determine the MV of the current block by searching the area of the reference picture indicated by the candidate MV for each of the selected at least one candidate MV. Note that searching the area of the reference picture may be referred to as motion estimation.
[0160] In the above example, steps Se_1 to Se_3 are performed by the inter prediction unit 126. However, the process of step Se_1 or step Se_2 may be performed by another component included in the encoding device 100.
[0161] [Motion vector derivation flow] FIG. 16 is a flowchart showing an example of motion vector derivation.
[0162] The inter prediction unit 126 derives the MV of the current block in a mode in which motion information (e.g., MV) is coded. In this case, for example, the motion information is coded as a prediction parameter and signaled. That is, the coded motion information is included in a coded signal (also called a coded bitstream).
[0163] Alternatively, the inter prediction unit 126 derives the MV in a mode in which motion information is not coded. In this case, the motion information is not included in the coded signal.
[0164] Here, the MV derivation mode may include a normal inter mode, a merge mode, a FRUC mode, and an affine mode, which will be described later. Among these modes, the modes for encoding motion information include a normal inter mode, a merge mode, and an affine mode (specifically, an affine inter mode and an affine merge mode). The motion information may include not only the MV but also predicted motion vector selection information, which will be described later. The modes for not encoding motion information include the FRUC mode. The inter prediction unit 126 selects a mode for deriving the MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.
[0165] FIG. 17 is a flowchart showing another example of motion vector derivation.
[0166] The inter prediction unit 126 derives the MV of the current block in a mode of encoding the differential MV. In this case, for example, the differential MV is encoded as a prediction parameter and signaled. That is, the encoded differential MV is included in the encoded signal. This differential MV is the difference between the MV of the current block and its predicted MV.
[0167] Alternatively, the inter prediction unit 126 derives the MV in a mode in which the differential MV is not coded. In this case, the coded differential MV is not included in the coded signal.
[0168] Here, as described above, the modes of deriving an MV include normal inter, merge mode, FRUC mode, and affine mode, which will be described later. Among these modes, the modes for encoding a differential MV include normal inter mode and affine mode (specifically, affine inter mode). Also, the modes for not encoding a differential MV include FRUC mode, merge mode, and affine mode (specifically, affine merge mode). The inter prediction unit 126 selects a mode for deriving an MV of the current block from these multiple modes, and derives the MV of the current block using the selected mode.
[0169] [Motion vector derivation flow] FIG. 18 is a flowchart showing another example of motion vector derivation. There are a plurality of modes of MV derivation, that is, inter prediction modes, which are roughly divided into a mode in which a differential MV is coded and a mode in which a differential motion vector is not coded. The modes in which a differential MV is not coded include a merge mode, a FRUC mode, and an affine mode (specifically, an affine merge mode). Details of these modes will be described later, but simply, the merge mode is a mode in which the MV of the current block is derived by selecting a motion vector from a surrounding coded block, and the FRUC mode is a mode in which the MV of the current block is derived by searching between coded regions. In addition, the affine mode is a mode in which the motion vector of each of a plurality of sub-blocks constituting the current block is derived as the MV of the current block, assuming an affine transformation.
[0170] Specifically, as shown in the figure, when the inter prediction mode information indicates 0 (Sf_1 is 0), the inter prediction unit 126 derives a motion vector by the merge mode (Sf_2). When the inter prediction mode information indicates 1 (Sf_1 is 1), the inter prediction unit 126 derives a motion vector by the FRUC mode (Sf_3). When the inter prediction mode information indicates 2 (Sf_1 is 2), the inter prediction unit 126 derives a motion vector by the affine mode (specifically, the affine merge mode) (Sf_4). When the inter prediction mode information indicates 3 (Sf_1 is 3), the inter prediction unit 126 derives a motion vector by a mode for encoding a differential MV (for example, normal inter mode) (Sf_5).
[0171] [MV Derivation > Normal Inter Mode] The normal inter mode is an inter prediction mode in which the MV of the current block is derived based on a block similar to the image of the current block from the region of the reference picture indicated by the candidate MV. In addition, in this normal inter mode, the differential MV is coded.
[0172] FIG. 19 is a flowchart showing an example of inter prediction in the normal inter mode.
[0173] The inter prediction unit 126 first obtains multiple candidate MVs for the current block based on information such as MVs of multiple coded blocks around the current block in time or space (step Sg_1). That is, the inter prediction unit 126 creates a candidate MV list.
[0174] Next, the inter prediction unit 126 extracts N candidate MVs (N is an integer equal to or greater than 2) from the multiple candidate MVs acquired in step Sg_1 as motion vector predictor candidates (also called predicted MV candidates) according to a predetermined priority order (step Sg_2). Note that the priority order may be predefined for each of the N candidate MVs.
[0175] Next, the inter prediction unit 126 selects one of the N motion vector predictor candidates as a motion vector predictor (also called a prediction MV) of the current block (step Sg_3). At this time, the inter prediction unit 126 encodes motion vector predictor selection information for identifying the selected motion vector predictor into a stream. Note that the stream is the above-mentioned encoded signal or encoded bit stream.
[0176] Next, the inter prediction unit 126 derives the MV of the current block by referring to the coded reference picture (step Sg_4). At this time, the inter prediction unit 126 further encodes the difference value between the derived MV and the predicted motion vector as a differential MV into a stream. Note that the coded reference picture is a picture consisting of a plurality of blocks reconstructed after coding.
[0177] Finally, the inter prediction unit 126 performs motion compensation on the current block using the derived MV and the coded reference picture to generate a predicted image of the current block (step Sg_5). Note that the predicted image is the above-mentioned inter prediction signal.
[0178] Furthermore, information indicating the inter prediction mode (normal inter mode in the above example) used to generate the predicted image, which is included in the coded signal, is coded as, for example, a prediction parameter.
[0179] The candidate MV list may be used in common with lists used in other modes. Furthermore, processing related to the candidate MV list may be applied to processing related to lists used in other modes. Processing related to this candidate MV list may include, for example, extraction or selection of candidate MVs from the candidate MV list, sorting of the candidate MVs, or deletion of candidate MVs.
[0180] [MV Derivation > Merge Mode] Merge mode is an inter prediction mode that derives the MV of the current block by selecting a candidate MV from a candidate MV list as the MV for that block.
[0181] FIG. 20 is a flowchart showing an example of inter prediction in the merge mode.
[0182] The inter prediction unit 126 first obtains multiple candidate MVs for the current block based on information such as MVs of multiple coded blocks around the current block in time or space (step Sh_1). That is, the inter prediction unit 126 creates a candidate MV list.
[0183] Next, the inter prediction unit 126 derives the MV of the current block by selecting one candidate MV from the multiple candidate MVs obtained in step Sh_1 (step Sh_2). At this time, the inter prediction unit 126 encodes MV selection information for identifying the selected candidate MV into the stream.
[0184] Finally, the inter prediction unit 126 performs motion compensation on the current block using the derived MV and the coded reference picture to generate a predicted image of the current block (step Sh_3).
[0185] Furthermore, information indicating the inter prediction mode (merge mode in the above example) used to generate the predicted image, which is included in the coded signal, is coded as, for example, a prediction parameter.
[0186] FIG. 21 is a conceptual diagram for explaining an example of a motion vector derivation process for a current picture in the merge mode.
[0187] First, a prediction MV list is generated in which prediction MV candidates are registered. The prediction MV candidates include a spatially adjacent prediction MV, which is an MV held by a plurality of coded blocks located spatially around the target block, a temporally adjacent prediction MV, which is an MV held by a nearby block projected from the position of the target block in a coded reference picture, a joint prediction MV, which is an MV generated by combining the MV values of the spatially adjacent prediction MV and the temporally adjacent prediction MV, and a zero prediction MV, which is an MV with a value of zero.
[0188] Next, one predicted MV is selected from the multiple predicted MVs registered in the predicted MV list, and is determined as the MV for the target block.
[0189] Furthermore, the variable length coding unit writes merge_idx, which is a signal indicating which predicted MV has been selected, into the stream and codes it.
[0190] Note that the predicted MVs registered in the predicted MV list described in Figure 21 are just an example, and the number may be different from the number shown in the figure, the configuration may not include some of the types of predicted MVs shown in the figure, or the configuration may include additional predicted MVs other than the types of predicted MVs shown in the figure.
[0191] The final MV may be determined by performing a decoder motion vector refinement (DMVR) process, which will be described later, using the MV of the current block derived in the merge mode.
[0192] The prediction MV candidates are the above-mentioned candidate MVs, and the prediction MV list is the above-mentioned candidate MV list. The candidate MV list may also be called a candidate list. merge_idx is MV selection information.
[0193] [MV derivation > FRUC mode] The motion information may be derived at the decoding device side without being signaled from the encoding device side. As described above, the merge mode defined in the H.265 / HEVC standard may be used. For example, the motion information may be derived by performing motion estimation at the decoding device side. In the embodiment, the motion estimation is performed at the decoding device side without using pixel values of the current block.
[0194] Here, a mode in which motion estimation is performed on the decoding device side will be described. This mode in which motion estimation is performed on the decoding device side is sometimes called a pattern matched motion vector derivation (PMMVD) mode or a frame rate up-conversion (FRUC) mode.
[0195] FIG. 22 shows an example of the FRUC process in the form of a flow chart. First, a list of multiple candidates (i.e., a candidate MV list, which may be common to the merge list) each having a predicted motion vector (MV) is generated with reference to the motion vectors of coded blocks spatially or temporally adjacent to the current block (step Si_1). Next, a best candidate MV is selected from the multiple candidate MVs registered in the candidate MV list (step Si_2). For example, an evaluation value of each candidate MV included in the candidate MV list is calculated, and one candidate MV is selected based on the evaluation value. Then, a motion vector for the current block is derived based on the motion vector of the selected candidate (step Si_4). Specifically, for example, the motion vector of the selected candidate (best candidate MV) is derived as it is as the motion vector for the current block. Also, for example, the motion vector for the current block may be derived by performing pattern matching in a peripheral area of a position in a reference picture corresponding to the motion vector of the selected candidate. That is, a search is performed on the area around the best candidate MV using pattern matching and evaluation values in the reference picture, and if an MV with a better evaluation value is found, the best candidate MV is updated to that MV and used as the final MV for the current block. It is also possible to configure the system without performing the process of updating to an MV with a better evaluation value.
[0196] Finally, the inter prediction unit 126 performs motion compensation on the current block using the derived MV and the coded reference picture to generate a predicted image of the current block (step Si_5).
[0197] The same processing may be performed when processing is performed in sub-block units.
[0198] The evaluation value may be calculated by various methods. For example, a reconstructed image of an area in a reference picture corresponding to the motion vector is compared with a reconstructed image of a predetermined area (which may be, for example, an area of another reference picture or an area of an adjacent block of the current picture, as shown below). The predetermined area may be predetermined.
[0199] Then, the difference between the pixel values of the two reconstructed images may be calculated and used as an evaluation value for the motion vector. Note that the evaluation value may be calculated using other information in addition to the difference value.
[0200] Next, an example of pattern matching will be described in detail. First, one candidate MV included in a candidate MV list (e.g., a merge list) is selected as a start point of a search by pattern matching. For example, a first pattern matching or a second pattern matching can be used as the pattern matching. The first pattern matching and the second pattern matching are sometimes called bilateral matching and template matching, respectively.
[0201] [MV derivation > FRUC > Bilateral matching] In the first pattern matching, pattern matching is performed between two blocks in two different reference pictures that are along the motion trajectory of the current block. Therefore, in the first pattern matching, an area in another reference picture along the motion trajectory of the current block is used as a predetermined area for calculating the evaluation value of the candidate. The predetermined area may be determined in advance.
[0202] FIG. 23 is a conceptual diagram for explaining an example of the first pattern matching (bilateral matching) between two blocks in two reference pictures along a motion trajectory. As shown in FIG. 23, in the first pattern matching, two motion vectors (MV0, MV1) are derived by searching for a pair of blocks that best match among pairs of two blocks in two different reference pictures (Ref0, Ref1) along the motion trajectory of a current block (Cur block). Specifically, for the current block, a difference is derived between a reconstructed image at a specified position in a first coded reference picture (Ref0) specified by a candidate MV and a reconstructed image at a specified position in a second coded reference picture (Ref1) specified by a symmetric MV obtained by scaling the candidate MV by a display time interval, and an evaluation value is calculated using the obtained difference value. It is possible to select the candidate MV with the best evaluation value among multiple candidate MVs as the final MV, which may bring about good results.
[0203] Under the assumption of continuous motion trajectories, the motion vectors (MV0, MV1) pointing to two reference blocks are proportional to the temporal distances (TD0, TD1) between the current picture (Cur Pic) and the two reference pictures (Ref0, Ref1). For example, if the current picture is located between two reference pictures in time and the temporal distances from the current picture to the two reference pictures are equal, the first pattern matching derives bidirectional motion vectors that are mirror-symmetric.
[0204] [MV derivation > FRUC > Template matching] In the second pattern matching (template matching), pattern matching is performed between a template in the current picture (a block adjacent to the current block in the current picture (e.g., an upper and / or left adjacent block)) and a block in the reference picture. Therefore, in the second pattern matching, a block adjacent to the current block in the current picture is used as a predetermined area for calculating the evaluation value of the above-mentioned candidate.
[0205] Fig. 24 is a conceptual diagram for explaining an example of pattern matching (template matching) between a template in a current picture and a block in a reference picture. As shown in Fig. 24, in the second pattern matching, a motion vector of a current block is derived by searching in a reference picture (Ref0) for a block that best matches a block adjacent to a current block (Cur block) in a current picture (Cur Pic). Specifically, for a current block, a difference is derived between a reconstructed image of both or either of the left adjacent and / or upper adjacent coded areas and a reconstructed image at the same position in a coded reference picture (Ref0) specified by a candidate MV, an evaluation value is calculated using the obtained difference value, and a candidate MV with the best evaluation value among a plurality of candidate MVs can be selected as a best candidate MV.
[0206] Information indicating whether such a FRUC mode is applied (e.g., called a FRUC flag) may be signaled at the CU level. Also, when the FRUC mode is applied (e.g., when the FRUC flag is true), information indicating an applicable pattern matching method (first pattern matching or second pattern matching) may be signaled at the CU level. Note that the signaling of such information does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or sub-block level).
[0207] [MV derivation > Affine mode] Next, a description will be given of an affine mode in which a motion vector is derived for each sub-block based on the motion vectors of a plurality of adjacent blocks. This mode is sometimes called an affine motion compensation prediction mode.
[0208] 25A is a conceptual diagram for explaining an example of derivation of a motion vector for each sub-block based on the motion vectors of multiple adjacent blocks. In FIG. 25A, the current block includes 16 4x4 sub-blocks. Here, the motion vector v of the upper left corner control point of the current block is derived based on the motion vectors of the adjacent blocks. 0 Similarly, the motion vector v of the upper right corner control point of the current block is derived based on the motion vectors of the neighboring sub-blocks. 1 Then, the two motion vectors v 0 and v 1 may be projected, and the motion vector (v x ,v y ) may be derived.
[0209]
number
[0210] Here, x and y respectively indicate the horizontal and vertical positions of the sub-block, and w indicates a predetermined weighting factor, which may be determined in advance.
[0211] Such information indicating the affine mode (e.g., called an affine flag) may be signaled at the CU level. Note that the signaling of the information indicating the affine mode does not need to be limited to the CU level, and may be at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or sub-block level).
[0212] In addition, such an affine mode may include several modes that differ in the method of deriving the motion vectors of the upper-left and upper-right corner control points. For example, the affine mode includes two modes: an affine inter (also called an affine normal inter) mode and an affine merge mode.
[0213] [MV derivation > Affine mode] FIG. 25B is a conceptual diagram for explaining an example of derivation of a motion vector for each sub-block in an affine mode having three control points. In FIG. 25B, the current block includes 16 4x4 sub-blocks. Here, the motion vector v of the upper left corner control point of the current block is derived based on the motion vector of the adjacent block. 0 Similarly, the motion vector v of the upper right corner control point of the current block is derived based on the motion vectors of the neighboring blocks. 1 , the motion vector v of the lower left corner control point of the current block is calculated based on the motion vector of the neighboring block. 2 Then, the three motion vectors v 0 , v 1 and v 2 may be projected, and the motion vector (v x ,v y ) may be derived.
[0214]
number
[0215] Here, x and y respectively indicate the horizontal and vertical positions of the subblock center, w indicates the width of the current block, and h indicates the height of the current block.
[0216] Affine modes with different numbers of control points (e.g., two and three) may be switched and signaled at the CU level. Note that information indicating the number of control points of the affine mode used at the CU level may also be signaled at other levels (e.g., sequence level, picture level, slice level, tile level, CTU level, or subblock level).
[0217] In addition, such an affine mode having three control points may include several modes with different methods of deriving the motion vectors of the upper left, upper right, and lower left corner control points. For example, the affine mode includes two modes: affine inter (also called affine normal inter) mode and affine merge mode.
[0218] [MV Derivation > Affine Merge Mode] 26A, 26B, and 26C are conceptual diagrams for explaining the affine merge mode.
[0219] In the affine merge mode, as shown in FIG. 26A, for example, among the coded blocks A (left), B (top), C (top right), D (bottom left) and E (top left) adjacent to the current block, the predicted motion vectors of each of the control points of the current block are calculated based on a plurality of motion vectors corresponding to the blocks coded in affine mode. Specifically, these blocks are inspected in the order of coded blocks A (left), B (top), C (top right), D (bottom left) and E (top left), and the first valid block coded in affine mode is identified. Based on a plurality of motion vectors corresponding to this identified block, the predicted motion vector of the control point of the current block is calculated.
[0220] For example, as shown in FIG. 26B, if block A, which is adjacent to the left of the current block, is coded in an affine mode with two control points, the motion vector v projected onto the upper left and upper right corners of the coded block including block A is 3 and v 4 Then, the derived motion vector v 3 and v 4 , the predicted motion vector v of the control point in the upper left corner of the current block. 0 and the predicted motion vector v of the control point in the upper right corner 1 is calculated.
[0221] For example, as shown in FIG. 26C, if block A adjacent to the left of the current block is coded in an affine mode with three control points, the motion vector v projected onto the upper left corner, upper right corner, and lower left corner of the coded block including block A is 3 , v 4 and v 5 Then, the derived motion vector v 3 , v 4 and v 5 , the predicted motion vector v of the control point in the upper left corner of the current block. 0 and the predicted motion vector v of the control point in the upper right corner 1 and the predicted motion vector v of the bottom left corner control point 2 is calculated.
[0222] Note that this predicted motion vector derivation method may be used to derive predicted motion vectors for each control point of the current block in step Sj_1 of FIG. 29, which will be described later.
[0223] FIG. 27 is a flow chart illustrating an example of the affine merge mode.
[0224] In the affine merge mode, as shown in the figure, first, the inter prediction unit 126 derives prediction MVs for each of the control points of the current block (step Sk_1). The control points are the upper left and upper right corner points of the current block as shown in Figure 25A, or the upper left, upper right and lower left corner points of the current block as shown in Figure 25B.
[0225] That is, the inter prediction unit 126 examines the coded blocks in the following order, as shown in FIG. 26A: coded block A (left), block B (top), block C (top right), block D (bottom left) and block E (top left), and identifies the first valid block coded in affine mode.
[0226] Then, when block A is identified and block A has two control points, as shown in FIG. 26B, the inter prediction unit 126 calculates the motion vector v 3 and v 4 From the motion vector v of the control point in the upper left corner of the current block, 0 and the motion vector v of the control point in the upper right corner 1 For example, the inter prediction unit 126 calculates the motion vector v 3 and v 4 By projecting the current block, the predicted motion vector v 0 and the predicted motion vector v of the control point in the upper right corner 1 Calculate the following:
[0227] Alternatively, when block A is identified and block A has three control points, as shown in FIG. 26C, the inter prediction unit 126 predicts the motion vectors v 3 , v 4 and v 5 From the motion vector v of the control point in the upper left corner of the current block, 0 and the motion vector v of the control point in the upper right corner 1 , the motion vector of the control point in the lower left corner v 2 For example, the inter prediction unit 126 calculates the motion vectors v 3 , v 4 and v 5 By projecting the current block, the predicted motion vector v 0 and the predicted motion vector v of the control point in the upper right corner 1 , the motion vector of the control point in the lower left corner v 2 Calculate the following:
[0228] Next, the inter prediction unit 126 performs motion compensation on each of the sub-blocks included in the current block. That is, the inter prediction unit 126 performs motion compensation on each of the sub-blocks by using two predicted motion vectors v 0 and v 1 and the above formula (1A), or three predicted motion vectors v 0 , v 1 and v 2 Using the above formula (1B), the motion vector of the sub-block is calculated as an affine MV (step Sk_2). Then, the inter prediction unit 126 performs motion compensation on the sub-block using the affine MV and the coded reference picture (step Sk_3). As a result, motion compensation is performed on the current block, and a predicted image of the current block is generated.
[0229] [MV Derivation > Affine Intermode] FIG. 28A is a conceptual diagram for explaining an affine inter mode having two control points.
[0230] In this affine inter mode, as shown in FIG. 28A, a motion vector selected from the motion vectors of the coded blocks A, B, and C adjacent to the current block is set to the predicted motion vector v of the control point in the upper left corner of the current block. 0 Similarly, a motion vector selected from the motion vectors of the coded blocks D and E adjacent to the current block is used as the predicted motion vector v of the control point in the upper right corner of the current block. 1 It is used as.
[0231] FIG. 28B is a conceptual diagram for explaining an affine inter mode having three control points.
[0232] In this affine inter mode, as shown in FIG. 28B, a motion vector selected from the motion vectors of the coded blocks A, B, and C adjacent to the current block is set to the predicted motion vector v of the control point in the upper left corner of the current block. 0 Similarly, a motion vector selected from the motion vectors of the coded blocks D and E adjacent to the current block is used as the predicted motion vector v of the control point in the upper right corner of the current block. 1 In addition, a motion vector selected from the motion vectors of the coded blocks F and G adjacent to the current block is used as the predicted motion vector v of the control point in the lower left corner of the current block. 2 It is used as.
[0233] FIG. 29 is a flowchart showing an example of the affine inter mode.
[0234] As shown in the figure, in the affine inter mode, the inter prediction unit 126 first calculates the predicted MVs (v 0 ,v 1 ) or (v 0 ,v 1 ,v 2 ) is derived (step Sj_1). The control point is the upper left corner, the upper right corner, or the lower left corner of the current block, as shown in FIG. 25A or FIG. 25B.
[0235] That is, the inter prediction unit 126 selects a motion vector of any of the coded blocks in the vicinity of each control point of the current block shown in FIG. 28A or FIG. 28B to obtain a predicted motion vector (v 0 ,v 1 ) or (v 0 ,v 1 ,v 2 At this time, the inter prediction unit 126 encodes, into the stream, predicted motion vector selection information for identifying the two selected motion vectors.
[0236] For example, the inter prediction unit 126 may use cost evaluation or the like to determine which motion vector of an encoded block adjacent to the current block to select as the predicted motion vector of the control point, and may write a flag indicating which predicted motion vector has been selected in the bitstream.
[0237] Next, the inter prediction unit 126 performs motion search (steps Sj_3 and Sj_4) while updating each of the predicted motion vectors selected or derived in step Sj_1 (step Sj_2). That is, the inter prediction unit 126 calculates the motion vector of each sub-block corresponding to the predicted motion vector to be updated as an affine MV using the above-mentioned formula (1A) or formula (1B) (step Sj_3). Then, the inter prediction unit 126 performs motion compensation for each sub-block using the affine MVs and the coded reference picture (step Sj_4). As a result, the inter prediction unit 126 determines, in the motion search loop, for example, the predicted motion vector that provides the smallest cost as the motion vector of the control point (step Sj_5). At this time, the inter prediction unit 126 further codes the difference value between the determined MV and the predicted motion vector as a differential MV into a stream.
[0238] Finally, the inter prediction unit 126 performs motion compensation on the current block using the determined MV and the encoded reference picture to generate a predicted image of the current block (step Sj_6).
[0239] [MV Derivation > Affine Intermode] When affine modes with different numbers of control points (for example, two and three) are switched and signaled at the CU level, the number of control points may differ between the coded block and the current block. Figures 30A and 30B are conceptual diagrams for explaining a method of deriving a predicted vector of a control point when the number of control points differs between the coded block and the current block.
[0240] For example, as shown in FIG. 30A, if the current block has three control points, the upper left corner, the upper right corner, and the lower left corner, and the block A adjacent to the left of the current block is coded in an affine mode with two control points, the motion vector v projected to the positions of the upper left corner and the upper right corner of the coded block including the block A is 3 and v 4 Then, the derived motion vector v 3 and v 4 , the predicted motion vector v of the control point in the upper left corner of the current block. 0 and the predicted motion vector v of the control point in the upper right corner 1 is calculated. Furthermore, the derived motion vector v 0 and v 1 , the predicted motion vector v of the bottom left corner control point 2 is calculated.
[0241] For example, as shown in FIG. 30B, if the current block has two control points at the upper left and upper right corners, and the block A adjacent to the left of the current block is coded in an affine mode with three control points, the motion vector v projected to the positions of the upper left, upper right, and lower left corners of the coded block including block A is 3 , v 4 and v 5 Then, the derived motion vector v 3 , v 4 and v 5 , the predicted motion vector v of the control point in the upper left corner of the current block. 0 and the predicted motion vector v of the control point in the upper right corner 1 is calculated.
[0242] This prediction motion vector derivation method may be used to derive the prediction motion vector for each control point of the current block in step Sj_1 of FIG.
[0243] [MV Derivation > DMVR] FIG. 31A is a flowchart showing the relationship between the merge mode and the DMVR.
[0244] The inter prediction unit 126 derives a motion vector of the current block in merge mode (step Sl_1). Next, the inter prediction unit 126 determines whether or not to search for a motion vector, that is, to perform motion search (step Sl_2). Here, when the inter prediction unit 126 determines not to perform motion search (No in step Sl_2), it determines the motion vector derived in step Sl_1 as the final motion vector for the current block (step Sl_4). That is, in this case, the motion vector of the current block is determined in merge mode.
[0245] On the other hand, when it is determined in step Sl_1 that motion search is to be performed (Yes in step Sl_2), the inter prediction unit 126 derives a final motion vector for the current block by searching the surrounding area of the reference picture indicated by the motion vector derived in step Sl_1 (step Sl_3). That is, in this case, the motion vector of the current block is determined by DMVR.
[0246] FIG. 31B is a conceptual diagram for explaining an example of DMVR processing for determining an MV.
[0247] First, the optimal MVP set for the current block (e.g., in merge mode) is set as the candidate MV. Then, according to the candidate MV(L0), reference pixels are identified from the first reference picture (L0), which is an encoded picture in the L0 direction. Similarly, according to the candidate MV(L1), reference pixels are identified from the second reference picture (L1), which is an encoded picture in the L1 direction. A template is generated by averaging these reference pixels.
[0248] Next, the template is used to search the surrounding areas of the candidate MVs in the first reference picture (L0) and the second reference picture (L1), and the MV with the smallest cost is determined as the final MV. Note that the cost value may be calculated using, for example, the difference value between each pixel value of the template and each pixel value of the search area, the candidate MV value, etc.
[0249] Typically, the encoding device and a decoding device (to be described later) basically have the same configuration and operation as the processing described here.
[0250] Any process may be used other than the process example described here as long as it is capable of searching the vicinity of the candidate MV and deriving the final MV.
[0251] [Motion compensation > BIO / OBMC] In motion compensation, there is a mode in which a predicted image is generated and the predicted image is corrected, such as BIO and OBMC, which will be described later.
[0252] FIG. 32 is a flowchart showing an example of generation of a predicted image.
[0253] The inter prediction unit 126 generates a predicted image (step Sm_1), and corrects the predicted image using, for example, any of the modes described above (step Sm_2).
[0254] FIG. 33 is a flowchart showing another example of generation of a predicted image.
[0255] The inter prediction unit 126 determines a motion vector of the current block (step Sn_1). Next, the inter prediction unit 126 generates a predicted image (step Sn_2) and determines whether or not to perform correction processing (step Sn_3). Here, if the inter prediction unit 126 determines that correction processing is to be performed (Yes in step Sn_3), it generates a final predicted image by correcting the predicted image (step Sn_4). On the other hand, if the inter prediction unit 126 determines that correction processing is not to be performed (No in step Sn_3), it outputs the predicted image as the final predicted image without correcting it (step Sn_5).
[0256] Furthermore, motion compensation has a mode in which luminance is corrected when generating a predicted image, such as LIC, which will be described later.
[0257] FIG. 34 is a flowchart showing another example of generation of a predicted image.
[0258] The inter prediction unit 126 derives a motion vector of the current block (step So_1). Next, the inter prediction unit 126 determines whether or not to perform luminance correction processing (step So_2). Here, if the inter prediction unit 126 determines to perform luminance correction processing (Yes in step So_2), it generates a predicted image while performing luminance correction (step So_3). That is, the predicted image is generated by LIC. On the other hand, if the inter prediction unit 126 determines not to perform luminance correction processing (No in step So_2), it generates a predicted image by normal motion compensation without performing luminance correction (step So_4).
[0259] [Motion Compensation > OBMC] An inter prediction signal may be generated using not only the motion information of the current block obtained by motion search, but also the motion information of adjacent blocks. Specifically, a prediction signal based on the motion information obtained by motion search (in the reference picture) and a prediction signal based on the motion information of adjacent blocks (in the current picture) may be weighted and added to generate an inter prediction signal for each sub-block in the current block. Such inter prediction (motion compensation) may be called OBMC (overlapped block motion compensation).
[0260] In the OBMC mode, information indicating the size of a sub-block for OBMC (e.g., called OBMC block size) may be signaled at the sequence level. Furthermore, information indicating whether the OBMC mode is applied (e.g., called OBMC flag) may be signaled at the CU level. Note that the signaling level of these pieces of information does not need to be limited to the sequence level and the CU level, and may be other levels (e.g., the picture level, slice level, tile level, CTU level, or sub-block level).
[0261] An example of the OBMC mode will now be described more specifically. Figures 35 and 36 are a flowchart and a conceptual diagram for explaining an overview of the predicted image correction process in the OBMC process.
[0262] First, as shown in Fig. 36, a predicted image (Pred) is obtained by normal motion compensation using a motion vector (MV) assigned to a processing target (current) block. In Fig. 36, the arrow "MV" indicates a reference picture, and indicates what the current block of the current picture refers to in order to obtain a predicted image.
[0263] Next, the motion vector (MV_L) already derived for the coded left adjacent block is applied (reused) to the block to be coded to obtain a predicted image (Pred_L). The motion vector (MV_L) is indicated by an arrow "MV_L" pointing from the current block to the reference picture. The first correction of the predicted image is then performed by superimposing the two predicted images Pred and Pred_L. This has the effect of blending the boundaries between the adjacent blocks.
[0264] Similarly, a motion vector (MV_U) already derived for the coded upper adjacent block is applied (reused) to the current block to obtain a predicted image (Pred_U). The motion vector (MV_U) is indicated by an arrow "MV_U" pointing from the current block to the reference picture. The predicted image Pred_U is then superimposed on the predicted images (e.g., Pred and Pred_L) that have been corrected the first time, thereby performing a second correction of the predicted image. This has the effect of blending the boundaries between the adjacent blocks. The predicted image obtained by the second correction is the final predicted image of the current block, with the boundaries with the adjacent blocks blended (smoothed).
[0265] Note that the above example is a two-pass correction method using the left adjacent and above adjacent blocks, but the correction method may also be a three-pass or more pass correction method using the right adjacent and / or below adjacent blocks.
[0266] The area in which overlapping is performed does not have to be the entire pixel area of the block, but may be only a part of the area near the block boundary.
[0267] Here, the OBMC predicted image correction process for obtaining one predicted image Pred by superimposing additional predicted images Pred_L and Pred_U from one reference picture has been described. However, when the predicted image is corrected based on multiple reference pictures, the same process may be applied to each of the multiple reference pictures. In such a case, the OBMC image correction based on multiple reference pictures is performed to obtain a corrected predicted image from each reference picture, and then the obtained multiple corrected predicted images are further superimposed to obtain a final predicted image.
[0268] In addition, in OBMC, the unit of the target block may be a prediction block unit, or a sub-block unit obtained by further dividing the prediction block.
[0269] As a method of determining whether or not to apply OBMC processing, for example, there is a method of using obmc_flag, which is a signal indicating whether or not to apply OBMC processing. As a specific example, the encoding device may determine whether or not the target block belongs to an area with complex motion. If the target block belongs to an area with complex motion, the encoding device sets a value of 1 as obmc_flag and applies OBMC processing to perform encoding, and if the target block does not belong to an area with complex motion, the encoding device sets a value of 0 as obmc_flag and performs encoding of the block without applying OBMC processing. On the other hand, the decoding device decodes obmc_flag described in a stream (e.g., a compressed sequence), and switches whether or not to apply OBMC processing depending on the value to perform decoding.
[0270] In the above example, the inter prediction unit 126 generates one rectangular predicted image for the rectangular current block. However, the inter prediction unit 126 may generate multiple predicted images of shapes other than a rectangle for the rectangular current block, and combine the multiple predicted images to generate a final rectangular predicted image. The shape other than a rectangle may be, for example, a triangle.
[0271] FIG. 37 is a conceptual diagram for explaining generation of predicted images of two triangles.
[0272] The inter prediction unit 126 generates a predicted image of a triangle by performing motion compensation on a first partition of a triangle in the current block using a first MV of the first partition. Similarly, the inter prediction unit 126 generates a predicted image of a triangle by performing motion compensation on a second partition of a triangle in the current block using a second MV of the second partition. Then, the inter prediction unit 126 generates a predicted image of the same rectangle as the current block by combining these predicted images.
[0273] In the example shown in Fig. 37, the first partition and the second partition are each triangular, but they may be trapezoidal or may have different shapes. Furthermore, in the example shown in Fig. 37, the current block is composed of two partitions, but it may be composed of three or more partitions.
[0274] Also, the first partition and the second partition may overlap each other, i.e., the first partition and the second partition may include the same pixel area. In this case, the predicted image of the current block may be generated using the predicted image of the first partition and the predicted image of the second partition.
[0275] Furthermore, in this example, a predicted image is generated by inter prediction for both of the two partitions, but a predicted image may be generated by intra prediction for at least one partition.
[0276] [Motion compensation > BIO] Next, a method for deriving a motion vector will be described. First, a mode for deriving a motion vector based on a model assuming uniform linear motion will be described. This mode is sometimes called a BIO (bi-directional optical flow) mode.
[0277] Fig. 38 is a conceptual diagram for explaining a model assuming uniform linear motion. In Fig. 38, (vx, vy) indicates a velocity vector, and τ0 and τ1 indicate the temporal distance between the current picture (Cur Pic) and two reference pictures (Ref0, Ref1), respectively. (MVx0, MVy0) indicates a motion vector corresponding to the reference picture Ref0, and (MVx1, MVy1) indicates a motion vector corresponding to the reference picture Ref1.
[0278] In this case, under the assumption of uniform linear motion of the velocity vector (vx, vy), (MVx0, MVy0) and (MVx1, MVy1) are expressed as (vxτ0, vyτ0) and (-vxτ1, -vyτ1), respectively, and the following optical flow equation (2) may be adopted.
[0279]
number
[0280] Here, I(k) denotes the luminance value of reference image k (k=0,1) after motion compensation. This optical flow equation indicates that the sum of (i) the time derivative of the luminance value, (ii) the product of the horizontal velocity and the horizontal component of the spatial gradient of the reference image, and (iii) the product of the vertical velocity and the vertical component of the spatial gradient of the reference image is equal to zero. Based on a combination of this optical flow equation and Hermite interpolation, block-wise motion vectors obtained from a merge list or the like may be corrected pixel by pixel.
[0281] Note that the decoding device may derive a motion vector using a method other than the method based on a model assuming uniform linear motion. For example, a motion vector may be derived for each sub-block based on the motion vectors of multiple adjacent blocks.
[0282] [Motion Compensation > LIC] Next, an example of a mode in which a predicted image (prediction) is generated using LIC (local illumination compensation) processing will be described.
[0283] FIG. 39 is a conceptual diagram for explaining an example of a predicted image generating method using a luminance correction process by LIC processing.
[0284] First, the MV is derived from the coded reference picture to obtain the reference image corresponding to the current block.
[0285] Next, extract information indicating how the luminance value of the current block has changed between the reference picture and the current picture. This extraction is performed based on the luminance pixel values of the coded left adjacent reference area (peripheral reference area) and the coded upper adjacent reference area (peripheral reference area) in the current picture, and the luminance pixel values at the equivalent positions in the reference picture specified by the derived MV. Then, calculate a luminance correction parameter using the information indicating how the luminance value has changed.
[0286] A luminance correction process is performed by applying the luminance correction parameters to a reference image in a reference picture specified by the MV, thereby generating a predicted image for the current block.
[0287] It should be noted that the shape of the surrounding reference region in FIG. 39 is just an example, and other shapes may be used.
[0288] Although the process of generating a predicted image from one reference picture has been described here, the same applies when generating a predicted image from multiple reference pictures, and a luminance correction process may be performed on the reference images obtained from each reference picture in a manner similar to that described above before generating a predicted image.
[0289] As a method of determining whether or not to apply LIC processing, for example, there is a method of using lic_flag, which is a signal indicating whether or not to apply LIC processing. As a specific example, in an encoding device, it is determined whether or not the current block belongs to an area where a luminance change occurs, and if it belongs to an area where a luminance change occurs, a value of 1 is set as lic_flag and LIC processing is applied and encoding is performed, and if it does not belong to an area where a luminance change occurs, a value of 0 is set as lic_flag and encoding is performed without applying LIC processing. On the other hand, a decoding device may decode lic_flag described in a stream, and switch whether or not to apply LIC processing depending on the value and perform decoding.
[0290] Another method of determining whether to apply LIC processing is, for example, a method of determining according to whether LIC processing has been applied to surrounding blocks.As a specific example, when the current block is in merge mode, it is determined whether the surrounding coded blocks selected when deriving MV in merge mode processing have been coded by applying LIC processing.Depending on the result, it is switched to whether to apply LIC processing and performs coding.In this example, the same processing is also applied to the processing on the decoding device side.
[0291] The aspect of the LIC process (luminance correction process) has been described with reference to FIG. 39, and will be described in detail below.
[0292] First, the inter prediction unit 126 derives a motion vector for obtaining a reference image corresponding to the current block to be coded from a reference picture that is a coded picture.
[0293] Next, the inter prediction unit 126 uses the luminance pixel values of the coded surrounding reference areas adjacent to the left and above the coding target block and the luminance pixel values at the equivalent positions in the reference picture specified by the motion vector to extract information indicating how the luminance values have changed between the reference picture and the coding target picture, and calculates a luminance correction parameter. For example, the luminance pixel value of a pixel in the surrounding reference area in the coding target picture is set to p0, and the luminance pixel value of a pixel in the surrounding reference area in the reference picture at the equivalent position to the pixel is set to p1. The inter prediction unit 126 calculates coefficients A and B that optimize A×p1+B=p0 for multiple pixels in the surrounding reference areas as the luminance correction parameter.
[0294] Next, the inter prediction unit 126 performs luminance correction processing on a reference image in a reference picture specified by the motion vector using the luminance correction parameter to generate a predicted image for the block to be coded. For example, the luminance pixel value in the reference image is p2, and the luminance pixel value of the predicted image after the luminance correction processing is p3. The inter prediction unit 126 calculates A×p2+B=p3 for each pixel in the reference image to generate a predicted image after the luminance correction processing.
[0295] The shape of the surrounding reference area in FIG. 39 is an example, and other shapes may be used. A part of the surrounding reference area shown in FIG. 39 may be used. For example, an area including a predetermined number of pixels thinned out from each of the upper adjacent pixel and the left adjacent pixel may be used as the surrounding reference area. The surrounding reference area is not limited to an area adjacent to the encoding target block, and may be an area not adjacent to the encoding target block. The predetermined number of pixels may be determined in advance.
[0296] In the example shown in Figure 39, the surrounding reference area in the reference picture is an area specified by the motion vector of the encoding target picture from the surrounding reference area in the encoding target picture, but may be an area specified by another motion vector. For example, the other motion vector may be the motion vector of the surrounding reference area in the encoding target picture.
[0297] Although the operation of the encoding device 100 has been described above, the operation of the decoding device 200 is typically similar.
[0298] The LIC process may be applied to color difference instead of luminance. In this case, correction parameters may be derived for each of Y, Cb, and Cr, or a common correction parameter may be used for any of them.
[0299] Alternatively, the LIC process may be applied on a subblock basis. For example, the correction parameters may be derived using a surrounding reference region of the current subblock and a surrounding reference region of a reference subblock in a reference picture specified by the MV of the current subblock.
[0300] [Predictive control unit] The prediction control unit 128 selects either an intra-prediction signal (a signal output from the intra-prediction unit 124) or an inter-prediction signal (a signal output from the inter-prediction unit 126), and outputs the selected signal as a prediction signal to the subtraction unit 104 and the addition unit 116.
[0301] As shown in FIG. 1, in various exemplary encoding devices, the prediction control unit 128 may output prediction parameters to be input to the entropy coding unit 110. The entropy coding unit 110 may generate an encoded bitstream (or sequence) based on the prediction parameters input from the prediction control unit 128 and the quantization coefficients input from the quantization unit 108. The prediction parameters may be used by a decoding device. The decoding device may receive and decode the encoded bitstream and perform the same prediction process as that performed in the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128. The prediction parameters may include a selected prediction signal (e.g., a motion vector, a prediction type, or a prediction mode used in the intra prediction unit 124 or the inter prediction unit 126), or any index, flag, or value based on or indicating the prediction process performed in the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128.
[0302] [Example of an encoding device implementation] 40 is a block diagram showing an implementation example of the encoding device 100. The encoding device 100 includes a processor a1 and a memory a2. For example, several components of the encoding device 100 shown in FIG. 1 are implemented by the processor a1 and the memory a2 shown in FIG.
[0303] The processor a1 is a circuit that performs information processing and is a circuit that can access the memory a2. For example, the processor a1 is a dedicated or general-purpose electronic circuit that encodes moving images. The processor a1 may be a processor such as a CPU. The processor a1 may also be a collection of multiple electronic circuits. For example, the processor a1 may play the role of multiple components among multiple components of the encoding device 100 shown in FIG. 1 etc.
[0304] The memory a2 is a dedicated or general-purpose memory in which information for the processor a1 to encode a moving image is stored. The memory a2 may be an electronic circuit and may be connected to the processor a1. The memory a2 may be included in the processor a1. The memory a2 may be a collection of multiple electronic circuits. The memory a2 may be a magnetic disk or an optical disk, etc., and may be expressed as a storage or a recording medium, etc. The memory a2 may be a non-volatile memory or a volatile memory.
[0305] For example, the memory a2 may store a video to be encoded, or a bit string corresponding to the encoded video, or may store a program for the processor a1 to encode the video.
[0306] Also, for example, the memory a2 may play the role of a component for storing information among the multiple components of the encoding device 100 shown in Fig. 1 etc. For example, the memory a2 may play the role of the block memory 118 and the frame memory 122 shown in Fig. 1. More specifically, the memory a2 may store reconstructed blocks, reconstructed pictures, etc.
[0307] It should be noted that not all of the components shown in Fig. 1 and the like may be implemented, and not all of the processes described above may be performed, in the encoding device 100. Some of the components shown in Fig. 1 and the like may be included in another device, and some of the processes described above may be executed by another device.
[0308] [Decryption device] Next, a description will be given of a decoding device capable of decoding a coded signal (coded bit stream) outputted from, for example, the above coding device 100. Fig. 41 is a block diagram showing a functional configuration of a decoding device 200 according to an embodiment. The decoding device 200 is a video decoding device that decodes a video on a block-by-block basis.
[0309] As shown in FIG. 41, the decoding device 200 includes an entropy decoding unit 202, an inverse quantization unit 204, an inverse transform unit 206, an addition unit 208, a block memory 210, a loop filter unit 212, a frame memory 214, an intra prediction unit 216, an inter prediction unit 218, and a prediction control unit 220.
[0310] The decoding device 200 is realized by, for example, a general-purpose processor and a memory. In this case, when the software program stored in the memory is executed by the processor, the processor functions as the entropy decoding unit 202, the inverse quantization unit 204, the inverse transform unit 206, the addition unit 208, the loop filter unit 212, the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220. The decoding device 200 may also be realized as one or more dedicated electronic circuits corresponding to the entropy decoding unit 202, the inverse quantization unit 204, the inverse transform unit 206, the addition unit 208, the loop filter unit 212, the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220.
[0311] Below, the overall processing flow of the decoding device 200 will be described, and then each component included in the decoding device 200 will be described.
[0312] [Overall flow of decryption process] FIG. 42 is a flowchart showing an example of the overall decoding process by the decoding device 200.
[0313] First, the entropy decoding unit 202 of the decoding device 200 identifies a division pattern of fixed-size blocks (e.g., 128×128 pixels) (step Sp_1). This division pattern is the division pattern selected by the encoding device 100. Then, the decoding device 200 performs the processes of steps Sp_2 to Sp_6 on each of the multiple blocks constituting the division pattern.
[0314] That is, the entropy decoding unit 202 decodes (specifically, entropy decodes) the coded quantized coefficients and prediction parameters of the block to be decoded (also called the current block) (step Sp_2).
[0315] Next, the inverse quantization unit 204 and the inverse transform unit 206 perform inverse quantization and inverse transform on the multiple quantized coefficients to reconstruct multiple prediction residuals (that is, difference blocks) (step Sp_3).
[0316] Next, a prediction processing unit consisting of all or a part of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 generates a prediction signal (also called a prediction block) of the current block (step Sp_4).
[0317] Next, the adder 208 reconstructs the current block into a reconstructed image (also called a decoded image block) by adding the predicted block to the difference block (step Sp_5).
[0318] Then, when this reconstructed image is generated, the loop filter unit 212 performs filtering on the reconstructed image (step Sp_6).
[0319] Then, the decoding device 200 determines whether or not the decoding of the entire picture is completed (step Sp_7), and if it determines that the decoding is not completed (No in step Sp_7), it repeats the process from step Sp_1.
[0320] As illustrated, the processes of steps Sp_1 to Sp_7 are sequentially performed by the decoding device 200. Alternatively, some of the processes may be performed in parallel, or the order of the processes may be changed.
[0321] [Entropy Decoding Part] The entropy decoding unit 202 entropy decodes the coded bitstream. Specifically, for example, the entropy decoding unit 202 arithmetically decodes the coded bitstream into a binary signal. Then, the entropy decoding unit 202 debinarizes the binary signal. The entropy decoding unit 202 outputs the quantization coefficients to the inverse quantization unit 204 on a block-by-block basis. The entropy decoding unit 202 may output prediction parameters included in the coded bitstream (see FIG. 1) to the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 in the embodiment. The intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220 can execute the same prediction process as the process executed by the intra prediction unit 124, the inter prediction unit 126, and the prediction control unit 128 on the coding device side.
[0322] [Dequantization section] The inverse quantization unit 204 inverse quantizes the quantized coefficients of a block to be decoded (hereinafter, referred to as a current block) that is input from the entropy decoding unit 202. Specifically, the inverse quantization unit 204 inverse quantizes each quantized coefficient of the current block based on a quantization parameter corresponding to the quantized coefficient. Then, the inverse quantization unit 204 outputs the inverse quantized quantized coefficients (i.e., transform coefficients) of the current block to the inverse transform unit 206.
[0323] [Inverse conversion section] The inverse transform unit 206 restores the prediction error by inverse transforming the transform coefficients input from the inverse quantization unit 204 .
[0324] For example, if the information interpreted from the encoded bitstream indicates that EMT or AMT is to be applied (e.g., the AMT flag is true), the inverse transform unit 206 inverse transforms the transform coefficients of the current block based on the interpreted information indicating the transform type.
[0325] Also for example, if the information interpreted from the coded bitstream indicates to apply NSST, then inverse transform unit 206 applies an inverse re-transform to the transform coefficients.
[0326] [Addition section] The adder 208 reconstructs the current block by adding the prediction error, which is an input from the inverse transformer 206, and the prediction sample, which is an input from the prediction control unit 220. The adder 208 then outputs the reconstructed block to the block memory 210 and the loop filter unit 212.
[0327] [Block memory] The block memory 210 is a storage unit for storing blocks that are referenced in intra prediction and are in a picture to be decoded (hereinafter, referred to as a current picture). Specifically, the block memory 210 stores the reconstructed block output from the adder 208.
[0328] [Loop filter section] The loop filter unit 212 applies a loop filter to the block reconstructed by the adder unit 208, and outputs the filtered reconstructed block to a frame memory 214, a display device, or the like.
[0329] If the information indicating ALF on / off read from the encoded bitstream indicates ALF on, one filter is selected from among multiple filters based on the local gradient direction and activity, and the selected filter is applied to the reconstructed block.
[0330] [Frame memory] The frame memory 214 is a storage unit for storing reference pictures used in inter prediction, and may be called a frame buffer. Specifically, the frame memory 214 stores the reconstructed blocks filtered by the loop filter unit 212.
[0331] [Prediction processing unit (intra prediction unit, inter prediction unit, prediction control unit)] 43 is a flowchart showing an example of processing performed in the prediction processing unit of the decoding device 200. Note that the prediction processing unit is made up of all or some of the components of the intra prediction unit 216, the inter prediction unit 218, and the prediction control unit 220.
[0332] The prediction processing unit generates a prediction image of the current block (step Sq_1). This prediction image is also called a prediction signal or a prediction block. The prediction signal includes, for example, an intra prediction signal or an inter prediction signal. Specifically, the prediction processing unit generates a prediction image of the current block using a reconstructed image that has already been obtained by generating a prediction block, generating a difference block, generating a coefficient block, restoring the difference block, and generating a decoded image block.
[0333] The reconstructed image may be, for example, an image of a reference picture, or an image of a decoded block in a current picture, which is a picture that includes the current block. The decoded block in the current picture may be, for example, a neighboring block of the current block.
[0334] FIG. 44 is a flowchart showing another example of the process performed by the prediction processing unit of the decoding device 200.
[0335] The prediction processing unit determines a method or mode for generating a predicted image (step Sr_1). For example, the method or mode may be determined based on prediction parameters, for example.
[0336] When the prediction processing unit determines the first method as the mode for generating the predicted image, the prediction processing unit generates the predicted image according to the first method (step Sr_2a). When the prediction processing unit determines the second method as the mode for generating the predicted image, the prediction processing unit generates the predicted image according to the second method (step Sr_2b). When the prediction processing unit determines the third method as the mode for generating the predicted image, the prediction processing unit generates the predicted image according to the third method (step Sr_2c).
[0337] The first method, the second method, and the third method are different methods for generating a predicted image, and may be, for example, an inter-prediction method, an intra-prediction method, and other prediction methods. These prediction methods may use the above-mentioned reconstructed image.
[0338] [Intra prediction section] The intra prediction unit 216 generates a prediction signal (intra prediction signal) by performing intra prediction with reference to a block in the current picture stored in the block memory 210 based on an intra prediction mode interpreted from the encoded bit stream. Specifically, the intra prediction unit 216 generates an intra prediction signal by performing intra prediction with reference to samples (e.g., luminance values, chrominance values) of blocks adjacent to the current block, and outputs the intra prediction signal to the prediction control unit 220.
[0339] Note that, when an intra prediction mode that references a luminance block in intra prediction of a chrominance block is selected, the intra prediction unit 216 may predict the chrominance component of the current block based on the luminance component of the current block.
[0340] Furthermore, when information interpreted from the encoded bitstream indicates the application of PDPC, the intra prediction unit 216 corrects pixel values after intra prediction based on the gradients of reference pixels in the horizontal / vertical directions.
[0341] [Inter prediction section] The inter prediction unit 218 predicts the current block by referring to a reference picture stored in the frame memory 214. The prediction is performed in units of the current block or sub-blocks (e.g., 4x4 blocks) in the current block. For example, the inter prediction unit 218 generates an inter prediction signal of the current block or sub-block by performing motion compensation using motion information (e.g., motion vectors) interpreted from the encoded bit stream (e.g., prediction parameters output from the entropy decoding unit 202), and outputs the inter prediction signal to the prediction control unit 220.
[0342] If the information interpreted from the encoded bitstream indicates that the OBMC mode is to be applied, the inter prediction unit 218 generates an inter prediction signal using not only the motion information of the current block obtained by motion search, but also the motion information of adjacent blocks.
[0343] Also, if the information interpreted from the encoded bitstream indicates that the FRUC mode is applied, the inter prediction unit 218 derives motion information by performing motion search according to the pattern matching method (bilateral matching or template matching) interpreted from the encoded bitstream. Then, the inter prediction unit 218 performs motion compensation (prediction) using the derived motion information.
[0344] In addition, when the BIO mode is applied, the inter prediction unit 218 derives a motion vector based on a model assuming uniform linear motion. In addition, when information interpreted from the encoded bitstream indicates that an affine motion compensation prediction mode is applied, the inter prediction unit 218 derives a motion vector on a sub-block basis based on the motion vectors of multiple adjacent blocks.
[0345] [MV Derivation > Normal Inter Mode] If the information interpreted from the encoded bitstream indicates that normal inter mode is to be applied, the inter prediction unit 218 derives an MV based on the information interpreted from the encoded bitstream, and performs motion compensation (prediction) using the MV.
[0346] FIG. 45 is a flowchart showing an example of inter prediction in the normal inter mode in the decoding device 200.
[0347] The inter prediction unit 218 of the decoding device 200 performs motion compensation for each block. The inter prediction unit 218 obtains multiple candidate MVs for the current block based on information such as MVs of multiple decoded blocks around the current block in time or space (step Ss_1). That is, the inter prediction unit 218 creates a candidate MV list.
[0348] Next, the inter prediction unit 218 extracts N candidate MVs (N is an integer equal to or greater than 2) from the multiple candidate MVs acquired in step Ss_1 as motion vector predictor candidates (also called prediction MV candidates) according to a predetermined priority order (step Ss_2). Note that the priority order may be predefined for each of the N prediction MV candidates.
[0349] Next, the inter prediction unit 218 decodes the predicted motion vector selection information from the input stream (i.e., the encoded bit stream), and uses the decoded predicted motion vector selection information to select one predicted MV candidate from the N predicted MV candidates as the predicted motion vector (also called predicted MV) of the current block (step Ss_3).
[0350] Next, the inter prediction unit 218 decodes the differential MV from the input stream, and derives the MV of the current block by adding the differential value, which is the decoded differential MV, to the selected predicted motion vector (step Ss_4).
[0351] Finally, the inter prediction unit 218 performs motion compensation on the current block using the derived MV and the decoded reference picture to generate a predicted image of the current block (step Ss_5).
[0352] [Predictive control unit] The prediction control unit 220 selects either the intra prediction signal or the inter prediction signal, and outputs the selected signal as a prediction signal to the adder unit 208. Overall, the configurations, functions, and processing of the prediction control unit 220, the intra prediction unit 216, and the inter prediction unit 218 on the decoding device side may correspond to the configurations, functions, and processing of the prediction control unit 128, the intra prediction unit 124, and the inter prediction unit 126 on the encoding device side.
[0353] [Example of implementation of a decryption device] Fig. 46 is a block diagram showing an implementation example of the decoding device 200. The decoding device 200 includes a processor b1 and a memory b2. For example, several components of the decoding device 200 shown in Fig. 41 are implemented by the processor b1 and the memory b2 shown in Fig. 46.
[0354] The processor b1 is a circuit that performs information processing and is a circuit that can access the memory b2. For example, the processor b1 is a dedicated or general-purpose electronic circuit that decodes encoded video (i.e., an encoded bitstream). The processor b1 may be a processor such as a CPU. The processor b1 may also be a collection of multiple electronic circuits. For example, the processor b1 may play the role of multiple components among multiple components of the decoding device 200 shown in FIG. 41 etc.
[0355] The memory b2 is a dedicated or general-purpose memory in which information for the processor b1 to decode the encoded bit stream is stored. The memory b2 may be an electronic circuit and may be connected to the processor b1. The memory b2 may be included in the processor b1. The memory b2 may be a collection of multiple electronic circuits. The memory b2 may be a magnetic disk or an optical disk, etc., and may be expressed as a storage or a recording medium, etc. The memory b2 may be a non-volatile memory or a volatile memory.
[0356] For example, the memory b2 may store a video image or a coded bitstream, and may store a program for the processor b1 to decode the coded bitstream.
[0357] Also, for example, the memory b2 may play the role of a component for storing information among the multiple components of the decoding device 200 shown in Fig. 41 etc. Specifically, the memory b2 may play the role of the block memory 210 and the frame memory 214 shown in Fig. 41. More specifically, the memory b2 may store reconstructed blocks, reconstructed pictures, etc.
[0358] Note that not all of the components shown in Fig. 41 and the like may be implemented, and not all of the above-described processes may be performed, in the decoding device 200. Some of the components shown in Fig. 41 and the like may be included in another device, and some of the above-described processes may be executed by another device.
[0359] [Definition of each term] As an example, each term may be defined as follows:
[0360] A picture is an array of luma samples in monochrome format, or two corresponding arrays of luma samples and chroma samples in 4:2:0, 4:2:2 and 4:4:4 color formats. A picture may be a frame or a field.
[0361] A frame is a composition of a top field from which a number of sample rows occur: 0, 2, 4, . . . and a bottom field from which a number of sample rows occur: 1, 3, 5, . . .
[0362] A slice is an integer number of coding tree units contained in one independent slice segment and all subsequent dependent slice segments (if any) that precede the next independent slice segment (if any) within the same access unit.
[0363] A tile is a rectangular region of multiple coding tree blocks in a particular tile column and a particular tile row in a picture. A tile may also be a rectangular region of a frame that is intended to be decoded and coded independently, although loop filters across tile edges may still be applied.
[0364] A block is an MxN (N rows and M columns) array of samples, or an MxN array of transform coefficients. A block may be a square or rectangular region of pixels consisting of one luma and two chroma matrices.
[0365] A CTU (coding tree unit) may be a coding tree block of luma samples for a picture with three sample arrangements, or two corresponding coding tree blocks of chroma samples, or a coding tree block of samples for either monochrome pictures or pictures coded with three separated color planes and a syntax structure used for coding the samples.
[0366] A superblock may comprise one or two mode information blocks, or may be a square block of 64x64 pixels that can be recursively divided into four 32x32 blocks and further divided.
[0367] [First aspect of coefficient coding] Fig. 47 is a flowchart showing a basic coefficient coding method according to the first aspect. Specifically, Fig. 47 shows a coefficient coding method for an area in which a prediction residual is obtained by intra coding or inter coding. In the following description, operations performed by the coding device 100 are shown. The decoding device 200 may perform operations corresponding to the operations performed by the coding device 100. For example, the decoding device 200 may perform inverse orthogonal transform and decoding corresponding to the orthogonal transform and coding performed by the coding device 100.
[0368] In Fig. 47, last_sig_coeff, subblock_flag, thres, and CCB are shown. last_sig_coeff is a parameter representing the coordinate position where a non-zero coefficient first appears when scanning within a block. subblock_flag is a flag representing whether there is a non-zero coefficient in a 4x4 subblock (also called 16 transform coefficient levels). subblock_flag is also expressed as coded_sub_block_flag or subblock flag.
[0369] thres is a constant determined for each block. thres may be determined in advance. thres may have a different value depending on the size of the block, or may be the same value regardless of the size of the block. thres may have a different value depending on whether or not an orthogonal transform is applied. thres may be determined depending on the coordinate position determined in the block by last_sig_coeff.
[0370] CCB represents the number of bins coded in the context mode of CABAC (context-adaptive binary arithmetic coding). In other words, CCB represents the number of coding processes based on the context mode of CABAC. The context mode is also called the regular mode. Here, coding based on the context mode of CABAC is called CABAC coding or context-adaptive coding. Also, coding based on the bypass mode of CABAC is called bypass coding. The bypass coding process is lighter than the CABAC coding process.
[0371] CABAC coding is a process of converting a string of bins obtained by binarizing a signal to be coded into a coded bit string based on the occurrence probability of 0 and 1 for each bin. Note that CCB may count the number of all flags used in residual coefficient coding, or may count the number of some of the flags used in residual coefficient coding. Bypass coding is a process of coding 1 bin in a string of bins as 1 bit in a coded bit string without using the variable occurrence probability of 0 and 1 for each bin (in other words, using a fixed probability).
[0372] For example, the encoding device 100 compares the CCB value with the thres value to determine the coefficient encoding method.
[0373] Specifically, in FIG. 47, first, CCB is initialized to 0 (S101). Then, it is determined whether or not an orthogonal transform is applied to the block (S102). If an orthogonal transform is applied to the block (Yes in S102), encoding device 100 encodes last_sig_coeff (S131). Then, encoding device 100 performs loop processing for each sub-block (S141 to S148).
[0374] In the loop process for each subblock (S141 to S148), the encoding device 100 encodes subblock_flag for that subblock. If subblock_flag is different from 0 (Yes in S146), the encoding device 100 encodes the 16 coefficients in that subblock using a first encoding method described below (S147).
[0375] Furthermore, if orthogonal transform is not applied to the block (No in S102), encoding device 100 performs loop processing for each sub-block (S121 to S128).
[0376] In the loop process for each subblock (S121 to S128), the encoding device 100 determines whether or not CCB is less than or equal to thres (S122). If CCB is less than or equal to thres (Yes in S122), the encoding device 100 encodes subblock_flag using CABAC encoding (S123). Then, the encoding device 100 counts up CCB (S124). If not (No in S122), the encoding device 100 encodes subblock_flag using bypass encoding (S125).
[0377] If subblock_flag is different from 0 (Yes in S126), encoding device 100 encodes the 16 coefficients in that subblock using a second encoding method, which will be described later (S127).
[0378] When the orthogonal transform is not applied to the block, for example, the orthogonal transform may be skipped. The CCB is also used in the first and second encoding methods. The CCB may be initialized on a subblock basis. In this case, thres may be a value that changes for each subblock, rather than a fixed value for the block.
[0379] Note that here, the CCB is counted up from 0 and it is determined whether it has reached thres, but the CCB may be counted down from thres (or a specific value) and it may be determined whether it has reached 0.
[0380] Fig. 48 is a flowchart showing details of the first encoding method shown in Fig. 47. In the first encoding method, a plurality of coefficients in a sub-block are encoded. In this case, a first loop process (S151 to S156) is performed for each coefficient information flag of each coefficient in the sub-block, and a second loop process (S161 to S165) is performed for each coefficient in the sub-block.
[0381] In the first loop process (S151 to S156), one or more coefficient information flags each indicating one or more attributes of a coefficient are sequentially coded. The one or more coefficient information flags may include sig_flag, gt1_flag, parity_flag, and gt3_flag, which will be described later. Then, the one or more coefficient information flags are sequentially coded by CABAC coding within a range in which CCB does not exceed thres, and CCB is counted up by one each time coding is performed. After CCB exceeds thres, the coefficient information flags are not coded.
[0382] That is, in the first loop process (S151 to S156), the encoding device 100 determines whether or not CCB is equal to or less than thres (S152). If CCB is equal to or less than thres (Yes in S152), the encoding device 100 encodes the coefficient information flag by CABAC encoding (S153). Then, the encoding device 100 counts up CCB (S154). If CCB is not equal to or less than thres (No in S152), the encoding device 100 ends the first loop process (S151 to S156).
[0383] In the second loop process (S161 to S165), for coefficients whose coefficient information flags have been coded, the remainder, which is a remaining value not expressed by the coefficient information flag (i.e., a remaining value for reconstructing the value of the coefficient using the coefficient information flag), is coded by Golomb-Rice coding. Coefficients whose coefficient information flags have not been coded are directly coded by Golomb-Rice coding. Note that the remainder may be coded by using another coding method instead of Golomb-Rice coding.
[0384] That is, in the second loop process (S161 to S165), the encoding device 100 determines whether or not the coefficient information flag corresponding to the coefficient to be processed has been coded (S162). If the coefficient information flag has been coded (Yes in S162), the encoding device 100 codes the remainder using Golomb-Rice coding (S163). If the coefficient information flag has not been coded (No in S162), the encoding device 100 codes the value of the coefficient using Golomb-Rice coding (S164).
[0385] Note that, although the number of loop processes is two here, the number of loop processes may be different from two.
[0386] The above sig_flag is a flag indicating whether AbsLevel is non-zero. AbsLevel is the value of a coefficient, more specifically, the absolute value of the coefficient. gt1_flag is a flag indicating whether AbsLevel is greater than 1. parity_flag is a flag indicating the first bit of AbsLevel, and is a flag indicating whether AbsLevel is odd or even. gt3_flag is a flag indicating whether AbsLevel is greater than 3.
[0387] The gt1_flag and gt3_flag may be expressed as abs_gt1_flag and abs_gt3_flag, respectively. In addition, for example, as the above-mentioned remainder, a value of (Abslevel-4) / 2 may be coded by Golomb-Rice coding.
[0388] One or more coefficient information flags other than the one or more coefficient information flags may be coded. For example, some coefficient information flags may not be coded. The coefficient information flags included in the one or more coefficient information flags may be replaced with coefficient information flags or parameters having other meanings.
[0389] Fig. 49 is a flowchart showing details of the second encoding method shown in Fig. 47. In the second encoding method, a plurality of coefficients in a sub-block are encoded. In this case, a first loop process (S171 to S176) is performed for each coefficient information flag of each coefficient in the sub-block, and a second loop process (S181 to S185) is performed for each coefficient in the sub-block.
[0390] In the first loop process (S171 to S176), one or more coefficient information flags each indicating one or more attributes of a coefficient are sequentially coded. The one or more coefficient information flags may include sig_flag, sign_flag, gt1_flag, parity_flag, gt3_flag, gt5_flag, gt7_flag, and gt9_flag.
[0391] Here, sign_flag is a flag representing the positive or negative sign of the coefficient. gt5_flag is a flag representing whether AbsLevel is greater than 5. gt7_flag is a flag representing whether AbsLevel is greater than 7. gt9_flag is a flag representing whether AbsLevel is greater than 9. gt5_flag, gt7_flag, and gt9_flag may be expressed as abs_gt5_flag, abs_gt7_flag, and abs_gt9_flag, respectively. In addition, flags representing whether AbsLevel is greater than x (x is an integer equal to or greater than 1) may be collectively expressed as gtx_flag or abs_gtx_flag. AbsLevel is, for example, the absolute value of the transform coefficient level.
[0392] In addition, one or more coefficient information flags other than the one or more coefficient information flags may be coded. For example, some coefficient information flags may not be coded. The coefficient information flags included in the one or more coefficient information flags may be replaced with coefficient information flags or parameters having other meanings.
[0393] The coefficient information flags are coded sequentially by CABAC coding. Then, the CCB is counted up by one for each coding. After the CCB exceeds thres, the coefficient information flags are coded by bypass coding.
[0394] That is, in the first loop process (S171 to S176), the encoding device 100 determines whether or not CCB is equal to or less than thres (S172). If CCB is equal to or less than thres (Yes in S172), the encoding device 100 encodes the coefficient information flag by CABAC encoding (S173). Then, the encoding device 100 counts up CCB (S174). If CCB is not equal to or less than thres (No in S172), the encoding device 100 encodes the coefficient information flag by bypass encoding (S175).
[0395] The syntax of the second loop process in Fig. 49 does not change before and after CCB exceeds thres. That is, the same process is performed in the second loop process (S181 to S185) regardless of whether the coefficient information flag is coded by CABAC coding or by bypass coding.
[0396] Specifically, in the second loop process (S181 to S185), the encoding device 100 encodes remainder, which is a remaining value not represented by the coefficient information flag (i.e., a remaining value for reconstructing the coefficient value using the coefficient information flag), by Golomb-Rice encoding (S183). Note that remainder may be encoded by using another encoding method instead of Golomb-Rice encoding.
[0397] Although the number of loop processes is two here, the number of loop processes may be different from two.
[0398] As shown in Figure 47, Figure 48 and Figure 49, in the basic operation of this embodiment, there is a flag that is included in the limit of the number of processing times of CABAC encoding depending on whether or not orthogonal transform is applied. Also, the syntax of coefficient encoding is different between the case where orthogonal transform is applied and the case where orthogonal transform is not applied. This may require separate circuits. Therefore, the circuit configuration may become complicated.
[0399] [First Example of First Aspect of Coefficient Encoding] Fig. 50 is a flowchart showing a coefficient coding method according to a first example of the first aspect. In the example of Fig. 50, the post-processing of last_sig_coeff (S132) and the processing of subblock_flag (S142 to S145) are different from the example of Fig. 47.
[0400] In Fig. 47, when orthogonal transform is applied, the CCB is counted up for sig_flag, parity_flag, and gtX_flag (X = 1, 3). In the example of Fig. 50, the CCB is also counted up for last_sig_coeff and subblock_flag. On the other hand, the processing flow when orthogonal transform is not applied is the same as the example of Fig. 47.
[0401] That is, in the example of FIG. 50, the encoding device 100 encodes last_sig_coeff (S131), and then adds the number of CABAC encoding processes in encoding last_sig_coeff to the CCB (S132).
[0402] Furthermore, before encoding subblock_flag, encoding apparatus 100 determines whether CCB is less than or equal to thres (S142). If CCB is less than or equal to thres (Yes in S142), encoding apparatus 100 encodes subblock_flag using CABAC encoding (S143). Then, encoding apparatus 100 adds 1 to CCB (S144). On the other hand, if CCB is not less than or equal to thres (No in S142), encoding apparatus 100 encodes subblock_flag using bypass encoding (S145).
[0403] [Effect of the first example of the first aspect of coefficient encoding] According to the example of Fig. 50, it may be possible to standardize the process flow of coding subblock_flag between cases where orthogonal transform is performed and cases where orthogonal transform is not performed. Therefore, some circuits may be shared between cases where orthogonal transform is performed and cases where orthogonal transform is not performed, and the circuit scale may be reduced. As a result, multiple process flows that are divided depending on whether or not orthogonal transform is performed may be the same except for the presence or absence of last_sig_coeff.
[0404] For example, even if the number of times of CABAC encoding is limited at the block level, in the example of Fig. 47, after CCB reaches thres, subblock_flag is encoded by CABAC encoding. On the other hand, in the example of Fig. 50, after CCB reaches thres, subblock_flag is not encoded by CABAC encoding. This may result in the number of times of CABAC encoding being appropriately limited to thres.
[0405] Note that the number of CABAC encoding processes in last_sig_coeff does not have to be included in the CCB. Also, thres may be determined depending on the coordinate position determined in the block by last_sig_coeff.
[0406] Furthermore, the encoding device 100 may determine and encode the value of subblock_flag as 1 after the CCB exceeds thres. If it is determined that the value of subblock_flag is always 1 after the CCB exceeds thres, the encoding device 100 may not need to encode the subblock_flag after the CCB exceeds thres.
[0407] Furthermore, even when orthogonal transform is not applied, encoding device 100 may determine and encode the value of subblock_flag to be always 1 after CCB exceeds thres. Also in this case, if it is determined that the value of subblock_flag is always 1 after CCB exceeds thres, encoding device 100 may not need to encode subblock_flag after CCB exceeds thres.
[0408] [Second Example of the First Aspect of Coefficient Coding] 51 is a flowchart showing a coefficient coding method according to a second example of the first aspect. In the example of FIG. 51, the process of subblock_flag (S123) is different from the example of FIG.
[0409] In Fig. 47, when no orthogonal transform is applied, the CCB is counted up for sig_flag, parity_flag, gtX_flag (X=1, 3, 5, 7, 9), and subblock_flag. In the example of Fig. 51, the CCB is not counted up for subblock_flag. On the other hand, the processing flow when the orthogonal transform is applied is the same as the example of Fig. 47.
[0410] That is, in the example of FIG. 51, the encoding device 100 always encodes subblock_flag by CABAC encoding without counting up the CCB, regardless of whether the CCB exceeds thres (S123).
[0411] [Effect of the second example of the first aspect of coefficient coding] According to the example of Fig. 51, it may be possible to standardize the coding process of subblock_flag between cases where orthogonal transform is performed and cases where it is not performed. Therefore, some circuits may be shared between cases where orthogonal transform is performed and cases where it is not performed, and the circuit scale may be reduced. As a result, multiple processing flows that are divided depending on whether or not orthogonal transform is performed may be the same, except for the presence or absence of last_sig_coeff.
[0412] Moreover, the processing in FIG. 51 is simplified compared to FIG. 50. Therefore, the circuit scale may be reduced. Also, it is assumed that the frequency of occurrence of 0 or 1 for subblock_flag is likely to have a bias according to the surrounding circumstances. Therefore, in CABAC encoding of subblock_flag, it is assumed that the reduction in the code amount is large relative to the increase in the processing delay. Therefore, it is useful to perform CABAC encoding of subblock_flag without being subject to the limit on the number of CABAC encoding processes.
[0413] The number of CABAC encoding processes for last_sig_coeff may be included in the CCB. Furthermore, thres may be determined depending on the coordinate position determined in the block by last_sig_coeff.
[0414] [Second aspect of coefficient coding] [First Example of the Second Aspect of Coefficient Coding] Fig. 52 is a flowchart showing a coefficient coding method according to a first example of the second aspect. In the example of Fig. 52, even if orthogonal transform is not applied to the block, 16 coefficients in a sub-block are coded by the first coding method (S127a), which is different from the example of Fig. 47.
[0415] That is, in the example of Fig. 52, when orthogonal transform is not applied to a block, encoding device 100 encodes 16 coefficients in a sub-block by the first encoding method shown in Fig. 48, not the second encoding method shown in Fig. 49 (S127a). That is, whether or not orthogonal transform is applied, encoding device 100 encodes 16 coefficients in a sub-block by the first encoding method shown in Fig. 48, not the second encoding method shown in Fig. 49.
[0416] More specifically, the encoding device 100 skips encoding of the coefficient information flag without using bypass encoding when CCB exceeds thres in the first loop processing according to the first encoding method shown in Fig. 48, regardless of the presence or absence of orthogonal transform. Then, in the second loop processing, if the coefficient information flag corresponding to the coefficient to be processed is not encoded, the encoding device 100 encodes the value of the coefficient by Golomb-Rice encoding without using the coefficient information flag.
[0417] In addition, the syntax for coding the coefficient information flag in the first loop process in Fig. 48 may be different depending on whether or not the orthogonal transform is applied. For example, some or all of one or more coefficient information flags in the case where the orthogonal transform is applied may be different from one or more coefficient information flags in the case where the orthogonal transform is not applied.
[0418] [Effect of the first example of the second aspect of coefficient coding] According to the example of Fig. 52, even if the coding syntax of the coefficient information flag is different depending on whether or not orthogonal transform is performed, the coding syntax of 16 coefficients in a sub-block may be common after CCB exceeds thres, regardless of whether orthogonal transform is performed. This may allow some circuits to be shared between cases where orthogonal transform is applied and cases where orthogonal transform is not applied, and may reduce the circuit scale.
[0419] In addition, after CCB exceeds thres, the coefficient is coded without being divided into the coefficient information flag coded by bypass coding and the residual value information coded by Golomb-Rice coding. Therefore, the increase in the amount of information may be suppressed, and the increase in the amount of code may be suppressed.
[0420] [Second Example of the Second Aspect of Coefficient Coding] Fig. 53 is a flowchart showing a coefficient coding method according to a second example of the second aspect. In the example of Fig. 53, even if an orthogonal transform is applied to a block, 16 coefficients in a sub-block are coded by the second coding method (S147a), which is different from the example of Fig. 47.
[0421] That is, in the example of Fig. 53, when an orthogonal transform is applied to a block, encoding device 100 encodes 16 coefficients in a sub-block by the second encoding method shown in Fig. 49, not the first encoding method shown in Fig. 48 (S147a). That is, whether an orthogonal transform is applied or not, encoding device 100 encodes 16 coefficients in a sub-block by the second encoding method shown in Fig. 49, not the first encoding method shown in Fig. 48.
[0422] More specifically, the encoding device 100, in accordance with the second encoding method shown in Fig. 49, regardless of the presence or absence of orthogonal transform, does not skip encoding and encodes the coefficient information flag by bypass encoding when CCB exceeds thres in the first loop processing. Then, in the second loop processing, the encoding device 100 encodes remainder, which depends on the coefficient information flag, by Golomb-Rice encoding.
[0423] In addition, the syntax for coding the coefficient information flag in the first loop process in Fig. 49 may be different depending on whether or not the orthogonal transform is applied. For example, some or all of one or more coefficient information flags in the case where the orthogonal transform is applied may be different from one or more coefficient information flags in the case where the orthogonal transform is not applied.
[0424] [Effect of the second example of the second aspect of coefficient coding] According to the example of Fig. 53, even if the coding syntax of the coefficient information flag is different depending on whether or not orthogonal transform is performed, the coding syntax of 16 coefficients in a sub-block may be common after CCB exceeds thres, regardless of whether or not orthogonal transform is performed. This may allow some circuits to be shared between the case where orthogonal transform is applied and the case where orthogonal transform is not applied, and may reduce the circuit scale.
[0425] [Third aspect of coefficient coding] Fig. 54 is a syntax diagram showing a basic first encoding method according to the third aspect. The syntax shown in Fig. 54 corresponds to an example of the syntax of the first encoding method shown in Fig. 47. Basically, the first encoding method is used when orthogonal transform is applied.
[0426] Here, the coefficient information flags and parameters are the same as those shown in the first embodiment. Note that the multiple coefficient information flags shown here are only an example, and multiple other coefficient information flags may be coded. For example, some coefficient information flags may not be coded. In addition, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.
[0427] The first for loop in the example of FIG. 54 corresponds to the first loop process in the example of FIG. 48. In this first for loop, if a CCB remains, that is, if the CCB does not exceed a threshold, the coefficient information flag such as sig_flag is coded by CABAC coding. If no CCB remains, the coefficient information flag is not coded. Note that the second example of the second aspect may be applied to this example. That is, if no CCB remains, the coefficient information flag may be coded by bypass coding.
[0428] The second for loop from the top and the third for loop from the top correspond to the second loop process in the example of FIG. 48. In the second for loop from the top, the residual value is coded by Golomb-Rice coding for the coefficients whose coefficient information flags are coded. In the third for loop from the top, the coefficients whose coefficient information flags are not coded are coded by Golomb-Rice coding. Note that the residual value may always be coded by Golomb-Rice coding by applying the second example of the second aspect to this example.
[0429] In the fourth for loop from the top, sign_flag is encoded using bypass encoding.
[0430] The syntax described in this embodiment may be applied to each of the examples in Figures 47, 48, 50, 51 and 52.
[0431] Fig. 55 is a syntax diagram showing a basic second encoding method according to the third aspect. The syntax shown in Fig. 55 corresponds to an example of the syntax of the second encoding method in Fig. 47. Basically, the second encoding method is used when no orthogonal transform is applied.
[0432] Note that the multiple coefficient information flags shown here are just an example, and multiple other coefficient information flags may be coded. For example, some coefficient information flags may not be coded. In addition, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.
[0433] The first five for loops in the example of FIG. 55 correspond to the first loop process in the example of FIG. 49. In these first five for loops, if a CCB remains, that is, if the CCB does not exceed a threshold, the coefficient information flag such as sig_flag is coded by CABAC coding. If no CCB remains, the coefficient information flag is coded by bypass coding. Note that the first example of the second aspect may be applied to this example. In other words, if no CCB remains, the coefficient information flag does not need to be coded.
[0434] The sixth for loop from the top corresponds to the second loop process in the example of FIG. 49. In the sixth for loop from the top, the residual value is coded by Golomb-Rice coding. Note that the first example of the second aspect may be applied to this example. That is, the residual value may be coded by Golomb-Rice coding for the coefficients whose coefficient information flags are coded. And, the coefficients whose coefficient information flags are not coded may be coded by Golomb-Rice coding.
[0435] The syntax described in this embodiment may be applied to each of the examples in Figures 47, 49, 50, 51 and 53.
[0436] When the orthogonal transform is not applied (FIG. 55), the number of loop processes for coding the coefficient information flag is larger than when the orthogonal transform is applied (FIG. 54). Therefore, when the orthogonal transform is not applied, the amount of hardware processing may increase compared to when the orthogonal transform is applied. Also, since the syntax of coefficient coding differs depending on whether or not the orthogonal transform is performed, there is a possibility that a circuit must be prepared for each. Therefore, the circuit may become complicated.
[0437] [First example of the third aspect of coefficient coding] Fig. 56 is a syntax diagram showing a second encoding method according to a first example of the third aspect. The syntax shown in Fig. 56 corresponds to an example of the second encoding method in Fig. 47. The syntax shown in Fig. 54 may be used for the first encoding method in Fig. 47. This example may be combined with other examples of the third aspect, or may be combined with other aspects.
[0438] The first for loop in the example of Fig. 56 corresponds to the first loop process in the example of Fig. 49. In this first for loop, if 8 or more CCBs remain, that is, if the CCB to which 8 has been added does not exceed the threshold, up to 8 coefficient information flags are coded by CABAC coding according to the coefficients, and the CCBs are counted up up to 8 times. If 8 or more CCBs remain, that is, if the CCB to which 8 has been added exceeds the threshold, then 8 coefficient information flags are coded by bypass coding according to the coefficients.
[0439] In other words, before the eight coefficient information flags are coded, it is comprehensively determined whether the eight coefficient information flags can be coded by CABAC coding. Then, if the eight coefficient information flags can be coded by CABAC coding, a maximum of eight coefficient information flags are coded by CABAC coding.
[0440] In addition, the first example of the second aspect may be applied to this example. That is, if there are not 8 or more CCBs remaining, 8 coefficient information flags may not be coded. That is, in this case, 8 coefficient information flags may not be coded by bypass coding, and coding of 8 coefficient information flags may be skipped.
[0441] Also, as shown in Fig. 56, the coding of one or more of the eight coefficient information flags may be omitted according to the value of the coefficient. For example, when sig_flag is 0, the coding of the remaining seven coefficient information flags may be omitted.
[0442] The second for loop from the top corresponds to the second loop process in the example of FIG. 49. In the second for loop from the top, the residual value is coded by Golomb-Rice coding. Note that the first example of the second aspect may be applied to this example. That is, for coefficients in which eight coefficient information flags are coded, the residual value may be coded by Golomb-Rice coding, and for coefficients in which eight coefficient information flags are not coded, the coefficient may be coded by Golomb-Rice coding.
[0443] The multiple coefficient information flags shown here are just an example, and multiple other coefficient information flags may be coded. For example, some coefficient information flags may not be coded. In addition, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.
[0444] Also, the example of Figure 55 and the example of Figure 56 may be combined. For example, in the example of Figure 55, before the four coefficient information flags such as sig_flag and sign_flag are encoded, it may be comprehensively determined whether or not the four coefficient information flags can be encoded by CABAC encoding.
[0445] [Effect of the first example of the third aspect of coefficient coding] In the example of Fig. 56, all coefficient information flags that are coded by CABAC coding are coded in one loop process. That is, compared with the example of Fig. 55, the example of Fig. 56 has a smaller number of loop processes. Therefore, the amount of processing may be reduced.
[0446] Also, the number of loop processes for encoding a plurality of coefficient information flags by CABAC encoding is the same between the example of Figure 54 and the example of Figure 56. Therefore, compared with the combination of the example of Figure 54 and the example of Figure 55, the combination of the example of Figure 54 and the example of Figure 56 may require fewer changes to the circuit.
[0447] In addition, since a comprehensive determination is made as to whether or not the multiple coefficient information flags can be coded using CABAC coding before the multiple coefficient information flags are coded, processing is simplified and processing delays may be reduced.
[0448] In addition, in both cases where orthogonal transform is applied and where orthogonal transform is not applied, before the multiple coefficient information flags are coded, it may be comprehensively determined whether the multiple coefficient information flags can be coded by CABAC coding. This may further reduce the difference between the coding method used for the block where orthogonal transform is applied and the coding method used for the block where orthogonal transform is not applied, and may further reduce the circuit scale.
[0449] In the example of Fig. 56, sig_flag to abs_gt9_flag are included in one loop, but the coding method is not limited to this. Multiple loops (for example, two loops) may be used, and it may be comprehensively determined whether multiple coefficient information flags can be coded by CABAC coding for each loop. Although the amount of processing increases compared to one loop, the effect of reducing processing can be obtained similarly compared to the example of Fig. 55.
[0450] [Second example of the third aspect of coefficient coding] Fig. 57 is a syntax diagram showing a second encoding method according to a second example of the third aspect. The syntax shown in Fig. 57 corresponds to an example of the second encoding method in Fig. 47. The syntax shown in Fig. 54 may be used for the first encoding method in Fig. 47. This example may be combined with other examples of the third aspect, or may be combined with other aspects.
[0451] The first for loop in the example of Fig. 57 corresponds to the first loop process in the example of Fig. 49. In this first for loop, if 7 or more CCBs remain, that is, if the CCB to which 7 has been added does not exceed the threshold, up to 7 coefficient information flags are coded by CABAC coding according to the coefficients, and the CCBs are counted up to 7 times. If 7 or more CCBs remain, that is, if the CCB to which 7 has been added exceeds the threshold, 7 coefficient information flags are coded by bypass coding according to the coefficients.
[0452] In other words, before the seven coefficient information flags are coded, it is comprehensively determined whether the seven coefficient information flags can be coded by CABAC coding, and if the seven coefficient information flags can be coded by CABAC coding, the seven coefficient information flags are coded by CABAC coding.
[0453] In addition, the first example of the second aspect may be applied to this example. That is, if there are not 7 or more CCBs remaining, 7 coefficient information flags may not be coded. That is, in this case, 7 coefficient information flags may not be coded by bypass coding, and coding of 7 coefficient information flags may be skipped.
[0454] Also, as shown in Fig. 57, the coding of one or more of the seven coefficient information flags may be omitted according to the value of the coefficient. For example, when sig_flag is 0, the coding of the remaining six coefficient information flags may be omitted.
[0455] The second for loop from the top corresponds to the second loop process in the example of FIG. 49. In the second for loop from the top, the residual value is coded by Golomb-Rice coding. Note that the first example of the second aspect may be applied to this example. That is, for coefficients with seven coefficient information flags coded, the residual value may be coded by Golomb-Rice coding, and for coefficients with seven coefficient information flags not coded, the coefficient may be coded by Golomb-Rice coding.
[0456] In the third for loop from the top, if there is a CCB remaining, that is, if the CCB does not exceed the threshold, the sign_flag is coded by CABAC coding and the CCB is counted up. If there is no CCB remaining, the sign_flag is coded by bypass coding. Note that, as in the example of FIG. 54, the sign_flag may always be coded by bypass coding.
[0457] The multiple coefficient information flags shown here are just an example, and multiple other coefficient information flags may be coded. For example, some coefficient information flags may not be coded. In addition, the coefficient information flags shown here may be replaced with coefficient information flags or parameters having other meanings.
[0458] Also, the example of Figure 55 and the example of Figure 57 may be combined. For example, in the example of Figure 55, before the four coefficient information flags such as sig_flag and sign_flag are encoded, it may be comprehensively determined whether or not the four coefficient information flags can be encoded by CABAC encoding.
[0459] [Effect of the second example of the third aspect of coefficient coding] As in the example of Fig. 56, in the example of Fig. 57, a plurality of coefficient information flags (specifically, abs_gt3_flag, abs_gt5_flag, etc.) for expressing the magnitude of a coefficient compared with a threshold are coded in one loop process. Therefore, compared with the example of Fig. 55, the example of Fig. 57 has fewer loop processes. Therefore, the amount of processing may be reduced.
[0460] Compared with the example of Figure 56, the number of loop processes for encoding multiple coefficient information flags increases in the example of Figure 57. However, compared with the example of Figure 56, the example of Figure 57 has some parts similar to the example of Figure 54. For example, sign_flag is encoded last. Therefore, compared with the combination of the example of Figure 54 and the example of Figure 56, the combination of the example of Figure 54 and the example of Figure 57 may require fewer changes to the circuit.
[0461] In addition, since a comprehensive determination is made as to whether or not the multiple coefficient information flags can be coded using CABAC coding before the multiple coefficient information flags are coded, processing is simplified and processing delays may be reduced.
[0462] In addition, in both cases where orthogonal transform is applied and where orthogonal transform is not applied, before the multiple coefficient information flags are coded, it may be comprehensively determined whether the multiple coefficient information flags can be coded by CABAC coding. This may further reduce the difference between the coding method used for the block where orthogonal transform is applied and the coding method used for the block where orthogonal transform is not applied, and may further reduce the circuit scale.
[0463] In the example of Fig. 57, sig_flag to abs_gt9_flag are included in one loop, but the coding method is not limited to this. Multiple loops (for example, two loops) may be used, and it may be comprehensively determined whether multiple coefficient information flags can be coded by CABAC coding for each loop. Although the amount of processing increases compared to one loop, the effect of reducing processing can be obtained similarly compared to the example of Fig. 55.
[0464] [Fourth aspect of coefficient coding] Fig. 58 is a diagram showing a basic correspondence between coefficient information flags and context numbers according to the fourth aspect. Specifically, Fig. 58 shows an example of a method for determining a context number for encoding a coefficient information flag, which is encoded when no orthogonal transform is applied, by CABAC encoding. One context number indicates one occurrence probability for a value of 0 or 1. The encoding device 100 performs arithmetic encoding of the coefficient information flag with this occurrence probability.
[0465] For example, when the coefficient information flag to be coded is likely to be 0, the amount of coding may be reduced by coding the coefficient information flag by CABAC coding based on a context number indicating a high occurrence probability for the value 0. In other words, the amount of coding may be reduced by arithmetically coding the coefficient flag based on an appropriate context number indicating an appropriate occurrence probability.
[0466] Fig. 59 is a conceptual diagram showing a basic plurality of adjacent coefficients according to the fourth aspect, in which x indicates a coefficient to be coded.
[0467] The coefficient scan is performed diagonally from the top left of the 4x4 subblock shown in FIG. 59. Specifically, in a coordinate system in which the top left is expressed as (0,0), the top right as (3,0), the bottom left as (0,3), and the bottom right as (3,3), the coefficient scan is performed in the order of (0,0), (0,1), (1,0), (0,2), (1,1), . . . , (3,3). L and U indicate two coefficients adjacent to x. The positions of the coefficients L and U are adjacent to the position of the coefficient x. When no orthogonal transformation is applied, the three positions of the coefficients x, L, and U correspond to three pixel positions, respectively.
[0468] In this case, in the example of Figure 58, the sum of sig_flag of coefficients L and U is used as the context number for encoding sig_flag of coefficient x. That is, three context numbers are selectively used. Also, one fixed context number is used for each of parity_flag and gtX_flag (X in gtX is, for example, 1, 3, 5, 7, or 9).
[0469] That is, in Fig. 58, only one context number is used for coefficient information flags other than sig_flag. Generally, in a block to which orthogonal transformation is not applied, multiple pixels arranged in a horizontal or vertical direction tend to have correlation. However, when only one context number is used, the context number corresponding to this tendency is not selected.
[0470] For example, when gt3_flag is coded, the coefficient with gt3_flag coded among multiple coded coefficients may not exist in the horizontal or vertical line of the coding target coefficient. In this case, there is a high possibility that the value of other gt3_flag coded in the past is different from the value of gt3_flag coded in the coding target. As a result, the appropriate occurrence probability of the value of gt3_flag coded in the coding target is not used, and the compression efficiency may decrease.
[0471] [First example of the fourth aspect of coefficient coding] FIG. 60 is a conceptual diagram showing a plurality of adjacent coefficients according to a first example of the fourth aspect. In FIG. 60, x indicates a coefficient to be coded. x0, x1, and x2 each indicate three coded coefficients adjacent to x. When no orthogonal transform is applied, the four positions of the coefficients x, x0, x1, and x2 each correspond to four pixel positions. In the following, x, x0, x1, and x2 may each indicate a coefficient absolute value, which is the absolute value of the coefficient.
[0472] In this case, based on the three adjacent coefficient absolute values x0, x1, and x2, a predicted value of x, pred, is defined as follows:
[0473]
number
[0474] However, if x is located on a block boundary and therefore has no adjacent pixels, the coefficient of the adjacent pixel is regarded as 0, and pred is calculated.
[0475] When an orthogonal transform is not applied to a block, there is a tendency for edges to exist along the vertical or horizontal direction in the block. Here, an edge is a group of pixels whose pixel values are higher than those of the surrounding pixels. With respect to the above pred, it is assumed that the prediction accuracy is high both when the coefficient x is on an edge and when it is not on an edge. The reason is as follows.
[0476] Fig. 61A is a conceptual diagram showing a coding target coefficient existing at an edge position in the horizontal direction. In Fig. 61A, the shaded portion is an edge, and x is on the edge. In this case, since x1 is equal to or greater than x0, the condition for calculating pred is likely to satisfy conditional expression (3A). In this case, since x1 is equal to or greater than x2, pred=x1. That is, pred for x on the edge is found as x1 on the edge.
[0477] FIG. 61B is a conceptual diagram showing a coding target coefficient existing at an edge position in the vertical direction. In FIG. 61B, pred is obtained as x2 on the edge using the same logic. Specifically, in FIG. 61B, the shaded portion is the edge, and x is on the edge. In this case, since x2 is equal to or greater than x0, the condition for calculating pred is likely to satisfy conditional expression (3A). In this case, since x2 is equal to or greater than x1, pred=x2. That is, pred for x on the edge is obtained as x2 on the edge.
[0478] FIG. 62A is a conceptual diagram showing a coefficient to be coded adjacent to an edge position in the horizontal direction. In FIG. 62A, the shaded portion is the edge, and x is outside the edge. In this case, x0 is on the edge and is larger than x1, so the condition for calculating pred is likely to satisfy conditional expression (3B). In this case, x2 is equal to or larger than x1, so pred=x1. That is, pred for x outside the edge is found to be x1 outside the edge.
[0479] FIG. 62B is a conceptual diagram showing a coding target coefficient adjacent to an edge position in the vertical direction. In the same logic as in FIG. 62B, pred is calculated as x2 outside the edge. Specifically, in FIG. 62B, the shaded portion is the edge, and x is outside the edge. In this case, x0 is on the edge and is larger than x2, so that the condition for calculating pred is likely to satisfy conditional expression (3B). In this case, x1 is equal to or larger than x2, so pred=x2. That is, pred for x outside the edge is calculated as x2 outside the edge.
[0480] In addition, if there is no edge around x, it is assumed that x corresponds to a value that changes smoothly from the pixels x0, x1, and x2. Therefore, as in conditional formula (3C), x1+x2-x0 corresponding to the plane prediction value is obtained as the value of pred.
[0481] In this example, the context number of the sig_flag of the coefficient x is determined based on the above pred. As the syntax for coefficient coding, the syntax of the first example of the third aspect is used, but other syntaxes may be used.
[0482] The minimum value of the coefficient absolute values represented by x0, x1, and x2 adjacent to x is estimated based only on the multiple coefficient information flags processed in the first loop processing. That is, when y0, y1, and y2 are the original coefficient absolute values, the estimated minimum value of x0, x1, and x2 is expressed as follows: Here, a%b represents the remainder when a is divided by b.
[0483]
number
[0484] Using these three values, pred is calculated. pred is a predicted value of the minimum value of x estimated based only on the multiple coefficient information flags processed in the first loop process, specifically, a predicted value of the value of min(x, 11-!(x%2)). And, sig_ctx, which is the context number of sig_flag of coefficient x, is determined as follows.
[0485]
number
[0486] In Fig. 58, in order to determine the context number of sig_flag, three types of context numbers are used by using the two coefficients on the left and top. In this example, two types of context numbers are used by using three coefficients adjacent to the coding target coefficient.
[0487] In this example, the coefficient prediction value pred is obtained by using three coefficients adjacent to the coefficient to be coded. The number of adjacent coefficients for obtaining pred may be other numbers. The three coefficients may be obtained from positions other than those in this example. The method for obtaining pred may be changed. The coefficient absolute values x0, x1, and x2 may be estimated by using all flags in the same loop processing, or may be estimated by using only some flags.
[0488] Also, in the example of Fig. 58, one context number is used for coefficient information flags other than sig_flag. However, for coefficient information flags other than sig_flag, a method similar to this example may be used to selectively use multiple context numbers. For example, parity_ctx and gtX_ctx, which are context numbers of parity_flag and gtX_flag (X in gtX is, for example, 1, 3, 5, 7, or 9) of x, which is a coefficient to be coded, may be derived as follows.
[0489]
number
[0490]
number
[0491] In this example, the context number of each coefficient information flag is selected from two types of context numbers according to the value of pred. The two types of context numbers may be shared by a plurality of different coefficient information flags. In addition, there may be a coefficient information flag whose context number is determined by another determination method. For example, the method of FIG. 58 may be used to determine the context number of sig_flag, and the method of this example may be used to determine the context numbers of other coefficient information flags, or vice versa.
[0492] [Effect of the first example of the fourth aspect of coefficient information encoding] As described above, the prediction accuracy of the coefficient is high for pred. Therefore, for example, by switching the context number depending on whether the predicted value pred for gtX_ctx is larger or smaller than the threshold value X (X of gtX), an appropriate occurrence probability may be used, and the compression rate may be high. Also, for sig_flag, in this example, the compression rate may be high according to the high prediction accuracy of the coefficient, compared with the example using two adjacent coefficients as in Figures 58 and 59.
[0493] [Second Example of Fourth Mode of Coefficient Information Encoding] In a first example of the fourth aspect, in order to select a context number of a coefficient information flag for a coefficient x, a predicted value pred is used which is calculated using the values of multiple types of coefficient information flags which have already been coded within the loop processing in which the coefficient information flag is coded.
[0494] In this example, the value of the coefficient information flag to be coded for the coefficient to be coded is predicted using the values of three coefficient information flags for three coefficients adjacent to the coefficient to be coded, which are the same type as the coefficient information flag to be coded.
[0495] For example, when gt3_flag of x, which is a coefficient to be coded, gt3_flag_pred, which is a predicted value of gt3_flag, is calculated as follows: Here, x0, x1, and x2 are three coefficients adjacent to x, as shown in FIG.
[0496]
number
[0497] Then, gt3_flag_pred is defined as gt3_ctx, which is the context number of gt3_flag of coefficient x.
[0498]
number
[0499] In this example, the three gt3_flag values of the three adjacent coefficients used in the prediction and the predicted value gt3_flag_pred are each 0 or 1. Therefore, gt3_flag_pred is expressed only by bit operations as follows.
[0500]
number
[0501] Similarly, for each of sig_flag, parity_flag, gt1_flag, gt5_flag, gt7_flag, and gt9_flag, a predicted value of the coefficient information flag is obtained by the above-mentioned method. Then, a context number is determined.
[0502] In addition, the number of coefficients used for predicting the coefficient information flag may be changed, the positions of the coefficients may be changed, the prediction method of the coefficient information flag may be changed, and the number of candidates for the context number of the coefficient information flag may be increased.
[0503] [Effect of the second example of the fourth aspect of coefficient coding] In the prediction of the coefficient information flag in the second example of the fourth embodiment, the prediction accuracy may be high both when the coefficient is on an edge and when it is not on an edge, similar to the prediction of the coefficient information flag in the first example of the fourth embodiment. As a result, the compression ratio of cabac may be high.
[0504] Furthermore, since the predicted value of the coefficient information flag is found by only bit operations, the amount of processing can be reduced compared to the calculation of pred in the first example of the fourth aspect.
[0505] [Third example of the fourth aspect of coefficient coding] This example also relates to a processing flow in the case where orthogonal transform is not applied in the example of Fig. 47. As a syntax for coefficient coding, the first example of the third aspect, that is, the syntax of the example of Fig. 56 is used, but other syntax may be used. In the example of Fig. 56, remainder, which is the remainder of the coefficient not represented by the coefficient information flag, is coded by Golomb-Rice code. The explanation of remainder is as described in the first aspect of coefficient coding.
[0506] In this example, the Rice parameter used in Golomb-Rice coding is selected using pred, which is a value predicted using three coefficients adjacent to the coefficient to be coded, as described in the first example of the fourth aspect.
[0507] First, an overview of Golomb-Rice coding will be described. A method called Golomb-Rice coding is used to code the remainder. In Golomb-Rice coding, the value of the remainder is binarized using a prefix and a suffix.
[0508] Rice coding is used for the prefix. The coding method is switched by a Rice parameter g (g has three values, for example, 0, 1, or 2). Unary coding and exponential-Golomb coding are used for the suffix.
[0509] Fig. 63 is a conceptual diagram showing the correspondence between the remainder and the Golomb-Rice code according to the third example of the fourth aspect. Specifically, Fig. 63 shows the coding bins of the prefix and the suffix when the remainder is coded by the Golomb-Rice coding according to the value of the Rice parameter.
[0510] Here, x indicates a coefficient to be coded. x may indicate the absolute value of the coefficient. remainder[x] indicates the remainder of x in the processing flow of FIG. 49. remainder[x0], remainder[x1], and remainder[x2] respectively indicate the three remainders of the three coefficients adjacent to x in FIG. 60.
[0511] Also, if any of the three coefficients adjacent to the coefficient to be coded is represented by one or more coefficient information flags, that is, if no remainder occurs, the remainder of the coefficient may be represented as 0. Then, the predicted value remainder_pred of remainder[x] is defined as follows:
[0512]
number
[0513] Then, the Rice parameter r used in the Golomb-Rice coding of remainder[x] is derived as follows:
[0514]
number
[0515] In this case, the Rice parameter table may be defined, for example, as follows:
[0516]
number
[0517] In addition, the number of coefficients used for predicting remainder[x] may be changed, or the position of the coefficients used for predicting remainder[x] may be changed. The method for calculating remainder_pred may be changed. Also, the value of the Rice parameter table may be changed. A calculation method different from the above-mentioned calculation method of the Rice parameter may be used. The third example of the fourth aspect may be used in combination with the first example of the fourth aspect, the second example of the fourth aspect, or other aspects.
[0518] Furthermore, remainder_pred may be derived based on the absolute value of a coefficient adjacent to the coefficient to be coded, as in the first example of the fourth aspect, instead of the remainder of the coefficient adjacent to the coefficient to be coded.
[0519] Specifically, remainder_pred, which is a predicted value of x, may be calculated based on three absolute values x0, x1, and x2 of three coefficients adjacent to the coefficient to be coded, in a manner similar to that described with reference to Fig. 60. Then, remainder_pred may be used to derive the Rice parameter in the manner described above.
[0520] In the above case, remainder_pred is larger because it is based on the absolute value of the coefficient, not the remainder of the coefficient. Therefore, the Rice parameter table may be designed such that the Rice parameter for remainder_pred based on the absolute value is smaller compared to the Rice parameter for remainder_pred based on the remainder.
[0521] Alternatively, remainder_pred may be converted to remainder_pred', for example, as follows: Then, the same table as the table for deriving Rice parameters for remainder_pred based on remainder may be used as the table for deriving Rice parameters for remainder_pred'.
[0522]
number
[0523] [Effect of the third example of the fourth aspect of coefficient coding] In the prediction of the remainder in the third example of the fourth aspect, as in the prediction of the coefficient information flag in the first example of the fourth aspect, the prediction accuracy can be high both when the coefficient is on an edge and when it is not on an edge.
[0524] Also, for example, the Rice parameter table is designed so that the code length of remainder encoded by Golomb-Rice encoding using the Rice parameter obtained according to remainder_pred substituted into the Rice parameter table is the shortest. Therefore, there is a possibility that the code length of remainder encoded by Golomb-Rice encoding using this Rice parameter will actually be the shortest.
[0525] [Fifth aspect of coefficient coding] Fig. 64 is a flowchart showing a basic coefficient coding method according to the fifth aspect. Specifically, Fig. 64 shows a coefficient coding method for a region in which a prediction residual is obtained by intra coding or inter coding.
[0526] The example in Figure 64 differs from the example in Figure 47 in that, when orthogonal transform is applied, 16 coefficients in a sub-block are coded by the third coding scheme (S147b). That is, in the example in Figure 64, when orthogonal transform is applied to a block, coding device 100 codes 16 coefficients in a sub-block by the third coding scheme described below, instead of the first coding scheme shown in Figure 48 (S147b).
[0527] Fig. 65 is a flowchart showing details of the third encoding method shown in Fig. 64. In the third encoding method, a plurality of coefficients in a sub-block are encoded. In this case, a first loop process (S151 to S156) is performed for each coefficient information flag of each coefficient in the sub-block, and a second loop process (S161 to S165) is performed for each coefficient in the sub-block.
[0528] In the first loop process (S151 to S156), one or more coefficient information flags are sequentially coded, similarly to the first coding method shown in Fig. 48. The one or more coefficient information flags may include sig_flag, gt1_flag, parity_flag, and gt3_flag. Then, one or more coefficient information flags are sequentially coded by CABAC coding within a range in which CCB does not exceed thres, and CCB is counted up by one each time coding is performed. After CCB exceeds thres, the coefficient information flags are not coded.
[0529] In the second loop process (S161 to S165), for coefficients whose coefficient information flags have been coded, the remainder, which is a residual value not expressed by the coefficient information flag (i.e., a residual value for reconstructing the value of a coefficient using the coefficient information flag), is coded by Golomb-Rice coding. Coefficients whose coefficient information flags have not been coded are coded by Golomb-Rice coding (S164b) after passing through a conversion process (S164a) described later. Note that the remainder may be coded by using another coding method instead of Golomb-Rice coding.
[0530] That is, in the second loop process (S161 to S165), similarly to the first encoding method shown in Fig. 48, the encoding device 100 determines whether or not the coefficient information flag corresponding to the coefficient to be processed has been encoded (S162). Then, if the coefficient information flag has been encoded (Yes in S162), the encoding device 100 encodes the remainder by Golomb-Rice encoding (S163).
[0531] In the third encoding method shown in Fig. 65, if the coefficient information flag is not encoded (No in S162), the encoding device 100 applies a conversion process called zeropos processing or poszero processing (to be described later) to the value of the coefficient (S164a). After that, the encoding device 100 encodes the value of the coefficient by Golomb-Rice encoding (S164b).
[0532] Note that, although the number of loop processes is two here, the number of loop processes may be different from two.
[0533] Next, an example of the above-mentioned conversion process (S164a) will be described with reference to FIGS.
[0534] Fig. 66 is a conceptual diagram showing a plurality of peripheral coefficients according to the fifth aspect. In this example, the coefficient scan is performed diagonally from the lower right of the 4x4 subblock shown in Fig. 66. Specifically, in a coordinate system in which the upper left is expressed as (0,0), the upper right as (3,0), the lower left as (0,3), and the lower right as (3,3), the coefficient scan is performed in the order of (3,3), (3,2), (2,3), (3,1), (2,2), ..., (0,0).
[0535] Also, a indicates the coefficient to be coded (i.e., processed). a0, a1, a2, a3, and a4 indicate five coded (i.e., processed) coefficients around the coefficient a. Also, in the following, a, a0, a1, a2, a3, and a4 may indicate the value of a coefficient, and more specifically, may indicate the coefficient absolute value, which is the absolute value of the coefficient.
[0536] The encoding device 100 obtains sum, which is the sum of the absolute values of the five coefficients a0, a1, a2, a3, and a4. The encoding device 100 then determines a value called poszero according to sum. For example, the encoding device 100 may determine poszero corresponding to sum by referring to a lookup table.
[0537] Next, encoding device 100 compares value a with poszero. Encoding device 100 then converts value a to value b, which is determined as follows.
[0538]
number
[0539] Finally, the encoding device 100 encodes the value b obtained by converting the value a using Golomb-Rice coding.
[0540] Fig. 67 is a conceptual diagram showing the conversion process according to the fifth aspect. In the example of Fig. 67, poszero is 4. When value a is 0, value b is poszero (i.e. 4). When value a is greater than 0 and less than or equal to poszero (i.e. 4 or less), value b is a-1. When value a is greater than poszero (i.e. greater than 4), value b is value a. In this way, value b is uniquely determined by value a.
[0541] 67, when the value b is determined, the value a is uniquely determined. Therefore, the decoding device 200 may decode the value b by Golomb-Rice decoding and convert the decoded value b into the value a. For example, the decoding device 200 may derive the value a by converting the value b into the value a determined as follows.
[0542]
number
[0543] In addition, the multiple peripheral coefficients for determining poszero are not limited to the above five coefficients. As the peripheral coefficients for determining poszero, coefficients at positions different from the above five coefficients may be used. In addition, to determine poszero, multiple peripheral coefficients of six or more may be used, multiple peripheral coefficients of four or less may be used, or only one peripheral coefficient may be used. For example, poszero may be determined according to the sum of the absolute values of two coefficients a3 and a4.
[0544] Also, poszero may be determined according to sum and other information other than sum.
[0545] In the example of Fig. 66, the positions of the peripheral coefficients for determining poszero are determined according to the order of scanning from the bottom right. However, if the order of scanning is reversed, the positions of the peripheral coefficients for determining poszero may be reversed.
[0546] Generally, in an area where an orthogonal transform is applied, when the CCB exceeds the limit, the rate at which zero coefficients appear is reduced compared to when the CCB does not exceed the limit. Therefore, if the value of a coefficient is greater than 0 and less than or equal to poszero, a process of subtracting 1 from the value is performed. This reduces the amount of code generated by the subsequent Golomb-Rice coding. As a result, the coding efficiency is improved.
[0547] Next, an example of Golomb-Rice coding (S164b) of coefficients to which the transform process (S164a) has been applied will be described with reference to Fig. 66. For example, in the Golomb-Rice coding (S164b), five peripheral coefficients a0, a1, a2, a3, and a4 are used, similarly to the transform process (S164a).
[0548] Specifically, the encoding device 100 obtains sum, which is the sum of absolute values of five coefficients a0, a1, a2, a3, and a4. Then, the encoding device 100 determines the Rice parameter r according to sum. For example, the encoding device 100 may determine the Rice parameter r corresponding to sum by referring to a lookup table.
[0549] The encoding device 100 encodes the value b by Golomb-Rice encoding described with reference to Fig. 63. At that time, the encoding device 100 uses the Rice parameter r determined according to sum for the Golomb-Rice encoding.
[0550] In addition, the multiple peripheral coefficients for determining the Rice parameter r are not limited to the above five coefficients. As the peripheral coefficients for determining the Rice parameter r, coefficients at positions different from the above five coefficients may be used. In addition, to determine the Rice parameter r, multiple peripheral coefficients of six or more may be used, multiple peripheral coefficients of four or less may be used, or only one peripheral coefficient may be used. For example, the Rice parameter r may be determined according to the sum of the absolute values of the two coefficients a3 and a4.
[0551] In addition, the multiple marginal coefficients for determining the Rice parameter r may be the same as or different from the multiple marginal coefficients for determining poszero.
[0552] The Rice parameter r may also be determined according to sum and other information other than sum.
[0553] In the example of Fig. 66, the positions of the peripheral coefficients for determining the Rice parameter r are determined according to the scanning order performed from the bottom right. However, if the scanning order is reversed, the positions of the peripheral coefficients for determining the Rice parameter r may be reversed.
[0554] In general, in an area where an orthogonal transform is applied, the coefficient values tend to increase from the high frequency side to the low frequency side. Therefore, by determining the Rice parameter r for coding the coefficients by Golomb-Rice coding according to the values of the surrounding coefficients, it is possible to improve the coding efficiency.
[0555] [First example of the fifth aspect of coefficient coding] Fig. 68 is a flowchart showing a coefficient coding method according to a first example of the fifth aspect. Specifically, Fig. 68 shows a coefficient coding method for a region in which a prediction residual is obtained by intra coding or inter coding.
[0556] The example in Figure 68 differs from the example in Figure 64 in that, when orthogonal transform is not applied, 16 coefficients in a sub-block are coded by the third coding scheme (S127b). That is, in the example in Figure 68, even when orthogonal transform is not applied to a block, coding device 100 codes 16 coefficients in a sub-block by the above-mentioned third coding scheme, not by the second coding scheme shown in Figure 49 (S127b).
[0557] In addition, the syntax for coding the coefficient information flag in the first loop process in Fig. 65 may be different depending on whether or not the orthogonal transform is applied. For example, some or all of one or more coefficient information flags in the case where the orthogonal transform is applied may be different from one or more coefficient information flags in the case where the orthogonal transform is not applied.
[0558] [Effect of the first example of the fifth aspect of coefficient coding] According to the example of Fig. 68, even if the coding syntax of the coefficient information flag differs depending on whether or not an orthogonal transform is performed, the coding syntax of the 16 coefficients in the sub-block may be common after the CCB exceeds thres, regardless of whether or not an orthogonal transform is performed. This may allow some circuits to be shared between the case where an orthogonal transform is applied and the case where an orthogonal transform is not applied, and may reduce the circuit scale.
[0559] In addition, a part of the coding process (S127b and S147b) of the 16 coefficients in the sub-block may be different between the case where the orthogonal transform is applied and the case where the orthogonal transform is not applied. For example, the number of peripheral coefficients used to calculate poszero and the Rice parameter r in the coding process (S127b and S147b) of the 16 coefficients in the sub-block may be different between the case where the orthogonal transform is applied and the case where the orthogonal transform is not applied.
[0560] In addition, the number of marginal coefficients used in the calculation of poszero may be different from the number of marginal coefficients used in the calculation of the Rice parameter r.
[0561] In addition, the positions of the peripheral coefficients used in the calculation of poszero and the Rice parameter r may be determined according to the respective scan orders when the orthogonal transform is applied and when the orthogonal transform is not applied. For example, when the scan orders are different, the positions of the peripheral coefficients used in the calculation of poszero and the Rice parameter r may be different.
[0562] [Second example of the fifth aspect of coefficient coding] Fig. 69 is a flowchart showing a coefficient coding method according to a second example of the fifth aspect. Specifically, Fig. 69 shows a coefficient coding method for a region in which a prediction residual is obtained by intra coding or inter coding.
[0563] The example in Figure 69 differs from the example in Figure 64 in that when orthogonal transform is not applied, 16 coefficients in a sub-block are coded by the first coding scheme (S127a). That is, in the example in Figure 69, when orthogonal transform is not applied to a block, coding device 100 codes 16 coefficients in a sub-block by the first coding scheme shown in Figure 48, not by the second coding scheme or the third coding scheme (S127a).
[0564] For example, in the third encoding method, the conversion process (S164a) shown in Fig. 65 is performed. On the other hand, in the first encoding method, the conversion process (S164a) shown in Fig. 65 is not performed. In this respect, the first encoding method differs from the third encoding method. Except for this, the first encoding method may be the same as the third encoding method.
[0565] In addition, the syntax for coding the coefficient information flag in each of the first loop processes in Figures 48 and 65 may be different depending on whether or not the orthogonal transform is applied. For example, some or all of one or more coefficient information flags in the case where the orthogonal transform is applied may be different from one or more coefficient information flags in the case where the orthogonal transform is not applied.
[0566] [Effect of the second example of the fifth aspect of coefficient coding] In the example of Fig. 69, the coding syntax of the coefficient information flag may be different depending on whether or not orthogonal transform is applied. On the other hand, regardless of whether orthogonal transform is applied, the coding syntax of 16 coefficients in a subblock after CCB exceeds thres may be common except for poszero processing. This may allow some circuits to be shared between the case where orthogonal transform is applied and the case where orthogonal transform is not applied, and may reduce the circuit scale.
[0567] In general, when an orthogonal transform is applied, the poszero process is effective in improving the coding efficiency. On the other hand, when an orthogonal transform is not applied, the poszero process is not so effective in improving the coding efficiency. Therefore, when an orthogonal transform is not applied, the poszero process does not need to be performed. This may improve the processing efficiency and coding efficiency.
[0568] In addition, the number of peripheral coefficients used to calculate poszero and the Rice parameter r in the third encoding method may be different between the case where the orthogonal transform is applied and the case where the orthogonal transform is not applied. Also, the number of peripheral coefficients used to calculate poszero may be different from the number of peripheral coefficients used to calculate the Rice parameter r.
[0569] In addition, the positions of the peripheral coefficients used in the calculation of poszero and the Rice parameter r may be determined according to the respective scan orders when the orthogonal transform is applied and when the orthogonal transform is not applied. For example, when the scan orders are different, the positions of the peripheral coefficients used in the calculation of poszero and the Rice parameter r may be different.
[0570] [Modification of coefficient coding] Any of the above-mentioned multiple aspects and any of the above-mentioned multiple examples of coefficient coding may be combined. Also, any of the above-mentioned multiple aspects and multiple examples of coefficient coding and any of the above-mentioned multiple combinations may be applied to a luminance block or a chrominance block. In this case, different thres may be used for the luminance block and the chrominance block.
[0571] Also, for a block to which orthogonal transformation is not applied and to which BDPCM (Block-based Delta Pulse Code Modulation) is applied, any of the above-mentioned multiple aspects, multiple examples, and multiple combinations of these may be used. In a block to which BDPCM is applied, the amount of information is reduced by subtracting each residual signal in the block from the residual signal adjacent vertically or horizontally to the residual signal.
[0572] Furthermore, for blocks to which BDPCM is applied, that is, chrominance blocks, any of the above-mentioned multiple aspects, multiple examples, and any multiple combinations thereof regarding coefficient encoding may be used.
[0573] Also, for a block to which ISP (Intra Sub-Partitions) is applied, any of the above-mentioned multiple aspects, multiple examples, and multiple combinations of these may be used. In ISP, an intra block is divided vertically or horizontally, and intra prediction of each sub block is performed using pixel values of sub blocks adjacent to the sub block.
[0574] Furthermore, for a block to which the ISP is applied, that is, a chrominance block, any of the above-described multiple aspects, multiple examples, and any multiple combinations thereof regarding coefficient encoding may be used.
[0575] In addition, when chroma joint coding is used as the coding mode of the chroma block, any of the above-mentioned multiple aspects, multiple examples, and multiple arbitrary combinations thereof may be used. Here, chroma joint coding is a coding method that derives a Cr value from a Cb value.
[0576] Furthermore, the value of thres when the orthogonal transform is applied may be twice the value of thres when the orthogonal transform is not applied. Alternatively, the value of thres when the orthogonal transform is not applied may be twice the value of thres when the orthogonal transform is applied.
[0577] Furthermore, only when chrominance joint coding is used, the value of thres of the CCB when orthogonal transform is applied may be twice the value of thres of the CCB when orthogonal transform is not applied. Alternatively, only when chrominance joint coding is used, the value of thres of the CCB when orthogonal transform is not applied may be twice the value of thres of the CCB when orthogonal transform is applied.
[0578] In addition, in the above-mentioned aspects and examples of coefficient coding, the scan order of multiple coefficients in a block to which no orthogonal transformation is applied may be the same as the scan order of multiple coefficients in a block to which an orthogonal transformation is applied.
[0579] Also, in the third aspect and the examples of the third aspect, some examples of syntax are shown, but the syntax applied is not limited to these examples.For example, in the aspects different from the third aspect and the examples thereof, a syntax different from any of the syntaxes shown in the third aspect and the examples thereof may be used.Various syntaxes for encoding 16 coefficients may be applied.
[0580] In addition, although a process flow of encoding is shown in multiple aspects and multiple examples of coefficient encoding, a process flow of decoding is basically the same as the process flow of encoding, except for whether a bit stream is sent or received. For example, the decoding device 200 may perform inverse orthogonal transform and decoding corresponding to the orthogonal transform and encoding performed by the encoding device 100.
[0581] Furthermore, the flowcharts relating to the multiple aspects and examples of coefficient coding are merely examples. For each flowchart, new conditions or processes may be added, conditions or processes may be deleted, or conditions or processes may be changed.
[0582] Here, the coefficients are values constituting an image such as a block or sub-block. Specifically, the coefficients constituting the image may be obtained from the pixel values of the image through an orthogonal transform. The coefficients constituting the image may be obtained from the pixel values of the image without an orthogonal transform. That is, the coefficients constituting the image may be the pixel values of the image themselves. Each pixel value may be a pixel value of the original image or a value of a prediction residual. The coefficients may be quantized.
[0583] [Typical examples of configuration and processing] A representative example of the configuration and processing of the encoding device 100 and the decoding device 200 shown above will be described below.
[0584] Fig. 70 is a flowchart showing the operation of the encoding device 100. For example, the encoding device 100 includes a circuit and a memory connected to the circuit. The circuit and memory included in the encoding device 100 may correspond to the processor a1 and memory a2 shown in Fig. 40. The circuit of the encoding device 100 performs the operation shown in Fig. 70. Specifically, in the operation, the circuit of the encoding device 100 encodes a block of an image (S211).
[0585] For example, the circuitry of the encoding device 100 may code a block of an image using a limited number of context adaptive coding operations.
[0586] In addition, in both cases where an orthogonal transform is applied to a block and where an orthogonal transform is not applied to a block, if the number of processes is within a limited range, the coefficient information flag may be coded by context adaptive coding. In addition, in both cases, if the number of processes is not within the limited range, coding of the coefficient information flag may be skipped. Here, the coefficient information flag indicates an attribute of a coefficient included in the block.
[0587] In both of these cases, when the coefficient information flag is coded, the residual value information may be coded by Golomb-Rice coding. Here, the residual value information is information for reconstructing the value of the coefficient using the coefficient information flag.
[0588] In addition, when an orthogonal transform is applied to a block, if the coding of the coefficient information flag is skipped, the transform process may be performed and the coefficient values may be coded by Golomb-Rice coding. In addition, when an orthogonal transform is not applied to a block, if the coding of the coefficient information flag is skipped, the transform process may not be performed and the coefficient values may be coded by Golomb-Rice coding.
[0589] Here, the transformation process is a process of transforming the value of a coefficient using a value determined using surrounding coefficients, where the surrounding coefficients are coefficients located in the vicinity of the position of the coefficient in the block.
[0590] As a result, regardless of whether orthogonal transform is applied, the coding of the coefficient information flag may be skipped according to the limit of the number of processing times of the context adaptive coding. Therefore, the increase in processing delay may be suppressed, and the increase in the amount of code may be suppressed. In addition, the difference between the coding method used for the block to which the orthogonal transform is applied and the coding method used for the block to which the orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.
[0591] Furthermore, by appropriately controlling whether or not to convert the coefficient value using the peripheral coefficients, it is possible to suppress an increase in processing delay and an increase in the amount of code.
[0592] Furthermore, the coefficient information flag may be a flag indicating whether or not the coefficient value is greater than 1. As a result, regardless of whether or not the orthogonal transform is applied, coding of the coefficient information flag indicating whether or not the coefficient value is greater than 1 may be skipped according to the limit on the number of times the context adaptive coding is processed. Therefore, an increase in processing delay may be suppressed, and an increase in the amount of code may be suppressed.
[0593] The conversion process may also include replacing the coefficient value with a value determined using the surrounding coefficients when the coefficient value is 0, and decreasing the coefficient value by subtracting 1 from the coefficient value when the coefficient value is greater than 0 and equal to or less than the value determined using the surrounding coefficients. This allows the coefficient value to be appropriately converted according to the surrounding coefficients, and may suppress an increase in the amount of code.
[0594] The above operations performed by the circuits of the encoding device 100 may be performed by the entropy coding unit 110 of the encoding device 100.
[0595] Fig. 71 is a flowchart showing the operation of the decoding device 200. For example, the decoding device 200 includes a circuit and a memory connected to the circuit. The circuit and memory included in the decoding device 200 may correspond to the processor b1 and memory b2 shown in Fig. 46. The circuit of the decoding device 200 performs the operation shown in Fig. 71. Specifically, in the operation, the circuit of the decoding device 200 decodes a block of an image (S221).
[0596] For example, the circuitry of the decoding device 200 may decode blocks of an image by limiting the number of times the context adaptive decoding process is performed.
[0597] Then, in both cases where the inverse orthogonal transform is applied to the block and where the inverse orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of times of processing, the coefficient information flag may be decoded by context adaptive decoding. Also, in both cases, if the number of times of processing is not within the limited range of the number of times of processing, the decoding of the coefficient information flag may be skipped. Here, the coefficient information flag indicates the attribute of the coefficient included in the block.
[0598] In both of these cases, when the coefficient information flag is decoded, the residual value information may be decoded by Golomb-Rice decoding. Here, the residual value information is information for reconstructing the value of the coefficient using the coefficient information flag. Also, the value of the coefficient may be derived using the coefficient information flag and the residual value information.
[0599] Furthermore, in the case where an inverse orthogonal transform is applied to a block, if the decoding of the coefficient information flag is skipped, the coefficient value may be decoded by Golomb-Rice decoding. Then, a transform process may be performed to derive the coefficient value. In the case where an inverse orthogonal transform is not applied to a block, if the decoding of the coefficient information flag is skipped, the coefficient value may be decoded by Golomb-Rice decoding. Then, the coefficient value may be derived without performing a transform process.
[0600] Here, the transformation process is a process of transforming the value of a coefficient using a value determined using surrounding coefficients, where the surrounding coefficients are coefficients located in the vicinity of the position of the coefficient in the block.
[0601] As a result, regardless of whether inverse orthogonal transform is applied, the decoding of coefficient information flags may be skipped according to the limit of the number of processing times of context adaptive decoding. Therefore, the increase in processing delay may be suppressed, and the increase in the amount of code may be suppressed. In addition, the difference between the decoding method used for the block to which inverse orthogonal transform is applied and the decoding method used for the block to which inverse orthogonal transform is not applied may be reduced, and the circuit scale may be reduced.
[0602] Furthermore, by appropriately controlling whether or not to convert the coefficient value using the peripheral coefficients, it is possible to suppress an increase in processing delay and an increase in the amount of code.
[0603] Furthermore, the coefficient information flag may be a flag indicating whether or not the coefficient value is greater than 1. As a result, regardless of whether the inverse orthogonal transform is applied, the decoding of the coefficient information flag indicating whether or not the coefficient value is greater than 1 may be skipped according to the limit on the number of times the context adaptive decoding is performed. Therefore, an increase in the processing delay may be suppressed, and an increase in the amount of code may be suppressed.
[0604] The conversion process may also include replacing the value of a coefficient with 0 when the value of the coefficient is equal to the value determined using the surrounding coefficients, and increasing the value of the coefficient by adding 1 when the value of the coefficient is smaller than the value determined using the surrounding coefficients. This allows the value of the coefficient to be appropriately converted according to the surrounding coefficients, and may suppress an increase in the amount of code.
[0605] The above operations performed by the circuits of the decoding device 200 may be performed by the entropy decoding unit 202 of the decoding device 200.
[0606] [Other examples] The encoding device 100 and the decoding device 200 in each of the above-mentioned examples may be used as an image encoding device and an image decoding device, or as a video encoding device and a video decoding device, respectively.
[0607] Furthermore, the encoding device 100 and the decoding device 200 may perform only some of the above-described operations, and other devices may perform other operations. Furthermore, the encoding device 100 and the decoding device 200 may include only some of the above-described components, and other devices may include other components.
[0608] Furthermore, at least a part of the above-described examples may be used as an encoding method or a decoding method, or may be used as another method.
[0609] Each component may be implemented by dedicated hardware or by executing a software program suitable for each component. Each component may be implemented by a program execution unit such as a CPU or processor reading and executing a software program recorded on a recording medium such as a hard disk or semiconductor memory.
[0610] Specifically, each of the encoding device 100 and the decoding device 200 may include a processing circuitry and a storage device electrically connected to and accessible from the processing circuitry. For example, the processing circuitry corresponds to the processor a1 or b1, and the storage device corresponds to the memory a2 or b2.
[0611] The processing circuit includes at least one of dedicated hardware and a program execution unit, and executes processing using a storage device. In addition, when the processing circuit includes a program execution unit, the storage device stores a software program to be executed by the program execution unit.
[0612] Here, the software for realizing the above-described encoding device 100 or decoding device 200 is a program such as the following.
[0613] For example, this program may cause a computer to execute an encoding method in which the computer encodes a block of an image by limiting the number of times of context adaptive encoding, and in encoding the block, in both a case where an orthogonal transform is applied to the block and a case where an orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, encoding a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive encoding, and if the number of times of processing is not within the limited range of the number of processing, skipping encoding of the coefficient information flag, and if the coefficient information flag has been encoded, encoding residual value information for reconstructing a value of the coefficient using the coefficient information flag by Golomb-Rice coding, and if an orthogonal transform is applied to the block and encoding of the coefficient information flag is skipped, performing a transform process to transform a value of the coefficient using a value determined using surrounding coefficients that are coefficients in the vicinity of a position of the coefficient in the block and encoding the value of the coefficient by Golomb-Rice coding, and if an orthogonal transform is not applied to the block and encoding of the coefficient information flag is skipped, encoding the value of the coefficient by Golomb-Rice coding without performing the transform process.
[0614] Furthermore, for example, this program causes a computer to decode a block of an image by limiting the number of times of context adaptive decoding, and in decoding the block, in both a case where an inverse orthogonal transform is applied to the block and a case where an inverse orthogonal transform is not applied to the block, if the number of times of processing is within the limited range of the number of processing, decode a coefficient information flag indicating an attribute of a coefficient included in the block by context adaptive decoding, if the number of times of processing is not within the limited range of the number of processing, skip decoding the coefficient information flag, and if the coefficient information flag has been decoded, decode residual value information for reconstructing a value of the coefficient using the coefficient information flag by Golomb-Rice decoding. the coefficient information flag and the residual value information are used to derive the value of the coefficient; if an inverse orthogonal transform is applied to the block and the decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding; and a transform process is performed to transform the value of the coefficient using a value determined using surrounding coefficients that are coefficients in the vicinity of the position of the coefficient in the block, thereby deriving the value of the coefficient; if an inverse orthogonal transform is not applied to the block and the decoding of the coefficient information flag is skipped, the value of the coefficient is decoded by Golomb-Rice decoding, and the value of the coefficient is derive without performing the transform process.
[0615] Also, each component may be a circuit, as described above. These circuits may form one circuit as a whole, or each may be a separate circuit. Also, each component may be realized by a general-purpose processor, or a dedicated processor.
[0616] Furthermore, a process executed by a specific component may be executed by another component. The order in which the processes are executed may be changed, or multiple processes may be executed in parallel. Furthermore, the encoding / decoding device may include the encoding device 100 and the decoding device 200.
[0617] In addition, the ordinal numbers such as first and second used in the description may be changed as appropriate. Furthermore, new ordinal numbers may be given to components, etc., or ordinal numbers may be removed.
[0618] Although the aspects of the encoding device 100 and the decoding device 200 have been described based on a number of examples, the aspects of the encoding device 100 and the decoding device 200 are not limited to these examples. As long as they do not deviate from the spirit of the present disclosure, the scope of the aspects of the encoding device 100 and the decoding device 200 may include various modifications conceivable by a person skilled in the art to each example, or configurations constructed by combining components in different examples.
[0619] One or more aspects disclosed herein may be implemented in combination with at least a part of other aspects in the present disclosure. Also, some processes shown in the flowcharts of one or more aspects disclosed herein, some configurations of devices, some syntax, etc. may be implemented in combination with other aspects.
[0620] [Implementation and Application] In each of the above embodiments, each of the functional or operational blocks can usually be realized by an MPU (micro processing unit) and a memory, etc. Furthermore, the processing by each of the functional blocks may be realized as a program execution unit such as a processor that reads and executes software (programs) recorded on a recording medium such as a ROM. The software may be distributed. The software may be recorded on various recording media such as semiconductor memories. It is also possible to realize each functional block by hardware (dedicated circuitry). Various combinations of hardware and software may be adopted.
[0621] The processing described in each embodiment may be realized by centralized processing using a single device (system), or may be realized by distributed processing using multiple devices. Also, the processor that executes the above program may be single or multiple. That is, centralized processing or distributed processing may be performed.
[0622] The aspects of the present disclosure are not limited to the above-described examples, and various modifications are possible, which are also included within the scope of the aspects of the present disclosure.
[0623] Further, here, application examples of the video coding method (image coding method) or video decoding method (image decoding method) shown in each of the above embodiments and various systems implementing the application examples will be described. Such a system may be characterized by having an image coding device using the image coding method, an image decoding device using the image decoding method, or an image coding / decoding device including both. Other configurations of such a system can be appropriately changed depending on the case.
[0624] [Usage example] 72 is a diagram showing the overall configuration of an appropriate content supply system ex100 for realizing a content distribution service. The area where communication services are provided is divided into cells of a desired size, and base stations ex106, ex107, ex108, ex109, and ex110, which are fixed wireless stations in the illustrated example, are installed in each cell.
[0625] In this content supply system ex100, devices such as a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, and a smartphone ex115 are connected to the Internet ex101 via an Internet service provider ex102 or a communication network ex104, and base stations ex106 to ex110. The content supply system ex100 may be configured to connect any of the above devices in combination. In various implementations, the devices may be directly or indirectly connected to each other via a telephone network or short-distance wireless communication, etc., without the base stations ex106 to ex110. Furthermore, the streaming server ex103 may be connected to devices such as the computer ex111, the game machine ex112, the camera ex113, the home appliance ex114, and the smartphone ex115 via the Internet ex101, etc. Furthermore, the streaming server ex103 may be connected to a terminal in a hotspot in an airplane ex117, etc., via a satellite ex116.
[0626] Instead of the base stations ex106 to ex110, wireless access points or hot spots may be used. The streaming server ex103 may be directly connected to the communication network ex104 without going through the Internet ex101 or the Internet service provider ex102, or may be directly connected to an airplane ex117 without going through a satellite ex116.
[0627] The camera ex113 is a device capable of taking still images and videos, such as a digital camera. The smartphone ex115 is a smartphone, a mobile phone, or a PHS (Personal Handy-phone System) that supports the mobile communication system, such as 2G, 3G, 3.9G, 4G, and 5G in the future.
[0628] The home appliance ex114 is a refrigerator, or an appliance included in a home fuel cell cogeneration system.
[0629] In the content supply system ex100, a terminal having a photographing function is connected to a streaming server ex103 via a base station ex106 or the like, thereby enabling live distribution or the like. In live distribution, a terminal (such as a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, a smartphone ex115, and a terminal in an airplane ex117) may perform the encoding process described in each of the above embodiments on still image or video content photographed by a user using the terminal, may multiplex the video data obtained by encoding with sound data obtained by encoding sound corresponding to the video, and may transmit the obtained data to the streaming server ex103. That is, each terminal functions as an image encoding device according to one aspect of the present disclosure.
[0630] Meanwhile, the streaming server ex103 streams the transmitted content data to the requesting client. The client is a computer ex111, a game machine ex112, a camera ex113, a home appliance ex114, a smartphone ex115, a terminal in an airplane ex117, or the like, capable of decoding the encoded data. Each device that receives the distributed data may decode and play the received data. That is, each device may function as an image decoding device according to one aspect of the present disclosure.
[0631] [Distributed processing] The streaming server ex103 may be a plurality of servers or computers that process, record, and distribute data in a distributed manner. For example, the streaming server ex103 may be realized by a CDN (Contents Delivery Network), and content distribution may be realized by a network that connects a large number of edge servers distributed around the world. In the CDN, a physically close edge server may be dynamically assigned according to the client. The content is cached and distributed to the edge server, thereby reducing delays. In addition, when some types of errors occur or communication conditions change due to an increase in traffic, processing can be distributed among multiple edge servers, the distribution entity can be switched to another edge server, or distribution can be continued by bypassing the part of the network where a failure has occurred, thereby realizing high-speed and stable distribution.
[0632] In addition to the distributed processing of the distribution itself, the encoding processing of the captured data may be performed by each terminal, may be performed by the server side, or may be shared among the terminals. As an example, in the encoding processing, a processing loop is generally performed twice. In the first loop, the complexity of the image or the amount of code is detected for each frame or scene. In the second loop, processing is performed to maintain the image quality and improve the encoding efficiency. For example, the terminal performs the first encoding processing, and the server side that receives the content performs the second encoding processing, thereby improving the quality and efficiency of the content while reducing the processing load on each terminal. In this case, if there is a request to receive and decode almost in real time, the data encoded once by the terminal can be received and played back by other terminals, making it possible to perform more flexible real-time distribution.
[0633] As another example, the camera ex113 etc. extracts features (amount of features or characteristics) from an image, compresses data related to the features as metadata, and transmits the compressed data to the server. The server performs compression according to the meaning of the image (or the importance of the content), for example by determining the importance of an object from the features and switching the quantization precision. The feature data is particularly effective in improving the accuracy and efficiency of motion vector prediction when the server recompresses the image. Alternatively, the terminal may perform simple encoding such as VLC (variable length coding), and the server may perform encoding with a high processing load such as CABAC (context-adaptive binary arithmetic coding).
[0634] As another example, in a stadium, a shopping mall, a factory, etc., there may be a plurality of video data in which almost the same scene has been shot by a plurality of terminals. In this case, using the plurality of terminals that shot the video and, as necessary, other terminals and servers that did not shoot the video, coding processing is assigned to each of them, for example, in units of GOPs (Group of Pictures), in units of pictures, or in units of tiles obtained by dividing a picture, for distributed processing. This reduces delays and realizes better real-time performance.
[0635] Since the multiple video data are of almost the same scene, the server may manage and / or instruct the video data shot by each terminal to be mutually referenced. The server may also receive the encoded data from each terminal and change the reference relationship between the multiple data, or correct or replace the pictures themselves and re-encode them. This makes it possible to generate a stream with improved quality and efficiency for each piece of data.
[0636] Furthermore, the server may distribute the video data after performing transcoding to change the encoding method of the video data. For example, the server may convert the MPEG encoding method to the VP encoding method (e.g., VP9), or convert H.264 to H.265.
[0637] In this way, the encoding process can be performed by a terminal or one or more servers. Therefore, in the following, descriptions such as "server" or "terminal" are used to indicate the entity performing the processing, but some or all of the processing performed by the server may be performed by the terminal, and some or all of the processing performed by the terminal may be performed by the server. The same applies to the decoding process.
[0638] [3D, multi-angle] It is becoming increasingly common to integrate and use images or videos of different scenes or the same scene taken from different angles by multiple devices such as cameras ex113 and / or smartphones ex115 that are approximately synchronized with each other. The videos taken by each device can be integrated based on the relative positional relationship between the devices obtained separately, or on areas where feature points included in the videos match.
[0639] The server may not only encode 2D video, but also encode still images automatically or at a time specified by the user based on scene analysis of the video and transmit them to the receiving terminal. If the server can obtain the relative positional relationship between the shooting terminals, the server may generate a 3D shape of the scene based on not only 2D video but also images of the same scene captured from different angles. The server may separately encode 3D data generated by point cloud or the like, or may generate images to be transmitted to the receiving terminal by selecting or reconstructing images from images captured by multiple terminals based on the results of recognizing or tracking people or objects using the 3D data.
[0640] In this way, the user can enjoy a scene by arbitrarily selecting each video corresponding to each shooting terminal, or can enjoy content in which a video of a selected viewpoint is cut out from 3D data reconstructed using multiple images or videos. Furthermore, together with the video, sound may also be collected from multiple different angles, and the server may multiplex the sound from a specific angle or space with the corresponding video and transmit the multiplexed video and sound.
[0641] In recent years, content that associates the real world with a virtual world, such as Virtual Reality (VR) and Augmented Reality (AR), has also become popular. In the case of VR images, the server creates viewpoint images for the right eye and the left eye, respectively, and may perform encoding that allows reference between each viewpoint video using Multi-View Coding (MVC) or the like, or may encode them as separate streams without mutual reference. When decoding the separate streams, it is preferable to play them in synchronization with each other so that a virtual three-dimensional space is reproduced according to the user's viewpoint.
[0642] In the case of an AR image, the server may superimpose virtual object information in the virtual space on camera information in the real space based on the three-dimensional position or the movement of the user's viewpoint. The decoding device may obtain or hold virtual object information and three-dimensional data, generate a two-dimensional image according to the movement of the user's viewpoint, and smoothly connect the two-dimensional image to create superimposed data. Alternatively, the decoding device may transmit the movement of the user's viewpoint to the server in addition to the request for virtual object information. The server may create superimposed data according to the movement of the viewpoint received from the three-dimensional data held by the server, encode the superimposed data, and distribute it to the decoding device. Note that the superimposed data typically has an α value indicating the transparency in addition to RGB, and the server may set the α value of the part other than the object created from the three-dimensional data to 0 or the like, and encode the part in a state where the part is transparent. Alternatively, the server may generate data in which a predetermined value of RGB value is set to the background like a chromakey, and the part other than the object is the background color. The predetermined value of RGB value may be determined in advance.
[0643] Similarly, the decoding process of the distributed data may be performed by the client (e.g., a terminal), by the server, or may be shared between the client and the server. As an example, a certain terminal may once send a reception request to the server, and the content corresponding to the request may be received by another terminal, decoded, and the decoded signal may be transmitted to a device having a display. By distributing the processing and selecting the appropriate content regardless of the performance of the communication-enabled terminal itself, data with good image quality can be reproduced. As another example, while large-sized image data is received by a TV or the like, a part of the area, such as tiles into which the picture is divided, may be decoded and displayed on the viewer's personal terminal. This allows the viewer to check his / her own area of responsibility or the area he / she wants to check in more detail while sharing the overall picture.
[0644] It may be possible to seamlessly receive content using delivery system standards such as MPEG-DASH in situations where multiple short-range, medium-range, or long-range wireless communication is available indoors and outdoors. A user may freely select and switch in real time between a decoding device or a display device, such as a user's terminal or a display device placed indoors or outdoors. In addition, decoding can be performed while switching between a decoding device and a display device using the user's location information, etc. This makes it possible to map and display information on a part of the wall or ground of a neighboring building where a displayable device is embedded while the user is moving to a destination. It is also possible to switch the bit rate of the received data based on the accessibility of the encoded data on the network, such as when the encoded data is cached on a server that can be accessed from the receiving terminal in a short time, or copied to an edge server in a content delivery service.
[0645] [Scalable Coding] The switching of contents will be described using a scalable stream compressed and coded by applying the video coding method shown in each of the above embodiments, as shown in FIG. 73. The server may have multiple streams with the same content but different qualities as individual streams, but may be configured to switch contents by taking advantage of the characteristics of a temporal / spatial scalable stream realized by coding in layers as shown in the figure. In other words, the decoding side can freely switch and decode low-resolution content and high-resolution content by determining which layer to decode according to an internal factor such as performance and an external factor such as the state of the communication band. For example, if a user wants to continue watching a video that he or she was watching on his or her smartphone ex115 while on the move on a device such as an Internet TV after returning home, the device only needs to decode the same stream up to a different layer, thereby reducing the burden on the server side.
[0646] Furthermore, as described above, pictures are coded for each layer, and in addition to the configuration in which scalability is realized in an enhancement layer above the base layer, the enhancement layer may include meta-information based on image statistics and the like. The decoding side may generate high-quality content by super-resolving pictures in the base layer based on the meta-information. The super-resolution may improve the signal-to-noise ratio while maintaining and / or increasing the resolution. The meta-information includes information for specifying linear or non-linear filter coefficients to be used in the super-resolution process, or information for specifying parameter values in the filter process, machine learning, or least squares calculation to be used in the super-resolution process.
[0647] Alternatively, a configuration may be provided in which a picture is divided into tiles or the like according to the meaning of an object or the like in an image. The decoding side selects tiles to be decoded to decode only a part of the area. Furthermore, by storing the attributes of the object (person, car, ball, etc.) and the position in the video (coordinate position in the same image, etc.) as meta information, the decoding side can identify the position of a desired object based on the meta information and determine the tile including the object. For example, as shown in FIG. 74, the meta information may be stored using a data storage structure different from pixel data, such as a supplemental enhancement information (SEI) message in HEVC. This meta information indicates, for example, the position, size, or color of the main object.
[0648] Meta information may be stored in units consisting of multiple pictures, such as streams, sequences, or random access units. The decoding side can obtain the time when a specific person appears in a video, and by combining the picture-by-picture information with the time information, it can identify the picture in which an object exists and determine the position of the object within the picture.
[0649] [Web page optimization] FIG. 75 is a diagram showing an example of a display screen of a web page in a computer ex111 or the like. FIG. 76 is a diagram showing an example of a display screen of a web page in a smartphone ex115 or the like. As shown in FIG. 75 and FIG. 76, a web page may include a plurality of link images which are links to image content, and the appearance of the link images may differ depending on the device used to view the page. When a plurality of link images are visible on the screen, the display device (decoding device) may display a still image or I-picture that each content has as a link image, or may display an image such as a gif animation using a plurality of still images or I-pictures, or may receive only the base layer, and decode and display the image.
[0650] When a link image is selected by a user, the display device performs decoding, for example, giving top priority to the base layer. If the HTML constituting the web page contains information indicating that the content is scalable, the display device may decode up to the enhancement layer. Furthermore, in order to ensure real-time performance, before selection or when the communication band is very tight, the display device decodes and displays only forward-reference pictures (I pictures, P pictures, and B pictures with forward reference only), thereby reducing the delay between the decoding time of the first picture and the display time (the delay from the start of decoding the content to the start of display). Furthermore, the display device may intentionally ignore the reference relationship of pictures, roughly decode all B pictures and P pictures with forward reference, and perform normal decoding as the number of received pictures increases over time.
[0651] [Automatic driving] Furthermore, when transmitting and receiving still image or video data such as 2D or 3D map information for automatic driving or driving assistance of a vehicle, the receiving terminal may receive weather or construction information as meta information in addition to image data belonging to one or more layers, and may associate and decode these. Note that the meta information may belong to a layer, or may simply be multiplexed with the image data.
[0652] In this case, since a car, drone, or airplane including a receiving terminal moves, the receiving terminal can realize seamless reception and decoding while switching between base stations ex106 to ex110 by transmitting location information of the receiving terminal. Also, the receiving terminal can dynamically switch how much meta information to receive or how much to update map information according to a user's selection, a user's situation, and / or a communication band state.
[0653] In the content supply system ex100, the client can receive, decode, and play back encoded information sent by a user in real time.
[0654] [Distribution of personal content] Furthermore, the content supply system ex100 allows not only high-quality, long-duration content from video distributors, but also low-quality, short-duration content from individuals via unicast or multicast distribution. Such personal content is expected to continue to increase in the future. To improve the quality of personal content, the server may perform editing before encoding. This can be achieved, for example, by using the following configuration.
[0655] During shooting, in real time or after accumulating, the server performs recognition processing such as shooting errors, scene search, semantic analysis, and object detection from the original image data or the encoded data. Then, based on the recognition results, the server manually or automatically performs editing such as correcting focus deviation or camera shake, deleting less important scenes such as scenes that are less bright than other pictures or out of focus, emphasizing object edges, and changing color. The server encodes the edited data based on the editing results. It is also known that if the shooting time is too long, the viewer rating will decrease, and the server may automatically clip not only scenes with less importance as described above but also scenes with little movement based on the image processing results so that the content will be within a specific time range depending on the shooting time. Alternatively, the server may generate a digest based on the result of the semantic analysis of the scene and encode it.
[0656] In some cases, personal content may contain content that infringes copyright, moral rights, or portrait rights, and the range of sharing may exceed the intended range, which may be inconvenient for individuals. Therefore, for example, the server may change the image to an unfocused image of a person's face on the periphery of the screen, or the inside of a house, and encode it. Furthermore, the server may recognize whether the image to be encoded contains a face of a person other than a person registered in advance, and if so, may perform processing such as applying a mosaic to the face. Alternatively, as pre-processing or post-processing of encoding, the user may specify a person or background area that he or she wishes to process in the image from the viewpoint of copyright, etc. The server may replace the specified area with another image, or may perform processing such as blurring the focus. If it is a person, the person can be tracked in the video and the image of the person's face can be replaced.
[0657] Since viewing of personal content with a small amount of data requires real-time performance, the decoding device may receive the base layer as a top priority and decode and play it, depending on the bandwidth. The decoding device may receive an enhancement layer during this time, and when the content is played back two or more times, such as when the playback is looped, play back high-quality video including the enhancement layer. With a stream that has been scalably encoded in this way, it is possible to provide an experience in which the video is rough when not selected or when viewing begins, but the stream gradually becomes smarter and the image quality improves. In addition to scalable encoding, a similar experience can be provided even if a rough stream that is played the first time and a second stream that is encoded with reference to the first video are configured as a single stream.
[0658] [Other application examples] Moreover, these encoding or decoding processes are generally processed in an LSIex500 possessed by each terminal. The LSI (large scale integration circuitry)ex500 (see FIG. 72) may be a one-chip or multiple-chip configuration. Note that software for encoding or decoding moving images may be incorporated into some kind of recording medium (such as a CD-ROM, a flexible disk, or a hard disk) that can be read by the computer ex111 or the like, and the encoding or decoding process may be performed using the software. Furthermore, if the smartphone ex115 has a camera, video data captured by the camera may be transmitted. The video data at this time may be data encoded and processed by the LSIex500 possessed by the smartphone ex115.
[0659] The LSIex500 may be configured to download and activate application software. In this case, the terminal first determines whether the terminal supports the encoding method of the content or has the ability to execute a specific service. If the terminal does not support the encoding method of the content or does not have the ability to execute a specific service, the terminal may download a codec or application software, and then acquire and play the content.
[0660] Furthermore, at least one of the video encoding device (image encoding device) or video decoding device (image decoding device) of each of the above embodiments can be incorporated into a digital broadcasting system, not limited to the content supply system ex100 via the Internet ex101. Since multiplexed data in which video and audio are multiplexed is carried and transmitted over broadcasting radio waves using a satellite or the like, there is a difference in that it is more suitable for multicast compared to the content supply system ex100, which has a configuration that is easy to use for unicast, but similar applications are possible with regard to the encoding process and decoding process.
[0661] [Hardware configuration] FIG. 77 is a diagram showing further details of the smartphone ex115 shown in FIG. 72. FIG. 78 is a diagram showing a configuration example of the smartphone ex115. The smartphone ex115 includes an antenna ex450 for transmitting and receiving radio waves to and from the base station ex110, a camera unit ex465 capable of taking videos and still images, and a display unit ex458 for displaying the video captured by the camera unit ex465 and the decoded data of the video received by the antenna ex450. The smartphone ex115 further includes an operation unit ex466 such as a touch panel, an audio output unit ex457 such as a speaker for outputting audio or sound, an audio input unit ex456 such as a microphone for inputting audio, a memory unit ex467 capable of storing encoded data such as captured video or still images, recorded audio, received video or still images, and e-mail, or decoded data, and a slot unit ex464 which is an interface unit with a SIMex468 for identifying a user and authenticating access to various data including a network. In addition, an external memory may be used instead of the memory unit ex467.
[0662] A main control unit ex460 that can comprehensively control the display unit ex458 and operation unit ex466 etc. is connected to a power supply circuit unit ex461, an operation input control unit ex462, a video signal processing unit ex455, a camera interface unit ex463, a display control unit ex459, a modulation / demodulation unit ex452, a multiplexing / separation unit ex453, an audio signal processing unit ex454, a slot unit ex464, and a memory unit ex467 via a synchronization bus ex470.
[0663] When the power key is turned on by a user's operation, the power supply circuit unit ex461 starts up the smartphone ex115 into an operational state and supplies power to each unit from the battery pack.
[0664] The smartphone ex115 performs processes such as telephone calls and data communications under the control of a main control unit ex460 having a CPU, a ROM, and a RAM. During a telephone call, a voice signal collected by a voice input unit ex456 is converted into a digital voice signal by a voice signal processing unit ex454, and then subjected to spectrum spreading processing by a modulation / demodulation unit ex452, and then subjected to digital-to-analog conversion processing and frequency conversion processing by a transmission / reception unit ex451, and the resulting signal is transmitted via an antenna ex450. In addition, the received data is amplified and subjected to frequency conversion processing and analog-to-digital conversion processing, and then subjected to spectrum inverse spreading processing by a modulation / demodulation unit ex452, and then converted into an analog voice signal by a voice signal processing unit ex454, and then output from a voice output unit ex457. During a data communication mode, text, still images, or video data can be sent under the control of the main control unit ex460 via an operation input control unit ex462 based on the operation of an operation unit ex466 or the like of the main unit. Similar transmission and reception processing is performed. When transmitting video, still images, or video and audio in the data communication mode, the video signal processing unit ex455 compresses and codes the video signal stored in the memory unit ex467 or the video signal input from the camera unit ex465 by the moving image coding method shown in each of the above embodiments, and sends the coded video data to the multiplexing / separation unit ex453. The audio signal processing unit ex454 codes the audio signal collected by the audio input unit ex456 while the video or still image is being captured by the camera unit ex465, and sends the coded audio data to the multiplexing / separation unit ex453. The multiplexing / separation unit ex453 multiplexes the coded video data and the coded audio data by a predetermined method, and performs modulation and conversion processing in the modulation / demodulation unit (modulation / demodulation circuit unit) ex452 and the transmission / reception unit ex451, and transmits the data via the antenna ex450. The predetermined method may be determined in advance.
[0665] In the case of receiving a video attached to an e-mail or a chat, or a video linked to a web page, in order to decode the multiplexed data received via the antenna ex450, the multiplexing / separation unit ex453 separates the multiplexed data into a bit stream of video data and a bit stream of audio data by separating the multiplexed data, and supplies the encoded video data to the video signal processing unit ex455 via the synchronization bus ex470, and supplies the encoded audio data to the audio signal processing unit ex454. The video signal processing unit ex455 decodes the video signal by a video decoding method corresponding to the video encoding method shown in each of the above embodiments, and the video or still image included in the linked video file is displayed on the display unit ex458 via the display control unit ex459. The audio signal processing unit ex454 decodes the audio signal, and the audio is output from the audio output unit ex457. As real-time streaming becomes more and more popular, audio playback may not be socially appropriate depending on the user's situation. Therefore, as an initial setting, it is preferable to have a configuration in which only the video data is played without playing the audio signal, and audio may be played in sync only when the user performs an operation such as clicking on the video data.
[0666] Although the smartphone ex115 has been described as an example here, other implementation formats are possible, such as a transmitting terminal having only an encoder and a receiving terminal having only a decoder, in addition to a transmitting / receiving terminal having both an encoder and a decoder. In the digital broadcasting system, multiplexed data in which audio data is multiplexed with video data is received or transmitted. However, in addition to audio data, text data related to the video may also be multiplexed in the multiplexed data. Also, video data itself may be received or transmitted instead of the multiplexed data.
[0667] Although the main control unit ex460 including the CPU controls the encoding or decoding process, various terminals are often equipped with a GPU. Therefore, a configuration may be used in which a wide area is processed collectively by utilizing the performance of the GPU using a memory shared by the CPU and GPU, or a memory whose addresses are managed so that they can be used in common. This can shorten the encoding time, ensure real-time performance, and achieve low latency. In particular, it is efficient to perform the processing of motion search, deblocking filter, SAO (Sample Adaptive Offset), and transformation and quantization collectively in units such as pictures by the GPU, rather than by the CPU. [Industrial Applicability]
[0668] The present disclosure is applicable to, for example, television receivers, digital video recorders, car navigation systems, mobile phones, digital cameras, digital video cameras, video conference systems, electronic mirrors, and the like. [Explanation of symbols]
[0669] 100 Encoding device 102 Division 104 Subtraction section 106 Conversion unit 108 Quantization section 110 Entropy coding unit 112, 204 Inverse quantization section 114, 206 Inverse conversion unit 116, 208 Addition section 118, 210 Block Memory 120, 212 Loop filter section 122, 214 frame memory 124, 216 Intra prediction section 126, 218 Inter prediction section 128, 220 Predictive control unit 200 Decryption device 202 Entropy Decoding Unit 1201 Boundary determination section 1202, 1204, 1206 Switches 1203 Filter Judgment Unit 1205 Filter processing section 1207 Filter characteristic determination section 1208 Processing Judgment Unit a1, b1 processor a2, b2 memory
Claims
1. The circuit, a memory connected to the circuit; In the residual coding of the current block, both in the case where an orthogonal transform is applied and in the case where the orthogonal transform is skipped, the circuit If the number of times of processing of the context adaptive coding is equal to or less than a specific value, coding a plurality of coefficient information flags related to the coefficients included in the current block by the context adaptive coding, and coding the residual values of the coefficients by Golomb-Rice coding; skipping the coding of the coefficient information flags if the number of times of processing is not equal to or less than the specific value; When the orthogonal transform is applied, if the coding of the plurality of coefficient information flags is skipped, the coefficient is transformed into a second coefficient using a poszero value determined using a plurality of surrounding coefficients located around the coefficient in the current block, and the value of the second coefficient is coded by Golomb-Rice coding; When the orthogonal transform is skipped, if the coding of the plurality of coefficient information flags is skipped, the value of the coefficient is coded by Golomb-Rice coding without performing the transform; the plurality of coefficient information flags include a flag indicating whether a value of the coefficient is zero or non-zero, and a flag indicating whether the coefficient is odd or even; The poszero value is determined according to the sum of the absolute values of the plurality of surrounding coefficients. Encoding device.
2. The circuit, a memory connected to the circuit; In the residual decoding of the current block, in both cases where an inverse orthogonal transform is applied and where the inverse orthogonal transform is skipped, the circuit When the number of times of processing of the context adaptive decoding is equal to or less than a specific value, a plurality of coefficient information flags related to the coefficients included in the current block are decoded by the context adaptive decoding, a residual value of the coefficient is decoded by Golomb-Rice decoding, and a value of the coefficient is derived using the plurality of coefficient information flags and the residual value; skipping the decoding of the coefficient information flags if the number of times of processing is not equal to or less than the specific value; When the inverse orthogonal transform is applied, if the decoding of the plurality of coefficient information flags is skipped, a value of a second coefficient obtained by transforming the coefficient using a poszero value determined using a plurality of surrounding coefficients located around the coefficient in the current block is decoded by Golomb-Rice decoding, and a value of the coefficient is derived from the value of the decoded second coefficient; When the inverse orthogonal transform is skipped, if the decoding of the plurality of coefficient information flags is skipped, the values of the coefficients are decoded by Golomb-Rice decoding; the plurality of coefficient information flags include a flag indicating whether a value of the coefficient is zero or non-zero, and a flag indicating whether the coefficient is odd or even; The poszero value is determined according to the sum of the absolute values of the plurality of surrounding coefficients. Decryption device.
3. The circuit, a memory connected to the circuit; The circuit, in operation, generating information for causing a decoding device to perform residual decoding of the current block; including said information in a bitstream; In the residual decoding of the current block, in both cases where an inverse orthogonal transform is applied and where the inverse orthogonal transform is skipped, When the number of times of processing of the context adaptive decoding is equal to or less than a specific value, a plurality of coefficient information flags related to the coefficients included in the current block are decoded by the context adaptive decoding, a residual value of the coefficient is decoded by Golomb-Rice decoding, and a value of the coefficient is derived using the plurality of coefficient information flags and the residual value; If the number of times of processing is not equal to or less than the specific value, decoding of the plurality of coefficient information flags is skipped; In a case where the inverse orthogonal transform is applied, if the decoding of the plurality of coefficient information flags is skipped, a value of a second coefficient obtained by transforming the coefficient using a poszero value determined using a plurality of surrounding coefficients located around the coefficient in the current block is decoded by Golomb-Rice decoding, and a value of the coefficient is derived from the value of the decoded second coefficient; When the inverse orthogonal transform is skipped, if the decoding of the plurality of coefficient information flags is skipped, the values of the coefficients are decoded by Golomb-Rice decoding; the plurality of coefficient information flags include a flag indicating whether a value of the coefficient is zero or non-zero, and a flag indicating whether the coefficient is odd or even; The poszero value is determined according to the sum of the absolute values of the plurality of surrounding coefficients. Bitstream generator.
Citation Information
Patent Citations
Regular coded bin reduction for coefficient decoding using threshold and rice parameter
WO2020118212A1
Coefficient coding for transform SKIP mode
WO2020185875A1