Image decoding device, image decoding method, and program
By using application conditions related to weight coefficients and time distance in BDOF processing, the problem of decreasing encoding efficiency in the prior art is solved, and more efficient image decoding is achieved.
Patent Information
- Application Number
- CN202411866598.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-09-20
- Filing Date
- 2020-08-21
- Publication Date
- 2025-02-14
AI Technical Summary
The existing BDOF process uses equal weights in the calculation, without taking into account the time distance between reference frames, resulting in a decrease in encoding efficiency.
In the BDOF process, the operation is performed based on the weight coefficients of the pixel values of the two reference frames, and the conditions related to the time distance between the reference frame and the target frame are added to the application conditions, and the BDOF process is applied only in the blocks that meet the specific conditions.
By considering the time distance of the reference frame, the accuracy and efficiency of the BDOF process are improved, and the degradation of encoding efficiency is prevented.
Smart Images

Figure CN119450072A_ABST
Abstract
Description
[0001] This application is a divisional application of an application with a filing date of August 21, 2020, application number 202080058933.X, and invention name “Image decoding device, image decoding method and program”. [Technical field]
[0002] The present invention relates to an image decoding device, an image decoding method and a program. [Background Technology]
[0003] Conventionally, regarding the BDOF (Bi-Directional Optical Flow) technology, a method of generating a prediction signal using pixel values of two reference frames is known. Furthermore, as a block unit application condition of BDOF, a method having the following condition is known: either one of the two reference frames is a subsequent frame compared to the current frame, and the other is a past frame compared to the current frame (for example, refer to non-patent document 1).
[0004] [Prior art literature]
[0005] Non-patent literature
[0006] Non-patent document 1: Versatile Video Coding (Draft 6), JVET-N1001 [Summary of the invention]
[0007] Problems to be solved by the invention
[0008] However, the BDOF processing of non-patent document 1 uses equal weights to calculate the respective pixel values between two reference frames and the respective values of gradients calculated from the pixel values (for example, mutual addition and subtraction operations). This processing implicitly assumes that the absolute value of the time distance between the frame and the reference frame in the subsequent direction is equal to the absolute value of the time distance between the frame and the reference frame in the past direction. On the other hand, the time distance between reference frames is not considered in the application conditions of BDOF.
[0009] Therefore, the present invention is completed in view of the above-mentioned problems, and its purpose is to provide an image decoding device, an image decoding method and a program, which can set conditions related to the distance between the reference frame and the frame in the application conditions of BDOF according to the weights of the pixel values of each reference frame in the operations within the BDOF processing.
[0010] Means for solving problems
[0011] The main purpose of the first feature of the present invention is an image decoding device, comprising: a prediction signal generating unit, configured to determine whether an application condition of BDOF processing is satisfied for each block, and when it is determined that the application condition is satisfied, perform the BDOF processing and generate a prediction signal. In the BDOF processing, a weight coefficient is used when performing calculations based on pixel values of two reference frames or respective values calculated based on the pixel values, and the application condition includes a condition related to the temporal distance between the two reference frames and the frame.
[0012] The main purpose of the second feature of the present invention is an image decoding device, comprising: a prediction signal generating unit, configured to perform BDOF processing; and an affine prediction signal generating unit, configured to perform PROF processing; and when the PROF processing is applied to two reference frames, the gradient calculation processing in the BDOF processing performed by the prediction signal generating unit and the gradient calculation processing in the PROF processing performed by the affine prediction signal generating unit are made to be the same processing.
[0013] The main purpose of the third feature of the present invention is an image decoding method, which determines for each block whether the application conditions of BDOF processing are met. When it is determined that the application conditions are met, the BDOF processing is performed and a prediction signal is generated. In the BDOF processing, weight coefficients are used when performing operations based on the respective pixel values of two reference frames or the respective values calculated based on the pixel values. The application conditions include conditions related to the temporal distance between the two reference frames and the frame.
[0014] The main purpose of the fourth feature of the present invention is a program that enables a computer to function as an image decoding device, wherein the image decoding device determines whether an application condition of BDOF processing is satisfied for each block, and when it is determined that the application condition is satisfied, the BDOF processing is performed and a prediction signal is generated. In the BDOF processing, weight coefficients are used when performing operations using respective pixel values of two reference frames or respective values calculated based on the pixel values, and the application conditions include conditions related to the temporal distance between the two reference frames and the frame.
[0015] Effects of the Invention
[0016] According to the present invention, there can be provided an image decoding device, an image decoding method and a program, which are capable of setting conditions related to the temporal distance between the reference frame and the frame in the application conditions of BDOF by taking into account the weights of the pixel values of each reference frame in the BDOF process, and applying BDOF only in blocks having a reference frame structure that matches the operations in the BDOF process, thereby preventing a reduction in coding efficiency. [Drawings]
[0017] Figure 1It is a diagram showing an example of the configuration of an image processing system 10 according to one embodiment.
[0018] Figure 2 This is a diagram showing an example of a functional block of the image encoding device 100 according to one embodiment.
[0019] Figure 3 This is a diagram showing an example of the structure of coded data (bit stream) output from the coding unit 140 of the image coding device 100 according to one embodiment.
[0020] Figure 4 It is shown Figure 3 FIG. 1 is a diagram showing an example of control data included in SPS 141.
[0021] Figure 5 It is shown Figure 3 An example of control data included in slice header 143A is shown.
[0022] Figure 6 FIG. 1 is a diagram showing an example of a functional block of the inter-frame prediction unit 111 of the image encoding device 100 according to one embodiment.
[0023] Figure 7 This is a flowchart showing an example of a processing procedure of the refinement unit 111C of the inter prediction unit 111 of the image encoding device 100 according to one embodiment.
[0024] Figure 8 This is a flowchart showing an example of a processing procedure of the prediction signal generating unit 111D of the inter prediction unit 111 of the image encoding device 100 according to one embodiment.
[0025] Fig. 9 This is a flowchart showing an example of a processing procedure of the affine motion vector calculation unit 111E of the inter prediction unit 111 of the image encoding device 100 according to one embodiment.
[0026] Fig.10 This is a diagram for explaining an example of a processing procedure of the affine motion vector calculation unit 111E of the inter prediction unit 111 of the image encoding device 100 according to one embodiment.
[0027] Fig.11 This is a flowchart showing an example of a processing procedure of the affine prediction signal generation unit 111F of the inter prediction unit 111 of the image encoding device 100 according to one embodiment.
[0028] Fig.12 FIG. 1 is a diagram showing an example of a functional block of the loop filter processing unit 150 of the image encoding device 100 according to one embodiment.
[0029] Fig.13 This is a diagram for explaining the processing order of the boundary strength determination unit 153 (153A / 153B) of the loop filter processing unit 150 of the image encoding device 100 according to one embodiment.
[0030] Fig.14 This is a diagram showing an example of a functional block of an image decoding device 200 according to an embodiment.
[0031] Fig.15 This is a diagram showing an example of a functional block of the inter prediction unit 241 of the image decoding device 200 according to one embodiment.
[0032] Fig.16 This is a diagram showing an example of a functional block of the loop filter processing unit 250 of the image decoding device 200 according to one embodiment.
[0033] Fig.17 This is a diagram for explaining Modification Example 1.
[0034] Fig.18 This is a diagram for explaining Modification Example 1.
[0035] Fig.19 This is a diagram for explaining Modification Example 2.
[0036] Fig. 20 This is a diagram for explaining Modification Example 2. [Specific implementation method]
[0037] The following is an explanation of the embodiments of the present invention with reference to the accompanying drawings. In addition, the constituent elements in the following embodiments may be appropriately replaced with existing constituent elements, etc., and various modifications including combinations with other existing constituent elements may be performed. Therefore, the content of the invention recorded in the claims should not be limited by the description of the following embodiments.
[0038] (First Embodiment)
[0039] Below, reference Figures 1 to 16 An image processing system 10 according to a first embodiment of the present invention will be described. Figure 1 1 is a diagram showing an image processing system 10 according to the present embodiment.
[0040] like Figure 1 As shown, the image processing system 10 includes an image encoding device 100 and an image decoding device 200 .
[0041] The image encoding device 100 is configured to generate encoded data by encoding an input image signal, and the image decoding device 200 is configured to generate an output image signal by decoding the encoded data.
[0042] Here, the coded data may be transmitted from the image coding apparatus 100 to the image decoding apparatus 200 via a transmission path. Alternatively, the coded data may be provided from the image coding apparatus 100 to the image decoding apparatus 200 after being stored in a storage medium.
[0043] (Image Coding Device 100)
[0044] Below, reference Figure 2 The image encoding device 100 according to this embodiment will be described. Figure 2 This is a diagram showing an example of functional blocks of the image encoding device 100 according to the present embodiment.
[0045] like Figure 2 As shown, the image encoding device 100 includes an inter-frame prediction unit 111, an intra-frame prediction unit 112, a subtractor 121, an adder 122, a transform and quantization unit 131, an inverse transform and inverse quantization unit 132, an encoding unit 140, a loop filter processing unit 150 and a frame buffer 160.
[0046] The inter-frame prediction unit 111 is configured to generate a prediction signal by inter-frame prediction.
[0047] Specifically, the inter-frame prediction unit 111 is configured to specify a reference block included in the reference frame by comparing a frame to be encoded (hereinafter referred to as a target frame) with a reference frame stored in the frame buffer 160 , and determine a motion vector of the specified reference block.
[0048] The inter prediction unit 111 is configured to generate a prediction signal included in each prediction block based on the reference block and the motion vector. The inter prediction unit 111 is configured to output the prediction signal to the subtractor 121 and the adder 122. Here, the reference frame is a frame different from the target frame.
[0049] The intra prediction unit 112 is configured to generate a prediction signal by intraframe prediction.
[0050] Specifically, the intra prediction unit 112 is configured to designate a reference block included in the target frame, and to generate a prediction signal for each prediction block based on the designated reference block. Furthermore, the intra prediction unit 112 is configured to output the prediction signal to the subtractor 121 and the adder 122 .
[0051] Here, the reference block is a block that is referenced by a block to be predicted (hereinafter referred to as a target block). For example, the reference block is a block adjacent to the target block.
[0052] The subtractor 121 is configured to subtract the prediction signal from the input image signal and output a prediction residual signal to the transform and quantization unit 131. Here, the subtractor 121 is configured to generate a prediction residual signal which is a difference between a prediction signal generated by intra prediction or inter prediction and the input image signal.
[0053] The adder 122 is configured to add the prediction signal and the prediction residual signal output from the inverse transform and inverse quantization unit 132 to generate a pre-filtered decoded signal, and output the pre-filtered decoded signal to the intra prediction unit 112 and the loop filter processing unit 150 .
[0054] Here, the decoded signal before filtering constitutes a reference block used in the intra prediction unit 112 .
[0055] The transform and quantization unit 131 is configured to perform a transform process on the prediction residual signal and obtain a coefficient level value. In addition, the transform and quantization unit 131 may be configured to perform quantization on the coefficient level value.
[0056] Here, the transformation process is a process of transforming the prediction residual signal into a frequency component signal. In this transformation process, a base model (transformation matrix) corresponding to a discrete cosine transform (DCT) or a base model (transformation matrix) corresponding to a discrete sine transform (DST) can be used.
[0057] The inverse transform and inverse quantization unit 132 is configured to perform an inverse transform process on the coefficient level value output from the transform and quantization unit 131. Here, the inverse transform and inverse quantization unit 132 may be configured to perform an inverse quantization on the coefficient level value before the inverse transform process.
[0058] Here, the inverse transform process and the inverse quantization are performed in the reverse order of the transform process and the quantization performed by the transform and quantization unit 131 .
[0059] The encoding unit 140 is configured to encode the coefficient level value output from the transform and quantization unit 131 and output the encoded data.
[0060] Here, for example, the encoding is entropy encoding that assigns codes of different lengths based on the probability of occurrence of coefficient level values.
[0061] Furthermore, the encoding unit 140 is configured to encode not only the coefficient level value but also the control data used in the decoding process.
[0062] Here, the control data may include size data such as the coding block (CU, Coding Unit) size, the prediction block (PU, Prediction Unit) size, and the transform block (TU, Transform Unit) size.
[0063] The loop filter processing unit 150 is configured to perform filtering on the pre-filtering decoded signal output from the adder 122 , and output the post-filtering decoded signal to the frame buffer 160 .
[0064] Here, the filtering process is, for example, a deblocking filtering process for reducing distortion generated at a boundary portion of a block (coding block, prediction block, or transform block).
[0065] The frame buffer 160 is configured to store reference frames used by the inter-frame prediction unit 111 .
[0066] Here, the decoded signal after the filtering process constitutes a reference frame used in the inter-frame prediction unit 111.
[0067] (Encoding unit 140)
[0068] Next, use Figures 3 to 5 The control data encoded by the encoding unit 140 will be described. Figure 3 This is an example of the structure of the encoded data (bit stream) output from the encoding unit 140.
[0069] First, the bitstream may include an SPS (Sequence Parameter Set) 141 at the beginning. SPS 141 is a set of control data in units of sequences (sets of pictures). Specific examples will be described below. Each SPS 141 includes at least id information for identifying each SPS 141 when there are multiple SPSs 141.
[0070] The bitstream may also include a PPS (Picture Parameter Set) 142 after the SPS 141. The PPS 142 is a set of control data in units of pictures (a set of slices). Each PPS 142 includes at least id information for identifying each SPS 141 when there are multiple SPSs 141. In addition, each PPS 142 includes at least SPS id information for specifying the SPS 141 corresponding to each PPS 142.
[0071] The bit stream may also include a slice header 143A after the PPS 142. The slice header 143A is a collection of control data in units of slices. A specific example will be described below. Each slice header 143A includes at least PPS id information for specifying the PPS 142 corresponding to each slice header 143A.
[0072] The bitstream may also include slice data 144A after the slice header 143A. The slice data 144A may include the coefficient level value and size data mentioned above.
[0073] As described above, the structure is as follows: each of the slice headers 143A / 143B, PPS 142, and SPS 141 corresponds to each slice data 144A / 144B. As described above, in the slice header 143A / 143B, the PPS id information specifies which PPS 142 is referenced, and in the PPS 142, the SPS id information further specifies which SPS 141 is referenced, so that the common SPS 141 and PPS 142 can be used for a plurality of slice data 144A / 144B.
[0074] In other words, it is not necessary to transmit the SPS 141 and the PPS 142 for each slice data 144A / 144B. Figure 3 As shown, the stream structure may be such that the SPS 141 and the PPS 142 are not encoded before the slice header 143B and the slice data 144B.
[0075] in addition, Figure 3 The composition is just an example. If the composition is composed of the slice header 143A / 143B, PPS 142, and control data specified by SPS 141 and each slice data 144A / 144B, elements other than the above can be added as stream components. And, similarly, it can also be shaped into the same as Figure 3 Different composition.
[0076] Figure 4 This is a diagram showing an example of control data included in the SPS 141 .
[0077] As described above, the SPS 141 includes at least id information (sps_seq_parameter_set_id) for identifying each SPS 141 .
[0078] SPS141 may also include a flag "sps_bdof_enabled_flag" for controlling whether the following BDOF (Bi-Directional Optical Flow) processing can be used (valid or invalid). When the value of this flag is "0", it means that the BDOF processing is not used in the slice corresponding to the SPS141. On the other hand, when the value of this flag is "1", it means that the BDOF processing can be used in the slice corresponding to the SPS141. In the following processing, it is determined for each block whether the BDOF processing is actually used in each block in the slice.
[0079] That is, "sps_bdof_enabled_flag" is a flag (fourth flag) included in the SPS 141 and indicating whether or not the BDOF process can be used in units of sequences.
[0080] SPS141 may also include a flag "sps_dmvr_enabled_flag" for controlling whether the following DMVR (Decoder-side Motion Vector Refinement) processing can be used (valid or invalid). When the value of this flag is "0", it indicates that the DMVR processing is not used in the slice corresponding to the SPS141. On the other hand, when the value of this flag is "1", it indicates that the DMVR processing can be used in the slice corresponding to the SPS141. In the following processing, it is determined for each block whether the DMVR processing is actually used in each block in the slice.
[0081] That is, "sps_dmvr_enabled_flag" is a flag (third flag) included in the SPS 141 and indicating whether or not the DMVR process can be used in units of sequences.
[0082] SPS141 may also include a flag "sps_affine_enabled_flag" for controlling whether the affine motion compensation described below can be used (valid or invalid). When the value of this flag is "0", it indicates that affine motion compensation is not used in the slice corresponding to this SPS141. On the other hand, when the value of this flag is "1", it indicates that affine motion compensation can be used in the slice corresponding to this SPS141. In the following processing, it is determined for each block whether affine motion compensation is actually used in each block in the slice.
[0083] That is, "sps_affine_prof_enabled_flag" is a flag (fifth flag) included in the SPS 141 and indicating whether or not the PROF process can be used in units of sequences.
[0084] When "sps_affine_enabled_flag" is "1", SPS141 may further include a flag "sps_affine_type_flag". When the value of this flag is "0", it indicates that the number of parameters for the affine motion compensation described below is always set to "4" in the slice corresponding to this SPS141. On the other hand, when the value of this flag is "1", it indicates that when affine motion compensation is performed in the slice corresponding to this SPS141, either "4" or "6" can be selected as the number of parameters for each block.
[0085] When the value of "sps_affine_enabled_flag" is "1", SPS141 may further include a flag "sps_affine_prof_enabled_flag". When the value of this flag is "0", it indicates that the following PROF (Prediction Refinement with Optical Flow) processing is not used in the slice corresponding to this SPS141. On the other hand, when the value of this flag is "1", it indicates that the PROF processing can be used in the slice corresponding to this SPS141. In the following processing, it is determined for each block whether the PROF processing is actually used in each block in the slice.
[0086] When the value of at least any one of the flags "sps_bdof_enabled_flag", "sps_dmvr_enabled_flag" and "sps_affine_prof_enabled_flag" is "1", the SPS 141 may further include a flag "sps_bdof_dmvr_prof_slice_present_flag". When the flag is "1", it indicates that the following flag "slice_disable_bdof_dmvr_prof_flag" is included in the slice header 143A / 143B corresponding to the SPS 141. When the value of the flag is "0", it indicates that the slice header 143A / 143B corresponding to the SPS 141 does not include "slice_disable_bdof_dmvr_prof_flag".
[0087] That is, "sps_bdof_dmvr_prof_slice_present_flag" is a flag (second flag) indicating whether "slice_disable_bdof_dmvr_prof_flag" is included in the slice header 143A / 143B. When this flag does not exist, it can be implicitly regarded that the value of the flag is "0".
[0088] Figure 5 143A / 143B is a diagram showing an example of control data included in the slice header 143A / 143B.
[0089] As described above, the slice header 143A / 143B includes at least PPS id information “slice_pic_parameter_set_id” for specifying the PPS 142 corresponding to the slice. As described above, the SPS 141 referenced in the PPS specified by the PPS id information is the SPS 141 corresponding to the slice header 143A / 143B.
[0090] When "sps_bdof_dmvr_prof_slice_present_flag" is included in the SPS141 corresponding to the slice header 143A / 143B, and the value of the flag is "1", "slice_disable_bdof_dmvr_prof_flag" may also be included in the slice header 143A / 143B. When the value of the flag is "1", as described below, it can be controlled so that BDOF processing, DMVR processing, and PROF processing are not used in each block included in the slice. When the value of the flag is "0", it can be controlled so that BDOF processing, DMVR processing, and PROF processing can be used in each block included in the slice.
[0091] That is, "slice_disable_bdof_dmvr_prof_flag" is a flag (first flag) included in the slice header 143A / 143B for collectively controlling whether or not the DMVR process, the BDOF process, and the PROF process can be used.
[0092] In other words, "slice_disable_bdof_dmvr_prof_flag" is a flag included in the slice header 143A / 143B to control whether PROF processing can be used, a flag included in the slice header 143A / 143B to control whether DMVR processing can be used, and a flag included in the slice header 143A / 143B to control whether BDOF processing can be used.
[0093] The flag values described above are merely examples. When the meanings of the values ("0" and "1") assigned to the flags are reversed, equivalent processing can be achieved by reversing the corresponding processing accordingly.
[0094] Furthermore, as described above, by setting a flag to control not to use BDOF processing, DMVR processing, and PROF processing in units of slices, the image encoding device 100 side can explicitly control not to use this function. Therefore, by not using this function, the processing load and power consumption of the image encoding device 100 and the corresponding image decoding device 200 can be reduced.
[0095] (Inter-frame prediction unit 111)
[0096] Below, reference Figure 6 The inter-frame prediction unit 111 of the image encoding device 100 according to this embodiment will be described. Figure 6 This is a diagram showing an example of a functional block of the inter-frame prediction unit 111 of the image encoding device 100 according to the present embodiment.
[0097] like Figure 6 As shown, the inter prediction unit 111 includes a motion vector search unit 111A, a motion vector encoding unit 111B, a refinement unit 111C, a prediction signal generation unit 111D, an affine motion vector calculation unit 111E, and an affine prediction signal generation unit 111F.
[0098] The inter prediction unit 111 is an example of a prediction unit configured to generate a prediction signal included in a prediction block based on a motion vector.
[0099] The motion vector search unit 111A is configured to specify a reference block included in the reference frame by comparing the target frame with the reference frame, and to search for a motion vector of the specified reference block.
[0100] Furthermore, the above search is performed on multiple candidate reference frames to determine the reference frame and motion vector used for prediction in the prediction block. Up to two reference frames and motion vectors can be used for each block. The case where only one set of reference frames and motion vectors is used for a block is called unidirectional prediction, and the case where two sets of reference frames and motion vectors are used is called bidirectional prediction. In the following, the first set is called L0 and the second set is called L1.
[0101] The motion vector search unit 111A is configured to determine a coding method for a reference frame and a motion vector. In addition to a conventional method for transmitting information of a reference frame and a motion vector separately, there are the following merge mode and affine motion compensation.
[0102] In addition, regarding the method of searching for a motion vector, the method of determining a reference frame, and the method of determining the encoding method of a reference frame and a motion vector, known methods can be used, and therefore, detailed descriptions thereof are omitted.
[0103] The motion vector coding unit 111B is configured to code the reference frame and motion vector information determined by the motion vector search unit 111A using the coding method determined by the motion vector search unit 111A. A known method can be used for coding the reference frame and motion vector information, and thus a detailed description thereof will be omitted.
[0104] When the encoding method of the block is the merge mode, a merge list for the block is first created on the side of the image encoding device 100. Here, the merge list is a list that lists combinations of multiple reference frames and motion vectors.
[0105] An index is assigned to each combination, and the image encoding device 100 encodes only the index instead of encoding the reference frame and motion vector information separately, and transmits it to the image decoding device 200. By sharing the creation method of the merge list in advance on the image encoding device 100 side and the image decoding device 200 side, the image decoding device 200 side can decode the reference frame and motion vector information based on only the index information.
[0106] In addition, regarding the method of creating the merge list, a known method can be used, and therefore, a detailed description thereof is omitted.
[0107] Affine motion compensation is a method that transmits a small amount of parameters for each block and derives a motion vector for each sub-block obtained by dividing the block based on the parameters and a predetermined model. The details of the method for deriving the motion vector will be described below.
[0108] In the case of affine motion compensation, the motion vector encoding unit 111B is configured to encode the following control point motion vector information and reference frame information. As described below, the control point motion vector transmits two or three pieces of motion vector information for each block.
[0109] Furthermore, when the block is a block for bidirectional prediction, information of two or three control point motion vectors is transmitted for L0 and L1, respectively. As for the specific encoding method, a known method can be adopted, and therefore, its detailed description is omitted.
[0110] When affine motion compensation is used in this block, move to Figure 6 Otherwise, the process moves to the process of the thinning unit 111C.
[0111] The thinning unit 111C is configured to perform a thinning process (for example, DMVR) for correcting the motion vector encoded by the motion vector encoding unit 111B.
[0112] Specifically, the refinement unit 111C is configured to perform the following refinement processing: set a search range based on the reference position specified by the motion vector encoded by the motion vector encoding unit 111B, specify a correction reference position with the smallest specific cost from the search range, and correct the motion vector based on the correction reference position.
[0113] Figure 7 11 is a flowchart showing an example of the processing procedure of the refinement unit 111C.
[0114] like Figure 7As shown, in step S71, the refinement unit 111C determines whether specific conditions for applying refinement processing are satisfied. When all the specific conditions are satisfied, the process sequence proceeds to step S72. On the other hand, when any of the specific conditions is not satisfied, the process sequence proceeds to step S75 and the refinement processing ends.
[0115] Here, the specific condition includes the condition that the block is a block to be bidirectionally predicted.
[0116] Furthermore, the specific conditions may also include the following conditions: either the reference frame on the L0 side or the reference frame on the L1 side is a past frame in time relative to the frame, the other reference frame is a subsequent frame in time relative to the frame, and the time distances of the L0 side and the L1 side from the frame (for example, the absolute value of the difference in POC (Picture Order Count)) are equal.
[0117] Furthermore, the specific condition may also include a condition that the motion vector is encoded in the merge mode.
[0118] Furthermore, the specific condition may also include the following condition: in the SPS 141 of the sequence to which the block belongs, the value of "sps_dmvr_enabled_flag" indicates that DMVR can be used in the sequence (for example, the value of the flag is "1").
[0119] Furthermore, the specific condition may include the following condition: in the slice header 143A / 143B of the slice to which the block belongs, the value of "slice_disable_bdof_dmvr_prof_flag" indicates that DMVR can be used in the slice (for example, the value of the flag is "0").
[0120] In step S72 , the thinning unit 111C generates a search image based on the motion vector encoded by the motion vector encoding unit 111B and the information of the reference frame.
[0121] Here, when the motion vector points to a non-integer pixel position, the thinning section 111C applies a filter to interpolate the pixel at the non-integer pixel position to the pixel value of the reference frame. At this time, the thinning section 111C can reduce the amount of calculation by using an interpolation filter having a smaller number of taps than the interpolation filter used in the prediction signal generation section 111D described below. For example, the thinning section 111C can interpolate the pixel value at the non-integer pixel position by bilinear interpolation.
[0122] In step S73, the thinning unit 111C searches with integer pixel accuracy using the search image generated in step S72. Here, integer pixel accuracy means searching only points that are integer pixel apart based on the motion vector encoded by the motion vector encoding unit 111B.
[0123] The thinning section 111C determines the corrected motion vector at the integer pixel interval position by searching in step S72. As a search method, a known method can be used.
[0124] For example, the refinement unit 111C may perform a search by searching only points corresponding to a combination obtained by inverting the signs of the differential motion vectors on the L0 side and the L1 side. During the search, the refinement unit 111C may calculate a search cost at each search point and correct the motion vector at the search point with the minimum search cost.
[0125] Here, the refinement unit 111C may calculate the search cost so as to reduce the search cost only at the search point corresponding to the motion vector encoded by the motion vector encoding unit 111B. For example, the refinement unit 111C may set a value obtained by reducing the search cost calculated by the same method as other search points to 3 / 4 as the final search cost of the search point.
[0126] The search result in step S73 may also be the same value as the motion vector before the search.
[0127] In step S74, the thinning unit 111C uses the corrected motion vector with integer pixel accuracy determined in step S73 as an initial value and searches for a motion vector with non-integer pixel accuracy. As a method for searching a motion vector, a known method can be used.
[0128] Furthermore, the refinement unit 111C may use the result of step S73 as input and determine a vector with non-integer pixel accuracy using a parametric model such as parabola fitting without actually performing a search.
[0129] After determining the corrected motion vector of non-integer pixel accuracy in step S74, the refinement unit 111C moves to step S45 to end the refinement process. Here, for convenience, the expression of the corrected motion vector of non-integer pixel accuracy is used, but depending on the search result of step S74, the result may be the same value as the motion vector of integer pixel accuracy obtained in step S73.
[0130] The thinning unit 111C may also divide a block larger than a predetermined threshold into smaller sub-blocks and perform thinning processing on each sub-block. For example, the thinning unit 111C may set the execution unit of the thinning processing to 16×16 pixels in advance, and when the horizontal or vertical size of the block is larger than 16 pixels, it is divided into smaller blocks of 16 pixels. In this case, for all sub-blocks in the same block, the motion vector of the block encoded by the motion vector encoding unit 111B is used as the reference motion vector for the thinning processing.
[0131] When processing each sub-block, the refinement unit 111C may perform Figure 7 Furthermore, the refinement unit 111C may also perform only the following steps on each sub-block: Figure 7 Specifically, the refinement unit 111C may perform partial processing on each block. Figure 7 The processing of steps S71 and S72 is performed on each sub-block, and the processing of steps S73 and S74 is performed on each sub-block.
[0132] The prediction signal generation unit 111D is configured to generate a prediction signal based on the corrected motion vector output from the refinement unit 111C.
[0133] Here, as described below, the prediction signal generation unit 111D is configured to determine whether to perform the BDOF process on each block based on the information (for example, the search cost) calculated in the above-mentioned thinning process.
[0134] Specifically, when the motion vector is not corrected, the prediction signal generator 111D is configured to generate a prediction signal based on the motion vector encoded by the motion vector encoder 111B. On the other hand, when the motion vector is corrected, the prediction signal generator 111D is configured to generate a prediction signal based on the motion vector corrected by the refinement unit 111C.
[0135] Figure 8 11 is a flowchart showing an example of the processing sequence of the prediction signal generating unit 111D. Here, when the refinement unit 111C performs refinement processing in units of sub-blocks, the processing of the prediction signal generating unit 111D is also performed in units of sub-blocks. In this case, the term "block" in the following description can be appropriately replaced with "sub-block".
[0136] like Figure 8 As shown, in step S81, the prediction signal generation unit 111D generates a prediction signal.
[0137] Specifically, the prediction signal generation unit 111D receives the motion vector encoded by the motion vector encoding unit 111B or the motion vector encoded by the thinning unit 111C as input, and when the position indicated by the motion vector is a non-integer pixel position, applies a filter to interpolate the pixel at the non-integer pixel position to the pixel value of the reference frame. Here, as for the specific filter, a horizontally and vertically separable filter with a maximum of 8 taps disclosed in Non-Patent Document 1 can be applied.
[0138] When the block is a bidirectionally predicted block, the prediction signal generator 111D generates both a prediction signal based on a first set (hereinafter referred to as L0) of reference frames and motion vectors and a prediction signal based on a second set (hereinafter referred to as L1) of reference frames and motion vectors.
[0139] In step S82 , the prediction signal generation unit 111D checks for each block whether or not the application conditions for the BDOF process described below are satisfied.
[0140] The application condition includes at least the condition that the block is a block to be bidirectionally predicted.
[0141] Furthermore, the application condition may also include the following condition: in the integer pixel position search performed by the refinement unit 111C in step S73 , the search cost of the search point with the minimum search cost is greater than or equal to a predetermined threshold.
[0142] Furthermore, the specific condition may also include the following condition: in the SPS 141 of the sequence to which the block belongs, the value of "sps_bdof_enabled_flag" indicates that BDOF can be used in the sequence (for example, the value of the flag is "1").
[0143] Furthermore, the application condition may also include the following condition: in the slice header 143A / 143B of the slice to which the block belongs, the value of "slice_disable_bdof_dmvr_prof_flag" indicates that BDOF processing can be used in the slice (for example, the value of the flag is "0").
[0144] Furthermore, the application conditions may also include the following conditions: either the reference frame on the L0 side or the reference frame on the L1 side is a past frame in time relative to the frame, the other reference frame is a subsequent frame in time relative to the frame, and the ratio of the time distance from the frame on the L0 side and the L1 side (for example, the absolute value of the difference in POC) is a predetermined ratio.
[0145] Here, as a method of determining the ratio, for example, the ratio may be determined in a manner proportional to the inverse of a weight coefficient when performing calculations using gradients or brightness values on the L0 side and the L1 side in the BDOF process described below.
[0146] For example, when the weight coefficient on the L0 side is set to "2 / 3" and the weight coefficient on the L1 side is set to "1 / 3", as the ratio of the distance to the reference frame, if the distance between L0 and the frame is set to "1", then the distance between L1 and the frame is "2". Only in this case is BDOF processing applied.
[0147] Similarly, for example, when the weight coefficient on the L0 side is set to "1 / 2" and the weight coefficient on the L1 side is set to "1 / 2", as the ratio of the distance between L0 and the frame, the distance between L1 and the frame is "1", that is, the distance between the frame and L0 is equal to the distance between the frame and L1. Only in this case is BDOF processing applied.
[0148] That is, the prediction signal generating unit 111D may also include the following condition as the application condition: the two reference frames (L0 / L1) are related to the temporal distance between the frame and the frame in a manner that is proportional to the inverse of the weight coefficient when performing calculations using the respective pixel values of the two reference frames (L0 / L1) or the respective values calculated based on the pixel values of the two reference frames (L0 / L1).
[0149] Furthermore, the prediction signal generating unit 111D may include the following condition as the application condition: when the weight coefficients are equal, as a condition related to the temporal distance, the temporal distances between the two reference frames (L0 / L1) and the frame are equal.
[0150] In addition, here, the case where the weight coefficient is "1 / 2" is used as an example, but when the same weight is used on the L0 side and the L1 side (for example, it can also be "1"), BDOF processing is applied only when the distance between the frame and L0 is equal to the distance between the frame and L1.
[0151] When it is determined that the application condition is met, the processing sequence moves to step S83, and when it is determined that the application condition is not met, the processing sequence moves to step S84.
[0152] In step S83, the prediction signal generation unit 111D performs BDOF processing and generates a prediction signal. The BDOF processing itself can use a known method, so only an overview is described and its detailed description is omitted.
[0153] First, the prediction signal generation unit 111D calculates the gradient of the brightness value in the vertical direction and the horizontal direction for each pixel in the reference block of the block. As a specific calculation method, for example, the method described in non-patent document 1 can be used for calculation. Here, the horizontal gradient of L0 is called "gradientHL0", the vertical gradient of L0 is called "gradientVL0", the horizontal gradient of L1 is called "gradientHL1", and the vertical gradient of L1 is called "gradientVL1".
[0154] Second, the prediction signal generation unit 111D calculates the correction MV (vx, vy) of the block. As a specific calculation method, for example, the method described in non-patent document 1 can be used for calculation. Here, the above-mentioned gradient sum (tempH, tempV) and the brightness value difference (diff) between the reference blocks L0 and L1 are calculated as follows, as described in non-patent document 1, and can also be used to calculate the above-mentioned (vx, vy).
[0155] diff=predSampleL0×weightL0-predSampleL1×weightL1tempH=gradientHL0×weightL0+gradientHL1×weightL1
[0156] tempV=gradientVL0×weightL0+gradientVL1×weightL1
[0157] Here, "predSampleL0" and "predSampleL1" are the brightness values of the reference blocks L0 and L1, respectively, and "weightL0" and "weightL1" are weight coefficients when calculating the above-mentioned gradient and brightness value difference, respectively.
[0158] Here, an example of using common weights is described using the three parameters "diff", "tempH" and "tempV" as examples. The same weights can be set when adding, subtracting, multiplying and dividing the information on the L0 side and the information on the L1 side.
[0159] Furthermore, the application conditions of the BDOF processing related to the distance from the reference frame may be set as described above in a manner proportional to the inverse of the weight. In other words, the weights for addition, subtraction, multiplication, and division may be set as described above in a manner proportional to the inverse of the ratio of the distance between the frame and each reference frame of L0 and L1.
[0160] By setting in this way, when assuming that the gradient or brightness value changes linearly between L0 and L1, an appropriate weight coefficient can be set for the time position of the frame. In addition, by setting the application conditions of the BDOF processing corresponding to the weight coefficient, it is possible to ensure that an appropriate weight coefficient is always used.
[0161] Thirdly, the prediction signal generation unit 111D uses the gradient and correction MV obtained as described above to calculate the brightness value correction amount "bdofOffset" of each pixel, for example, as follows.
[0162] bdofOffset=vx×(weightL0×gradientHL0―weightL1×gradientHL1)+vy×(weightL0×gradientVL0―weightL1×gradientVL1)
[0163] Fourthly, the prediction signal generation unit 111D may calculate the prediction value of the corrected luminance value of each pixel using “bdofOffset” as described in Non-Patent Document 1, for example.
[0164] That is, the prediction signal generating unit 111D is configured to, in BDOF processing, use weight coefficients when performing calculations based on respective pixel values of two reference frames (L0 / L1) or respective values calculated based on the pixel values of the two reference frames (L0 / L1), wherein the above-mentioned application conditions include conditions related to the temporal distance between the two reference frames and the frame.
[0165] After the BDOF process is performed, the process sequence moves to step S85 and the process ends.
[0166] In step S84, when the block is a block for bidirectional prediction, the prediction signal generator 111D synthesizes the prediction signals of L0 and L1 generated in step S81 to generate a final prediction signal. As for the specific synthesis method, a known method can be used, so its detailed description is omitted. When the block is a block for unidirectional prediction, the prediction signal generator 111D directly uses the prediction signal generated in step S81 as the final prediction signal.
[0167] After generating the final prediction signal according to the above procedure, the prediction signal generating unit 111D moves to step S85 and ends the processing.
[0168] When the motion vector search unit 111A determines that affine motion compensation is to be performed on the block, the affine motion vector calculation unit 111E is configured to calculate a motion vector for each sub-block obtained by dividing the block based on the control point motion vector encoded by the motion vector encoding unit 111B.
[0169] Fig. 9 This is a flowchart showing an example of the processing procedure of the affine motion vector calculation unit 111E.
[0170] like Fig. 9 As shown, in step S91, the affine motion vector calculation unit 111E calculates values of four parameters, namely, "dHorX", "dhorY", "dVerX" and "dVerY".
[0171] Here, the affine motion vector calculation unit 111E uses the value of the control point motion vector encoded by the motion vector encoding unit 111B when calculating the parameter.
[0172] As mentioned above, each block has two or three control point motion vectors. Fig.10 , an example is shown when there are three control point motion vectors ("CPMV0", "CPMV1", "CPMV2").
[0173] Here, in Fig.10 In FIG. 8 , the solid line represents the boundary of the block, the dotted line represents the boundary of the sub-blocks obtained by dividing the block, the solid arrow represents the control point motion vector, and the dotted arrow represents the motion vector of each sub-block.
[0174] When there are two control point motion vectors, only Fig.10 The specific method of calculating the values of the four parameters "dHorX", "dhorY", "dVerX" and "dVerY" according to the value of the control point motion vector can use a known method, so its detailed description is omitted.
[0175] In step S92 , the affine motion vector calculation unit 111E determines whether to apply “fallbackMode” to the block.
[0176] Here, "fallbackMode" is a mode in which the same motion vector is used in all sub-blocks obtained by dividing the block. A known method can be used for determining "fallbackMode", so its detailed description is omitted. When "fallbackMode" is applied to the block, the processing sequence proceeds to step S93, and when "fallbackMode" is not applied to the block, the processing sequence proceeds to step S94.
[0177] In step S93 , the affine motion vector calculation unit 111E calculates the motion vector of each sub-block when “fallbackMode” is used.
[0178] As described above, when the mode is "fallbackMode", the motion vector values of all sub-blocks in the same block are the same. A known method can be used as a specific calculation method, and therefore, a detailed description thereof is omitted.
[0179] For example, in Non-Patent Document 1, the values of the above-mentioned "dHorX", "dHorY", "dVerX", and "dVerY" and the coordinate value of the center of the block when the coordinates of the upper left corner of the block are taken as the origin (values obtained by setting the height and width of the block to "1 / 2" respectively) are substituted into a predetermined model to calculate a motion vector. After step S93 is completed, this processing sequence moves to step S97 and ends the processing.
[0180] In step S94, the affine motion vector calculation unit 111E calculates the motion vector of each sub-block when the "fallbackMode" is not applied. A known method can be used as a specific calculation method, and therefore, a detailed description thereof is omitted.
[0181] For example, in non-patent document 1, the values of "dHorX", "dHorY", "dVerX", and "dVerY" and the coordinate values of the center of each sub-block when the coordinates of the upper left corner of the block are taken as the origin are substituted into a predetermined model to calculate a motion vector. After step S94, this processing sequence moves to step S95.
[0182] In step S95 , the affine motion vector calculation unit 111E determines whether or not the conditions for applying the PROF process to the block are satisfied.
[0183] The application condition may include a condition that the value of "sps_affine_prof_enabled_flag" is "1".
[0184] Furthermore, the application condition may include a condition that the value of "slice_disable_bdof_dmvr_prof_flag" indicates that PROF processing can be used in the slice (for example, the value of the flag is "0").
[0185] Furthermore, the application condition may include a condition that "fallbackMode" is not applied to the block.
[0186] When the affine motion vector calculation unit 111E determines that all application conditions are satisfied, it determines that the PROF process is applied to the block, and the process proceeds to step S96. Otherwise, it determines that the PROF process is not applied to the block, and the process proceeds to step S97 to end the process.
[0187] The above shows an example in which the affine motion vector calculation unit 111E determines whether all the application conditions are satisfied. However, the affine motion vector calculation unit 111E may determine by other logically equivalent methods.
[0188] Specifically, all the above-mentioned application conditions can also be reversed and defined as conditions for not applying PROF processing. When any situation meets the non-application conditions, the affine motion vector calculation unit 111E determines not to apply PROF processing to the block and proceeds to step S97. When none of the non-application conditions are met, it is determined to apply PROF processing to the block and proceeds to step S96.
[0189] The conditions for not applying PROF processing corresponding to the above example can be defined as follows.
[0190] The non-application condition may include a condition that the value of "sps_affine_prof_enabled_flag" is "0".
[0191] Furthermore, the non-application condition may include a condition that the value of "slice_disable_bdof_dmvr_prof_flag" indicates that the use of PROF processing in the slice is prohibited (for example, the value of the flag is "1").
[0192] Furthermore, the non-application condition may also include a condition that "fallbackMode" is applied to the block.
[0193] In step S96, the affine motion vector calculation unit 111E calculates the value of "diffMV" used in the PROF process. For example, the value of "diffMV" is calculated for each pixel position when the coordinates of the upper left corner of each sub-block are taken as the origin. In addition, when the size of each sub-block in the block is the same (for example, 4×4 pixels), the value of "diffMV" calculated for each pixel position of one sub-block can be used in other sub-blocks.
[0194] For example, "diffMV" can be calculated as follows.
[0195] diffMV[x][y][0]=x×(dHorX<<2)+y×(dVerX<<2)-posOffsetX
[0196] diffMV[x][y][1]=x×(dHorY<<2)+y×(dVerY<<2)-posOffsetYHere, x, y represent the position of each pixel (x, y) with the coordinates of the upper left corner of each sub-block as the origin, [0] represents the x-direction component of "diffMV", and [1] represents the y-direction component of "diffMV".
[0197] In addition, the following relationship holds.
[0198] posOffsetX=6×dHorX+6×dVerX
[0199] posOffsetY=6×dHorY+6×dVerY
[0200] Thereafter, as described in Non-Patent Document 1, the affine motion vector calculation unit 111E performs right shift and clipping processing.
[0201] After calculating "diffMV", the processing sequence moves to step S97 and ends the processing.
[0202] The above description is about the processing of one reference frame in the block. For example, when it is a bidirectional prediction with two reference frames, the processing of steps S91 to S97 is performed on L0 and L1 respectively. Therefore, the judgment result of whether to apply PROF processing or the calculation result of "diffMV" may be different for L0 and L1 respectively.
[0203] Fig.11 111F is a flowchart showing an example of the processing of the affine prediction signal generating unit 111F.
[0204] The affine prediction signal generating unit 111F is configured to generate a prediction signal by performing PROF processing when "slice_disable_bdof_dmvr_prof_flag" indicates that PROF processing can be used in the slice corresponding to the slice header (when the value of the flag is "0"), and not performing PROF processing when it indicates that PROF processing cannot be used (when the value of the flag is "1").
[0205] Furthermore, the affine prediction signal generator 111F may be configured to implicitly interpret that, when the slice header does not include “slice_disable_bdof_dmvr_prof_flag”, the flag indicates that the flag can be used (the value of the flag is “0”) and perform processing.
[0206] In step S111 , the affine prediction signal generation unit 111F generates a prediction signal.
[0207] Specifically, the affine prediction signal generating unit 111F takes the motion vector of each sub-block calculated by the affine motion vector calculating unit 111E as input, and when the position indicated by the motion vector is a non-integer pixel position, applies a filter to interpolate the pixel at the non-integer pixel position to the pixel value of the reference frame. Here, as for the specific filter, a horizontally and vertically separable filter with a maximum of 6 taps disclosed in Non-Patent Document 1 can be applied.
[0208] When the block is a block to be bidirectionally predicted, the affine prediction signal generator 111F generates both prediction signals of L0 and L1.
[0209] In step S112, the affine prediction signal generation unit 111F determines whether PROF processing is applied to the prediction direction (L0 or L1) of the block. In this determination, the determination result in step S95 described above can be used directly.
[0210] When it is determined that the PROF process is applied to the prediction direction of the block, the process sequence proceeds to step S113. On the other hand, when it is determined that the PROF process is not applied to the prediction direction of the block, the process sequence proceeds to step S114.
[0211] In step S113, the affine prediction signal generation unit 111F performs PROF processing. The specific processing of the PROF processing can use a known method, so its detailed description is omitted. The affine prediction signal generation unit 111F corrects the prediction signal through the PROF processing.
[0212] In step S114, when the block is a block for bidirectional prediction, the affine prediction signal generator 111F synthesizes the prediction signals of L0 and L1 generated in step S111 or the prediction signal obtained by correcting the prediction signal in step S113 to generate a final prediction signal. The specific synthesis method can use a known method, so its detailed description is omitted. When the block is a block for unidirectional prediction, the affine prediction signal generator 111F directly uses the prediction signal generated in step S111 or the prediction signal obtained by correcting the prediction signal in step S113 as the final prediction signal.
[0213] After the generation of the final prediction signal is completed, the processing sequence moves to step S115 and ends the processing.
[0214] In the above example, for convenience, the prediction signal generation unit 111D and the affine prediction signal generation unit 111F are described as different processing blocks, but part of their processing may be shared or may be set as a single processing block.
[0215] For example, step S81 and step S111 , and step S84 and step S114 may be regarded as the same process.
[0216] In this case, if Figure 8 After the judgment is "No" in step S82, the following steps are executed in sequence: Fig.10 Steps S112, S113 and S114 can be Figure 8 and Fig.10 The flowcharts of FIG. 1 and FIG. 2 are integrated and regarded as a single processing block. At this time, BDOF processing and PROF processing are exclusively applied in units of blocks.
[0217] (Loop Filter Processing Unit 150)
[0218] Next, the loop filter processing unit 150 according to the present embodiment will be described. Fig.12 2 is a diagram showing the loop filter processing unit 150 according to the present embodiment.
[0219] like Fig.12 As shown, the loop filter processing unit 150 includes a block boundary detection unit 151 , a boundary strength determination unit 153 , a filter determination unit 154 , and a filter processing unit 155 .
[0220] Here, the configuration with "A" at the end is a configuration related to the deblocking filtering process at the block boundary in the vertical direction, and the configuration with "B" at the end is a configuration related to the deblocking filtering process at the block boundary in the horizontal direction.
[0221] The following is an example of a case where a deblocking filtering process is performed on a block boundary in the horizontal direction after a deblocking filtering process is performed on a block boundary in the vertical direction.
[0222] As described above, the deblocking filter process can be applied to a coding block, a prediction block, or a transform block. Furthermore, the deblocking filter process can also be applied to sub-blocks obtained by dividing the above blocks. That is, the target block and the adjacent block can be a coding block, a prediction block, a transform block, or sub-blocks obtained by dividing them.
[0223] The definition of a sub-block includes the sub-block described as the processing unit of the refinement unit 111C and the prediction signal generation unit 111D. In addition, the definition of a sub-block includes the sub-block described as the processing unit of the affine motion vector calculation unit 111E and the affine prediction signal generation unit 111F. When deblocking filtering is applied to a sub-block, the block in the following description may be appropriately replaced with a sub-block.
[0224] Since the deblocking filtering process for the block boundary in the vertical direction is the same as the deblocking filtering process for the block boundary in the horizontal direction, the deblocking filtering process for the block boundary in the vertical direction will be described below.
[0225] The block boundary detection unit 151A is configured to detect the block boundary based on the control data indicating the block size. Here, the block is a coding block (CU), a prediction block (PU), or a transform block (TU). A known method can be applied to the specific detection method, so its detailed description is omitted.
[0226] The boundary strength determination unit 153A is configured to determine the boundary strength of the block boundary between the target block and the adjacent block.
[0227] The boundary strength determination unit 153A may be configured to determine the boundary strength of the block boundary based on control data indicating whether the target block and the adjacent block are intra-prediction blocks.
[0228] For example, Fig.13 As shown, the boundary strength judgment unit 153A can also be configured to judge that the boundary strength of the block boundary is "2" when at least one of the object block and the adjacent blocks is an intra-frame prediction block (that is, when at least one of the blocks on both sides of the block boundary is an intra-frame prediction block).
[0229] The boundary strength determination unit 153A may also be configured to determine the boundary strength of a block boundary based on control data indicating whether a non-zero (zero) orthogonal transformation coefficient is contained in the object block and the adjacent blocks, and whether the block boundary is a boundary of a transformation block.
[0230] For example, Fig.13As shown, the boundary strength judgment unit 153A can also be configured to judge that the boundary strength of the block boundary is "1" when at least any one of the object block and the adjacent blocks contains a non-zero orthogonal transform coefficient and the block boundary is the boundary of the transform block (that is, at least any one of the blocks on both sides of the block boundary has a non-zero transform coefficient and it is the boundary of the TU).
[0231] The boundary strength determination unit 153A may also be configured to determine the boundary strength of the block boundary based on control data indicating whether the absolute value of the difference between the motion vectors of the target block and the adjacent block is greater than a threshold value (eg, 1 / 2 pixel).
[0232] For example, Fig.13 As shown, the boundary strength judgment unit 153A can also be configured to judge that the boundary strength of the block boundary is "1" when the absolute value of the difference between the motion vectors of the object block and the adjacent block is greater than a threshold value (e.g., 1 / 2 pixel) (i.e., when the absolute value of the difference between the motion vectors of the blocks on both sides of the block boundary is greater than a threshold value (e.g., 1 / 2 pixel)).
[0233] The boundary strength determination unit 153A may be configured to determine the boundary strength of the block boundary based on control data indicating whether the reference blocks used for prediction of the motion vectors of the target block and the adjacent blocks are different.
[0234] For example, Fig.13 As shown, the boundary strength judgment unit 153A may also be configured to judge the boundary strength of the block boundary as "1" when the reference blocks used for predicting the motion vectors of the object block and the adjacent block are different (i.e., the reference images in the blocks on both sides of the block boundary are different).
[0235] The boundary strength determination unit 153A may be configured to determine the boundary strength of the block boundary based on control data indicating whether the number of motion vectors of the target block and the number of motion vectors of the adjacent blocks are different.
[0236] For example, Fig.13 As shown, the boundary strength judgment unit 153A may be configured to judge the boundary strength of the block boundary as "1" when the number of motion vectors of the object block and the adjacent block is different (that is, when the number of motion vectors in the blocks on both sides of the block boundary is different).
[0237] For example, Fig.13 As shown, the boundary strength determination unit 153A may be configured to determine that the boundary strength of the block boundary is "0" when none of the above conditions are satisfied.
[0238] In addition, it is likely that the larger the value of the boundary strength, the larger the block distortion generated at the block boundary.
[0239] For brightness signals and color difference signals, the above-mentioned boundary strength judgment method can be judged by a common method or by using partially different conditions.
[0240] The filter determination unit 154A is configured to determine the type of filter processing (for example, deblocking filter processing) to be applied to the block boundary.
[0241] For example, the filter determination unit 154A may determine whether to apply filtering to the block boundary, or whether to apply either weak filtering or strong filtering, based on the boundary strength of the block boundary, or quantization parameters included in the target block and the adjacent blocks.
[0242] The filter determination unit 154A may be configured to determine that the filter process is not to be applied when the boundary strength of the block boundary is “0”.
[0243] The filter processing unit 155A is configured to process the image before deblocking based on the determination result of the filter determination unit 154A. The process performed on the image before deblocking is no filter processing, weak filter processing, strong filter processing, or the like.
[0244] (Image Decoding Device 200)
[0245] Below, reference Fig.14 The image decoding device 200 according to this embodiment is described. Fig.14 This is a diagram showing an example of functional blocks of the image decoding device 200 according to the present embodiment.
[0246] like Fig.14 As shown, the image decoding apparatus 200 includes a decoding unit 210 , an inverse transform and inverse quantization unit 220 , an adder 230 , an inter prediction unit 241 , an intra prediction unit 242 , a loop filter processing unit 250 , and a frame buffer 260 .
[0247] The decoding unit 210 is configured to decode the encoded data generated by the image encoding device 100 and decode the coefficient level values.
[0248] Here, for example, decoding is entropy decoding in the reverse order to the entropy encoding performed by the encoding unit 140 .
[0249] Furthermore, the decoding unit 210 may be configured to acquire control data by decoding the encoded data.
[0250] In addition, as described above, the control data may include size data such as coding block size, prediction block size, and transform block size.
[0251] Furthermore, as described above, the control data may also include header information such as a sequence parameter set (SPS), a picture parameter set (PPS), and a slice header.
[0252] For example, the decoding unit 21 may be configured to decode, from the slice header, a flag for controlling whether the PROF process can be used, or a flag for collectively controlling whether the DMVR process, the BDOF process, and the PROF process can be used.
[0253] The inverse transform and inverse quantization unit 220 is configured to perform an inverse transform process on the coefficient level values output from the decoding unit 210. Here, the inverse transform and inverse quantization unit 220 may be configured to perform an inverse quantization on the coefficient level values before the inverse transform process.
[0254] Here, the inverse transform process and the inverse quantization are performed in the reverse order of the transform process and the quantization performed by the transform and quantization unit 131 .
[0255] The adder 230 is configured to add the prediction signal and the prediction residual signal output from the inverse transform and inverse quantization unit 220 to generate a pre-filtered decoded signal, and output the pre-filtered decoded signal to the intra prediction unit 242 and the loop filter processing unit 250 .
[0256] Here, the decoded signal before filtering constitutes a reference block used in the intra prediction unit 242 .
[0257] Similar to the inter-frame prediction unit 111 , the inter-frame prediction unit 241 is configured to generate a prediction signal by inter-frame prediction.
[0258] Specifically, the inter-frame prediction unit 241 is configured to generate a prediction signal for each prediction block based on a motion vector decoded from the coded data and a reference signal included in a reference frame. The inter-frame prediction unit 241 is configured to output the prediction signal to the adder 230 .
[0259] Similar to the intra prediction unit 112 , the intra prediction unit 242 is configured to generate a prediction signal by intra prediction (intraframe prediction).
[0260] Specifically, the intra prediction unit 242 is configured to designate a reference block included in the target frame, and to generate a prediction signal for each prediction block based on the designated reference block. The intra prediction unit 242 is configured to output the prediction signal to the adder 230 .
[0261] Similar to the loop filter processing unit 150 , the loop filter processing unit 250 is configured to perform filtering on the pre-filtering decoded signal output from the adder 230 and output the post-filtering decoded signal to the frame buffer 260 .
[0262] Here, the filtering process is, for example, a deblocking filtering process for reducing distortion generated at a boundary portion of a block (a coding block, a prediction block, a transform block, or a sub-block obtained by dividing these blocks).
[0263] Similar to the frame buffer 160 , the frame buffer 260 is configured to store reference frames used by the inter-frame prediction unit 241 .
[0264] Here, the filtered decoded signal constitutes a reference frame used in the inter-frame prediction unit 241 .
[0265] (Inter-frame prediction unit 241)
[0266] Below, reference Fig.15 The inter-frame prediction unit 241 according to this embodiment will be described. Fig.15 This is a diagram showing an example of functional blocks of the inter-frame prediction unit 241 according to the present embodiment.
[0267] like Fig.15 As shown, the inter prediction unit 241 includes a motion vector decoding unit 241B, a refinement unit 241C, a prediction signal generation unit 241D, an affine motion vector calculation unit 241E, and an affine prediction signal generation unit 241F.
[0268] The inter prediction unit 241 is an example of a prediction unit configured to generate a prediction signal included in a prediction block based on a motion vector.
[0269] The motion vector decoding unit 241B is configured to obtain a motion vector by decoding the control data received from the image encoding device 100 .
[0270] Furthermore, the motion vector decoding unit 241B is configured to also decode information on whether affine motion compensation is used for the block.
[0271] Here, when affine motion compensation is not used for the block, the processing of the refinement processing unit 241C and the prediction signal generation unit 241D is performed, and when affine motion compensation is used for the block, the processing of the affine motion vector calculation unit 241E and the affine prediction signal generation unit 241F is performed.
[0272] Similar to the thinning unit 111C, the thinning unit 241C is configured to execute thinning processing for correcting the motion vector.
[0273] Similar to the prediction signal generating unit 111D, the prediction signal generating unit 241D is configured to generate a prediction signal based on a motion vector.
[0274] Similar to the affine motion vector calculation unit 111E, the affine motion vector calculation unit 241E is configured to calculate the motion vector of each sub-block using the control point motion vector decoded by the motion vector decoding unit 241B.
[0275] Similar to the affine prediction signal generating unit 111F, the affine prediction signal generating unit 241F generates a prediction signal using the motion vector of each sub-block calculated by the affine motion vector calculating unit 241E, and similarly to the prediction signal generating unit 111D and the affine prediction signal generating unit 111F, the prediction signal generating unit 241D and the affine prediction signal generating unit 241F can also be integrated into the same processing block.
[0276] (Loop Filter Processing Unit 250)
[0277] Next, the loop filter processing unit 250 according to this embodiment will be described. Fig.16 2 is a diagram showing the loop filter processing unit 250 according to the present embodiment.
[0278] like Fig.16 As shown, the loop filter processing unit 250 includes a block boundary detection unit 251, a boundary strength judgment unit 253, a filter determination unit 254 and a filter processing unit 255.
[0279] Here, the configuration with "A" at the end is a configuration related to the deblocking filtering process at the block boundary in the vertical direction, and the configuration with "B" at the end is a configuration related to the deblocking filtering process at the block boundary in the horizontal direction.
[0280] Here, a case where the deblocking filtering process is performed on the block boundary in the horizontal direction after the deblocking filtering process is performed on the block boundary in the vertical direction is exemplified.
[0281] As described above, the deblocking filter process can be applied to a coding block, a prediction block, or a transform block. Furthermore, the deblocking filter process can also be applied to sub-blocks obtained by dividing the above blocks. That is, the target block and the adjacent block can be a coding block, a prediction block, a transform block, or sub-blocks obtained by dividing them.
[0282] Since the deblocking filtering process for the block boundary in the vertical direction is the same as the deblocking filtering process for the block boundary in the horizontal direction, the deblocking filtering process for the block boundary in the vertical direction will be described below.
[0283] Similar to the block boundary detection unit 151A, the block boundary detection unit 251A is configured to detect a block boundary based on control data indicating a block size.
[0284] The boundary strength determination unit 253A is configured to determine the boundary strength of the block boundary between the target block and the adjacent block, similarly to the boundary strength determination unit 153A. The method of determining the boundary strength of the block boundary is as described above.
[0285] Similar to the filter determination unit 154A, the filter determination unit 254A is configured to determine the type of deblocking filter processing to be applied to the block boundary. The method of determining the type of deblocking filter processing is as described above.
[0286] Similar to the filter processing unit 155A, the filter processing unit 255A is configured to process the image before deblocking based on the determination result of the filter determination unit 254A. The process performed on the image before deblocking is no filter processing, weak filter processing, strong filter processing, etc.
[0287] (Change Example 1)
[0288] Below, reference Fig.17 and Fig.18 Modification 1 of the above embodiment will be described. The following mainly describes the differences from the above embodiment. In the above embodiment, detailed descriptions of BDOF processing and PROF processing are omitted, but in this modification, an example of specific processing is described.
[0289] First, use Fig.17 A specific example of the BDOF process in step S83 will be described.
[0290] like Fig.17 As shown, in step S171, the prediction signal generation unit 111D / 241D calculates the brightness value gradients in the horizontal and vertical directions for each pixel in the reference blocks L0 and L1 corresponding to the block or sub-block to which the BDOF process is applied.
[0291] Specifically, the prediction signal generation unit 111D / 241D calculates the above-mentioned gradient for each pixel position (x, y) in the block using the following equation.
[0292] gradientHL0[x][y]=(predSamplesL0[hx+1][vy]>>shift1)-(predSamplesL0[hx-1][vy]>>shift1)
[0293] gradientV0[x][y]=(predSamplesL0[hx][vy+1]>shift1)-(predSamplesL0[hx][vy-1]>>shift1)
[0294] gradientHL1[x][y]=(predSamplesL1[hx+1][vy]>>shift1)-(predSamplesL1[hx-1][vy]>>shift1)
[0295] gradientV1[x][y]=(predSamplesL1[hx][vy+1]>shift1)-(predSamplesL0[hx][vy-1]>>shift1)
[0296] Here, "predSamplesL0" and "predSamplesL1" are prediction signals of L0 and L1 calculated in step S81. Furthermore, "hx" and "vy" are defined by the following equations.
[0297] In the following formula, "nCbW" is the width of the block, "nCbH" is the height of the block, and "Clip3(min, max, input)" is a function that limits the value of "input" to "min≦input≦max".
[0298] hx=Clip3(1,nCbW,x)
[0299] hy=Clip3(1,nCbH,y)
[0300] In addition, "shift1" is defined by the following formula.
[0301] shift1=Max(6, bitDepth-6)
[0302] Here, "bitDepth" is the bit depth when processing pixel values.
[0303] In step S172, the prediction signal generation unit 111D / 241D calculates the corrected MV.
[0304] Here, first, the prediction signal generation unit 111D / 241D calculates the values of the following three parameters for each pixel of the block or sub-block.
[0305] diff[x][y]=(predSamplesL0[hx][vy]>>shift2)-(predSamplesL1[hx][vy]>>shift2)
[0306] tempH[x][y]=(gradientHL0[x][y]+gradientHL1[x][y])>>shift3tempV[x][y]=(gradientVL0[x][y]+gradientVL1[x][y])>>shift3Here, “shift2” and “shift3” are defined by the following formulas.
[0307] shift2 = Max(4, bitDepth - 8)
[0308] shift3=Max(3,15-bitDepth)
[0309] Secondly, the prediction signal generation unit 111D / 241D divides the block or sub-block into 4×4 pixel blocks, and calculates parameters for each 4×4 pixel block as described below.
[0310] [Mathematical formula 1]
[0311] sGx2=∑ i ∑ j Abs(tempH[XSb+i][ySb+j])with i,j=-1..4
[0312] sGy2=∑ i ∑ j Abs(tempV[xSb+i][ySb+j])with i,j=-1..4
[0313] sGxGy=Σ i ∑ j (Sign(tempV[xSb+i][ySb+j])*tempH[xSb+i][ySb+j])with i,j=-1..4
[0314] SXWh m =sGxGy>>12
[0315] SXWh s =sGxGy&((1<<12)-1)
[0316] sGxdI=∑ i ∑ j (-Sign(tempH[xSb+i][ySb+j])*diff[xSb+i][ySb+j])with i,j=-1..4
[0317] sGydI=∑ i ∑ j (-Sign(tempV[xSb+i][ySb+j])*diff[xSb+i][ySb+j])with i,j=-1..4
[0318] Here, "xSb" and "yXb" are the coordinates of the upper left pixel of each 4×4 pixel block when the upper left pixel of the block or sub-block is the origin. And, "Sign(input)" is a function that returns "1" when the value of "input" is positive, returns "-1" when the value of "input" is negative, and returns "0" when the value of "input" is "0".
[0319] As described below, the prediction signal generation unit 111D / 241D calculates the corrected MV (vx, vy) using the values calculated in the above manner.
[0320] vx=sGx2>0? Clip3(-mvRefineThres, mvRefineThres-1,-(sGxdI<<3)>>Floor(Log2(sGx2))): 0
[0321] vy=sGx2>0? Clip3(-mvRefineThres, mvRefineThres-1, ((sGydI<<3)-((vx×sGxGy m )<<12+vx×sGxGy s )>>1)>>Floor(Log2(sGx2))): 0
[0322] Here, "mvRefineThres" is defined by the following formula.
[0323] mvRefineThres=1<<Max(5, bitDepth-7)
[0324] By setting it as said structure, the bit width of each component of correction MV (vx, vy) can be suppressed to "1<<Max(5, bitDepth-7)+1" bits (including the sign).
[0325] In step S173 , the prediction signal generation unit 111D / 241D corrects the prediction signal of each pixel as described below.
[0326] bdofOffset=(vx×(gradientHL0[x+1][y+1]-gradientHL1[x+1][y+1]))>>1+(vy×(gradientVL0[x+1][y+1]-gradientVL1[x+1][y+1]))>>1
[0327] pbSamples[x][y]=Clip3(0,(2 bitDepth )-1, (predSamplesL0[x+1][y+1]+offset4+predSamplesL1[x+1][y+1]+bdofOffset)>>shift4)
[0328] Here, "offset4" and "shift4" are defined as follows.
[0329] offset4=1<<(shift4-1)
[0330] shift4=Max(3,15-bitDepth)
[0331] After performing all the above processing, the prediction signal generation unit 111D / 241D proceeds to step S174 and ends the processing.
[0332] Next, use Fig.18 A specific example of the PROF process in step S113 will be described.
[0333] like Fig.18 As shown, in step S181, the affine prediction signal generation unit 111F / 241F calculates the brightness value gradients in the horizontal and vertical directions for each pixel in the reference blocks L0 and L1 to which the PROF process is applied.
[0334] Specifically, the affine prediction signal generation unit 111F / 241F calculates the gradient for each pixel position (x, y) within the block using the following formula.
[0335] gradientH[x][y]=(predSamples[x+2][y]>>shift1)-(predSamples[x][y]>>shift1)
[0336] gradientV[x][y]=(predSamples[x][y+2]>>shift1)-(predSamples[x][y]>>shift1)
[0337] Here, "predSamples" is the prediction signal of L0 or L1 generated in step S111. Here, it is assumed that shift1 = Max(6, bitDepth-6).
[0338] When the PROF process is applied to both L0 and L1, the affine prediction signal generation unit 111F / 241F calculates the above-mentioned "gradientH" and "gradientV" for L0 and L1, respectively. At this time, the calculation content in step S181 is exactly the same as the calculation content in step S171 in terms of pixels.
[0339] In step S182, the affine prediction signal generating unit 111F / 241F calculates the correction MV. This process is actually performed as step S96 inside the affine motion vector calculating unit 111E / 241E, but for convenience, it is described as the process performed in step S182. In fact, the affine prediction signal generating unit 111F / 241F can directly use the value calculated in step S96.
[0340] First, similarly to the description of step S96 above, the affine prediction signal generation unit 111F / 241F calculates the value of "diffMv".
[0341] diffMv[x][y][0]=x×(dHorX<<2)+y×(dVerX<<2)−posOffsetX diffMv[x][y][1]=x×(dHorY<<2)+y×(dVerY<<2)−posOffsetY Second, the affine prediction signal generation unit 111F / 241F right-shifts the value of “diffMv” by 7 bits.
[0342] Third, as described below, the affine prediction signal generation unit 111F / 241F performs clipping processing.
[0343] diffMv[x][y][i]=Clip3(-dmvLimit, dmvLimit-1, diffMv[x][y][i])
[0344] Here,
[0345] dmvLimit=1<<Max(5, bitDepth-7).
[0346] By adopting the above configuration, the bit width of each component of "diffMv" can be suppressed to within "1<<Max(5, bitDepth-7)+1" bits (including the sign). This bit width is the same as the correction MV calculated in step S172.
[0347] In step S183, the affine prediction signal generation unit 111F / 241F corrects the prediction signal.
[0348] As described below, the affine prediction signal generation unit 111F / 241F corrects the value of the prediction signal "pbSamples" for the block and prediction direction to which the PROF process is applied.
[0349] dI=gradientH[x][y]×diffMv[x][y][0]+gradientV[x][y]×diffMv[x][y][1]
[0350] pbSamples[x][y]=predSamples[x+1][y+1]+(dI>>1)
[0351] When the PROF process is applied to both L0 and L1, the affine prediction signal generation unit 111F / 241F executes the above-described process on L0 and L1, respectively.
[0352] After completing the above correction, the affine prediction signal generation unit 111F / 241F moves to step S184 and ends the PROF processing.
[0353] After the PROF process is completed, the affine prediction signal generation unit 111F / 241F performs the prediction value synthesis process described in step S114. The prediction value synthesis can be performed, for example, by the following equation.
[0354] predSamples[x][y]=Clip3(0, (1<<bitDepth)-1, (predSamplesL0[x][y]+predSamplesL1[x][y]+offset2)>>shift2)
[0355] Here,
[0356] offset2=1<<(shift2-1)
[0357] shift2=Max(3,15-bitDepth).
[0358] In addition, when both the prediction signal "predSamplesL0" on the L0 side and the prediction signal "predSamplesL1" on the L1 side are corrected by further PROF processing, if the calculation of step S183 is substituted into "predSamplesL0" and "predSamplesL1", the following transformation can be performed.
[0359] dI_Bi=(dI_L0>>1)+(dI_L1>>1)
[0360] pbSamples[x][y]=Clips(0, (1<<bitDepth)-1, (predSamplesL0_orig[x][y]+offset2+predSamplesL1_orig[x][y]+dI_Bi)>>shift2)
[0361] Here, “dI_L0” and “dI_L1” are the values of dI of L0 and L1, respectively, and “predSamplesL0_orig” and “predSamplesL1_orig” are prediction signals before correction by PROF processing.
[0362] The values of the gradient and correction MV calculated in the BDOF process and PROF process described above are respectively clipped so as to have the same bit width, and therefore the bit widths of “bdofOffset” and “dI_Bi” calculated thereby are also the same.
[0363] That is, the calculation may be performed as follows: the offset calculated in the BDOF processing performed by the prediction signal generating unit 111D / 241D and the offset calculated for the two reference frames (L0 / L1) in the PROF processing performed by the affine prediction signal generating unit 111F / 241F have the same bit width as the value synthesized.
[0364] Furthermore, the values of "offset2" and "shift2" when synthesizing the prediction signal after PROF processing are the same as the values of "offset4" and "shift4" in BDOF processing. Therefore, the prediction value generation process when applying BDOF processing and PROF processing to both L0 and L1 is exactly the same formula.
[0365] By configuring the BDOF process and the PROF process as described above, the following effects are achieved.
[0366] First, the gradient calculation processing of step S171 and step S181 can be made completely the same processing.
[0367] That is, when the PROF processing is applied to two reference frames (L0 / L1), the gradient calculation processing in the BDOF processing performed by the prediction signal generating unit 111D / 241D and the gradient calculation processing in the PROF processing performed by the affine prediction signal generating unit 111F / 241F can be made the same processing.
[0368] Second, the bit widths of the corrected MVs, which are outputs of step S172 and step S182, can be made completely the same.
[0369] That is, it is possible to perform clipping processing so that the correction MV amount in the BDOF processing performed by the prediction signal generating unit 111D / 241D and the correction MV amount used in the PROF processing performed by the affine prediction signal generating unit 111F / 241F have the same bit width.
[0370] Third, the predicted value correction process of step S173, the predicted value correction process of step S183, and the predicted value synthesis process of step S114 can be made completely the same process.
[0371] That is, the final prediction signal generation process performed by the prediction signal generation unit 111D / 241D using the offset and the final prediction signal generation process performed by the affine prediction signal generation unit 111F / 241F using the value synthesized by the offset can be made the same process.
[0372] As described above, since the BDOF process and the PROF process are applied exclusively to each block, when the same processing portion is implemented in hardware, the processing circuit can be shared between the BDOF process and the PROF process, thereby reducing the circuit scale.
[0373] (Change Example 2)
[0374] Below, reference Fig.19 and Fig. 20 A second modification of the above embodiment will be described. The following mainly describes the differences from the above embodiment. In this modification, a block boundary detection method in the block boundary detection unit 151 / 251 and a boundary strength determination method in the boundary strength determination unit 153 / 253 are described using examples different from those in the above embodiment.
[0375] The block boundary detection unit 151A will be described below, but the block boundary detection unit 151B / 251A / 251B can also detect the block boundary through the same processing.
[0376] Fig.19 15A is a flowchart showing an example of the processing of the block boundary detection unit 151A. Hereinafter, a case where the processing is performed in units of CUs will be described as an example.
[0377] In step S191, the block boundary detection unit 151A detects a CU boundary. Since the block boundary detection unit 151A is a processing block for detecting a vertical boundary, the vertical boundary on the left side of the CU is detected as a block boundary to be filtered.
[0378] In addition, "detected as a block boundary" is equivalent to, for example, preparing in advance a two-dimensional flag sequence (for example, "edgeFlags[x][y]") indicating whether the pixel position in the picture is a boundary, setting the flag value of the pixel position detected as the boundary to "1", and setting the flag value of the pixel position not detected as the boundary to "0".
[0379] Here, when the vertical boundary on the left side of the CU is located at a boundary of a coding unit such as a picture boundary, a slice boundary, or a tile boundary, the block boundary detection unit 151A may not detect the boundary as a block boundary.
[0380] After detecting the CU boundary in the above-described procedure, the block boundary detection unit 151A moves to step S192 .
[0381] In step S192, the block boundary detection unit 151A detects a TU boundary (transform block boundary).
[0382] The block boundary detection unit 151A starts from the vertical boundary on the left side of the CU, increases the horizontal coordinate by 4 pixels each time, and increases the vertical pixel position by 1 pixel each time, while checking whether each pixel position is a TU boundary. If the pixel position is a TU boundary, the block boundary detection unit 151A detects the pixel position as a block boundary.
[0383] After detecting the TU boundary in the above-described procedure, the block boundary detection unit 151A moves to step S193.
[0384] In step S193 , the block boundary detection unit 151A detects sub-block boundaries.
[0385] In step S193 , the sub-block boundary to be detected may be, for example, a sub-block boundary of a CU after inter-frame prediction.
[0386] At this time, the above-mentioned sub-block boundaries may include both the boundaries of sub-blocks (for example, 16×16 pixel size) in the DMVR processing performed by the refinement unit 111C / 241C, and the boundaries of sub-blocks (for example, 4×4 pixel size) in the affine motion compensation performed by the affine motion vector calculation unit 111E / 241E and the affine prediction signal generation unit 111F / 241F.
[0387] In step S193 , the sub-block boundary to be detected may be, for example, a sub-block boundary of a CU after affine motion compensation or “merge_subblock” is applied.
[0388] In addition, when the PROF process is applied to the CU, the sub-blocks subjected to the affine motion compensation are consistent with the sub-blocks subjected to the PROF process.
[0389] Here, when the sub-block boundary of affine motion compensation is used as the detection target in step S193, when PROF processing is applied to the CU, the block boundary detection unit 151A may not use the sub-block boundary of affine motion compensation and the sub-block boundary of PROF processing as the detection target.
[0390] That is, the block boundary detection unit 151A may detect the sub-block boundary of affine motion compensation only when affine motion compensation is applied to the CU and PROF processing is not applied to the CU. Of course, for a CU to which PROF processing is applied, the block boundary detection unit 151A may detect the sub-block boundary of affine motion compensation and the sub-block boundary of PROF processing.
[0391] In addition, for the sub-block boundary of the block to be bidirectionally predicted, when the PROF process is applied to at least one of L0 and L1, the block boundary detection unit 151A may regard the block as a "CU to which the PROF process is applied". Furthermore, the block boundary detection unit 151A may regard the block as a "CU to which the PROF process is applied" only when the PROF process is applied to both L0 and L1. The same explanation can be applied in the following description.
[0392] The block boundary detection unit 151A takes the vertical boundary on the left side of the CU as the starting point, increases the horizontal coordinate by the sub-block size calculated by the following method, and increases the vertical pixel position by 1 pixel, while checking whether each pixel position is a sub-block boundary.
[0393] When the pixel position is a sub-block boundary, the block boundary detection unit 151A detects the pixel position as a block boundary. Here, even if the position is a sub-block boundary, when the PROF process is applied to the CU, the block boundary detection unit 151A may not detect it as a sub-block boundary.
[0394] For example, the above sub-block size can be calculated as follows.
[0395] Subblock size = Max(8, (nCbW / NumSbX))
[0396] Here, "nCbW" is the width of the CU (the number of pixels in the horizontal direction), and "NumSbX" is the number of sub-blocks included in the horizontal direction within the CU.
[0397] When the above formula is used, it is determined whether the sub-block boundary is a sub-block boundary starting from the vertical boundary on the left side of the CU and located at a minimum of every 8 pixels in the horizontal direction.
[0398] For example, the above sub-block size may also be calculated as follows.
[0399] Subblock size = Max(4, (nCbW / NumSbX))
[0400] At this time, it is determined whether the sub-block boundary is a sub-block boundary starting from the vertical boundary on the left side of the CU and located at a minimum of every 4 pixels in the horizontal direction.
[0401] That is, the block boundary detection unit 151A is configured to determine whether the target pixel position is a sub-block boundary at a minimum interval of 4 pixels, based on the coordinates of the left end or the top end of the target block.
[0402] After detecting the sub-block boundary in accordance with the above-described procedure, the block boundary detection unit 151A moves to step S194 and ends the processing.
[0403] The above description takes the example of simply detecting the block boundary without distinguishing the CU boundary, TU boundary, and sub-block boundary respectively, but they may also be distinguished and stored.
[0404] For example, the data may be stored as CU boundaries, TU boundaries, and sub-block boundaries, or as TU boundaries and motion vector boundaries. In this case, the CU boundary is detected as both the TU boundary and the motion vector boundary. Furthermore, the TU boundary is detected as the TU boundary, and the sub-block boundary is detected as the motion vector boundary. This distinction may be used, for example, in the boundary strength determination unit 153A described below.
[0405] The boundary strength judgment unit 153A is described below. Exactly the same judgment can also be performed in the boundary strength judgment unit 153B / 253A / 253B.
[0406] The boundary strength determination unit 153A may be configured to determine the boundary strength as “0” when the target pixel position is not a block boundary.
[0407] That is, the block boundary detection unit 151 can be configured to not detect the sub-blocks within the block to which PROF processing is applied as block boundaries, the boundary strength judgment unit 153A can be configured to judge the boundary strength of pixel positions that are not detected as block boundaries as "0", and the filter determination unit 154 can be configured to determine that deblocking filtering is not applied to the block boundary when the boundary strength is "0".
[0408] The boundary strength determination unit 153A may be configured to determine the boundary strength of the block boundary based on control data indicating whether the target block and the adjacent block are intra-prediction blocks.
[0409] For example, Fig. 20 As shown, the boundary strength judgment unit 153A can also be configured to judge that the boundary strength of the block boundary is "2" when at least one of the object block and the adjacent blocks is an intra-frame prediction block (that is, when at least one of the blocks on both sides of the block boundary is an intra-frame prediction block).
[0410] The boundary strength determination unit 153A may also be configured to determine the boundary strength of a block boundary based on control data indicating whether a non-zero (zero) orthogonal transformation coefficient is contained in the object block and the adjacent blocks, and whether the block boundary is a boundary of a transformation block.
[0411] For example, Fig. 20 As shown, the boundary strength judgment unit 153A can also be configured to judge that the boundary strength of the block boundary is "1" when at least any one of the object block and the adjacent blocks contains a non-zero orthogonal transform coefficient and the block boundary is the boundary of the transform block (that is, at least any one of the blocks on both sides of the block boundary has a non-zero transform coefficient and it is the boundary of the TU).
[0412] The boundary strength determination unit 153A may also be configured to determine the boundary strength of the block boundary based on control data indicating whether the absolute value of the difference between the motion vectors of the target block and the adjacent block is greater than a threshold value (e.g., 1 / 2 pixel). In this case, the boundary strength of the boundary may also be determined based on whether the block boundary is a sub-block boundary within the block to which the PROF process is applied.
[0413] For example, Fig. 20 As shown, the boundary strength judgment unit 153A can also be configured to judge the boundary strength of the block boundary as "1" when the absolute value of the difference between the motion vectors of the object block and the adjacent block is greater than a threshold value (for example, 1 / 2 pixel) (that is, the absolute value of the difference between the motion vectors of the blocks on both sides of the block boundary is greater than a threshold value (for example, 1 / 2 pixel)), and the block boundary is not a sub-block (4×4 pixel block) boundary of the block to which PROF processing is determined to be applied in step S95.
[0414] That is, the boundary strength judgment unit 153A may be configured to judge the boundary strength for each block boundary, and to judge the boundary strength as "1" when the absolute value of the difference in motion vectors of blocks on both sides of the block boundary is greater than 1 / 2 pixel and the block boundary is not a sub-block boundary after PROF processing is applied.
[0415] Here, the filter determination unit 154 may be configured to determine not to apply the deblocking filter to the block boundary when the boundary strength is “0”.
[0416] For example, the boundary strength judgment unit 153A may also be configured to judge the boundary strength of the block boundary as "1" when the absolute value of the difference between the motion vectors of the object block and the adjacent block is greater than a threshold value (e.g., 1 / 2 pixel) (i.e., the absolute value of the difference between the motion vectors of the blocks on both sides of the block boundary is greater than a threshold value (e.g., 1 / 2 pixel)), and the blocks on both sides of the block boundary are not the blocks to which PROF processing is determined in step S95.
[0417] For example, the boundary strength judgment unit 153A may also be configured to judge the boundary strength of the block boundary as "1" when the absolute value of the difference between the motion vectors of the object block and the adjacent block is greater than a threshold value (e.g., 1 / 2 pixel) (i.e., the absolute value of the difference between the motion vectors of the blocks on both sides of the block boundary is greater than a threshold value (e.g., 1 / 2 pixel)), and when at least one block at the block boundary is not a block determined in step S95 to be subject to PROF processing.
[0418] In addition, for a sub-block boundary of a block subjected to bidirectional prediction, when PROF processing is applied in at least one of L0 and L1, it can also be regarded as "a block determined to be subjected to PROF processing". That is, in this case, when PROF processing is not applied in both L0 and L1, the boundary strength is determined to be "1" when the difference in motion vectors is greater than the threshold.
[0419] That is, the boundary strength determination unit 153A may be configured to regard the PROF process as being applied to the target block when the target block is bidirectionally predicted and the PROF process is applied to at least one of the two reference frames.
[0420] Alternatively, only when PROF processing is applied to both L0 and L1, it is considered that "a block is determined to be applied PROF processing." That is, in this case, when PROF processing is applied only to L0 or L1 and the difference in motion vectors is greater than a threshold, the boundary strength is determined to be "1."
[0421] As another example, the following judgment may be made: for a block boundary to which PROF processing is applied, when judging the boundary strength, the difference in motion vectors is not judged, or the difference in motion vectors is regarded as “0”. As a specific example, the judgment may be made as follows.
[0422] When the block is a block for unidirectional prediction and PROF is applied to the block, when determining the boundary strength of the sub-block boundary, the difference in motion vectors is not determined or is regarded as "0".
[0423] When the block is a block for bidirectional prediction and the reference frame on the L0 side is different from the reference frame on the L1 side, the difference in motion vectors is not determined or is regarded as "0" in the prediction directions (only L0, only L1, or both) of PROF applied in the L0 side and the L1 side.
[0424] When the block is a block for bidirectional prediction and the reference frame on the L0 side and the reference frame on the L1 side are the same frame, when PROF is applied on the L0 side, the difference between the motion vectors of L0 on both sides of the sub-block boundary is not determined, or the difference between the motion vectors of L0 on both sides of the sub-block boundary is regarded as "0".
[0425] Likewise, when PROF is applied on the L1 side, the difference between the motion vectors of L1 on both sides of the sub-block boundary is not determined, or is regarded as "0".
[0426] In this case, as in the past, the difference in motion vectors between L0 and L1 is used to determine the boundary strength. Specifically, for example, the difference in motion vectors between the L0 side of the sub-block on the left side of the sub-block boundary and the L1 side of the sub-block on the right side of the sub-block boundary is used to determine the boundary strength.
[0427] That is, the boundary strength judgment unit 153A may also be configured to, when judging the difference in motion vectors of blocks on both sides of the object boundary in the same prediction direction, not judge the difference in motion vectors in the prediction direction when PROF processing is applied in the prediction direction, or regard the difference in motion vectors in the prediction direction as "0".
[0428] Alternatively, when the block is a block for bidirectional prediction and the reference frame on the L0 side and the reference frame on the L1 side are the same frame, when PROF is applied to the motion vectors on both sides of the sub-block boundary respectively, the difference in the motion vectors may not be determined, or the difference in the motion vectors may be regarded as "0".
[0429] In this case, for example, when PROF is applied to both the L0 side and the L1 side, the difference in motion vector between L0 and L1 is not determined, or is regarded as "0", which is different from the above example.
[0430] The boundary strength determination unit 153A may be configured to determine the boundary strength of the block boundary based on control data indicating whether the reference blocks used for prediction of the motion vectors of the target block and the adjacent blocks are different.
[0431] For example, Fig. 20 As shown, the boundary strength judgment unit 153A may also be configured to judge the boundary strength of the block boundary as "1" when the reference blocks used for predicting the motion vectors of the object block and the adjacent block are different (i.e., the reference images in the blocks on both sides of the block boundary are different).
[0432] The boundary strength determination unit 153A may be configured to determine the boundary strength of the block boundary based on control data indicating whether the number of motion vectors of the target block and the number of motion vectors of the adjacent blocks are different.
[0433] For example, Fig. 20 As shown, the boundary strength judgment unit 153A may be configured to judge the boundary strength of the block boundary as "1" when the number of motion vectors of the object block and the adjacent block is different (that is, when the number of motion vectors in the blocks on both sides of the block boundary is different).
[0434] The above describes an example of a method of using a motion vector or a reference block to determine the boundary strength, but the determination using a motion vector or a reference block may be performed only on a block boundary detected as the above-mentioned CU boundary, sub-block boundary or motion vector boundary.
[0435] In other words, it is also possible to skip the determination of using a motion vector or a reference block at a block boundary that is a TU boundary but not a subblock boundary or a motion vector boundary. In this case, at the TU boundary, only whether there is a non-zero orthogonal transform coefficient in at least one of the blocks on both sides of the boundary.
[0436] For example, Fig. 20 As shown, the boundary strength determination unit 153A may be configured to determine that the boundary strength of the block boundary is "0" when none of the above conditions are satisfied.
[0437] That is, the affine prediction signal generation unit 111F / 241F is configured to determine whether PROF is appropriate for each block, and when the PROF process is applied, the PROF process is performed on each sub-block obtained by dividing the block.
[0438] Furthermore, the loop filter processing unit 150 / 250 is configured to determine whether the deblocking filter is appropriate for each block boundary, and determine not to apply the deblocking filter to the sub-block boundary of the block to which the PROF process is applied.
[0439] By setting the above configuration, the boundary strength of the block boundary or sub-block boundary after the PROF processing is applied is "0", and the deblocking filter is no longer applied. Since the PROF processing has the effect of improving the subjective image quality, by setting the configuration as such, it is possible to prevent the following situation: due to the correction of the pixel value of the block boundary by the deblocking filter, the subjective image quality is damaged.
[0440] Furthermore, the above-described image encoding apparatus 100 and image decoding apparatus 200 may be realized by a program that causes a computer to execute each function (each step).
[0441] In addition, in the above-mentioned embodiments, the application of the present invention to the image encoding device 100 and the image decoding device 200 is described as an example, but the present invention is not limited to this example, and can also be applied to an image encoding / decoding system having the functions of the image encoding device 100 and the image decoding device 200.
[0442] According to the present invention, by making the bit widths of the variables in the BDOF process and the PROF process consistent, circuits can be shared, thereby reducing the circuit scale.
[0443] [Explanation of symbols]
[0444] 10: image processing system; 100: image encoding device; 111, 241: inter-frame prediction unit; 111A: motion vector search unit; 111B: motion vector encoding unit; 111C, 241C: refinement unit; 111D, 241D: prediction signal generation unit; 111E, 241E: affine motion vector calculation unit; 111F, 241F: affine prediction signal generation unit; 112, 242: intra-frame prediction unit; 121: subtractor; 122, 230: adder; 131: transformation and quantization unit; 132, 220: inverse transformation and inverse quantization unit; 140: encoding unit; 150, 250: loop filter processing unit; 160, 260: frame buffer; 200: image decoding device; 210: decoding unit; 241B: motion vector decoding unit.
Claims
1. An image decoding device, characterized in that: The image decoding device includes a prediction signal generating unit, the prediction signal generating unit being configured to: determine whether an application condition of a bidirectional optical flow (BDOF) process is satisfied for each block, and if it is determined that the application condition is satisfied, perform the BDOF process and generate a prediction signal; In the BDOF process, the correction amount is calculated based on the linear weighted sum of the gradient of the brightness values of the two reference frames and the weight coefficient. The prediction signal generating unit is configured to generate the prediction signal based on the calculated correction amount. As the application conditions, a condition related to the time distance between the two reference frames and the frame based on the weight coefficient is included, In the application condition, a ratio of a temporal distance between each of the two reference frames and the frame is determined to be proportional to the inverse of the weight coefficient.
2. The image decoding device according to claim 1, characterized in that When the weight coefficients are equal, the condition related to the time distance includes that the time distances between the two reference frames and the frame are equal as the application condition.
3. An image decoding method, characterized in that: include: A step of determining whether the application conditions of the BDOF process are met for each block; as well as When it is determined that the application condition is satisfied, the step of executing the BDOF processing and generating a prediction signal is performed. In the BDOF process, the correction amount is calculated based on the linear weighted sum of the gradient of the brightness values of the two reference frames and the weight coefficient. In the step, the prediction signal is generated based on the calculated correction amount. As the application conditions, a condition related to the time distance between the two reference frames and the frame based on the weight coefficient is included, In the application condition, a ratio of a temporal distance between each of the two reference frames and the frame is determined to be proportional to the inverse of the weight coefficient.
4. A program for causing a computer to function as an image decoding device, the program being characterized in that: The image decoding device includes a prediction signal generating unit configured to determine whether an application condition of the BDOF process is satisfied for each block, and if it is determined that the application condition is satisfied, perform the BDOF process and generate a prediction signal. In the BDOF process, the correction amount is calculated based on the linear weighted sum of the gradient of the brightness values of the two reference frames and the weight coefficient. The prediction signal generating unit is configured to generate the prediction signal based on the calculated correction amount. As the application conditions, a condition related to the time distance between the two reference frames and the frame based on the weight coefficient is included, In the application condition, a ratio of a temporal distance between each of the two reference frames and the frame is determined to be proportional to the inverse of the weight coefficient.