Image encoding device and image decoding device
The image decoding apparatus addresses poorer loop filter performance on chrominance images by adaptive filtering and referencing luminance images, improving quality and reducing memory usage.
Patent Information
- Application Number
- JP2023176960
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-10-12
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2039-08-28
AI Technical Summary
Existing video encoding methods, such as those described in Non-Patent Document 1, perform poorer loop filter processing on chrominance images compared to luminance images, and require significant memory for storing intermediate images when processing color difference images with reference to luminance images.
An image decoding apparatus that includes a parameter decoding mechanism for cross-component parameters, a filter coefficient derivation process for adaptive loop filtering of luminance and chrominance images, and a clipping mechanism to enhance chrominance image quality by referring to luminance images, thereby reducing memory usage and improving image quality.
The solution enhances chrominance image quality while reducing memory requirements by increasing the amount of chrominance filter information and referencing luminance images during processing.
Smart Images

Figure 0007612805000001 
Figure 0007612805000002 
Figure 0007612805000003
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to an image decoding device and an image encoding device. [Background technology]
[0002] In order to efficiently transmit or record moving images, a moving image encoding device is used that generates encoded data by encoding moving images, and a moving image decoding device is used that generates a decoded image by decoding the encoded data.
[0003] Specific examples of video encoding methods include H.264 / AVC and High-Efficiency Video Coding (HEVC).
[0004] In such a video coding method, images (pictures) constituting a video are managed in a hierarchical structure consisting of slices obtained by dividing images, coding tree units (CTUs) obtained by dividing slices, coding units (sometimes called coding units: CUs) obtained by dividing coding tree units, and transform units (TUs) obtained by dividing coding units, and are coded / decoded for each CU.
[0005] In such a video coding method, a predicted image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes called a "difference image" or "residual image") obtained by subtracting the predicted image from the input image (original image) is coded. Methods for generating a predicted image include inter-prediction and intra-prediction. Another technique is to use a loop filter to improve the image quality of a reference image used to generate a predicted image, thereby improving the image quality of a decoded image without increasing the amount of code.
[0006] Furthermore, Non-Patent Document 1 is an example of a recent video encoding and decoding technique, and a technique for performing loop filtering by multi-stage filtering such as a deblocking filter, a sample offset filter (SAO), and an adaptive loop filter (ALF) is known.
[0007] Also, a technique is known in which a loop filter for a certain color component refers to an image of another color component. [Prior art documents] [Non-patent literature]
[0008] [Non-Patent Document 1] "Versatile Video Coding (Draft 6)", JVET-O2001-vE, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11 Summary of the Invention [Problem to be solved by the invention]
[0009] However, the method described in Non-Patent Document 1 has a problem that the loop filter is weaker in processing the chrominance image than the luminance image. Also, when performing loop filter processing on the chrominance image by referring to the luminance image, a large memory is required to store the intermediate image. [Means for solving the problem]
[0010] An image decoding device according to one embodiment of the present invention is an image decoding device for decoding an input image, comprising: parameter decoding means for decoding cross component parameters from encoded data; filter coefficient derivation means for deriving cross component filter coefficients using the cross component parameters; filter means for applying an adaptive loop filter to a luminance image and a chrominance image to output a filtered luminance image and a filtered chrominance image; cross component filter means for deriving a summed value using the equation (sum+64)>>7, where the sum is a product-sum value of the luminance image and the cross component filter coefficients; clipping means for deriving a clipped value by clipping the summed value to a range based on a bit depth; and addition means for deriving a modified filtered chrominance image by adding the clipped value to the filtered chrominance image. Effect of the Invention
[0011] According to one aspect of the present invention, in an image encoding / decoding process, by increasing the amount of chrominance filter information to be notified and by referring to a luminance image in addition to a chrominance image, it is possible to improve the image quality of a chrominance image while reducing the amount of memory used. [Brief description of the drawings]
[0012] [Figure 1] 1 is a schematic diagram showing a configuration of an image transmission system according to an embodiment of the present invention. [Diagram 2] 1 is a diagram showing the configuration of a transmitting device equipped with a video encoding device according to the present embodiment, and a receiving device equipped with a video decoding device, where (a) shows the transmitting device equipped with the video encoding device, and (b) shows the receiving device equipped with the video decoding device. [Diagram 3]1 is a diagram showing the configuration of a recording device equipped with a video encoding device according to the present embodiment, and a playback device equipped with a video decoding device, where (a) shows the configuration of a recording device equipped with a video encoding device, and (b) shows the configuration of a playback device equipped with a video decoding device. [Figure 4] FIG. 2 is a diagram showing a hierarchical structure of data in an encoded stream. [Diagram 5] FIG. 1 is a schematic diagram showing a configuration of a video decoding device. [Figure 6] 11 is a flowchart illustrating a schematic operation of the video decoding device. [Figure 7] FIG. 1 is a block diagram showing a configuration of a video encoding device. [Figure 8] FIG. 2 is a block diagram showing a configuration of a loop filter according to the present invention; [Figure 9] FIG. 2 is a block diagram showing a configuration of a loop filter according to the present invention; [Figure 10] FIG. 2 is a diagram showing the shape of a loop filter according to the present invention; [Figure 11] FIG. 2 illustrates the syntax of the loop filter of the present invention. [Figure 12] FIG. 2 is a diagram showing the shape of a loop filter according to the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] (First embodiment) Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0014] FIG. 1 is a schematic diagram showing the configuration of an image transmission system 1 according to this embodiment.
[0015] The image transmission system 1 is a system that transmits an encoded stream obtained by encoding a target image, decodes the transmitted encoded stream, and displays an image. The image transmission system 1 includes a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and a video display device (image display device) 41.
[0016] An image T is input to the video encoding device 11 .
[0017] The network 21 transmits the encoded stream Te generated by the video encoding device 11 to the video decoding device 31. The network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination of these. The network 21 is not necessarily limited to a bidirectional communication network, and may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. The network 21 may also be replaced by a storage medium on which the encoded stream Te is recorded, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blue-ray Disc: registered trademark).
[0018] The video decoding device 31 decodes each of the coded streams Te transmitted by the network 21, and generates one or more decoded images Td.
[0019] The video display device 41 displays all or part of one or more decoded images Td generated by the video decoding device 31. The video display device 41 includes a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. The display may be in the form of a stationary display, a mobile display, an HMD, or the like. When the video decoding device 31 has high processing power, it displays high quality images, and when it has only low processing power, it displays images that do not require high processing power or display power.
[0020] <operator> The operators used in this specification are listed below.
[0021] >> is a right bit shift, << is a left bit shift, & is a bitwise AND, | is a bitwise OR, |= is the OR assignment operator, and || indicates logical OR.
[0022] x?y:z is a ternary operator that takes y when x is true (non-zero) and z when x is false (0).
[0023] Clip3(a, b, c) is a function that clips c to a value between a and b (inclusive). It returns a if c < a, b if c > b, and c otherwise (assuming a <= b).
[0024] abs(a) is a function that returns the absolute value of a.
[0025] Int(a) is a function that returns the integer value of a.
[0026] floor(a) is a function that returns the largest integer less than or equal to a.
[0027] ceil(a) is a function that returns the smallest integer greater than or equal to a.
[0028] a / d represents the division of a by d, rounded down to the nearest integer.
[0029] x..y represents the set of integers from x to y (inclusive). Or, it represents performing a predetermined process repeatedly on the integers from x to y.
[0030] <Structure of the Encoded Stream Te> Prior to the detailed description of the moving image encoding device 11 and the moving image decoding device 31 according to this embodiment, the data structure of the encoded stream Te generated by the moving image encoding device 11 and decoded by the moving image decoding device 31 will be described.
[0031] Fig. 4 is a diagram showing a hierarchical structure of data in an encoded stream Te. The encoded stream Te illustratively includes a sequence and a plurality of pictures constituting the sequence. (a) to (f) of Fig. 4 show an encoded video sequence that defines a sequence SEQ, an encoded picture that defines a picture PICT, an encoded slice that defines a slice S, encoded slice data that defines slice data, an encoding tree unit included in the encoded slice data, and an encoding unit included in the encoding tree unit, respectively.
[0032] (Coded Video Sequence) The coded video sequence defines a set of data to be referred to by the video decoding device 31 in order to decode the sequence SEQ to be processed. As shown in Fig. 4, the sequence SEQ includes a video parameter set, a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), an adaptation parameter set APS (Adaptation Parameter Set), a picture PICT, and supplemental enhancement information SEI (Supplemental Enhancement Information).
[0033] The video parameter set VPS specifies a set of coding parameters common to multiple videos composed of multiple layers, as well as a set of coding parameters related to multiple layers and each individual layer included in the video.
[0034] The sequence parameter set SPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode the target sequence. For example, the width and height of a picture are specified. Note that there may be multiple SPSs. In that case, one of the multiple SPSs is selected from the PPS.
[0035] The picture parameter set PPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode each picture in the target sequence. For example, the picture parameter set PPS includes a reference value of the quantization width (pic_init_qp_minus26) used in decoding the picture and a flag (weighted_pred_flag) indicating the application of weighted prediction. Note that there may be multiple PPSs. In that case, one of the multiple PPSs is selected for each picture in the target sequence.
[0036] The adaptive parameter set APS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode each slice in a target sequence. For example, the APS includes ALF parameters (filter coefficients, clipping values) used in decoding a picture. Note that there may be multiple APSs, and each slice header notifies information for selecting one of the multiple APSs. The same APS can be shared by multiple pictures. An APS may be referenced by multiple subsequent pictures. Also, when a picture includes multiple slices, different slices may reference different APSs.
[0037] The color format of the picture can be Y, Cb, Cr or R, G, B or other. Also, the sampling for each color component can be different. For example, the horizontal ratio of the first, second, and third color components is indicated as SubWidthC, and the vertical ratio is indicated as SubHeightC, as the ratio of the number of samples for the first, second, and third color components. For example, 4:4:4, 4:2:2, and 4:2:0 are respectively as follows. 4:2:0, SubWidthC = 2, SubHeightC = 2 4:2:2, SubWidthC = 2, SubHeightC = 1 4:4:4, SubWidthC = 1, SubHeightC = 1 The video encoding device 11 and the video decoding device 31 may encode and decode chroma_format_idc. chroma_format_idc = 0, 4:0:0(monochrome) chroma_format_idc = 1, 4:2:0 chroma_format_idc = 2, 4:2:2 chroma_format_idc = 3, 4:4:4 (Encoded Picture) A coded picture defines a set of data to be referenced by the video decoding device 31 in order to decode a picture PICT to be processed. As shown in Fig. 4, the picture PICT includes slices 0 to NS-1 (NS is the total number of slices included in the picture PICT).
[0038] In the following description, when there is no need to distinguish between slices 0 to NS-1, the subscripts of the symbols may be omitted. The same applies to other data that are included in the coded stream Te and that are to be described below and that are to be given subscripts.
[0039] (Coded Slice) A coded slice defines a set of data to be referenced by the video decoding device 31 in order to decode a target slice S. As shown in Fig. 4, a slice includes a slice header and slice data.
[0040] The slice header includes a group of coding parameters to be referred to by the video decoding device 31 in order to determine a decoding method for the current slice. Slice type designation information (slice_type) that designates the slice type is an example of a coding parameter included in the slice header.
[0041] Slice types that can be specified by the slice type specification information include (1) an I slice that uses only intra prediction when encoding, (2) a P slice that uses unidirectional prediction or intra prediction when encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction when encoding. Note that inter prediction is not limited to uni-prediction or bi-prediction, and a predicted image may be generated using more reference pictures. Hereinafter, when referring to P or B slice, it refers to a slice including a block that can use inter prediction.
[0042] In addition, the slice header may include a reference to a picture parameter set PPS (pic_parameter_set_id).
[0043] (Encoded slice data) The coded slice data defines a set of data to be referenced by the video decoding device 31 in order to decode the slice data to be processed. As shown in Fig. 4(d), the slice data includes a CTU. A CTU is a block of a fixed size (e.g., 64x64) that constitutes a slice, and is also called a Largest Coding Unit (LCU).
[0044] (coding tree unit) 4 specifies a set of data that the video decoding device 31 refers to in order to decode a CTU to be processed. The CTU is divided into coding units CU, which are basic units of encoding processing, by recursive quad tree division (QT (Quad Tree) division), binary tree division (BT (Binary Tree) division), or ternary tree division (TT (Ternary Tree) division). BT division and TT division are collectively called multi tree division (MT (Multi Tree) division). A node of a tree structure obtained by recursive quad tree division is called a coding node. Intermediate nodes of a quad tree, binary tree, and ternary tree are coding nodes, and the CTU itself is specified as the top coding node.
[0045] Also, when the size of the CTU is 64x64 pixels, the size of the CU can be any of the following: 64x64 pixels, 64x32 pixels, 32x64 pixels, 32x32 pixels, 64x16 pixels, 16x64 pixels, 32x16 pixels, 16x32 pixels, 16x16 pixels, 64x8 pixels, 8x64 pixels, 32x8 pixels, 8x32 pixels, 16x8 pixels, 8x16 pixels, 8x8 pixels, 64x4 pixels, 4x64 pixels, 32x4 pixels, 4x32 pixels, 16x4 pixels, 4x16 pixels, 8x4 pixels, 4x8 pixels, and 4x4 pixels.
[0046] (Encoding Unit) 4 specifies a set of data to be referred to by the video decoding device 31 in order to decode a coding unit to be processed. Specifically, a CU is composed of a CU header CUH, prediction parameters, transformation parameters, quantization transformation coefficients, etc. The CU header specifies a prediction mode, etc.
[0047] The prediction process may be performed on a CU basis, or on a sub-CU basis by further dividing a CU. If the size of a CU and a sub-CU are the same, there is one sub-CU in the CU. If the size of a CU is larger than that of a sub-CU, the CU is divided into sub-CUs. For example, if the CU is 8x8 and the sub-CU is 4x4, the CU is divided into 2 parts horizontally and 2 parts vertically, into 4 sub-CUs.
[0048] There are two types of prediction (prediction modes): intra prediction and inter prediction. Intra prediction is a prediction within the same picture, while inter prediction refers to a prediction process performed between different pictures (for example, between display times or between layer images).
[0049] The transform and quantization processes are performed in units of CUs, but the quantized transform coefficients may be entropy coded in units of sub-blocks such as 4x4.
[0050] (Prediction parameters) The predicted image is derived from prediction parameters associated with the block, which include intra-prediction and inter-prediction parameters.
[0051] (Configuration of a video decoding device) The configuration of a video decoding device 31 (FIG. 5) according to this embodiment will be described.
[0052] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (prediction image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generating unit (prediction image generating device) 308, an inverse quantization and inverse transform unit 311, an adder 312, and a prediction parameter derivation unit 320. Note that, in accordance with the video encoding device 11 described below, the video decoding device 31 may also be configured not to include the loop filter 305.
[0053] The parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), and the CU decoding unit 3022 further includes a TU decoding unit 3024. These may be collectively referred to as a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, PPS, and APS, and slice header (slice information) from the encoded data. The CT information decoding unit 3021 decodes the CT from the encoded data. The CU decoding unit 3022 decodes the CU from the encoded data. When a prediction error is included in the TU, the TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the encoded data. The parameter decoding unit 302 may decode chroma_format_idc to derive SubWidthC and SubHeightC.
[0054] In cases other than the skip mode (skip_mode==0), the TU decoding unit 3024 decodes the QP update information and the quantized prediction error from the encoded data. More specifically, in cases of skip_mode==0, the TU decoding unit 3024 decodes a flag cu_cbp indicating whether or not the current block includes a quantized prediction error, and decodes the quantized prediction error when cu_cbp is 1. When cu_cbp does not exist in the encoded data, it derives 0.
[0055] The TU decoding unit 3024 decodes an index mts_idx indicating a transformation base from the coded data. The TU decoding unit 3024 also decodes an index stIdx indicating the use of a secondary transformation and a transformation base from the coded data. When stIdx is 0, it indicates no application of a secondary transformation, when it is 1, it indicates one transformation of a set (pair) of secondary transformation bases, and when it is 2, it indicates the other transformation of the pair.
[0056] Furthermore, the TU decoding unit 3024 may decode a sub-block transform flag cu_sbt_flag. When cu_sbt_flag is 1, the CU is divided into a plurality of sub-blocks, and the residual of only one specific sub-block is decoded. Furthermore, the TU decoding unit 3024 may decode a flag cu_sbt_quad_flag indicating whether the number of sub-blocks is 4 or 2, cu_sbt_horizontal_flag indicating the division direction, and cu_sbt_pos_flag indicating a sub-block including a non-zero transform coefficient.
[0057] The predicted image generating unit 308 includes an inter predicted image generating unit 309 and an intra predicted image generating unit 310 .
[0058] The prediction parameter derivation unit 320 is configured to include an inter prediction parameter derivation unit 303 and an intra prediction parameter derivation unit 304 .
[0059] In addition, although an example in which CTU and CU are used as processing units will be described below, the present invention is not limited to this example, and processing may be performed in sub-CU units. Alternatively, CTU and CU may be read as blocks, and sub-CU as sub-blocks, and processing may be performed in block or sub-block units.
[0060] The entropy decoding unit 301 performs entropy decoding on the externally inputted coded stream Te to decode each code (syntax element). There are two types of entropy coding: a method of variable-length coding the syntax element using a context (probability model) adaptively selected according to the type of syntax element and surrounding circumstances, and a method of variable-length coding the syntax element using a predetermined table or formula. The former CABAC (Context Adaptive Binary Arithmetic Coding) stores the CABAC state of the context (probability state index pStateIdx that specifies the type (0 or 1) and probability of the most probable symbol) in memory. The entropy decoding unit 301 initializes all CABAC states at the beginning of a segment (tile, CTU row, slice). The entropy decoding unit 301 converts the syntax element into a binary string (Bin String) and decodes each bit of the Bin String. When a context is used, a context index ctxInc is derived for each bit of the syntax element, the bit is decoded using the context, and the CABAC state of the used context is updated. Bits that do not use a context are decoded with equal probability (EP, bypass), and the derivation of ctxInc and the CABAC state are omitted. The decoded syntax elements include prediction information for generating a predicted image and a prediction error for generating a difference image.
[0061] The entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. The decoded code is, for example, a prediction mode predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX, amvr_mode, etc. Control of which code to decode is performed based on an instruction from the parameter decoding unit 302.
[0062] (Basic flow) FIG. 6 is a flowchart illustrating a schematic operation of the video decoding device 31.
[0063] (S1100: Decode Parameter Set Information) The header decoding unit 3020 decodes parameter set information such as the VPS, SPS, and PPS from the encoded data.
[0064] (S1200: Decode slice information) The header decoding unit 3020 decodes the slice header (slice information) from the encoded data.
[0065] Thereafter, the video decoding device 31 repeats the processes from S1300 to S5000 for each CTU included in the target picture to derive a decoded image of each CTU.
[0066] (S1300: Decode CTU Information) The CT information decoding unit 3021 decodes the CTU from the encoded data.
[0067] (S1400: Decode CT Information) The CT information decoding unit 3021 decodes the CT from the encoded data.
[0068] (S1500: CU Decoding) The CU decoding unit 3022 performs S1510 and S1520 to decode the CU from the encoded data.
[0069] (S1510: Decoding CU information) The CU decoding unit 3022 decodes the CU information, prediction information, the TU split flag split_transform_flag, the CU residual flags cbf_cb, cbf_cr, cbf_luma, and the like from the encoded data.
[0070] (S1520: TU information decoding) When a prediction error is included in a TU, the TU decoding unit 3024 decodes the QP update information, the quantization prediction error, and the transform index mts_idx from the encoded data. Note that the QP update information is a difference value from the quantization parameter predicted value qPpred, which is a predicted value of the quantization parameter QP.
[0071] (S2000: Generation of predicted image) The predicted image generation unit 308 generates a predicted image for each block included in the current CU based on the prediction information.
[0072] (S3000: Inverse Quantization and Inverse Transformation) The inverse quantization and inverse transform unit 311 executes inverse quantization and inverse transform processing for each TU included in the target CU.
[0073] (S4000: Generate decoded image) The adder 312 adds the predicted image supplied from the predicted image generation unit 308 and the prediction error supplied from the inverse quantization and inverse transform unit 311 to generate a decoded image of the current CU.
[0074] (S5000: Loop Filter) The loop filter 305 applies a loop filter such as a deblocking filter, SAO, or ALF to the decoded image to generate a decoded image.
[0075] (Inter-prediction image generation unit 309) When predMode indicates inter prediction mode, the inter prediction image generation unit 309 generates a prediction image of a block or sub-block by inter prediction using the inter prediction parameters and reference picture input from the inter prediction parameter derivation unit 303.
[0076] The inter-prediction image generation unit 309 outputs the generated prediction image of the block to the addition unit 312 .
[0077] (Intra-prediction image generation unit 310) When predMode indicates an intra prediction mode, the intra prediction image generation unit 310 performs intra prediction using the intra prediction parameters input from the intra prediction parameter derivation unit 304 and reference pixels read from the reference picture memory 306 .
[0078] The inverse quantization and inverse transform unit 311 inverse quantizes the quantized transform coefficients input from the parameter decoding unit 302 to obtain transform coefficients.
[0079] The adder 312 generates a decoded image of the block by adding, for each pixel, the predicted image of the block input from the predicted image generation unit 308 and the prediction error input from the inverse quantization and inverse transform unit 311. The adder 312 stores the decoded image of the block in the reference picture memory 306, and also outputs it to the loop filter 305.
[0080] The loop filter 305 applies a deblocking filter, SAO, and ALF to the decoded image generated by the adder 106. Fig. 8(c) is a block diagram of the loop filter. The video decoding device 31 includes a loop filter 305 (a deblocking filter 3051, an SAO unit 3052, and an ALF unit 3053), and the video encoding device 11 includes a loop filter 107 (a deblocking filter 1071, an SAO unit 1072, and an ALF unit 1073). Note that the configuration may not include SAO, or may include a different filter instead of SAO.
[0081] The deblocking filter (3051, 1071) applies a low-pass filter to the boundary when adjacent input images across a prediction boundary or a transform boundary (e.g., a boundary between CU, PU, and TU) are smaller than a predetermined threshold, and smoothes the pixels near the boundary. The pixels that have been subjected to the deblocking filter are output to the SAO unit (3052, 1072). Note that the input image Rec1 is the output of the adder 312, or the output of luma mapping with chroma scaling (LMCS) if LMCS is applied. LMCS is a process of scaling luminance pixel values using a histogram of decoded luminance.
[0082] The SAO (Sample Adaptive Offset) unit (3052, 1072) classifies pixels for an input image for each predetermined unit, and adds a decoded offset according to the classification. Offset parameters, such as a classification method and offset value, are input from a parameter decoding unit 302 in the video decoding device 31, and are input from an encoding parameter determination unit 110 in the video encoding device 11. Pixels after the SAO process are output to an ALF unit (3053, 1073). Note that the input image Rec3 is an image that has been deblocked filtered if the deblocking filter is on, and is an image before the deblocking filter is applied if the deblocking filter is off.
[0083] The ALF unit (3053, 1073) applies an adaptive loop filter (ALF) to the input image for each predetermined unit (block). The pixels AlfPic that have been subjected to the ALF are output to the outside and stored in the reference picture memory (306, 109). Note that the input image Rec2 is an image that has been subjected to SAO when SAO is on, and is an image before SAO is applied when SAO is off. The target block may be a CTU, a CU, or a fixed size (for example, 64*64 pixels, 32*32 pixels), etc. In the following, the case where the target block is a CTU will be described, but the same description applies to target blocks other than a CTU. FIG. 10 shows examples of filter shapes. FIG. 10(a) shows a 7*7 filter with a diamond shape, (b) shows a 5*5 filter with a diamond shape, (c) shows a 3*3 filter with a diamond shape, and (d) shows a 1*1 filter. These filter coefficients may be point-symmetrical with respect to the center of the filter. The number of taps NTAP (the number of reference pixels used to filter the target picture) of the diamond-shaped filter is 25, 13, 5, and 1 for 7x7, 5x5, 3x3, and 1x1, respectively. When symmetry is used, the number of filter coefficients NumAlfFilterCoeff can be reduced to 13, 7, 3, and 1, respectively.
[0084] 8(a) is a block diagram showing the configuration of the ALF unit 3053 of the video decoding device 31. The ALF unit 3053 includes a filter set derivation unit 30531 and a filter processing unit 30532. The filter processing unit 30532 includes a characteristic derivation unit 30533, a selection unit 30534, and a filter unit 30535.
[0085] (Filter set extraction part) The filter set derivation unit 30531 derives a set of filter coefficients (filter set) to be used in the target picture or target slice. The filter set is notified using an adaptive parameter set (APS). One APS can notify NumApsAlf filters. The filter set derivation unit 30531 derives a filter set from syntax elements of the APS decoded by the parameter decoding unit 302. These filter sets are filters that can be used in the target picture or target slice. In the following, the filter set for luma is represented by AlfCoeffL[apsId][filtIdx][j], and the filter set for chroma is represented by AlfCoeffC[apsCId][j]. The apsId is an ID that specifies the APS to which the filter is notified (for example, apsId = 0..31). filtIdx is a filter index (fltIdx = 0 ..NumApsALf-1) that specifies one of the NumApsAlf filters notified by a certain APS. j represents the position of the coefficient included in one filter (j = 0..NumApsALfFilterCoeff-1). Since only one chrominance filter is notified by one APS, filtIdx is not necessary. apsCId is an ID that specifies the APS that notified the chrominance filter.
[0086] Information regarding clipping values required for deriving filters is also notified by the APS. The filter set derivation unit 30531 derives clipping values from syntax elements of the APS decoded by the parameter decoding unit 302. The clipping value for luminance is represented by AlfClipL[apsId][filtIdx][j], and the clipping value for chrominance is represented by AlfClipC[apsCId][j].
[0087] The filter set derivation unit 30531 outputs AlfCoeffL[][][], AlfCoeffC[][], AlfClipL[][][], and AlfClipC[][] to the selection unit 30534.
[0088] (Characteristics Derivation Part) The characteristic deriving unit 30533 divides the CTU into multiple sub-blocks and assigns a class to each sub-block. Using this class, a filter index filtIdx that selects one filter to be used in the filter processing unit 30532 from the above-mentioned filter set is derived. In addition, an index transposeIdx required for transposing the filter coefficients is derived. In the following, the size of the sub-block is assumed to be 4x4, but the same explanation applies to sizes other than 4x4.
[0089] If the input image to the ALF unit 3053 is rP[][], the top left coordinates of the target block are (xCtb, yCtb), the pixel position within the target block is (x, y), and the size of the target block is wCtb, hCtb, the characteristic derivation unit 30533 derives absolute pixel difference values filtH, filtV, filtD0, and filtD1 in the horizontal, vertical, and diagonal directions using the following equations. In the following, the array subscripts [x][y] may be abbreviated as [x, y].
[0090] filtH[x][y] = abs((rP[xCtb+x,yCtb+y]<<1)-rP[xCtb+x-1,yCtb+y]-rP[xCtb+x+1,yCtb+y]) filtV[x][y] = abs((rP[xCtb+x,yCtb+y]<<1)-rP[xCtb+x,yCtb+y-1]-rP[xCtb+x,yCtb+y+1]) filtD0[x][y] = abs((rP[xCtb+x,yCtb+y]<<1)-rP[xCtb+x-1,yCtb+y-1]-rP[xCtb+x+1, yCtb+y+1]) filtD1[x][y] = abs((rP[xCtb+x,yCtb+y]<<1)-rP[xCtb+x+1,yCtb+y-1]-rP[xCtb+x-1, yCtb+y+1]) For x=0..(wCtb-1)>>2 and y=0..(hCtb-1)>>2, the characteristic deriving unit 30533 derives the sums of absolute difference values of each sub-block, sumH, sumV, sumD0, and sumD1, and the activity sumOfHV using the following equations, where Σ is the sum of i, j = -2..5.
[0091] sumH[x][y] = ΣΣfiltH[(x<<2)+i][(y<<2)+j] sumV[x][y] = ΣΣfiltV[(x<<2)+i][(y<<2)+j] sumD0[x][y] = ΣΣfiltD0[h(x<<2)+i][v(y<<2)+j] sumD1[x][y] = ΣΣfiltD1[h(x<<2)+i][v(y<<2)+j] sumOfHV[x][y] = sumH[x][y]+sumV[x][y] The characteristic deriving unit 30533 derives variables hv0, hv1, and dirHV using the sums of the difference values of each sub-block, sumH and sumV. If sumV[x>>2][y>>2] is greater than sumH[x>>2][y>>2], the following formula is used for derivation.
[0092] hv1 = sumV[x>>2][y>>2] hv0 = sumH[x>>2][y>>2] dirHV = 1 If not, derive it using the following formula:
[0093] hv1 = sumH[x>>2][y>>2] hv0 = sumV[x>>2][y>>2] dirHV = 3 The characteristic derivation unit 30533 derives variables d0, d1, and dirD using the sums sumD0 and sumD1 of the difference values of each sub-block. If sumD0[x>>2][y>>2] is greater than sumD1[x>>2][y>>2], it is derived using the following formula.
[0094] d1 = sumD0[x>>2][y>>2] d0 = sumD1[x>>2][y>>2] dirD = 0 If not, derive it using the following formula:
[0095] d1 = sumD1[x>>2][y>>2] d0 = sumD0[x>>2][y>>2] dirD = 2 The characteristic derivation unit 30533 derives variables hvd1 and hvd0 using hv0, hv1, dirHV, d0, d1, and dirD.
[0096] hvd1 = (d1*hv0>hv1*d0) ? d1:hv1 hvd0 = (d1*hv0>hv1*d0) ? d0:hv0 The characteristic derivation unit 30533 derives the directional variables dirS[x][y], dir1[x][y], and dir2[x][y] using the following equation.
[0097] dir1[x][y] = (d1*hv0>hv1*d0) ? dirD:dirHV dir2[x][y] = (d1*hv0>hv1*d0) ? dirHV:dirD dirS[x][y] = (hvd1>2*hvd0) ? 1:((hvd1*2>9*hvd0) ? 2:0) The characteristic derivation unit 30533 derives the class avgVar[x][y] according to the activity sumOfHV.
[0098] avgVar[x][y] = varTab[Clip3(0,15,(sumOfHV[x>>2][y>>2]*ac)>>(3+BitDepthY))] varTab[] = { 0, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4} Here, BitDepthY is the bit depth of luminance, and ac is a predetermined constant, for example, 64 or 96.
[0099] The characteristic derivation unit 30533 derives filtIdx[x][y] and transposeIdx[x][y] using avgVar, dir2, and dirS.
[0100] transposeIdx[x][y] = transposeTable[dir1[x][y]*2+(dir2[x][y]>>1)] transposeTable[] = { 0, 1, 0, 2, 2, 3, 1, 3} filtIdx[x][y] = avgVar[x][y] If dirS[x][y] is not 0, filtIdx[x][y] may be changed as follows:
[0101] filtIdx[x][y] += (((dir1[x][y]&0x1)<<1)+dirS[x][y])*5 According to the above formula, the same value is stored in filtIdx[][] and transposeIdx[][] for each sub-block.
[0102] The characteristic derivation unit 30533 outputs filtIdx[][] and transposeIdx[][] to the selection unit 30534.
[0103] (Selection section) The selection unit 30534 selects the filter coefficients f[] and the clipping coefficients f[] using the outputs AlfCoeffL[][][], AlfCoeffC[][], AlfClipL[][][], and AlfClipC[][] of the filter set derivation unit 30531, the outputs transposeIdx[][] and filtIdx[][] of the characteristic derivation unit 30533, and the outputs apsId and apsCId of the parameter decoding unit. Derive the iterative value c[].
[0104] The luminance filter f[] and clipping value c[] are derived using the following formulas.
[0105] f[j] = AlfCoeffL[apsId][filtIdx[x][y]][j] c[j] = AlfClipL[apsId][filtIdx[x][y]][j] In the case of luminance, the order of the filter coefficients is changed according to transposeIdx[][]. Therefore, the filter coefficient and clipping value applied by the filter unit 30535 are f[idx[j]] and c[idx[j]].
[0106] For example, if transpose[x][y] is 1, then idx[]={9, 4, 10, 8, 1, 5, 11, 7, 3, 0, 2, 6}; if transposeIndex[x][y] is 2, then idx[]={0, 3, 2, 1, 8, 7, 6, 5, 4, 9, 10, 11}; if transposeIndex[x][y] is 3, then idx[]={9, 8, 10, 4, 3, 7, 11, 5, 1, 0, 2, 6}; otherwise, idx[]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}. For example, when transpose[x][y]=0, {a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11} is {f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], f[9], f
[10] , f
[11] }. However, when transpose[x][y]=1, {a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11} is {f[9], f[4], f
[10] , f[8], f[1], f[5], f
[11] , f[7], f[3], f[0], f [2], f[6]}. Note that a12 is derived using a0 to a11.
[0107] a12 = 128 - 2*Σam Σ represents the sum of m=0..11, that is, a12 is 128 minus twice the sum of a0 to a11.
[0108] The color difference filter f[] and clipping value c[] are derived using the following formula.
[0109] f[j] = AlfCoeffC[apsCId][j] c[j] = AlfClipC[apsCId][j] The selection unit 30534 outputs f[], c[], and idx[] to the filter unit 30535.
[0110] (Filter section) The filter unit 30535 applies ALF to the input image rP[] using the outputs f[], c[], and idx[] of the selection unit 30534.
[0111] In the case of luminance, if the input image is rPL[x,y], the target pixel is curr, and the output image is AlfPicL[x][y], ALF can be expressed by the following formula. Note that the filter is 7*7.
[0112] curr = rPL[x,y] (Formula ALF-1) sum = f[idx[0]]*(Clip3(-c[idx[0]],c[idx[0]],rPL[x,y+3]-curr)+ Clip3(-c[idx[0]],c[idx[0]],rPL[x,y-3]-curr))+ f[idx[1]]*(Clip3(-c[idx[1]],c[idx[1]],rPL[x+1,y+2]-curr)+ Clip3(-c[idx[1]],c[idx[1]],rPL[x-1,y-2]-curr))+ f[idx[2]]*(Clip3(-c[idx[2]],c[idx[2]],rPL[x,y+2]-curr)+ Clip3(-c[idx[2]],c[idx[2]],rPL[x,y-2]-curr))+ f[idx[3]]*(Clip3(-c[idx[3]],c[idx[3]],rPL[x-1,y+2]-curr)+ Clip3(-c[idx[3]],c[idx[3]],rPL[x+1,y-2]-curr))+ f[idx[4]]*(Clip3(-c[idx[4]],c[idx[4]],rPL[x+2,y+1]-curr)+ Clip3(-c[idx[4]],c[idx[4]],rPL[x-2,y-1]-curr))+ f[idx[5]]*(Clip3(-c[idx[5]],c[idx[5]],rPL[x+1,y+1]-curr)+ Clip3(-c[idx[5]],c[idx[5]],rPL[x-1,y-1]-curr))+ f[idx[6]]*(Clip3(-c[idx[6]],c[idx[6]],rPL[x,y+1]-curr)+ Clip3(-c[idx[6]],c[idx[6]],rPL[x,y-1]-curr))+ f[idx[7]]*(Clip3(-c[idx[7]],c[idx[7]],rPL[x-1,y+1]-curr)+ Clip3(-c[idx[7]],c[idx[7]],rPL[x+1,y-1]-curr))+ f[idx[8]]*(Clip3(-c[idx[8]],c[idx[8]],rPL[x-2,y+1]-curr)+ Clip3(-c[idx[8]],c[idx[8]],rPL[x+2,y-1]-curr))+ f[idx[9]]*(Clip3(-c[idx[9]],c[idx[9]],rPL[x+3,y]-curr)+ Clip3(-c[idx[9]],c[idx[9]],rPL[x-3,y]-curr))+ f[idx
[10] ]*(Clip3(-c[idx
[10] ],c[idx
[10] ],rPL[x+2,y]-curr)+ Clip3(-c[idx
[10] ],c[idx
[10] ],rPL[x-2,y]-curr))+ f[idx
[11] ]*(Clip3(-c[idx
[11] ],c[idx
[11] ],rPL[x+1,y]-curr)+ Clip3(-c[idx
[11] ],c[idx
[11] ],rPL[x-1,y]-curr)) sum = curr+((sum+64)>>7) AlfPicL[xCtb+x][yCtb+y] = Clip3(0,(1<<BitDepthY)-1,sum) BitDepthY is the bit depth of the luma pixels, where 64 and 7 are the constant and shift value of the round shift process, respectively, and can be different values.
[0113] In the case of color difference, if the input image is rPC[x,y], the target pixel is curr, and the output image is AlfPicC[x][y], ALF can be expressed by the following formula. Note that the filter is 5*5.
[0114] curr = rPC[x,y] (Formula ALF-2) sum = f[0]*(Clip3(-c[0],c[0],rPC[x,y+2]-curr)+ Clip3(-c[0],c[0],rPC[x,y-2]-curr))+ f[1]*(Clip3(-c[1],c[1],rPC[x+1,y+1]-curr)+ Clip3(-c[1],c[1],rPC[x-1,y-1]-curr))+ f[2]*(Clip3(-c[2],c[2],rPC[x,y+1]-curr)+ Clip3(-c[2],c[2],rPC[x,y-1]-curr))+ f[3]*(Clip3(-c[3],c[3],rPC[x-1,y+1]-curr)+ Clip3(-c[3],c[3],rPC[x+1,y-1]-curr))+ f[4]*(Clip3(-c[4],c[4],rPC[x+2,y]-curr)+ Clip3(-c[4],c[4],rPC[x-2,y]-curr))+ f[5]*(Clip3(-c[5],c[5],rPC[x+1,y]-curr)+ Clip3(-c[5],c[5],rPC[x-1,y]-curr)) sum = curr+(sum+64)>>7 AlfPicC[xCtbC+x][yCtbC+y] = Clip3(0,(1< <BitDepthC)-1,sum) BitDepthC is the bit depth of the chrominance pixels. The filter unit 30535 outputs AlfPicL[][] and AlfPicC[][] to the outside (display device) and the reference picture memory 306. AlfPicC[][] is AlfPicCb[][] or AlfPicCr[][].
[0115] Fig. 9 is a block diagram explaining an ALF unit 3053A which is another embodiment of the ALF unit. In the ALF unit 3053 in Fig. 8, there are fewer options for chrominance filters compared to luminance, and the number of pixels to be referenced is also small. In this embodiment, the amount of chrominance filter information to be notified is increased, and the image quality of the chrominance image is improved by referring to the luminance image in addition to the chrominance image.
[0116] 9, a CC filter coefficient derivation unit 30536, an ALFCC 30537, an adder 30538, and a clipping unit 30540 are added to FIG. 8(a). The ALFTC 30535 is the same as the filter unit 30535 in FIG. 8(a). The ALF unit 3053A derives a cross-component filter coefficient (CC filter coefficient) AlfCoeffCC in the CC filter coefficient derivation unit 30356. The ALFCC 30537 derives a value (for example, a value to be added to a chrominance image) to be used for filtering a target color component image (for example, a chrominance image) by referring to this CC filter coefficient and another color component image (for example, a luminance image) of the input image, clips the value in the clipping unit 30540, and adds the value to the output of the ALFTC in the adder 30538. The input image to the ALFCC and the input image to the ALFTC are the same, and are the input image to the loop filter 305. In other words, when the loop filter is composed of multiple stages, ALFTC and ALFCC use the image of the same stage (for example, an image that has been subjected to SAO).
[0117] (Cross-component filters) Fig. 11 shows an example of an APS that notifies the syntax of a CC filter used in the ALF unit 3053A. In addition to the syntax used in the ALF unit 3053, alf_cross_component_coeff_abs[] and alf_cross_component_coeff_sign[] are added. These syntax elements are decoded by the parameter decoding unit 302 and input to the CC filter coefficient derivation unit 30536. Note that Fig. 11 shows an example in which the filter shape is 3*3 as shown in Fig. 10(c).
[0118] (CC filter coefficient derivation part) The CC filter coefficient derivation unit 30536 derives the CC filter coefficient AlfCoeffCC[] from the above-mentioned syntax elements.
[0119] AlfCoeffCC[apsCId][j] = alf_cross_component_coeff_abs[j]*(1-2*alf_cross_component_coeff_sign[j]) fcc[j] = AlfCoeffCC[apsCId][j] The CC filter coefficient derivation unit 30536 outputs fcc[ ] to the ALFCC 30537.
[0120] (ALFCC) The ALFCC 30537 performs filtering using the output fcc[] of the CC filter coefficient derivation unit 30536 and an input image rPL[] that is an image of a color component different from the target color component. Here, the input image rP of the ALF unit 3053 is represented as (rPL, rPC). If the input image of a color component (e.g., luminance) different from the target color component is rPL[x,y] and the output image is addCC[x][y], the ALFCC 30537 performs processing of the following formula.
[0121] sumCC = Σfcc[k]*rPL[xx+i,yy+j] (formula ALF-3) addCC[x][y] = (sumCC+(1<<(shiftCC-1)))>>shiftCC Here, Σ is the sum with respect to k, (i, j) is the position of the reference luminance image corresponding to the filter coefficient fcc[k] of k, and is a set of values in the range of i=-3..3, j=-3..3, for example. Hereinafter, the subscript of fcc is k. shiftCC is the bit precision of the filter coefficient fcc[], and 1<<(shiftCC-1) is the offset for rounding. (xx, yy) is the position of the luminance image rPL corresponding to the target chrominance pixel, and may be (xx, yy) = (x, y), or may be changed according to SubWidthC and SubHeightC. xx = x * SubWidthC, yy = y * SubHeightC. Written out, this can be expressed as follows:
[0122] sumCC = Σfcc[k]*rPL[x*SubWidthC+i,y*SubHeightC+j] (formula ALF-4) addCC[x][y] = (sumCC+(1<<(shiftCC-1)))>>shiftCC For example, when the fcc precision shiftCC is 8, the rPL bitDepth is 10, and the number of reference pixels (k) is 14, the range of addCC is 8+10+ceil(log2(14))-8=14 bits. shiftCC may be 7, 8, 9, 10, etc. Below, an example of shiftCC=7, 8 will be explained. Furthermore, when using filter coefficients having a filter shape as shown in FIG. 12(a), the following formula may be used.
[0123] sumCC = fcc[0]*(rPL[xx,yy-2] + rPL[xx,yy+3]) + fcc[1]*rPL[xx-1,yy-1]+ fcc[2]*rPL[xx,yy-1]+ fcc[3]*rPL[xx+1,yy-1] + fcc[4]*(rPL[xx-2,yy] + rPL[xx+2,yy] + rPL[xx-2,yy+1] + rPL[xx+2,yy+1]) + fcc[5]*rPL[xx - 1, yy] + fcc[6]*rPL[xx, yy] + fcc[7]*rPL[xx + 1, yy] + fcc[8]*rPL[xx - 1, yy + 1] + fcc[9]*rPL[xx, yy + 1] + fcc
[10] *rPL[xx + 1, yy + 1] + fcc
[11] *rPL[xx - 1, yy + 2] + fcc
[12] *rPL[xx, yy + 2] + fcc
[13] *rPL[xx + 1, yy + 2] (Equation ALF - 5) addCC[x][y] = (sumCC + 128) >> 8 Alternatively, in the case of the filter coefficients of the filter shape shown in Fig. 12(b), the following equation may also be used.
[0124] sumCC = fcc[0]*(rPL[xx, yy + 1] + rPL[xx, yy - 1]) + fcc[1]*(rPL[xx + 1, yy] + rPL[xx - 1, yy]) + fcc[2]*rPL[xx, yy] (Equation ALF - 6) addCC[x][y] = (sumCC + 64) >> 7 ALFCC 30537 outputs addCC[][] to the adder 30358.
[0125] Alternatively, one of the filter coefficients, fcc[n - 1], may not be notified, and may be derived from the other coefficients so that the sum of the filter coefficients is (1 << shiftCC).
[0126] fcc[n - 1] = (1 << shiftCC) - Σfcc[k] Here, Σ is the sum for k = 0..n - 2, and n is the number of filter coefficients.
[0127] Also, the luminance pixel rPL at the position corresponding to the color - difference pixel may be a pixel derived by filtering or subsampling the luminance pixel rPL. Subsampling is, for example rPL[x, y] = rPL[x*SubWidthC, y*SubHeightC] (Adder and Clipping Unit) An adder 30358 adds the filtered image AlfPicC[][] (= AlfPicCb[][], AlfPicCr[][]) of the target color component which is the output of the ALFTC 30535, and the filtered image addCC[][] of the cross component which is the output of the ALFCC 30357. A clipping unit 30540 limits addCC[x][y] to a predetermined value range before adding AlfPicC[x][y] and addCC[x][y]. For example, it clips it to a predetermined value range represented by minCC and maxCC.
[0128] AlfPicCb[x][y] = AlfPicCb[x][y] + Clip3( minCC, maxCC, addCCb[x][y]) AlfPicCr[x][y] = AlfPicCr[x][y] + Clip3( minCC, maxCC, addCCr[x][y]) Note that AlfPicCb and AlfPicCr on the right side are filter images derived by (equation ALF-2), and addCCb and addCCr are difference values derived by (equation ALF-5). Also, a shift process may be added after the addition process.
[0129] AlfPicCb[x][y] = (AlfPicCb[x][y] + Clip3( minCC, maxCC, addCCb[x][y])+(1-(shiftCC2-1))) >> shiftCC2 AlfPicCr[x][y] = (AlfPicCr[x][y] + Clip3( minCC, maxCC, addCCr[x][y]) +(1-(shiftCC2-1))) >> shiftCC2 In other words, the filter unit 30535 performs filtering by adding the clip values of the term obtained by the multiplication and accumulation operation and round shift processing of the color difference image and the term obtained by the multiplication and accumulation operation and round shift processing of the luminance image. AlfPicCb[x][y] = (rPCb[x][y] + Σf[ij]*(Clip3(-c[ij],c[ij],rPCb[x+i][y+j]-rPCb[x][y]) + 64 ) >> 7 + Clip3( minCC, maxCC, addCCb[x][y]) AlfPicCr[x][y] = (rPCr[x][y] + Σf[ij]*(Clip3(-c[ij],c[ij],rPCr[x+i][y+j]-rPCr[x][y]) + 64 ) >> 7 + Clip3( minCC, maxCC, addCCr[x][y]) Here, rPCb[][] and rPCr[][] are the color difference input images of the filter unit 30535. Σ represents the sum for position (i, j) in the filter shape of the filter unit 30535, and f[ij] and c[ij] are the coefficient value and clip value corresponding to position (i, j). For example, minCC and maxCC are expressed as follows, using the value rangeCCBit, which represents the bit width: minCC = -(1< <rangeCCBit) maxCC = (1< <rangeCCBit)-1 may be set to
[0130] rangeCCBit may be a fixed value (e.g. rangeCCBit=5,6,7,8, etc.). For example, if rangeCCBit=6, it is restricted as follows:
[0131] AlfPicCb[x][y] = AlfPicCb[x][y] + Clip3( -64, 63, addCCb[x][y]) AlfPicCr[x][y] = AlfPicCr[x][y] + Clip3( -64, 63, addCCr[x][y]) According to the above, in a configuration in which addCC[][], which is a component of ccALF derived from a luminance image, is stored in advance in memory and addCC in the stored memory is used, the amount of memory required for storage can be reduced. For example, when the range of addCC before restriction is 14 bits and rangeCCBit=6, the amount of memory required can be reduced to less than half (=6 / 14).
[0132] Also, it is appropriate to set rangeCCBit so that it depends on bitDepth. For example, using the difference between bitDepth and a certain constant Mcc (rangeCCBit=bitDepth-Mcc), minCC = -(1<<(bitDepth-3)) maxCC = (1<<(bitDepth-3))-1 Here, Mcc may be 2, 3, 4, 5, etc. Also, a lower limit may be set for the magnitude (for example, absolute value) of the clip value, independent of the bit depth (rangeCCBit=max(minD, bitDepth-Mcc), for example, minD=6). minCC = -max(64, (1<<(bitDepth-3))) maxCC = max(64, (1<<(bitDepth-3)))-1 The lower limit minD is not limited to 6. An upper limit that is not dependent on the bit depth may be set (rangeCCBit=min(maxD, bitDepth-Mcc), e.g. maxD=15). minCC = -min(32768, (1<<(bitDepth-3))) maxCC = min(32768, (1<<(bitDepth-3)))-1 The upper limit maxDepth is not limited to 15 bits. You may further set a lower and upper limit (rangeCCBit = Clip3(minD, maxD, bitDepth-Mcc)). minCC = -Clip3(64, 32768, (1<<(bitDepth-3))) maxCC = Clip3(64, 32768, (1<<(bitDepth-3))) -1 Or, using bitDepth / 2 and a given constant Mcc2 (rangeCCBit=bitDepth / 2+Mcc2) minCC = -(1<<(bitDepth / 2+1)) maxCC = (1<<(bitDepth / 2+1))-1 Here, Mcc2 can be 0, 1, 2, 3, etc.
[0133] In addition, rangeCCBit may be switched depending on the attributes or values related to the pixel to be filtered. In this case, multiple thresholds may be used to switch in multiple stages. For example, if the slice type of the slice to which the pixel to be filtered belongs is an intra slice (I slice), rangeCCBit1 may be used. minCC = -(1< <rangeCCBit1) maxCC = (1< <rangeCCBit1)-1 In the case of inter-slice (B or P slice), use rangeCCBit2. minCC = -(1< <rangeCCBit2) maxCC = (1< <rangeCCBit2)-1 In this way, the range of the change amount can be switched according to the prediction method having different characteristics.
[0134] Alternatively, the set of minCC and maxCC may be switched based on the QP value of the pixel to be filtered. For example, when QP is less than a certain threshold QP_th, minCC = -(1< <rangeCCBit1) maxCC = (1< <rangeCCBit1)-1 If it is more than QP_th, minCC = -(1< <rangeCCBit2) maxCC = (1< <rangeCCBit2)-1 Let us assume that.
[0135] As another method, the range of the amount of change may be changed depending on the bit depth of the pixel to be filtered. For example, when the bit depth of the pixel to be filtered is less than 10, minCC = -(1< <rangeCCBit1) maxCC = (1< <rangeCCBit1)-1 If it is more than QP_th, minCC = -(1< <rangeCCBit2) maxCC = (1< <rangeCCBit2)-1 This can be expressed as minCC = -(1<<(bitDepth<10 ? rangeCCBit1 : rangeCCBit2)) maxCC = (1<<(bitDepth<10 ? rangeCCBit1 : rangeCCBit2)) where the values of (rangeCCBit1, rangeCCBit2) are, for example, (5,6), (5,7) or (6,7).
[0136] The adder 30358 outputs AlfPicCb[][] and AlfPicCr[][] to the outside (display device) and the reference picture memory 306.
[0137] (Configuration of a video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Fig. 7 is a block diagram showing the configuration of the video encoding device 11 according to this embodiment. The video encoding device 11 includes a prediction image generating unit 101, a subtraction unit 102, a transformation and quantization unit 103, an inverse quantization and inverse transformation unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, a reference picture memory (reference image storage unit, frame memory) 109, an encoding parameter determining unit 110, a parameter encoding unit 111, a prediction parameter derivation unit 120, and an entropy encoding unit 104.
[0138] The predicted image generation unit 101 generates a predicted image for each CU. The predicted image generation unit 101 includes the inter predicted image generation unit 309 and the intra predicted image generation unit 310, which have already been described, and therefore a description thereof will be omitted.
[0139] The subtraction unit 102 generates a prediction error by subtracting the pixel values of the predicted image of the block input from the predicted image generation unit 101 from the pixel values of the image T. The subtraction unit 102 outputs the prediction error to the transformation and quantization unit 103.
[0140] The transform / quantization unit 103 calculates transform coefficients by frequency transforming the prediction errors input from the subtraction unit 102, and derives quantized transform coefficients by quantizing the prediction errors. The transform / quantization unit 103 outputs the quantized transform coefficients to the parameter coding unit 111 and the inverse quantization / inverse transform unit 105.
[0141] The inverse quantization and inverse transform unit 105 is the same as the inverse quantization and inverse transform unit 311 (FIG. 5) in the video decoding device 31, and a description thereof will be omitted. The calculated prediction error is output to the addition unit .
[0142] The parameter encoding unit 111 includes a header encoding unit 1110, a CT information encoding unit 1111, and a CU encoding unit 1112 (prediction mode encoding unit). The CU encoding unit 1112 further includes a TU encoding unit 1114.
[0143] The entropy coding unit 104 receives the quantized transform coefficients and coding parameters (division information, prediction parameters) from the parameter coding unit 111. The entropy coding unit 104 entropy codes these to generate and output a coded stream Te.
[0144] The prediction parameter derivation unit 120 is a means including an inter-prediction parameter encoding unit 112 and an intra-prediction parameter encoding unit 113, and derives intra-prediction parameters and intra-prediction parameters from the parameters input from the encoding parameter determination unit 110. The derived intra-prediction parameters and intra-prediction parameters are output to the parameter encoding unit 111.
[0145] The adder 106 generates a decoded image by adding, for each pixel, the pixel value of the predicted block input from the predicted image generation unit 101 and the prediction error input from the inverse quantization and inverse transform unit 105. The adder 106 stores the generated decoded image in a reference picture memory 109.
[0146] The loop filter 107 applies deblocking filtering, SAO, and ALF to the decoded image generated by the adder 106.
[0147] 8(b) is a block diagram showing the configuration of the ALF unit 1073 of the video encoding device 11. The ALF unit 107 includes a filter processing unit 30532. The filter processing unit 30532 is the filter processing unit 30532 of the ALF unit 3053 of the video decoding device 31, and a description thereof will be omitted. Since the ALF unit 1073 receives as input a filter set to be used in a target picture or a target slice from the encoding parameter determination unit 110, the filter set derivation unit 30531 is not necessary. Moreover, it is the reference picture memory 109 from which the ALF unit 1073 reads a reference image or from which the ALF unit 1073 outputs an output image.
[0148] The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in a predetermined location for each current picture and CU.
[0149] The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each current picture and CU.
[0150] The coding parameter determination unit 110 selects one set from among a plurality of sets of coding parameters. The coding parameters are the above-mentioned QT, BT or TT division information, prediction parameters, or parameters to be coded that are generated in relation to these. The predicted image generation unit 101 generates a predicted image using these coding parameters.
[0151] The coding parameter determination unit 110 calculates an RD cost value indicating the magnitude of the information amount and the coding error for each of the multiple sets. The RD cost value is, for example, the sum of the code amount and the value obtained by multiplying the squared error by a coefficient λ. The code amount is the information amount of the coding stream Te obtained by entropy coding the quantization error and the coding parameters. The squared error is the sum of the squares of the prediction errors calculated in the subtraction unit 102. The coefficient λ is a real number greater than zero that is set in advance. The coding parameter determination unit 110 selects a set of coding parameters that minimizes the calculated cost value. The coding parameter determination unit 110 outputs the determined coding parameters to the parameter coding unit 111 and the prediction parameter derivation unit 120.
[0152] In addition, a part of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generating unit 308, the inverse quantization and inverse transform unit 311, the addition unit 312, the prediction parameter derivation unit 320, the predicted image generating unit 101, the subtraction unit 102, the transform and quantization unit 103, the entropy coding unit 104, the inverse quantization and inverse transform unit 105, the loop filter 107, the coding parameter determination unit 110, the parameter coding unit 111, and the prediction parameter derivation unit 120 may be realized by a computer. In this case, a program for realizing this control function may be recorded in a computer-readable recording medium, and the program recorded in the recording medium may be read into and executed by a computer system. In addition, the "computer system" referred to here is a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. In addition, "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, and storage devices such as hard disks built into computer systems. Furthermore, "computer-readable recording medium" may also include devices that dynamically hold a program for a short period of time, such as a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line, and devices that hold a program for a certain period of time, such as volatile memory inside a computer system that serves as a server or client in such cases. Furthermore, the above program may be one that realizes part of the above-mentioned functions, or may be one that can realize the above-mentioned functions in combination with a program already recorded in the computer system.
[0153] In addition, a part or the whole of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment may be realized as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the video encoding device 11 and the video decoding device 31 may be individually made into a processor, or a part or the whole may be integrated into a processor. The integrated circuit method is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. Furthermore, when an integrated circuit technology that replaces LSI appears due to the progress of semiconductor technology, an integrated circuit based on that technology may be used.
[0154] Although one embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to the above, and various design changes, etc. are possible within the scope that does not deviate from the gist of the present invention.
[0155] [Application example] The above-mentioned video encoding device 11 and video decoding device 31 can be mounted on various devices that transmit, receive, record, and play videos. The video may be a natural video captured by a camera or the like, or an artificial video (including CG and GUI) generated by a computer or the like.
[0156] First, it will be described with reference to FIG. 2 that the above-mentioned video encoding device 11 and video decoding device 31 can be used for transmitting and receiving videos.
[0157] Fig. 2(a) is a block diagram showing the configuration of a transmitting device PROD_A equipped with a video encoding device 11. As shown in the figure, the transmitting device PROD_A includes an encoding unit PROD_A1 that obtains encoded data by encoding a video, a modulation unit PROD_A2 that obtains a modulated signal by modulating a carrier wave with the encoded data obtained by the encoding unit PROD_A1, and a transmitting unit PROD_A3 that transmits the modulated signal obtained by the modulation unit PROD_A2. The above-mentioned video encoding device 11 is used as this encoding unit PROD_A1.
[0158] The transmitting device PROD_A may further include a camera PROD_A4 for capturing moving images, a recording medium PROD_A5 for recording moving images, an input terminal PROD_A6 for inputting moving images from the outside, and an image processing unit A7 for generating or processing images, as a source of moving images to be input to the encoding unit PROD_A1. In the figure, the transmitting device PROD_A is illustrated as having all of these components, but some of them may be omitted.
[0159] The recording medium PROD_A5 may record unencoded video, or may record video encoded by an encoding method for recording that is different from the encoding method for transmission. In the latter case, a decoding unit (not shown) that decodes the encoded data read from the recording medium PROD_A5 according to the encoding method for recording may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
[0160] 2(b) is a block diagram showing the configuration of a receiving device PROD_B equipped with a video decoding device 31. As shown in the figure, the receiving device PROD_B includes a receiving unit PROD_B1 that receives a modulated signal, a demodulation unit PROD_B2 that obtains coded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a decoding unit PROD_B3 that obtains a video by decoding the coded data obtained by the demodulation unit PROD_B2. The above-mentioned video decoding device 31 is used as this decoding unit PROD_B3.
[0161] The receiving device PROD_B may further include, as destinations of the moving image output by the decoding unit PROD_B3, a display PROD_B4 for displaying the moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal PROD_B6 for outputting the moving image to the outside. In the figure, the receiving device PROD_B is illustrated as having all of these components, but some of them may be omitted.
[0162] The recording medium PROD_B5 may be for recording unencoded video, or may be encoded by an encoding method for recording that is different from the encoding method for transmission. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_B3 and the recording medium PROD_B5, which encodes the video acquired from the decoding unit PROD_B3 according to the encoding method for recording.
[0163] The transmission medium for transmitting the modulated signal may be wireless or wired. The transmission mode for transmitting the modulated signal may be broadcast (here, this refers to a transmission mode in which the destination is not specified in advance) or communication (here, this refers to a transmission mode in which the destination is specified in advance). In other words, the transmission of the modulated signal may be realized by any of wireless broadcast, wired broadcast, wireless communication, and wired communication.
[0164] For example, a broadcasting station (such as a broadcasting facility) / receiving station (such as a television receiver) for terrestrial digital broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by wireless broadcasting. Also, a broadcasting station (such as a broadcasting facility) / receiving station (such as a television receiver) for cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by cable broadcasting.
[0165] Also, a server (such as a workstation) / client (such as a television receiver, a personal computer, a smartphone, etc.) of a VOD (Video On Demand) service or a video sharing service using the Internet is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by communication (usually, in a LAN, either wireless or wired is used as a transmission medium, and in a WAN, wired is used as a transmission medium). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Also, smartphones include multi-function mobile phone terminals.
[0166] The client of the video hosting service has a function to decode the encoded data downloaded from the server and display it on a display, as well as a function to encode the video captured by the camera and upload it to the server. That is, the client of the video hosting service functions as both the transmitting device PROD_A and the receiving device PROD_B.
[0167] Next, it will be described with reference to FIG. 3 that the above-mentioned video encoding device 11 and video decoding device 31 can be used for recording and reproducing videos.
[0168] 3(a) is a block diagram showing the configuration of a recording device PROD_C equipped with the above-mentioned video encoding device 11. As shown in the figure, the recording device PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding a video, and a writing unit PROD_C2 that writes the encoded data obtained by the encoding unit PROD_C1 onto a recording medium PROD_M. The above-mentioned video encoding device 11 is used as this encoding unit PROD_C1.
[0169] The recording medium PROD_M may be (1) a type built into the recording device PROD_C, such as an HDD (Hard Disk Drive) or SSD (Solid State Drive), (2) a type connected to the recording device PROD_C, such as an SD memory card or USB (Universal Serial Bus) flash memory, or (3) a type loaded into a drive device (not shown) built into the recording device PROD_C, such as a DVD (Digital Versatile Disc: registered trademark) or BD (Blu-ray Disc: registered trademark).
[0170] The recording device PROD_C may further include a camera PROD_C3 for capturing moving images, an input terminal PROD_C4 for inputting moving images from the outside, a receiving unit PROD_C5 for receiving moving images, and an image processing unit PROD_C6 for generating or processing images, as a supply source of moving images to be input to the encoding unit PROD_C1. Although the figure illustrates a configuration in which the recording device PROD_C includes all of these, some of them may be omitted.
[0171] The receiving unit PROD_C5 may receive uncoded video, or may receive coded data coded by a coding method for transmission that is different from the coding method for recording. In the latter case, a transmission decoding unit (not shown) that decodes the coded data coded by the coding method for transmission may be interposed between the receiving unit PROD_C5 and the coding unit PROD_C1.
[0172] Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and an HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is the main source of the moving image). Other examples of such a recording device PROD_C include a camcorder (in this case, the camera PROD_C3 is the main source of the moving image), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is the main source of the moving image), and a smartphone (in this case, the camera PROD_C3 or the receiving unit PROD_C5 is the main source of the moving image).
[0173] 3(b) is a block diagram showing the configuration of a playback device PROD_D equipped with the above-mentioned video decoding device 31. As shown in the figure, the playback device PROD_D includes a reading unit PROD_D1 that reads out coded data written to a recording medium PROD_M, and a decoding unit PROD_D2 that obtains video by decoding the coded data read by the reading unit PROD_D1. The above-mentioned video decoding device 31 is used as this decoding unit PROD_D2.
[0174] The recording medium PROD_M may be (1) a type that is built into the playback device PROD_D, such as an HDD or SSD, (2) a type that is connected to the playback device PROD_D, such as an SD memory card or USB flash memory, or (3) a type that is loaded into a drive device (not shown) built into the playback device PROD_D, such as a DVD or BD.
[0175] The playback device PROD_D may further include, as destinations of the video output by the decoding unit PROD_D2, a display PROD_D3 for displaying the video, an output terminal PROD_D4 for outputting the video to the outside, and a transmission unit PROD_D5 for transmitting the video. In the figure, the playback device PROD_D is illustrated as having all of these components, but some of them may be omitted.
[0176] The transmission unit PROD_D5 may transmit unencoded video, or may transmit encoded data encoded by an encoding method for transmission different from the encoding method for recording. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_D2 and the transmission unit PROD_D5, which encodes the video by the encoding method for transmission.
[0177] Examples of such a playback device PROD_D include a DVD player, a BD player, and an HDD player (in this case, the output terminal PROD_D4 to which a television receiver or the like is connected is the main destination of the video image). Other examples of such a playback device PROD_D include a television receiver (in this case, the display PROD_D3 is the main destination of the video image), a digital signage (also called an electronic billboard or electronic bulletin board, and the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), a desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main destination of the video image), a laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), and a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image).
[0178] (Hardware and Software Realizations) Furthermore, each block of the above-mentioned video decoding device 31 and video encoding device 11 may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or in software by using a CPU (Central Processing Unit).
[0179] In the latter case, each of the above devices includes a CPU that executes the commands of a program that realizes each function, a ROM (Read Only Memory) that stores the above program, and a RAM (Random Access Memory) that expands the above program. The present invention also includes a storage device (recording medium) such as a memory for storing the above-mentioned programs and various data, and the like. The object of the embodiment of the present invention can also be achieved by supplying each of the above-mentioned devices with a recording medium on which the program code (executable program, intermediate code program, source program) of the control program of each of the above-mentioned devices, which is software for realizing the above-mentioned functions, is recorded in a computer-readable manner, and the computer (or CPU or MPU) reads out and executes the program code recorded on the recording medium.
[0180] Examples of the recording medium that can be used include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy disks (registered trademark) and hard disks, disks including optical disks such as CD-ROMs (Compact Disc Read-Only Memory), MO disks (Magneto-Optical discs), MDs (Mini Discs), DVDs (Digital Versatile Discs: registered trademark), CD-Rs (CD Recordable), and Blu-ray Discs (registered trademark), cards such as IC cards (including memory cards) and optical cards, semiconductor memories such as mask ROMs, EPROMs (Erasable Programmable Read-Only Memory), EEPROMs (Electrically Erasable and Programmable Read-Only Memory: registered trademark), and flash ROMs, and logic circuits such as PLDs (Programmable logic devices) and FPGAs (Field Programmable Gate Arrays).
[0181] Moreover, each of the above devices may be configured to be connectable to a communication network, and the above program code may be supplied via the communication network. This communication network is not particularly limited as long as it is capable of transmitting the program code. For example, the Internet, an intranet, an extranet, a LAN (Local Area Network), an ISDN (Integrated Services Digital Network), a VAN (Value-Added Network), a CATV (Community Antenna television / Cable Television) communication network, a virtual private network, a telephone line network, a mobile communication network, a satellite communication network, etc. may be used. Moreover, the transmission medium constituting this communication network is not limited to a specific configuration or type as long as it is a medium capable of transmitting the program code. For example, it can be used in wired communication such as IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, etc., or in wireless communication such as infrared such as IrDA (Infrared Data Association) or remote control, BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. The embodiment of the present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.
[0182] The present invention is not limited to the above-described embodiment, and various modifications are possible within the scope of the claims. In other words, the technical scope of the present invention also includes embodiments obtained by combining technical means that are appropriately modified within the scope of the claims. [Industrial Applicability]
[0183] The embodiments of the present invention can be suitably applied to a video decoding device that decodes coded data in which image data is coded, and a video coding device that generates coded data in which image data is coded, and can also be suitably applied to the data structure of coded data that is generated by a video coding device and referenced by the video decoding device. [Explanation of symbols]
[0184] 31 Image Decoding Device 301 Entropy Decoding Unit 302 Parameter Decoding Unit 305, 107 Loop Filter 306, 109 Reference Picture Memory 307, 108 Prediction parameter memory 308, 101 Prediction image generation unit 311, 105 Inverse quantization and inverse transformation unit 312, 106 Addition section 320 Prediction Parameter Derivation Unit 11 Image encoding device 102 Subtraction section 103 Transformation and Quantization Section 104 Entropy coding unit 110 Encoding parameter determination unit 111 Parameter Encoding Unit 120 Prediction parameter derivation part
Claims
[Claim 1] An image decoding device for decoding an input image, comprising: a parameter decoding means for decoding cross-component parameters from the encoded data; a filter coefficient derivation means for deriving cross component filter coefficients using the cross component parameters; a filter means for applying an adaptive loop filter to the luminance image and the color difference image, and outputting a filtered luminance image and a filtered color difference image; a cross component filter means for deriving a sum using the formula (sum+64)>>7, where the sum is a product sum value of the luminance image and the cross component filter coefficient; clipping means for clipping the summed value to a range based on a bit depth to derive a clipped value; and adding means for adding the clipped value to the filtered chrominance image to derive a modified filtered chrominance image.