Image filter device, filtering method, and video decoding device
The image filter device addresses memory inefficiencies in conventional offset filters by setting value ranges and classifying pixels, achieving reduced memory usage and improved coding efficiency through offset type determination and classification.
Patent Information
- Application Number
- JP2022204706
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2011-09-29
- Filing Date
- 2022-12-21
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2032-06-22
AI Technical Summary
Conventional adaptive offset filters lack a defined range of values and require a large memory size due to numerous bits, leading to inefficiencies in storing offsets.
An image filter device that sets an offset value range, decodes offsets within this range, and adds offsets to pixel values, utilizing offset type determination and classification to reduce memory size and improve coding efficiency.
The solution effectively reduces memory requirements while maintaining appropriate offset filtering, enhancing coding efficiency by classifying pixels and using offset types with varying bit widths.
Smart Images

Figure 0007797368000001 
Figure 0007797368000002 
Figure 0007797368000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to an image filter device that filters images, an offset decoding device that decodes an offset referenced by an image filter, an offset encoding device that encodes an offset referenced by an image filter, and a data structure of encoded data. [Background technology]
[0002] In order to efficiently transmit or record moving images, a moving image coding device (coding device) that encodes moving images to generate coded data and a moving image decoding device (decoding device) that decodes the coded data to generate decoded images are used. Specific moving image coding methods include, for example, the method adopted in H.264 / MPEG-4.AVC, the method adopted in KTA software, which is a codec jointly developed by VCEG (Video Coding Expert Group), the method adopted in TMuC (Test Model under Consideration) software, which is its successor codec, and the method adopted in HM (HEVC Test Model) software.
[0003] In such coding methods, images (pictures) that make up a video are managed using a hierarchical structure consisting of slices obtained by dividing images, largest coding units (LCUs, also called tree blocks) obtained by dividing slices, coding units (CUs, also called coding nodes) obtained by dividing the largest coding units, and blocks and partitions obtained by dividing the coding units, and in many cases, blocks are used as the smallest unit for coding.
[0004] In addition, in such a coding method, a predicted image is usually generated based on a locally decoded image obtained by coding / decoding an input image, and differential data between the predicted image and the input image is coded. Also, methods called inter-frame prediction (inter-prediction) and intra-frame prediction (intra-prediction) are known as methods for generating predicted images.
[0005] In intra prediction, predicted images in a frame are sequentially generated based on local decoded images in the same frame. Specifically, in intra prediction, usually, for each prediction unit (for example, block), one prediction direction is selected from prediction directions included in a group of predetermined prediction directions (prediction modes), and predicted pixel values in a prediction target area are generated by extrapolating pixel values of reference pixels in the local decoded image to the selected prediction direction. In addition, in inter prediction, predicted images in a prediction target frame are generated for each prediction unit (for example, block) by applying motion compensation using a motion vector to a reference image in a reference frame (decoded image) in which the entire frame is decoded.
[0006] Non-Patent Documents 1 and 2 disclose an adaptive offset filter (also called an "adaptive offset filter") that is introduced after a deblocking filter that reduces block distortion in a decoded image and before an adaptive loop filter (also called an "adaptive filter") that performs filtering using adaptively determined filter coefficients. This adaptive offset filter adds an adaptively set offset to each pixel value of the image output from the deblocking filter.
[0007] By providing such an adaptive offset filter, block distortion can be suppressed more effectively. [Prior art documents] [Non-patent literature]
[0008] [Non-Patent Document 1] "JCTVC-D122",Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG16 WP3 and ISO / IEC JTC1 / SC29 / WG11, 4th Meeting: Daegu, KR, 01 / 2011 [Non-patent document 2] "JCTVC-E049",Joint Collaborative Team on Video Coding (JCT-VC) of ITU-T SG16 WP3 and ISO / IEC JTC1 / SC29 / WG11, 5th Meeting: Geneva, CH, 03 / 2011 Summary of the Invention [Problem to be solved by the invention]
[0009] However, the offset used in conventional adaptive offset filters does not have a set range of values and has a large number of bits, which poses the problem of requiring a large memory size to store the offset.
[0010] The present invention has been made in view of the above problems, and aims to realize an image filtering device that can reduce block distortion while suppressing an increase in memory size. [Means for solving the problem]
[0011] In order to solve the above problems, the image filter device of the present invention is an image filter device that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and is characterized by comprising: an offset attribute setting means that references encoded data and sets an offset value range; an offset decoding means that decodes offsets limited to the set offset value range; and a filter means that adds the offset to each pixel value of the input image.
[0012] According to the image filter device configured as described above, the offset attribute setting means sets an offset value range, and the offset decoding means decodes an offset having a bit width according to the set offset value range, thereby effectively reducing the memory size for storing the offset.
[0013] Therefore, with the above configuration, it is possible to perform appropriate offset filtering while reducing the memory size for storing offsets.
[0014] Furthermore, an offset decoding device according to the present invention is an offset decoding device that decodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and is characterized by comprising: offset residual decoding means that decodes each offset residual from encoded data; predicted value derivation means that derives a predicted value of each offset from an offset that has already been decoded; and offset calculation means that calculates each offset from the predicted value derived by the predicted value derivation means and the offset residual decoded by the offset residual decoding means.
[0015] The offset decoding device configured as described above includes offset residual decoding means that decodes each offset residual from encoded data, predicted value derivation means that derives a predicted value of each offset from an already decoded offset, and offset calculation means that calculates each offset from the predicted value derived by the predicted value derivation means and the offset residual decoded by the offset residual decoding means. Therefore, it is possible to appropriately decode offsets from encoded data with a smaller amount of code than when each offset is encoded as is.
[0016] Furthermore, an image filter device according to the present invention is an image filter device that operates on an input image, and is characterized by comprising: calculation means for calculating a difference value between the pixel value of a target pixel in the input image and the pixel values of pixels surrounding the target pixel; bit shift means for bit-shifting the pixel value referenced by the calculation means or the difference value calculated by the calculation means to the right by a predetermined shift value; classification means for classifying the target pixel into one of a plurality of offset classes depending on the magnitude relationship between the difference value bit-shifted to the right by the bit shift means and 0; and offset means for adding an offset associated with the offset class classified by the classification means to the pixel value of the target pixel.
[0017] According to the image filter device configured as described above, the target pixel is classified into one of a plurality of offset classes according to the magnitude relationship between the right bit-shifted difference value and 0, and an offset associated with the offset class classified by the classification means is added to the pixel value of the target pixel. This makes the class classification process less susceptible to the influence of noise, and improves coding efficiency.
[0018] Furthermore, the image filter device according to the present invention is an image filter device that acts on an input image, and is characterized by comprising: a calculation means that calculates a difference value between the pixel value of a target pixel in the input image and the pixel values of pixels surrounding the target pixel; a classification means that classifies the target pixel into one of a plurality of offset classes depending on the magnitude relationship between the difference value calculated by the calculation means and predetermined first and second thresholds; and an offset means that adds an offset associated with the offset class classified by the classification means to the pixel value of the target pixel.
[0019] The image filter device configured as described above classifies the target pixel into one of a plurality of offset classes depending on the magnitude relationship between the difference value calculated by the calculation means and predetermined first and second thresholds, and adds an offset associated with the offset class classified by the classification means to the pixel value of the target pixel, thereby making the class classification process less susceptible to noise and improving coding efficiency.
[0020] In addition, the image filter device of the present invention is an image filter device that acts on an input image composed of a plurality of unit areas, and includes a determination means for determining, from first and second offset types, an offset type to which a target unit area including a target pixel in the input image belongs; a classification means for classifying the target pixel into an offset class that does not add an offset or one of a plurality of offset classes that add an offset, depending on the offset type to which the target unit area belongs and the pixel value of the target pixel; and an offset means for adding, to the pixel value of the target pixel, an offset associated with the offset type to which the target unit area belongs and the offset class classified by the classification means, when the pixel value of the target pixel is within a predetermined range, the classification means classifies the target pixel into an offset class that adds an offset, regardless of whether the offset type to which the unit area including the target pixel belongs is the first or second offset type.
[0021] According to the image filtering device configured as above, when the pixel value of the target pixel is within a predetermined range, the target pixel is classified into an offset class to which an offset is added, regardless of whether the offset type to which the unit area including the target pixel belongs is the first or second offset type, thereby making it possible to effectively remove block noise. Therefore, according to the configuration, it is possible to improve coding efficiency.
[0022] Furthermore, the image filter device according to the present invention is an image filter device that adds an offset to each pixel value of an input image composed of a plurality of unit areas, and is characterized by comprising: a determination means that determines, from a plurality of offset types, an offset type to which the unit area to be processed belongs; an offset encoding means that determines an offset having a different bit width according to the offset type and encodes the offset; and a filter means that adds the determined offset to each pixel value of the input image.
[0023] According to the image filter device configured as described above, an offset type to which a unit region to be processed belongs is determined from among a plurality of offset types, offsets having different bit widths are determined according to the determined offset type, the determined offsets are added to each pixel of the input image, and the determined offsets are encoded.
[0024] Therefore, according to the above configuration, it is possible to perform appropriate offset filtering while reducing the memory size for storing offsets. Also, according to the above configuration, the amount of coding of encoded data is reduced, thereby improving coding efficiency.
[0025] Furthermore, an offset coding device according to the present invention is an offset coding device that codes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and is characterized by comprising: predicted value derivation means that derives a predicted value of each offset from an already-coded offset; offset residual calculation means that calculates an offset residual from each offset and the predicted value derived by the predicted value derivation means; and offset residual coding means that encodes the offset residual calculated by the offset residual calculation means.
[0026] The offset coding device configured as described above includes predicted value derivation means for deriving a predicted value of each offset from an already-coded offset, offset residual calculation means for calculating an offset residual from each offset and the predicted value derived by the predicted value derivation means, and offset residual coding means for coding the offset residual calculated by the offset residual calculation means, thereby making it possible to reduce the amount of code required for coded data.
[0027] Furthermore, the data structure of the coded data according to the present invention is a data structure of coded data referenced by an image filter that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and includes offset type designation information that designates the offset type to which each unit area belongs, and an offset having a different bit width depending on the offset type, and the image filter is characterized in that it references the offset type designation information included in the coded data, determines the offset type to which the unit area to be processed belongs, and decodes the offset having a different bit width depending on the determined offset type.
[0028] Since the coded data configured as described above includes offsets having different bit widths depending on the offset type, the amount of code for the coded data is reduced. Furthermore, the image filter that decodes the coded data refers to the offset type designation information, determines the offset type to which the unit region to be processed belongs, and decodes the offsets having different bit widths depending on the determined offset type, thereby reducing the memory size for storing the offsets and performing appropriate offset filter processing.
[0029] The offset type designation information may be determined for each of the input images, for each of the unit areas, for each of a predetermined set of the input images, or for each of a predetermined set of the unit areas. [Effects of the Invention]
[0030] As described above, the image filter device of the present invention is an image filter device that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and is equipped with an offset attribute setting means that references encoded data and sets an offset value range, an offset decoding means that decodes an offset limited to the set offset value range, and a filter means that adds the offset to each pixel value of the input image.
[0031] In addition, the image filter device of the present invention is an image filter device that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and is equipped with a determination means that determines an offset type to which the unit area to be processed belongs from among a plurality of offset types, an offset encoding means that determines an offset having a different bit width according to the offset type and encodes the offset, and a filter means that adds the determined offset to each pixel value of the input image.
[0032] Furthermore, the data structure of the encoded data according to the present invention is a data structure of encoded data referenced by an image filter that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and includes offset type designation information that designates the offset type to which each unit area belongs, and an offset having a different bit width depending on the offset type, and the image filter references the offset type designation information included in the encoded data, determines the offset type to which the unit area to be processed belongs, and decodes the offset having a different bit width depending on the determined offset type.
[0033] According to the above configuration, it is possible to reduce the memory size for storing offsets and allow the image filter to perform appropriate offset filtering. [Brief explanation of the drawings]
[0034] [Figure 1]FIG. 1 is a block diagram showing a configuration of an adaptive offset filter according to a first embodiment of the present invention. [Figure 2] A figure showing the data structure of encoded data generated by a video encoding device related to the first embodiment of the present invention and decoded by a video decoding device, where (a) to (d) respectively show the picture layer, slice layer, tree block layer, and CU layer, (e) shows the structure of QAOU information for a non-leaf QAOU, and (f) shows the structure of QAOU information for a leaf QAOU. [Figure 3] FIG. 2 is a diagram showing each syntax included in offset information OI of encoded data according to the first embodiment of the present invention. [Figure 4] 10A and 10B are diagrams showing the manner of division of offset units according to the first embodiment of the present invention, where (a) shows the case where sao_curr_depth=0, (b) shows the case where sao_curr_depth=1, (c) shows the case where sao_curr_depth=2, (d) shows the case where sao_curr_depth=3, and (e) shows the case where sao_curr_depth=4. [Figure 5] FIG. 1 is a block diagram showing a configuration of a video decoding device according to a first embodiment of the present invention. [Figure 6] A figure for explaining the first embodiment of the present invention, where (a) shows each QAOMU of a division depth of 3 that constitutes the target processing unit and the QAOU index assigned to each QAOMU, and (b) shows the offset type associated with each QAOU index 0 to 9 and the offset for each class that can be selected for each offset type. [Figure 7]A figure showing an example of QAOMU numbers assigned to QAOMUs included in a target processing unit in the first embodiment of the present invention, where (a) shows a QAOMU number assigned to a QAOMU with a division depth of 0, (b) shows a QAOMU number assigned to a QAOMU with a division depth of 1, (c) shows a QAOMU number assigned to a QAOMU with a division depth of 2, (d) shows a QAOMU number assigned to a QAOMU with a division depth of 3, and (e) shows a QAOMU number assigned to a QAOMU with a division depth of 4. [Figure 8] 5 is a flowchart showing the flow of processing by an adaptive offset filter processing unit according to the first embodiment of the present invention. [Figure 9] FIG. 10 shows examples of offset bit depths and shift values set by an offset attribute setting unit provided in an adaptive filter according to a first embodiment of the present invention, together with pixel bit depths, where (a) to (d) show examples corresponding to patterns S1 to S4, respectively, and (e) shows the case where STEP=2 is set in (d). [Figure 10] 1A to 1D are diagrams for explaining offset processing by an adaptive offset filter according to a first embodiment of the present invention, and show pixels referenced when sao_type_idx=1 to 4, respectively. [Figure 11] 1A is a diagram for explaining offset processing by an adaptive offset filter according to a first embodiment of the present invention, in which (a) is a graph showing the magnitude relationship between the pixel value pic[x] of the pixel x to be processed and the pixel value of pixel a or b, and the value of the function Sign corresponding to this magnitude relationship; (b) is a graph showing the magnitude relationship between the pixel value of the pixel x to be processed and the pixel values of pixels a and b, and the value of EdgeType corresponding to this magnitude relationship; (c) shows the correspondence between each graph shown in (b) and class_idx; and (d) is a conversion table showing the conversion from EdgeType to class_idx. [Figure 12]1A and 1B are diagrams for explaining offset processing by an adaptive offset filter according to a first embodiment of the present invention, in which (a) schematically shows class classification when sao_type_idx=5, (b) schematically shows class classification when sao_type_idx=6, and (c) is a table showing an example of class classification when a band offset is specified. [Figure 13] FIG. 10 is a diagram for explaining offset processing by the adaptive offset filter according to the first embodiment of the present invention, and is a table showing another example of class classification when a band offset is specified. [Figure 14] 1 is a block diagram showing a configuration of a video encoding device according to a first embodiment of the present invention. [Figure 15] FIG. 1 is a block diagram showing the configuration of an adaptive offset filter included in a video encoding device according to a first embodiment of the present invention. [Figure 16] 5 is a flowchart showing the flow of processing by an offset calculation unit of an adaptive offset filter included in the video encoding device according to the first embodiment of the present invention. [Figure 17] 5 is a flowchart showing the flow of processing by an offset information selection unit of an adaptive offset filter included in the video encoding device according to the first embodiment of the present invention. [Figure 18] 1 is a diagram for explaining processing by an offset information selection unit of an adaptive offset filter provided in a video encoding device according to a first embodiment of the present invention, in which (a) shows the manner of division when the division depth is 0 and 1, (b) shows the manner of division when the division depth is 1, (c) shows the manner of division when the division depth is 2, and (d) shows an example of division determined by the offset information selection unit. [Figure 19] FIG. 10 is a block diagram showing the configuration of an adaptive offset filter included in a video decoding device according to a second embodiment of the present invention. [Figure 20]10A and 10B are diagrams for explaining an adaptive offset filter according to a second embodiment of the present invention, in which FIG. 10A shows a first specific example of the function merge_tbl[sao_type_idx], and FIG. 10B shows a second specific example of the function merge_tbl[sao_type_idx]. [Figure 21] FIG. 10 is a block diagram showing the configuration of an adaptive offset filter included in a video encoding device according to a second embodiment of the present invention. [Figure 22] FIG. 10 is a block diagram showing a configuration of an adaptive offset filter according to a third embodiment of the present invention. [Figure 23] FIG. 11 is a diagram showing the syntax of offset information OI of the coded data according to the third embodiment. [Figure 24] A figure for explaining the above-mentioned third embodiment, where (a) is a figure showing each QAOMU of a division depth of 3 that constitutes the target processing unit and the QAOU index assigned to each QAOMU, and (b) is a figure showing the offset type associated with each QAOU index 0 to 9 and the offset for each class that can be selected for each offset type. [Figure 25] FIG. 11 is a diagram showing a conversion table used by an offset information decoding unit according to the third embodiment. [Figure 26] 10A is a diagram for explaining offset processing by an adaptive offset filter according to the third embodiment, in which (a) is a graph showing the magnitude relationship between the pixel value pic[x] of the pixel x to be processed and the pixel value of pixel a or b, and the value of the function Sign corresponding to this magnitude relationship, (b) is a graph showing the magnitude relationship between the pixel value of the pixel x to be processed and the pixel values of pixels a and b, and the value of EdgeType corresponding to this magnitude relationship, (c) is a diagram showing the correspondence between each graph shown in (b) and class_idx, and (d) to (f) are diagrams showing conversion tables indicating the conversion from EdgeType to class_idx. [Figure 27]10A and 10B are diagrams for explaining offset processing by the adaptive offset filter according to the third embodiment, in which (a) is a diagram schematically showing class classification when sao_type_idx=5, and (b) is a diagram schematically showing class classification when sao_type_idx=6. [Figure 28] 10A and 10B are diagrams for explaining offset processing by an adaptive offset filter according to the third embodiment, in which (a) is a diagram schematically showing class classification when the hierarchical depth of the QAOU to be processed is less than a threshold, and (b) is a diagram schematically showing class classification when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold. [Figure 29] 10A and 10B are diagrams showing an example of class classification when a band offset is specified in the third embodiment, where (a) is a diagram showing an example of class classification when the hierarchical depth of the QAOU to be processed is less than a threshold, and (b) is a diagram showing an example of class classification when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold. [Figure 30] FIG. 11 is a block diagram showing the configuration of an adaptive offset filter included in the video encoding device according to the third embodiment. [Figure 31] FIG. 11 is a diagram illustrating an outline of calculating the square error for each offset type for a QAOU with a QAOU index of "x" in the third embodiment. [Figure 32] 10A and 10B are diagrams for explaining a configuration for switching between EO and BO based on pixel values in a fourth embodiment of the present invention, where (a) is a diagram for explaining an outline of a configuration for switching between EO and BO based on pixel values, (b) is a diagram for explaining specific switching values, and (c) is a diagram showing the contents of a list memory stored in an offset information storage unit 621. [Figure 33]10A and 10B are diagrams illustrating a case where the EO type is limited to the horizontal direction in the fifth embodiment of the present invention, in which (a) is a diagram illustrating an outline of the effect, (b) is a diagram illustrating the position of pixels in the horizontal direction, (c) is a diagram illustrating a state different from (b), and (d) is a diagram illustrating the effect of (c). [Figure 34] 10A and 10B are diagrams for explaining a case where the EO type is limited to the horizontal direction in the fifth embodiment, in which (a) and (b) are diagrams showing a case where the reference pixel is in an asymmetric position, and (c) is a diagram showing an outline of a horizontal edge. [Figure 35] FIG. 20 is a diagram showing an overview of a case where the offset accuracy is improved in the sixth embodiment according to the present invention. [Figure 36] 13A to 13D are diagrams showing an overview of a case where class classification is subdivided in the sixth embodiment, where (a) is a diagram showing a conversion table, and (b) to (d) are diagrams for explaining class division. [Figure 37] 10A and 10B are diagrams for explaining the case where class classification is performed according to color difference in the sixth embodiment, where (a) is a diagram for explaining class classification taking into account achromatic pixel values, (b) is a diagram for explaining asymmetric class classification in two value ranges sandwiching achromatic pixel values, (c) and (d) are diagrams for explaining different class classification for each color channel (Cr or Cb), and (e) is a diagram for explaining the case where BO class classification is combined into one. [Figure 38] FIG. 20 is a block diagram showing a configuration of an offset information decoding unit in a seventh embodiment according to the present invention. [Figure 39] FIG. 20 is a diagram showing an overview of a case in which there is a class to which no pixels can be classified in the seventh embodiment. [Figure 40] FIG. 23 is a diagram showing syntax when a prediction candidate flag is used in the seventh embodiment. [Figure 41] FIG. 13 is a block diagram showing a configuration of an offset information decoding unit according to the fifth embodiment. [Figure 42]FIG. 10(a) is a block diagram showing the configuration of a use offset type selection unit according to the fifth embodiment, and FIG. 10(b) is a block diagram showing the configuration of another use offset type selection unit. [Figure 43] FIG. 13 is a block diagram showing a configuration of a classification unit according to the fifth embodiment. [Figure 44] 10A and 10B are diagrams showing the syntax of offset information and QAOU information according to the third embodiment, where (a) is a diagram showing the syntax of offset information, (b) is a diagram showing the syntax of QAOU information, and (c) is a diagram showing the syntax of the entire adaptive offset filter that calls the syntax shown in (a) and (b). [Figure 45] 1A and 1B are diagrams for explaining that a video decoding device and a video encoding device can be used to transmit and receive video, where (a) is a block diagram showing the configuration of a transmitting device equipped with a video encoding device, and (b) is a block diagram showing the configuration of a receiving device equipped with a video decoding device. [Figure 46] This figure explains that a video decoding device and a video encoding device can be used to record and play back video, where (a) is a block diagram showing the configuration of a recording device equipped with a video encoding device 2, and (b) is a block diagram showing the configuration of a playback device equipped with a video decoding device. DETAILED DESCRIPTION OF THE INVENTION
[0035] First Embodiment (Encoded data #1) Before proceeding to a detailed description of the video encoding device 2 and video decoding device 1 according to this embodiment, the data structure of the encoded data #1 generated by the video encoding device 2 and decoded by the video decoding device 1 will be described.
[0036] 2 is a diagram showing the data structure of coded data #1. The coded data #1 illustratively includes a sequence and a plurality of pictures that make up the sequence.
[0037] The hierarchical structure of the picture layer and below in coded data #1 is shown in Fig. 2. (a) to (d) in Fig. 2 respectively show the picture layer that defines the picture PICT, the slice layer that defines the slice S, the tree block layer that defines the tree block TBLK, and the CU layer that defines the coding unit (CU) included in the tree block TBLK.
[0038] (Picture Layer) The picture layer defines a set of data that the video decoding device 1 refers to in order to decode a picture PICT to be processed (hereinafter also referred to as a target picture). As shown in (a) of FIG. 2, the picture PICT includes a picture header PH and slices S1 to S NS where NS is the total number of slices contained in the picture PICT.
[0039] In the following, slices S1 to S NS When there is no need to distinguish between the above, the subscripts of the codes may be omitted. The same applies to other data that are included in the encoded data #1 described below and have subscripts.
[0040] The picture header PH includes a set of coding parameters that the video decoding device 1 refers to in order to determine a decoding method for the current picture. For example, coding mode information (entropy_coding_mode_flag) indicating the variable-length coding mode used by the video coding device 2 during coding is an example of the coding parameters included in the picture header PH.
[0041] If entropy_coding_mode_flag is 0, the picture PICT is coded by CAVLC (Context-based Adaptive Variable Length Coding). If entropy_coding_mode_flag is 1, the picture PICT is coded by CABAC (Context-based Adaptive Binary Arithmetic Coding).
[0042] The picture header PH is also called a picture parameter set (PPS).
[0043] (Slice Layer) The slice layer defines a set of data that the video decoding device 1 refers to in order to decode a slice S to be processed (also referred to as a target slice). As shown in (b) of FIG. 2, the slice S includes a slice header SH and tree blocks TBLK1 to TBLK2. NC (NC is the total number of treeblocks in slice S).
[0044] The slice header SH includes a group of coding parameters that the video decoding device 1 refers to 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 SH.
[0045] Slice types that can be specified by the slice type specification information include (1) an I slice that uses only intra prediction during encoding, (2) a P slice that uses unidirectional prediction or intra prediction during encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction during encoding.
[0046] The slice header SH also includes filter parameters FP that are referenced by an adaptive filter included in the video decoding device 1. The filter parameters FP may be included in the picture header PH.
[0047] (Treeblock layer) The treeblock layer defines a set of data that the video decoding device 1 refers to in order to decode a treeblock TBLK to be processed (hereinafter also referred to as a target treeblock). Note that a treeblock is also sometimes called a largest coding unit (LCU).
[0048] The tree block TBLK includes a tree block header TBLKH and coding unit information CU1 to CU2. NL (NL is the total number of pieces of coding unit information included in the tree block TBLK). First, the relationship between the tree block TBLK and the coding unit information CU will be described below.
[0049] The treeblock TBLK is divided into partitions to specify block sizes for intra-prediction or inter-prediction and each transform process.
[0050] The partitions of the tree block TBLK are divided by recursive quadtree division. The tree structure obtained by this recursive quadtree division is hereinafter referred to as a coding tree.
[0051] Hereinafter, a partition corresponding to a leaf, which is a terminal node of a coding tree, will be referred to as a coding node. Also, since a coding node is a basic unit of coding processing, a coding node will also be referred to as a coding unit (CU) below.
[0052] That is, coding unit information (hereinafter referred to as CU information) CU1 to CU NLis information corresponding to each coding node (coding unit) obtained by recursively dividing the tree block TBLK into quadtrees.
[0053] The root of the coding tree is associated with the tree block TBLK. In other words, the tree block TBLK is associated with the top node of the quadtree division tree structure that recursively includes multiple coding nodes.
[0054] The size of each coding node is half the length and width of the size of the coding node to which the coding node directly belongs (that is, the partition of the node one layer above the coding node in question).
[0055] The size of each coding node depends on the coding node size specification information and maximum hierarchical depth included in the sequence parameter set SPS of coded data #1. For example, if the size of tree block TBLK is 64x64 pixels and the maximum hierarchical depth is 3, coding nodes in the hierarchy below tree block TBLK can have one of three sizes: 64x64 pixels, 32x32 pixels, and 16x16 pixels.
[0056] (treeblock header) The tree block header TBLKH includes coding parameters that the video decoding device 1 refers to in order to determine a decoding method for the current tree block. Specifically, as shown in (c) of Fig. 2, the tree block header TBLKH includes tree block division information SP_TBLK that specifies a division pattern for the current tree block into CUs, and a quantization parameter difference Δqp (qp_delta) that specifies the size of the quantization step.
[0057] The tree block division information SP_TBLK is information that represents the coding tree for dividing the tree block, and specifically, is information that specifies the shape, size, and position within the target tree block of each CU included in the target tree block.
[0058] The tree block split information SP_TBLK does not have to explicitly include the shape and size of the CU. For example, the tree block split information SP_TBLK may be a set of flags (split_coding_unit_flag) indicating whether to split the entire target tree block or a partial region of the tree block into four. In this case, the shape and size of each CU can be identified by using the shape and size of the tree block.
[0059] Furthermore, the quantization parameter difference Δqp is the difference qp−qp′ between the quantization parameter qp in the current tree block and the quantization parameter qp′ in the tree block coded immediately before the current tree block.
[0060] (CU layer) The CU layer defines a set of data that the video decoding device 1 refers to in order to decode a CU to be processed (hereinafter also referred to as a target CU).
[0061] Before describing the specific contents of the data included in the CU information CU, the tree structure of the data included in the CU will be described. The coding node is the root node of a prediction tree (PT) and a transform tree (TT). The prediction tree and the transform tree will be described as follows.
[0062] In the prediction tree, a coding node is divided into one or more prediction blocks, and the position and size of each prediction block are specified.In other words, a prediction block is one or more non-overlapping regions that constitute a coding node.In addition, the prediction tree includes one or more prediction blocks obtained by the above division.
[0063] The prediction process is performed for each prediction block. Hereinafter, the prediction block, which is the unit of prediction, is also referred to as a prediction unit (PU).
[0064] Roughly speaking, there are two types of division in the prediction tree: intra prediction and inter prediction.
[0065] In the case of intra prediction, the division method is either 2N×2N (same size as the coding node) or N×N.
[0066] In the case of inter prediction, the division method includes 2N×2N (same size as the coding node), 2N×N, N×2N, and N×N.
[0067] In the transform tree, a coding node is divided into one or more transform blocks, and the position and size of each transform block are specified. In other words, a transform block is one or more non-overlapping regions that make up a coding node. The transform tree includes one or more transform blocks obtained by the division.
[0068] The division in the transform tree can be performed by allocating an area of the same size as the coding node as a transform block, or by recursive quad-tree division, similar to the division of the tree block described above.
[0069] The transform process is performed for each transform block. Hereinafter, the transform block, which is the unit of transform, is also referred to as a transform unit (TU).
[0070] (CU information data structure) Next, specific contents of data included in the CU information CU will be described with reference to (d) of Fig. 2. As shown in (d) of Fig. 2, the CU information CU specifically includes a skip flag SKIP, PT information PTI, and TT information TTI.
[0071] The skip flag SKIP is a flag indicating whether or not the skip mode is applied to the target PU, and when the value of the skip flag SKIP is 1, that is, when the skip mode is applied to the target CU, the PT information PTI and the TT information TTI in the CU information CU are omitted. Note that the skip flag SKIP is omitted in an I slice.
[0072] The PT information PTI is information about a PT included in a CU. In other words, the PT information PTI is a collection of information about one or more PUs included in a PT, and is referenced when a predicted image is generated by the video decoding device 1. As shown in (d) of Fig. 2, the PT information PTI includes prediction type information PType and prediction information PInfo.
[0073] The prediction type information PType is information that specifies whether intra prediction or inter prediction is to be used as a prediction image generation method for the target PU.
[0074] The prediction information PInfo is composed of intra prediction information or inter prediction information, depending on which prediction method is specified by the prediction type information PType. Hereinafter, a PU to which intra prediction is applied will also be referred to as an intra PU, and a PU to which inter prediction is applied will also be referred to as an inter PU.
[0075] Furthermore, the prediction information PInfo includes information specifying the shape, size, and position of the target PU. As described above, the predicted image is generated in units of PU. The prediction information PInfo will be described in detail later.
[0076] The TT information TTI is information about a TT included in a CU. In other words, the TT information TTI is a collection of information about one or more TUs included in a TT, and is referred to when the video decoding device 1 decodes residual data. Note that TUs may also be referred to as blocks hereinafter.
[0077] As shown in (d) of FIG. 2, the TT information TTI includes TT division information SP_TT that specifies a division pattern for each transform block of the target CU, and quantized prediction residuals QD1 to QD2. NT (NT is the total number of blocks included in the target CU).
[0078] Specifically, the TT division information SP_TT is information for determining the shape, size, and position within the target CU of each TU included in the target CU. For example, the TT division information SP_TT can be realized by information (split_transform_unit_flag) indicating whether or not to split the target node, and information (trafoDepth) indicating the depth of the split.
[0079] Furthermore, for example, if the size of a CU is 64×64, each TU obtained by division can have a size ranging from 32×32 pixels to 2×2 pixels.
[0080] Each quantized prediction residual QD is coded data generated by the video coding device 2 by performing the following processes 1 to 3 on a target block, which is a block to be processed.
[0081] Process 1: Subtract the predicted image from the image to be coded and perform DCT (Discrete Cosine Transform) on the prediction residual; Process 2: quantize the transform coefficients obtained in process 1; Process 3: Variable-length coding the transform coefficients quantized in process 2; The quantization parameter qp described above represents the size of the quantization step QP used when the video encoding device 2 quantizes the transform coefficients (QP=2 qp / 6 ).
[0082] (Prediction information PInfo) As described above, there are two types of prediction information PInfo: inter prediction information and intra prediction information.
[0083] The inter prediction information includes coding parameters that are referenced when generating an inter predicted image by inter prediction by the video decoding device 1. More specifically, the inter prediction information includes inter PU partition information that specifies a partition pattern of the target CU into inter PUs, and inter prediction parameters for each inter PU.
[0084] The inter prediction parameters include a reference picture index, an estimated motion vector index, and a motion vector residual.
[0085] On the other hand, the intra prediction information includes coding parameters that are referenced when the video decoding device 1 generates an intra predicted image by intra prediction. More specifically, the intra prediction information includes intra PU division information that specifies a division pattern of the target CU into each intra PU, and intra prediction parameters for each intra PU. The intra prediction parameters are parameters for specifying an intra prediction method (prediction mode) for each intra PU.
[0086] (offset units) In this embodiment, each picture or each slice is recursively divided into a plurality of offset units (also called Quad Adaptive Offset Units (QAOUs)) using a quadtree structure. Here, a QAOU is a processing unit for offset filtering by the adaptive offset filter according to this embodiment.
[0087] 2(e) to 2(f), the QAOU information, which is information about each QAOU, includes sao_split_flag, which indicates whether the QAOU itself is further split. More specifically, sao_split_flag is specified by arguments (sao_curr_depth, ys, xs) described later, and is also expressed as sao_split_flag[sao_curr_depth][ys][xs].
[0088] If the sao_split_flag included in a QAOU indicates that the QAOU is to be further split (i.e., if the QAOU is not a leaf), the QAOU information for the QAOU includes QAOU information for each of the multiple QAOUs included in the QAOU, as shown in Figure 2(e).
[0089] On the other hand, if the sao_split_flag included in a certain QAOU indicates that the QAOU will not be split any further (i.e., the QAOU is a leaf), the QAOU information for the QAOU includes offset information OI for the QAOU, as shown in Figure 2(f). Also, as shown in Figure 2(f), the offset information OI includes offset type designation information OTI that designates the offset type, and an offset group determined according to the offset type. Furthermore, as shown in Figure 2(f), the offset group includes multiple offsets.
[0090] The offset in the encoded data is a quantized value. The offset in the encoded data may also be a prediction residual obtained by using some kind of prediction, for example, linear prediction. In addition, when a pixel bit depth, which will be described later, is specified differently for each unit area, in this embodiment, the offset bit depth, offset value range, and shift value are changed according to the pixel bit depth. It is also possible to include the pixel bit depth of the processing target area in the offset type specification information OTI.
[0091] The offset information OI will be described below with reference to different drawings.
[0092] FIG. 3 is a diagram showing each syntax included in the offset information OI (denoted as sao_offset_param() in FIG. 3).
[0093] 3, the offset information OI includes the syntax sao_type_idx[sao_curr_depth][ys][xs]. If sao_type_idx[sao_curr_depth][ys][xs] is not 0, the offset information OI includes sao_offset[sao_curr_depth][ys][xs][i].
[0094] (sao_curr_depth, ys, xs) The arguments sao_type_idx and sao_offset, sao_curr_depth, are indices that represent the division depth of the QAOU, and ys and xs are indices that represent the positions in the y and x directions of the QAOU (or QAOMU, described later), respectively.
[0095] 4(a) to (e) are diagrams showing how QAOUs are divided according to the value of sao_curr_depth, where (a) shows the case where sao_curr_depth = 0, (b) shows the case where sao_curr_depth = 1, (c) shows the case where sao_curr_depth = 2, (d) shows the case where sao_curr_depth = 3, and (e) shows the case where sao_curr_depth = 4. As shown in FIG. 4(a) to (e), each QAOU is specified by sao_curr_depth and (xs, ys).
[0096] As shown in FIG. 4(a), when sao_curr_depth=0, xs and ys are each 0. As shown in FIG. 4(b), when sao_curr_depth=1, xs and ys can each take on a value of 0 or 1. As shown in FIG. 4(c), when sao_curr_depth=2, xs and ys can each take on a value of 0, 1, 2, or 3. In general, for a given sao_curr_depth, xs and ys can each take on a value between 0 and 2. sao_curr_depth Can have a value of -1.
[0097] (sao_type_idx) sao_type_idx[sao_curr_depth][ys][xs] corresponds to the offset type specification information OTI described above, and is a syntax for specifying the offset type for each QAOU. Hereinafter, sao_type_idx may be simply referred to as the offset type.
[0098] In this embodiment, sao_type_idx[sao_curr_depth][ys][xs] takes an integer value from 0 to 6. sao_type_idx[sao_curr_depth][ys][xs]=0 indicates that offset filter processing is not performed on the pre-offset filter image in the target QAOU (for example, the deblocked decoded image P_DB described later), sao_type_idx[sao_curr_depth][ys][xs]=1 to 4 indicates that edge offset processing is performed on the pre-offset filter image in the target QAOU, and sao_type_idx[sao_curr_depth][ys][xs]=5 to 6 indicates that band offset processing is performed on the pre-offset filter image in the target QAOU. Specific details of edge offset processing and band offset processing will be described later.
[0099] (sao_offset) sao_offset[sao_curr_depth][ys][xs][i] is a syntax that represents a specific value of the offset to be added to each pixel included in the target QAOU in the offset filter processing by the adaptive offset filter according to this embodiment. In this embodiment, sao_offset may also be simply referred to as the offset.
[0100] sao_offset[sao_curr_depth][ys][xs][i] is specified by the arguments sao_curr_depth, ys, and xs, as well as the index i. Here, the index i is an index for specifying a class, and is also expressed as class_idx. If the value of sao_type_idx[sao_curr_depth][ys][xs] is any of 1 to 4 (i.e., in the case of an edge offset), the index i takes an integer value of i=0 to 4. If the value of sao_type_idx[sao_curr_depth][ys][xs] is any of 5 to 6 (i.e., in the case of a band offset), the index i takes an integer value of i=0 to 16. Note that, in either case, i=0 indicates that no offset is added, as will be described later.
[0101] As will be described later, the adaptive offset filter according to this embodiment classifies a target pixel included in a target QAOU into one of the above-mentioned multiple classes, and adds to the target pixel an offset Offset for the class into which the target pixel is classified.
[0102] Also, the Descriptor ue(v) shown in Figure 3 indicates that the syntax associated with this descriptor is an unsigned number and the value is variable-length coded, while se(v) indicates that the syntax associated with this descriptor is a signed number and the sign and absolute value are separated and variable-length coded.
[0103] (Video Decoding Device 1) A video decoding device 1 according to this embodiment will be described below with reference to Fig. 1 and Fig. 5 to Fig. 13. The video decoding device 1 includes, as part thereof, the method adopted in H.264 / MPEG-4.AVC, the method adopted in KTA software, which is a codec jointly developed by VCEG (Video Coding Expert Group), the method adopted in TMuC (Test Model under Consideration) software, which is a successor codec, and the technology adopted in HM (HEVC Test Model) software.
[0104] Fig. 5 is a block diagram showing the configuration of a video decoding device 1. As shown in Fig. 5, the video decoding device 1 includes a variable-length code decoding unit 13, a motion vector restoration unit 14, a buffer memory 15, an inter-prediction image generation unit 16, an intra-prediction image generation unit 17, a prediction method determination unit 18, an inverse quantization and inverse transform unit 19, an adder 20, a deblocking filter 41, an adaptive filter 50, and an adaptive offset filter 60. The video decoding device 1 is a device for generating video #4 by decoding encoded data #1.
[0105] The variable-length code decoding unit 13 decodes prediction parameters PP for each partition from the coded data #1. That is, for an inter-prediction partition, the variable-length code decoding unit 13 decodes a reference image index RI, an estimated motion vector index PMVI, and a motion vector residual MVD from the coded data #1 and supplies these to the motion vector restoration unit 14. On the other hand, for an intra-prediction partition, the variable-length code decoding unit 13 decodes (1) size designation information that designates the partition size and (2) prediction index designation information that designates the prediction index from the coded data #1 and supplies this to the intra-prediction image generation unit 17. The variable-length code decoding unit 13 also decodes CU information from the coded data and supplies this to the prediction method determination unit 18 (not shown). Furthermore, the variable-length code decoding unit 13 decodes a quantized prediction residual QD for each block and a quantization parameter difference Δqp for the tree block including that block from the coded data #1 and supplies these to the inverse quantization and inverse transform unit 19. Furthermore, the variable-length code decoding unit 13 extracts QAOU information from the coded data #1 and supplies the extracted QAOU information to the adaptive offset filter 60.
[0106] The motion vector restoration unit 14 restores a motion vector mv for each inter-prediction partition from a motion vector residual MVD for that partition and restored motion vectors mv' for other partitions. Specifically, (1) an estimated motion vector pmv is derived from the restored motion vector mv' according to an estimation method specified by an estimated motion vector index PMVI, and (2) a motion vector mv is obtained by adding the derived estimated motion vector pmv and the motion vector residual MVD. Note that the restored motion vectors mv' for other partitions can be read from the buffer memory 15. The motion vector restoration unit 14 supplies the restored motion vector mv together with the corresponding reference image index RI to the inter-prediction image generation unit 16. Note that for an inter-prediction partition that performs bidirectional prediction (weighted prediction), the two restored motion vectors mv1 and mv2 are supplied to the inter-prediction image generation unit 16 together with the corresponding reference image indexes RI1 and RI2.
[0107] The inter-prediction image generation unit 16 generates a motion-compensated image mc for each inter-prediction partition. Specifically, using the motion vector mv supplied from the motion vector restoration unit 14, the motion-compensated image mc is generated from the filtered decoded image P_FL' specified by the reference image index RI also supplied from the motion vector restoration unit 14. Here, the filtered decoded image P_FL' is an image obtained by performing deblocking processing by the deblocking filter 41, offset filtering processing by the adaptive offset filter 60, and adaptive filtering processing by the adaptive filter 50 on the decoded image P that has already been decoded. The inter-prediction image generation unit 16 can read out the pixel values of each pixel constituting the filtered decoded image P_FL' from the buffer memory 15. The motion-compensated image mc generated by the inter-prediction image generation unit 16 is supplied to the prediction method determination unit 18 as the inter-prediction image Pred_Inter. For inter-prediction partitions that perform bidirectional prediction (weighted prediction), (1) a motion-compensated image mc1 is generated from the filtered decoded image P_FL1' specified by the reference image index RI1 using the motion vector mv1, (2) a motion-compensated image mc2 is generated from the filtered decoded image P_FL2' specified by the reference image index RI2 using the motion vector mv2, and (3) an inter-predicted image Pred_Inter is generated by adding an offset value to the weighted average of the motion-compensated images mc1 and mc2.
[0108] The intra-prediction image generation unit 17 generates a predicted image Pred_Intra for each intra-prediction partition. Specifically, first, the prediction mode decoded from the coded data #1 is referenced, and the prediction mode is assigned to the target partition, for example, in raster scan order. Next, the predicted image Pred_Intra is generated from the decoded image P according to the prediction method indicated by the prediction mode. The intra-prediction image Pred_Intra generated by the intra-prediction image generation unit 17 is supplied to the prediction method determination unit 18.
[0109] Furthermore, the intra-predicted image generation unit 17 supplies the adaptive filter 50 with intra-coding mode information IEM, which is information indicating the size of the target partition and the prediction mode assigned to the target partition.
[0110] The prediction method determination unit 18 determines, based on the CU information, whether each partition is an inter-prediction partition on which inter-prediction should be performed, or an intra-prediction partition on which intra-prediction should be performed. In the former case, the prediction method determination unit 18 supplies the inter-prediction image Pred_Inter generated by the inter-prediction image generation unit 16 to the adder 20 as the predicted image Pred, and in the latter case, the prediction method determination unit 18 supplies the intra-prediction image Pred_Intra generated by the intra-prediction image generation unit 17 to the adder 20 as the predicted image Pred.
[0111] The inverse quantization and inverse transform unit 19 (1) inverse quantizes the quantized prediction residual QD, (2) performs inverse DCT (Discrete Cosine Transform) on the DCT coefficients obtained by the inverse quantization, and (3) supplies the prediction residual D obtained by the inverse DCT transform to the adder 20. When inverse quantizing the quantized prediction residual QD, the inverse quantization and inverse transform unit 19 derives the quantization step QP from the quantization parameter difference Δqp supplied from the variable-length code decoding unit 13. The quantization parameter qp can be derived by adding the quantization parameter difference Δqp to the quantization parameter qp' related to the tree block that was inverse quantized / inverse DCT transformed immediately before, and the quantization step QP is calculated by subtracting the quantization step qp from the quantization step QP by QP=2. pq / 6 Furthermore, the prediction residual D is generated by the inverse quantization and inverse transform unit 19 in units of blocks (transform units).
[0112] The adder 20 generates a decoded image P by adding the predicted image Pred supplied from the prediction method determination unit 18 and the prediction residual D supplied from the inverse quantization and inverse transform unit 19 .
[0113] When the difference in pixel values between adjacent pixels across a block boundary or a CU boundary in the decoded image P is smaller than a predetermined threshold, the deblocking filter 41 smoothes the image near the block boundary or the CU boundary by performing a deblocking process on the block boundary or the CU boundary in the decoded image P. The image deblocked by the deblocking filter 41 is output to the adaptive offset filter 60 as a deblocked decoded image P_DB.
[0114] The adaptive offset filter 60 generates an offset-filtered decoded image P_OF by performing offset filtering processing using the offset decoded from the encoded data #1, with QAOU as the processing unit, on the deblocked decoded image P_DB supplied from the deblocking filter 41. The generated offset-filtered decoded image P_OF is supplied to the adaptive filter 50. A specific configuration of the adaptive offset filter 60 will be described later, and therefore will not be described here.
[0115] The adaptive filter 50 generates a filtered decoded image P_FL by performing filtering using filter parameters FP decoded from the encoded data #1 on the offset-filtered decoded image P_OF supplied from the adaptive offset filter 60. The image filtered by the adaptive filter 50 is output to the outside as the filtered decoded image P_FL, and is also stored in the buffer memory 15 in association with POC designation information decoded from the encoded data by the variable-length code decoding unit 13.
[0116] (adaptive offset filter 60) 1 is a block diagram showing the configuration of the adaptive offset filter 60. As shown in FIG. 1, the adaptive offset filter 60 includes an adaptive offset filter information decoding unit 61 and an adaptive offset filter processing unit 62.
[0117] As shown in FIG. 1, the adaptive offset filter information decoding unit 61 includes an offset information decoding unit 611, a QAOU structure decoding unit 612, and an offset attribute setting unit 613.
[0118] The offset information decoding unit 611 references the QAOU information included in the coded data #1 and decodes the offset information OI included in the QAOU information. The offset information decoding unit 611 also associates the values of sao_type_idx[sao_curr_depth][ys][xs] and sao_offset[sao_curr_depth][ys][xs][i] obtained by decoding the offset information OI with the respective arguments (sao_curr_depth, ys, xs) and (sao_curr_depth, ys, xs, i), and supplies them to the offset information storage unit 621.
[0119] The QAOU structure decoding unit 612 determines the division structure of the QAOU by decoding sao_split_flag[sao_curr_depth][ys][xs] included in the QAOU information, and supplies the QAOU structure information representing the determined division structure of the QAOU to the offset information storage unit 621.
[0120] The offset attribute setting unit 613 determines the bit depth of the offset (also referred to as SAO_DEPTH) and the value range of the offset. Here, the bit depth of the offset is determined from the pixel bit depth (also referred to as PIC_DEPTH) (not shown) input to the offset attribute setting unit 613. The pixel bit depth indicates the value range of the pixel values constituting the input image of the adaptive offset filter 60 in bit width. When the pixel bit depth is N bits, the pixel value ranges from 0 to 2. N The pixel value ranges from 0 to 255. For example, when the pixel bit depth is 8 bits, the pixel value can range from 0 to 255. If the input image to the adaptive offset filter 60 is a decoded image from the video decoding device 1 or a locally decoded image from the video encoding device 2, the bit depth of the decoded image / locally decoded image is used. The precision of the input image and the precision of the output image of the adaptive offset filter 60 are the pixel bit depth.
[0121] The pixel bit depth can be determined by decoding a value defined using syntax in the coded data #1. For example, in the case of H.264 / AVC, it can be determined using bit_depth_luma_minus8 in the sequence parameter set. Alternatively, the pixel bit depth can be determined for each unit region to be processed. In this case, the pixel bit depth is decoded from the header of the unit region. The pixel bit depth of the unit region may be included in parameter information or a header in the coded data #1 for decoding an input image to the adaptive offset filter 60, or may be included as part of the QAOU information. The parameter information and header for decoding the input image may include the pixel bit depth in a picture parameter header, slice header, LCU, CU, or the like. Furthermore, as part of the QAOU information, the pixel bit depth may be included in a leaf QAOU, or may be included in the QAOU information of a predetermined layer (e.g., a QAOU in the highest layer or a QAOU in the first layer). Furthermore, the pixel bit depth is preferably coded as a difference value from 8 bits. In QAOU information, it is appropriate to directly encode the shift value in addition to the pixel bit depth. Also, it is appropriate to encode the shift value only if it exceeds 8 bits. Here, the shift value indicates the bit shift amount required for inverse quantization. The parameter used for inverse quantization may be a step value in addition to the shift value. In this case, inverse quantization of the offset is performed by multiplying it by the step value, and quantization of the offset is performed by dividing it by the step value.
[0122] The offset bit depth is a value indicating the precision of the offset coded in the coded data #1. The offset included in the coded data #1 is quantized, and after decoding, this quantized offset is dequantized by an offset derivation unit 625 (described later) to a bit depth that matches the pixel bit depth. The dequantized offset is added by an offset addition unit 626 (described later). The offset bit depth has a value equal to or less than the pixel bit depth. If the offset bit depth is smaller than the pixel bit depth by k bits, the offset value to be coded is 2 k means a value quantized using the offset quantization step. Conversion from the decoded bit depth (offset bit depth) to the pixel bit depth is performed by the offset derivation unit 625, which will be described later.
[0123] The offset attribute setting unit 613 further sets an offset value range based on the determined offset bit depth. Furthermore, it sets a shift value based on the pixel bit depth of the offset and the offset value range. The set offset value range and shift value are supplied to the offset information storage unit 621 and the offset information decoding unit 611. The offset bit depth is determined and the shift value is set in one of patterns S1 to S6, which will be described later. The offset value range is set in one of patterns C1 and C2, which will be described later. Attributes common to offsets, such as the offset value range and shift value, are called offset attributes. Meanwhile, as shown in FIG. 1, the adaptive offset filter processing unit 62 includes an offset information storage unit 621, a QAOU control unit 622, an offset type derivation unit 623, a classification unit 624, an offset derivation unit 625, and an offset addition unit 626.
[0124] The offset information storage unit 621 is configured to manage and store the offset type specified for each QAOU and the specific values of the offset for each class selectable for that offset type based on QAOU structure information, sao_type_idx[sao_curr_depth][ys][xs], and sao_offset[sao_curr_depth][ys][xs][i], and is equipped with a map memory and a list memory.
[0125] The map memory stores QAOU indices (described later) assigned to each offset minimum unit (also referred to as QAOMU: Quad Adaptive Offset Minimum Unit) determined according to the division depth. The map memory will be described with reference to FIG. 6(a). FIG. 6(a) is intended to explain an example of QAOU indices stored in the map memory, and shows each QAOMU with a division depth of 3 that constitutes a target processing unit (e.g., an LCU) and the QAOU index assigned to each QAOMU. In FIG. 6(a), indexes 0 to 9 are used to simply specify a QAOU without considering the division depth of the QAOU. In the example shown in FIG. 6(a), a QAOU specified by a QAOU index = I is denoted as QAOUI. Furthermore, thin lines in FIG. 6(a) indicate boundaries between QAOMUs, and thick lines indicate boundaries between QAOUs.
[0126] As shown in Figure 6(a), QAOU0 is composed of four QAOMUs, and these four QAOMUs are assigned a QAOU index of 0. On the other hand, QAOU3 is composed of one QAOMU, and this QAOMU is assigned a QAOU index of 3. In this way, the map memory stores the QAOU index assigned to each QAOMU.
[0127] On the other hand, the list memory stores each QAOU index, an offset type associated with the QAOU index, and a specific value of the offset for each class selectable for the offset type, in association with one another. The offset information storage unit 621 stores offsets whose value range is limited to the offset value range set by the offset attribute setting unit 613.
[0128] Fig. 6(b) is intended to explain an example of information stored in the list memory, and shows the offset types associated with each of the QAOU indices 0 to 9 and the offsets for each class that can be selected for each offset type. "xxx" in Fig. 6(b) represents specific numerical values that may differ from one another.
[0129] Also, "BO_1" in Figure 6(b) represents the offset type specified by sao_type_idx=5. Also, "EO_1" represents the offset type specified by sao_type_idx=1. In this way, edge offsets, which are offset types specified by sao_type_idx=1, 2, 3, and 4, are also written as EO_1, 2, 3, and 4, respectively, and band offsets, which are offset types specified by sao_type_idx=5 and 6, are also written as BO_1 and 2, respectively.
[0130] As shown in FIG. 6(b), when the offset type is band offset, a total of 16 offsets, offset 1 to offset 16, are stored in the list memory for that offset type. Here, offset 1 to offset 16 refer to the values specified by sao_offset[sao_curr_depth][ys][xs][1] to sao_offset[sao_curr_depth][ys][xs]
[16] , respectively, when the value of sao_type_idx[sao_curr_depth][ys][xs] is 5 or 6. On the other hand, when the offset type is edge offset, a total of four offsets, offset 1 to offset 4, are stored in the list memory for that offset type. Here, offsets 1 to 4 refer to the values specified by sao_offset[sao_curr_depth][ys][xs][1] to sao_offset[sao_curr_depth][ys][xs][4] when the value of sao_type_idx[sao_curr_depth][ys][xs] is 1, 2, 3, or 4. Nothing is stored in offsets 5 to 16.
[0131] The memory size of each offset stored in the list memory is determined by the offset value range supplied from the offset attribute setting unit 613. When the offset value range is -2 4 ~2 4 If it is -1, each offset can be expressed with 5 bits, and a memory size of 5 bits is required.
[0132] Each QAOMU is assigned a QAOMU number, which allows each QAOMU to be distinguished from others. In the following, the QAOMU number is N Q QAOMU is QAOMUN Q It can also be written as:
[0133] The QAOU index is the number of the QAOU block specified, from the partition depth 0 to the maximum partition depth. When the maximum partition depth is 4, the values 0 to 340 are specified by the QAOU index for all blocks of the partition depth (1 + 4 + 16 + 64 + 256 = 341 blocks), as shown in Figure 7.
[0134] The offset information storage unit 621 used in the video decoding device 1 does not need to store offsets for all QAOUs at all partition depths, so it does not need to reserve 341 memory areas; it only needs memory areas for the number of QAOUs actually used in the structure specified by the input QAOU information. When the maximum partition depth is 4, the number of blocks is 256 or less, so 256 map memories and list memories are sufficient. In this case, the QAOU index used in the offset information storage unit 621 is a unique index for identifying a leaf QAOU, for example, an index ranging from 0 to 255 that is incremented by 1 each time a leaf QAOU is decoded. The offset information storage unit 621 can also store a map list in units of QAOU information corresponding to the maximum partition depth. In this case, the QAOU index used in the offset information storage unit 621 uses numbers from 0 to 255, which correspond to QAOU numbers 85 to 340 in FIG. 7.
[0135] Figures 7(a) to (e) are figures showing examples of QAOMU numbers assigned to QAOMUs included in the target processing unit (e.g., LCU), where (a) shows the QAOMU number assigned to a QAOMU with a partitioning depth of 0, (b) shows the QAOMU number assigned to a QAOMU with a partitioning depth of 1, (c) shows the QAOMU number assigned to a QAOMU with a partitioning depth of 2, (d) shows the QAOMU number assigned to a QAOMU with a partitioning depth of 3, and (e) shows the QAOMU number assigned to a QAOMU with a partitioning depth of 4.
[0136] The QAOU control unit 622 controls each unit included in the adaptive offset filter processing unit 62. The QAOU control unit 622 also refers to the QAOU structure information, divides the deblocked decoded image P_DB into one or more QAOUs, and scans each QAOU in a predetermined order. The QAOU control unit 622 also supplies the offset type derivation unit 623 with a QAOMU number indicating the target QAOMU to be processed.
[0137] The offset type derivation unit 623 refers to the map memory and list memory of the offset information storage unit 621, and derives the offset type specified by the QAOU number supplied from the QAOU control unit 622. In addition, it supplies the derived offset type to the class classification unit 624.
[0138] The classifying unit 624 classifies each pixel included in the target QAOU into one of a plurality of classes selectable in the offset type supplied from the offset type derivation unit 623. The classifying unit 624 also supplies the offset type and a class index indicating the class into which each pixel has been classified to the offset derivation unit 625. Note that the specific classification process performed by the classifying unit 624 will be described later, and therefore will not be described here.
[0139] The offset derivation unit 625 references the list memory of the offset information storage unit 621 and derives an offset specified by the offset type and class index supplied from the classification unit 624 for each pixel included in the target QAOU. It also includes an offset inverse shift unit (not shown) that bit-shifts the offset to the left by the shift value set by the offset attribute setting unit 613. The offset inverse shift unit inversely quantizes the offset so that the bit depth of the offset matches the pixel bit depth. By performing this inverse quantization, it becomes possible to add the pixel value and the offset at the same bit depth in the addition process of the offset addition unit 626, which will be described later. The inversely quantized offset for each pixel is supplied to the offset addition unit 626.
[0140] The offset addition unit 626 adds, to each pixel of the deblocked decoded image P_DB in the target QAOU, the offset supplied from the offset derivation unit 625. The offset addition unit 626 outputs the image obtained by performing processing on all QAOUs included in the deblocked decoded image P_DB as the offset-filtered decoded image P_OF.
[0141] FIG. 8 is a flowchart showing the flow of processing by the adaptive offset filter processing unit 62.
[0142] (Step S101) First, the QAOU control unit 622 acquires the QAOU structure information from the offset information storage unit 621 .
[0143] (Step S102) Next, the QAOU control unit 622 starts a first loop in which the QAOMU number of the target QAOMU to be processed is used as a loop variable.
[0144] (Step S103) The QAOU control unit 622 supplies a QAOMU number to the offset type derivation unit 623. Based on the control of the QAOU control unit 622, the offset type derivation unit 623 reads out the offset type specified by the QAOMU number supplied from the QAOU control unit 622 from the map memory and list memory of the offset information storage unit 621. The offset type derivation unit 623 also supplies the read offset type to the class classification unit 624.
[0145] (Step S104) Next, the QAOU control unit 622 starts a second loop using the pixel number of each pixel included in the target QAOMU as a loop variable. Here, the pixel number is used to distinguish between pixels included in the target QAOMU. For example, a pixel number assigned to each pixel included in the target QAOMU in a predetermined scan order can be used. Alternatively, instead of such a pixel number, the x and y coordinates of each pixel included in the target QAOMU can be used as loop variables.
[0146] (Step S105) Next, under the control of the QAOU control unit 622, the class classification unit 624 classifies the pixel to be processed into one of a plurality of classes selectable in the offset type supplied from the offset type derivation unit 623. In addition, the class classification unit 624 supplies the offset type and a class index indicating the class into which the pixel to be processed has been classified to the offset derivation unit 625.
[0147] (Step S106) Next, the offset derivation unit 625, under the control of the QAOU control unit 622, reads out an offset to be added to the pixel being processed from the offset information storage unit 621. That is, it reads out an offset specified by the offset type and class index supplied from the classification unit 624. It also bit-shifts the offset derived for the pixel being processed to the left by the shift value supplied from the offset attribute setting unit 613, thereby dequantizing the offset, and supplies the dequantized offset to the offset addition unit 626.
[0148] (Step S107) Next, under the control of the QAOU control unit 622, the offset adding unit 626 adds the offset supplied from the offset derivation unit 625 to the pixel value of the pixel to be processed of the deblocked decoded image P_DB.
[0149] (Step S108) This step is the end of the second loop.
[0150] (Step S109) This step is the end of the first loop.
[0151] In step S103, when the offset read by the offset type derivation unit 623 is 0 (offset type=0), the QAOU control unit 622 controls the offset addition unit 626 so as not to add an offset to each pixel of the QAOMU to be processed.
[0152] Furthermore, in step S105, if the target pixel is classified into class 0 (class index=0), the offset adding unit 626 is controlled so as not to add an offset to the target pixel.
[0153] (number of bits required to store the offset) Next, we will explain the number of bits required to store the offset (sao_offset). If the pixel bit depth is 10 bits and the offset bit depth is 9 bits, the offset is -2 9 ~2 9 The offset information storage unit 621 has a maximum memory size of 10 bits per picture for storing the offsets. (Total number of QAOMUs per picture) x (Number of classes) x (Number of bits per offset) = 256 x 16 x 10 (bits) = 40960 (bits) The total number of QAOMUs per picture is 256 in the decoding device, but 341 are used in the encoding device described later, which requires even larger memory. In this way, if the range of offset values is not limited and the range of values allowed by the offset bit depth is used, the number of offset bits is large, so a large memory size is required to store the offsets.
[0154] (Relationship between SAO_DEPTH and coding efficiency) SAO_DEPTH and PIC_DEPTH are closely related in terms of quantization error. The bit depth of the output image of the adaptive offset filter 60 is the pixel bit depth PIC_DEPTH, and SAO_DEPTH is the bit depth of the offset added to the pixel. Therefore, even if an offset with precision exceeding the pixel bit depth is used, it will be discarded in the output process. Therefore, it is preferable that SAO_DEPTH, which is the offset precision, be set to PIC_DEPTH or less. Furthermore, if SAO_DEPTH is smaller than PIC_DEPTH, the input image can only be corrected coarser than the precision (PIC_DEPTH) at which the filter can correct the image, reducing the filter effect.
[0155] Note that when the offset precision SAO_DEPTH is high, the offset coding amount increases. Generally, as can be understood from the fact that coding efficiency is optimized by minimizing the rate-distortion cost D+λR, which is expressed using the coding amount R of the encoded data, the distortion D of the input image, and the weight λ, the offset precision has a negative effect on the distortion D and a positive effect on the rate R, so there is a trade-off in the precision and a specific optimal value.
[0156] Furthermore, in this embodiment, by limiting the offset value range to one that can represent the quantized offset with a certain bit width, the bit width for storing the quantized offset in the offset information storage unit 621 can be limited. This can reduce memory size compared to when no limit is imposed. However, excessively narrowing the offset value range reduces the effect of the offset in correcting distortion in the decoded image, so the offset addition process cannot remove distortion in the decoded image, which can result in reduced coding efficiency. Therefore, it is preferable to set the offset value range to an optimal range so as not to reduce coding efficiency.
[0157] In this embodiment, the offset attribute setting unit 613 sets the offset bit depth and the offset shift value according to one of patterns S1 to S6, and sets the offset value range according to one of patterns C1 to C3.
[0158] (Pattern S1) In pattern S1, as shown in Fig. 9(a), the offset bit depth SAO_DEPTH is set equal to the pixel bit depth PIC_DEPTH. Since the maximum value of offset precision is the pixel bit depth, pattern S1 encodes the offset with maximum precision.
[0159] (Pattern S2) In pattern S2, as shown in FIG. 9(b), when PIC_DEPTH is 10 bits or less, SAO_DEPTH is set to be equal to PIC_DEPTH, and when PIC_DEPTH is 11 bits or more, SAO_DEPTH is set to 10. In pattern S2, the upper limit of the offset bit depth is set to 10 bits. According to the inventor's knowledge, when the value of the quantization step QP of the decoded image is small (when the bit rate is high), coding efficiency is higher when the offset bit depth is the same as the pixel bit depth compared to when the offset bit depth is reduced, and conversely, when the value of the quantization step QP is large, coding efficiency is higher when the offset bit depth is smaller than the pixel bit depth than when it is the same as the pixel bit depth. In the inventor's experiments, it was confirmed that by determining the offset bit depth as in pattern S2 in the range where the quantization parameter qp is from 12 to 27, encoding efficiency is improved compared to when the offset bit depth is 8 bits when the pixel bit depth is 9 bits or less, and when the offset bit depth is 9 bits when the pixel bit depth is 10 bits or more. Therefore, by changing the dependency on the pixel bit depth at the boundary of 10 bits in pattern S2, the amount of offset code can be reduced compared to when the offset bit depth and the pixel bit depth are equal as in pattern S1, and high encoding efficiency can be achieved.
[0160] (Pattern S3) In pattern S3, as shown in Fig. 9(c), when PIC_DEPTH is 9 bits or less, SAO_DEPTH is set equal to PIC_DEPTH, and when PIC_DEPTH is 10 bits or more, SAO_DEPTH is set to 9. In pattern S3, the upper limit of the offset bit depth is set to 9 bits. In pattern S3, as in pattern S2, the amount of offset coding can be reduced, making it possible to achieve high coding efficiency.
[0161] (Pattern S4) In pattern S4, as shown in FIG. 9(d), when PIC_DEPTH is 10 bits or less, SAO_DEPTH is set equal to PIC_DEPTH, and when PIC_DEPTH is 11 bits or more, SAO_DEPTH is set to 10-floor((PIC_DEPTH-10) / STEP). Here, the function floor(x) is a function that gives the largest integer less than or equal to x. In pattern S4, when the pixel bit depth is 11 bits or more, this means that the offset bit depth increases (decreases) by 1 bit every time the pixel bit depth increases (decreases) by STEP bits. FIG. 9(e) shows the case where STEP=2 in pattern S4, where the offset bit depth increases by 1 bit every time the pixel bit depth increases by 2 bits. This configuration allows for a greater degree of flexibility in dealing with the size of the bit rate than patterns S2 and S3, while taking into account the size of the pixel bit depth.
[0162] In addition, in common to patterns S1 to S4, the shift value is expressed as the difference value between PIC_DEPTH and SAO_DEPTH, PIC_DEPTH-SAO_DEPTH. The change of the offset bit depth and shift value in the above patterns S1 to S4 sets the offset bit depth and shift value without increasing the memory size or processing amount, and therefore, it is possible to improve coding efficiency.
[0163] (Pattern S5) In pattern S5, the offset bit depth is explicitly coded. Specifically, the difference between the offset bit depth and a predetermined value is coded. The predetermined value is preferably 8 or the pixel bit depth. In the former case, SAO_DEPTH-8 is coded, and in the latter case, PIC_DEPTH-SAO_DEPTH is coded. The offset bit depth may be coded as part of various parameter information, a header, or QAOU information of the coded data. As part of the QAOU information, the pixel bit depth may be included in a leaf QAOU, or in the QAOU information of a predetermined layer (e.g., a QAOU in the highest layer or a QAOU in the first layer). By coding the offset bit depth as part of the coded data, the decoding device and the coding device can set the bit depth to an optimal value, thereby maximizing coding efficiency. Furthermore, when coding the bit depth using QAOU information, changing the bit depth according to the QAOU depth (sao_curr_depth) can reduce the memory required to store the offset. Since many offsets are likely to appear when sao_curr_depth is large, the required memory size can be reduced by reducing the bit depth when sao_curr_depth is large and increasing the bit depth when sao_curr_depth is small. For example, when sao_curr_depth=0 to 1, it is appropriate to set the offset bit depth equal to the pixel bit depth (pattern S1), and when sao_curr_depth=2 to 4, it is appropriate to set an upper limit on the offset bit depth (pattern S2), and encode the bit depth in this manner. It is also appropriate to encode a flag indicating whether to encode the offset bit depth for each QAOU depth or to use one offset bit depth regardless of the QAOU depth, and switch whether to encode for each QAOU depth.
[0164] (Pattern S6) In pattern S6, the bit depth is determined according to sao_curr_depth without explicit coding. For example, when sao_curr_depth=0 to 1, the offset bit depth is set to the pixel bit depth (pattern S1), and when sao_curr_depth=2 to 4, an upper limit is set to the offset bit depth (pattern S2).
[0165] (Pattern C1) In pattern C1, the offset range is set according to SAO_DEPTH. In the following, the maximum bit length representing the value of the offset range is CLIP_BIT. Specifically, the offset range is set to -2 by calculating CLIP_BIT=SAO_DEPTH-K. CLIP_BIT-1 ~2 CLIP_BIT-1 The value is set to -1. Experiments conducted by the inventors have found that K=4 is appropriate. That is, it has been confirmed that when K=4, there is no decrease in encoding efficiency even if the offset range is limited by the offset value range. K=4 is appropriate when the bit depth of the most commonly used pixels is 8. When the pixel bit depth is 8, the offset bit depth SAO_DEPTH is also 8, and CLIP_BIT=8-K=4. The fact that one offset can be stored in 4 bits means that software that handles 8-bit bytes as units can pack and store two offsets in one byte, making it possible to easily reduce memory size.
[0166] (Pattern C2) In pattern C2, the offset value range is set regardless of SAO_DEPTH. Specifically, CLIP_BIT=8 and the offset value range is set to -2 7 ~2 7 Set it to -1.
[0167] Generally, a constant N that does not depend on SAO_DEPTH may be used to set CLIP_BIT=N. When setting the offset value range without depending on SAO_DEPTH, it is preferable to set it to a value smaller than the bit depth of the offset in order to obtain the effect of reducing memory size.
[0168] (Pattern C3) In pattern C3, the offset value range is determined according to the QAOU layer. When sao_curr_depth is small (e.g., 0 to 1), the offset value range is determined regardless of the offset bit depth, and when sao_curr_depth is large (e.g., 2 to 4), it is appropriate to determine the offset value range according to the offset bit depth. For example, the former can be set to CLIP_BIT=8 (pattern C2), and the latter can be set to SAO_DEPTH-K bits (pattern C1). Note that when the offset bit depth is changed according to the QAOU layer, a fixed number of bits may be acceptable as a result. For example, CLIP_BIT=4 is appropriate.
[0169] (Example 1 of offset bit count) Next, a first specific example of the number of bits of the offset (sao_offset) according to this embodiment will be described. In this example, a case will be described in which the pixel bit depth is 10 bits, the shift value is set using pattern S2, and the offset value range is set using pattern C1. In pattern S2, the offset bit depth is set to 10 bits, and in pattern C1, the offset value range is set to 10-4=6 bits. The number of bits per offset being 6 bits corresponds to limiting the possible values of the offset to values from -32 to 31. In this example, the offset information storage unit 621 has a maximum memory size per picture for storing offsets of (Total number of QAOMUs per picture) × (Number of classes) × (Number of bits per offset) = 256 × 16 × 6 (bits) = 24576 (bits) It is sufficient to have the above.
[0170] Therefore, by configuring the offset to have the range of values in this example, the memory size required for the offset information storage unit 621 can be reduced to approximately 3 / 5 of the conventional example.
[0171] Since the amount of offset coding included in the coded data #1 can be reduced, coding efficiency can be improved. In addition, adding an excessive offset is prevented, ensuring appropriate image quality.
[0172] (Example 2 of offset bit count) Next, a second specific example of the number of bits of the offset (sao_offset) according to this embodiment will be described. In this example, an example will be described in which the pixel bit depth is 10 bits, the shift value is set using pattern S2, and the offset value range is set using pattern C2. The offset bit depth is set to 10 bits using pattern S2, and the offset value range is set to 8 bits using pattern C2. The number of bits per offset being 8 bits corresponds to limiting the possible values of the offset to values from -128 to 127, for example. In this example, the offset information storage unit 621 has a maximum memory size per picture for storing offsets of (Total number of QAOMUs per picture) x (Number of classes) x (Number of bits per offset) = 256 x 16 x 8 (bits) = 32768 (bits) It is sufficient to have the above.
[0173] Therefore, by configuring the offset to have the number of bits in this example, the memory size required for the offset information storage unit 621 can be reduced to approximately 4 / 5 of the conventional example.
[0174] Furthermore, since the amount of coding for the offset included in the coded data #1 can be reduced, coding efficiency can be improved, and since the addition of an excessive offset is prevented, appropriate image quality can be guaranteed.
[0175] Although limiting the number of offset bits can reduce the amount of coding for the offset information included in the encoded data, excessive restriction reduces the benefits of having an adaptive offset filter, and results in a problem in that the amount of coding for the residual data (pixel values of the residual image) included in the encoded data increases.
[0176] (Example 3 of offset bit count) Next, a third specific example of the number of bits of the offset (sao_offset) will be described. In either pattern C1 or C2 of this example, a different value is set for the number of bits of the offset depending on whether the offset type is an edge offset (offset type = 1 to 4) or a band offset (offset type = 5 to 6). Here, using an example where the pixel bit depth is 10 bits, a method will be described in which the shift value is set using pattern S2, the offset value range of the edge offset is set using pattern C2, and the offset value range of the band offset is set using pattern C1.
[0177] When the pixel bit depth is 10 bits, the offset bit depth is set to 10 bits in pattern S2. The offsets belonging to the edge offset offset type (hereinafter referred to as edge offset offsets) have a value range set to 8 bits from pattern C2. The offsets belonging to the band offset offset type (hereinafter referred to as band offset offsets) have a value range set to 6 bits from pattern C1. More generally, when the number of bits of the edge offset offset is N bits and the number of bits of the band offset offset is M bits, the number of bits of the offset is determined so that N≧M is satisfied.
[0178] The memory size that needs to be reserved in the offset information storage unit 621 is, in QAOU units, the number of classes of the offset type multiplied by the number of bits of the offset. Therefore, by reducing the number of bits of the band offset, whose number of classes of the offset is larger than that of the edge offset, the memory area used for the offset in the offset information storage unit 621 can be effectively utilized.
[0179] By varying the number of offset bits depending on the offset type in this way, it is possible to improve coding efficiency without requiring an excessive memory size for the offset information storage unit 621. This makes it possible to make the most effective use of memory space.
[0180] The threshold value th for limiting the possible offset values is 2. m-1 Bigger, 2 m When ≤ 1, an m-bit fixed-length coding / decoding method can be used as the coding method for encoding the offset. Alternatively, a variable-length coding / decoding method such as truncated unary coding or truncated rice coding, in which th is the maximum value, can be used. Note that the maximum value th is determined by the offset value range supplied from the offset attribute setting unit 613. The video decoding device 1 can decode the offset coded in this manner.
[0181] In the above configuration, the offset attribute setting unit 613 sets the offset bit depth, offset range, and shift value. The adaptive offset filter information decoding unit 61 decodes quantized offsets having values within the range of the offset range, and stores each offset in the offset information storage unit 621, which has a storage area with a bit width equal to or greater than the offset range. This embodiment is characterized in that the offset range is determined according to the offset bit depth. Furthermore, the offset bit depth is determined according to the pixel bit depth. Therefore, determining the offset bit depth according to the pixel bit depth is also a feature of this embodiment.
[0182] Furthermore, the adaptive offset filter information decoding unit 61 in the first embodiment may be configured to include a storage unit that stores the decoded offset and an inverse quantization unit that inverse quantizes the offset obtained from the storage unit, thereby omitting the inverse quantization process in the offset derivation unit 625. In this case, the storage unit stores an offset that is limited to an offset value range set by the offset attribute setting unit 613, and the inverse quantization unit performs inverse quantization by shifting to the left according to the shift value set by the offset attribute setting unit 613.
[0183] The offset information decoding unit 611 decodes each offset referenced by the offset addition unit 626, which adds an offset to each pixel value of an input image consisting of multiple unit areas, from the encoded data #1, and can also be described as having an offset decoding means that sets an offset value range and shift value determined according to a pixel bit depth not shown, and decodes an offset that is limited to the offset value range.
[0184] Furthermore, the adaptive offset filter 60 according to this embodiment can also be expressed as an image filter device that adds an offset to each pixel value of an input image made up of a plurality of unit areas, and that includes an offset attribute setting unit 613 that references offset type designation information included in the encoded data and sets an offset attribute for the unit area to be processed, an offset information decoding unit 611 that decodes an offset having a bit width according to the offset value range included in the set offset attribute, and an offset addition unit 626 that adds the offset to each pixel value of the input image.
[0185] Furthermore, the offset information decoding unit 611 may be configured to include, in addition to the offset decoding means, a determination means for determining, from among a plurality of offset types, the offset type to which the unit area to be processed belongs, and an offset decoding means for decoding an offset having a different bit width depending on the offset type determined by the determination means.
[0186] In addition, the offset type specification information may include the bit depth of the pixel values of the input image in each unit area, and the offset information decoding unit 611 may be configured to decode an offset having a bit width corresponding to the bit depth of the pixel values.
[0187] The following describes a specific example of classification processing by the classifying unit 624. Of the following classification processing examples, it is preferable that the classifying unit 624 performs classification processing corresponding to the classification processing in the video encoding device that generates encoded data #1.
[0188] (Classification Processing Example 1 by Classification Unit 624) A first example of the classification process by the classification unit 624 will be described with reference to FIGS. 10(a) to 10(d) to 12. FIG.
[0189] (When offset type = 1 to 4 (edge offset)) When the offset type supplied from the offset type derivation unit 623 is one of 1 to 4, the class classification unit 624 determines whether or not an edge exists near the pixel to be processed, and if an edge exists, the type of edge, and classifies the pixel to be processed into one of a plurality of classes depending on the result of the determination.
[0190] More specifically, first, the classification unit 624 calculates the sign of the difference between the pixel value pic[x] of the pixel x to be processed and the pixel values pic[a] and pic[b] of two pixels a and b that are adjacent to the pixel to be processed or share a vertex with the pixel x. Sign(pic[x]-pic[a]), and Sign(pic[x]-pic[b]) where Sign(z) is Sign(z)=+1 (when z>0) Sign(z)=0 (when z=0) Sign(z)=-1 (when z<0) In addition, which pixels are used as pixel a and pixel b specifically depends on the offset type, and is determined as follows:
[0191] When offset type = 1 (sao_type_idx = 1) As shown in FIG. 10(a), the pixel adjacent to the left side of the pixel x to be processed is designated as pixel a, and the pixel adjacent to the right side of the pixel x to be processed is designated as pixel b.
[0192] When offset type = 2 (sao_type_idx = 2) As shown in FIG. 10(b), the pixel adjacent to the upper side of the processing target pixel x is designated as pixel a, and the pixel adjacent to the lower side of the processing target pixel is designated as pixel b.
[0193] When offset type = 3 (sao_type_idx = 3) As shown in FIG. 10(c), the pixel sharing the upper left vertex of the pixel x to be processed is designated as pixel a, and the pixel sharing the lower right vertex of the pixel to be processed is designated as pixel b.
[0194] When offset type = 4 (sao_type_idx = 4) As shown in FIG. 10(d), the pixel sharing the lower left vertex of the pixel x to be processed is designated as pixel a, and the pixel sharing the upper right vertex of the pixel to be processed is designated as pixel b.
[0195] Fig. 11(a) is a graph showing the magnitude relationship between the pixel value pic[x] of the pixel x to be processed and the pixel value of pixel a or b, and a diagram showing the value of the function Sign corresponding to this magnitude relationship. In the graph shown in Fig. 11(a), the black circle marked with pic[x] indicates the pixel value of the pixel x to be processed, and the black circle without pic[x] indicates the pixel value of the pixel a or b to be processed. In addition, the up and down direction in the graph shown in Fig. 11(a) indicates the magnitude relationship of the pixel values.
[0196] Next, the classification unit 624 derives EdgeType based on Sign(pic[x]-pic[a]) and Sign(pic[x]-pic[b]) using the following equation (1-1).
[0197] EgdeType=Sign(pic[x]-pic[a])+Sign(pic[x]-pic[b])+2 ···(1-1) Fig. 11(b) is a graph showing the magnitude relationship between the pixel value of the pixel x to be processed and the pixel values of pixels a and b, and a diagram showing the EdgeType value corresponding to this magnitude relationship. In Fig. 11(b), the black circle in the center of each graph indicates the pixel value of the pixel x to be processed, and the black circles on both ends indicate the pixel values of pixels a and b. The up and down directions in the graphs shown in Fig. 11(b) indicate the magnitude relationship between the pixel values.
[0198] Next, the classification unit 624 derives the class index (class_idx) of the class to which the target pixel x to be processed should belong based on the derived EdgeType as follows.
[0199] class_idx=EoTbl[EdgeType] Here, EoTbl[EdgeType] is a conversion table used to derive class_idx from EdgeType. A specific example of the conversion table EoTbl is shown in FIG.
[0200] As shown in Fig. 11(d), when there is no edge in the area consisting of the target pixel x, pixel a, and pixel b (hereinafter also referred to as the flat case), the classification unit 624 classifies the target pixel x into class 0 (class_idx=0). Fig. 11(c) shows the correspondence between each graph shown in Fig. 11(b) and class_idx.
[0201] (When offset type = 5 to 6 (band offset)) When the offset type supplied from the offset type derivation unit 623 is one of 5 and 6, the classification unit 624 classifies the pixel value of the processing target pixel x into one of a plurality of classes according to the pixel value pic[x] of the processing target pixel x.
[0202] When offset type = 5 (sao_type_idx = 5) The classification unit 624 classifies the pixel value pic[x] of the pixel x to be processed as follows: (max×1 / 4)≦pic[x]≦(max×3 / 4) satisfies the condition, the pixel to be processed is classified into a class other than class 0. In other words, if the pixel value of the pixel to be processed is within the shaded area in FIG. 12(a), the pixel to be processed is classified into a class other than class 0. Note that the above max represents the maximum value that the pixel value of the pixel to be processed x can take, and is, for example, max=255. When max=255, the above condition is met. 8≦(pic[x] / 8)≦23 It can also be expressed as:
[0203] When offset type = 6 (sao_type_idx = 6) The classification unit 624 classifies the pixel value pic[x] of the pixel x to be processed as follows: pic[x]≦(max×1 / 4) or (max×3 / 4)≦pic[x] satisfies the condition, the pixel to be processed is classified into a class other than class 0. In other words, if the pixel value of the pixel to be processed is within the shaded area in FIG. 12(b), the pixel to be processed is classified into a class other than class 0. Note that the above max represents the maximum value that the pixel value of the pixel to be processed x can take, and is, for example, max=255. When max=255, the above condition is met. (pic[x] / 8)≦7 or 24≦(pic[x] / 8) It can also be expressed as:
[0204] The classification process performed by the classification unit 624 will be described in more detail below.
[0205] When the offset type is one of 5 and 6, the classification unit 624 derives the class index (class_idx) of the class to which the target pixel x to be processed belongs as follows.
[0206] class_idx=BoTbl[sao_type_idx][pic[x] / 8] Here, BoTbl[sao_type_idx][pic[x] / 8] is a conversion table used to derive class_idx from the pixel value pic[x] of the pixel x to be processed and sao_type_idx. A specific example of the conversion table BoTbl is shown in Fig. 12. In Fig. 12(c), "BO_1" indicates that sao_type_index=5, and "BO_2" indicates that sao_type_index=6.
[0207] As shown in Figure 12(c), when sao_type_index=5, if the pixel value pic[x] of the processing target pixel x satisfies 8≦(pic[x] / 8)≦23, the classification unit 624 classifies the processing target pixel x into one of the classes from class index 1 to 16 depending on the magnitude of pic[x].
[0208] On the other hand, when sao_type_index=6, if the pixel value pic[x] of the pixel x to be processed satisfies pic[x] / 8)≦7 or 24≦(pic[x] / 8), the classification unit 624 classifies the pixel x to be processed into one of the classes from class index 1 to 16 according to the magnitude of pic[x].
[0209] Generally, when the image bit depth is PIC_DEPTH, max=2 PIC_DEPTH -1, and pic / 2 instead of pic / 8 in Fig. 12(c). (PIC_DEPTH-5) Classification is performed using
[0210] (Classification Processing Example 2 by Classification Unit 624) Next, a second example of the classification process by the classification unit 624 will be described.
[0211] In this processing example, the classification unit 624 derives EdgeType using the following formula (1-2) instead of formula (1-1). The rest is the same as in classification processing example 1.
[0212] EgdeType=Sign((pic[x]>>shift)-(pic[a]>>shift))+Sign((pic[x]>>shift)-(pic[b]>>shift))+2 ···(1-2) Here, ">>" represents a right bit shift, and "shift" represents the magnitude of the bit shift. The specific value of "shift" can be determined to have a positive correlation with the bit depth of the pixel value, for example.
[0213] In the classification process according to classification process example 1, even if the gradient of pixel values is very small, the value of Sign will be non-zero unless the gradient of pixel values is 0. Therefore, the classification process according to classification process example 1 has an aspect that it is susceptible to the influence of noise.
[0214] In this processing example, the pixel value is shifted to the right before the difference is calculated, so the EdgeType value is less susceptible to the influence of noise, which has the effect of improving coding efficiency.
[0215] In this processing example, the following formula (1-3) may be used instead of formula (1-2).
[0216] EdgeType=Sign((pic[x]-pic[a])>>shift)+Sign((pic[x]-pic[b])>>shift))+2 (1-3) In other words, after calculating the difference between pixel values, a right bit shift may be performed. Using formula (1-3) also produces the same effect as using formula (1-2).
[0217] (Classification Processing Example 3 by Classification Unit 624) Next, a third example of the classification process by the classification unit 624 will be described.
[0218] In this processing example, the classification unit 624 changes the definition of the function Sign described in classification processing example 1 as follows: The rest is the same as in classification processing example 1.
[0219] Sign(z)=+1 (when z>th) Sign(z)=0 (when -th≦z≦th) Sign(z)=-1 (when z<-th) Here, th is a threshold value having a predetermined value. The specific value of the threshold value th can be determined so that its absolute value has a positive correlation with, for example, the bit depth of the pixel value.
[0220] In this processing example as well, the value of EdgeType is less susceptible to the influence of noise, and high coding efficiency can be achieved.
[0221] (Classification Processing Example 4 by Classification Unit 624) Next, a fourth example of the classification process by the classification unit 624 will be described.
[0222] In this processing example, the classification unit 624 uses BoTbl[sao_type_idx][pic[x] / 8] shown in FIG. 13 instead of BoTbl[sao_type_idx][pic[x] / 8] shown in FIG. 12(c).
[0223] 13, in this processing example, when the value of pic[x] / 8 is either 8 or 9, the pixel x to be processed is classified into a class whose class index is not 0, regardless of whether sao_type_index=5 or sao_type_index=6. Also, when the value of pic[x] / 8 is either 22 or 23, the pixel x to be processed is classified into a class whose class index is not 0, regardless of whether sao_type_index=5 or sao_type_index=6.
[0224] In this processing example, the pixel value of the pixel to be processed is clipped to MIN if its value is 15 or less (if pic[x] / 8=0 or 1). Also, the pixel value of the pixel to be processed is clipped to MAX if its value is 240 or more (if pic[x] / 8=30 or 31). Here, MIN and MAX are defined as follows: MIN=15, MAX=240 MIN=16, MAX=239 MIN=16, MAX=235 It is preferable to use any combination of the above.
[0225] In classification processing example 1, a pixel to be processed that is classified into class 0 when sao_type_index=5 is classified into a class other than class 0 when sao_type_index=6. Also, a pixel to be processed that is classified into class 0 when sao_type_index=6 is classified into a class other than class 0 when sao_type_index=5.
[0226] Therefore, in classification process example 1, the pixel value after adding the offset may differ significantly depending on whether sao_type_index = 5 or sao_type_index = 6, which may result in a problem that the coding efficiency does not improve as much as expected. Furthermore, this problem may become significant when the pixel value of the image before the offset filter is such that the value of pic[x] / 8 is either 8 or 9, or the value of pic[x] / 8 is either 22 or 23.
[0227] In this processing example, when the value of pic[x] / 8 is either 8 or 9, the pixel x to be processed is classified into a class whose class index is not 0, whether sao_type_index=5 or sao_type_index=6, and when the value of pic[x] / 8 is either 22 or 23, the pixel x to be processed is classified into a class whose class index is not 0, whether sao_type_index=5 or sao_type_index=6, so the above-mentioned problem is unlikely to occur. Therefore, by performing the processing of this processing example, it is possible to improve coding efficiency.
[0228] In this processing example, when the value of pic[x] / 8 is either 8 or 9, and when the value of pic[x] / 8 is either 22 or 23, the pixel x to be processed is classified into a class whose class index is not 0, regardless of whether sao_type_index=5 or sao_type_index=6. However, this does not limit this processing example, and it is sufficient if processing is performed in which the pixel x to be processed is classified into a class whose class index is not 0, regardless of whether sao_type_index=5 or sao_type_index=6, when the value of pic[x] / 8 is within a predetermined range.
[0229] Generally, when the pixel bit depth of the image is PIC_DEPTH, max=2 PIC_DEPTH -1 and pic / 2 instead of pic / 8 in Figure 13 (PIC_DEPTH-5) Classification is performed using
[0230] In this way, the class classification unit 624 that performs the classification processing of this processing example can also be described as classifying the target pixel into an offset class to which an offset is added when the pixel value of the target pixel is within a predetermined range, regardless of whether the offset type to which the unit area including the target pixel belongs is the first or second offset type.
[0231] (Video Encoding Device 2) 14 to 18(a)-(d), a video encoding device 2 that generates encoded data #1 by encoding a target image to be encoded will be described below. The video encoding device 2 partially incorporates the method adopted in H.264 / MPEG-4.AVC, the method adopted in KTA software, which is a codec jointly developed by VCEG (Video Coding Expert Group), the method adopted in TMuC (Test Model under Consideration) software, which is its successor codec, and the technology adopted in HM (HEVC Test Model) software.
[0232] Fig. 14 is a block diagram showing the configuration of a video encoding device 2 according to this embodiment. As shown in Fig. 14, the video encoding device 2 includes a transform / quantization unit 21, a variable-length code encoding unit 22, an inverse quantization / inverse transform unit 23, a buffer memory 24, an intra-prediction image generation unit 25, an inter-prediction image generation unit 26, a motion vector detection unit 27, a prediction method control unit 28, a motion vector redundancy elimination unit 29, an adder 31, a subtractor 32, a deblocking filter 33, an adaptive filter 70, and an adaptive offset filter 80. The video encoding device 2 is a device that generates coded data #3 by encoding video #10 (a target image to be coded).
[0233] The transform and quantization unit 21 (1) performs a DCT (Discrete Cosine Transform) on a block-by-block basis on a prediction residual D obtained by subtracting a predicted image Pred from an image to be coded, (2) quantizes the DCT coefficients obtained by the DCT transformation, and (3) supplies the quantized prediction residual QD obtained by the quantization to the variable-length code encoding unit 22 and the inverse quantization and inverse transform unit 23. The transform and quantization unit 21 (1) selects a quantization step QP to be used during quantization for each tree block, (2) supplies a quantization parameter difference Δqp indicating the size of the selected quantization step QP to the variable-length code encoding unit 22, and (3) supplies the selected quantization step QP to the inverse quantization and inverse transform unit 23. Here, the quantization parameter difference Δqp is the quantization parameter qp (QP=2 pq / 6 ) by subtracting the value of the quantization parameter qp' for the tree block that was DCT transformed / quantized immediately before.
[0234] The variable-length code encoding unit 22 generates coded data #1 by variable-length coding (1) the quantized prediction residuals QD and Δqp supplied from the transform / quantization unit 21, (2) the prediction parameters PP supplied from a prediction method control unit 28 (described later), and (3) the filter set number, filter coefficient group, region designation information, and on / off information supplied from an adaptive filter 70 (described later). The variable-length code encoding unit 22 also encodes the QAOU information supplied from the adaptive offset filter 80 and includes it in coded data #3.
[0235] The inverse quantization and inverse transform unit 23 (1) inverse quantizes the quantized prediction residual QD, (2) performs an inverse DCT (Discrete Cosine Transform) on the DCT coefficients obtained by the inverse quantization, and (3) supplies the prediction residual D obtained by the inverse DCT transform to the adder 31. When inverse quantizing the quantized prediction residual QD, the quantization step QP supplied from the transform and quantization unit 21 is used. Note that the prediction residual D output from the inverse quantization and inverse transform unit 23 is the prediction residual D input to the transform and quantization unit 21 plus a quantization error, but for simplicity, a common name will be used here.
[0236] The intra-prediction image generation unit 25 generates a prediction image Pred_Intra for each partition. Specifically, (1) a prediction mode to be used for intra-prediction for each partition is selected, and (2) the selected prediction mode is used to generate the prediction image Pred_Intra from the decoded image P. The intra-prediction image generation unit 25 supplies the generated intra-prediction image Pred_Intra to the prediction method control unit 28.
[0237] Furthermore, the intra-prediction image generation unit 25 identifies a prediction index PI for each partition from the prediction mode selected for each partition and the size of each partition, and supplies the prediction index PI to the prediction method control unit .
[0238] Furthermore, the intra-predicted image generation unit 25 supplies the adaptive filter 70 with intra-coding mode information IEM, which is information indicating the size of the target partition and the prediction mode assigned to the target partition.
[0239] The motion vector detection unit 27 detects a motion vector mv for each partition. Specifically, (1) selects a filtered decoded image P_FL′ to be used as a reference image, and (2) searches for an area in the selected filtered decoded image P_FL′ that best approximates the target partition, thereby detecting the motion vector mv for the target partition. Here, the filtered decoded image P_FL′ is an image obtained by performing deblocking processing by the deblocking filter 33, adaptive offset processing by the adaptive offset filter 80, and adaptive filtering by the adaptive filter 70 on an already decoded image that has been decoded. The motion vector detection unit 27 can read pixel values of each pixel constituting the filtered decoded image P_FL′ from the buffer memory 24. The motion vector detection unit 27 supplies the detected motion vector mv to the inter-prediction image generation unit 26 and the motion vector redundancy elimination unit 29, together with a reference image index RI that specifies the filtered decoded image P_FL′ used as the reference image. For partitions that perform bidirectional prediction (weighted prediction), two filtered decoded images P_FL1' and P_FL2' are selected as reference images, and motion vectors mv1 and mv2 corresponding to the two filtered decoded images P_FL1' and P_FL2', as well as reference image indices RI1 and RI2, are supplied to the inter-prediction image generation unit 26 and the motion vector redundancy elimination unit 29.
[0240] The inter-predicted image generation unit 26 generates a motion-compensated image mc for each inter-prediction partition. Specifically, using the motion vector mv supplied from the motion vector detection unit 27, the motion-compensated image mc is generated from the filtered decoded image P_FL′ specified by the reference image index RI supplied from the motion vector detection unit 27. Like the motion vector detection unit 27, the inter-predicted image generation unit 26 can read out the pixel values of each pixel constituting the filtered decoded image P_FL′ from the buffer memory 24. The inter-predicted image generation unit 26 supplies the generated motion-compensated image mc (inter-predicted image Pred_Inter) to the prediction method control unit 28, together with the reference image index RI supplied from the motion vector detection unit 27. For bidirectional prediction (weighted prediction) partitions, (1) a motion-compensated image mc1 is generated from the filtered decoded image P_FL1' specified by the reference image index RI1 using the motion vector mv1, (2) a motion-compensated image mc2 is generated from the filtered reference image P_FL2' specified by the reference image index RI2 using the motion vector mv2, and (3) an inter-predicted image Pred_Inter is generated by adding an offset value to the weighted average of the motion-compensated images mc1 and mc2.
[0241] The prediction method control unit 28 compares the intra-predicted image Pred_Intra and the inter-predicted image Pred_Inter with the image to be coded, and selects whether to perform intra-prediction or inter-prediction. If intra-prediction is selected, the prediction method control unit 28 supplies the intra-predicted image Pred_Intra as a predicted image Pred to the adder 31 and the subtractor 32, and supplies the prediction index PI supplied from the intra-predicted image generation unit 25 as a prediction parameter PP to the variable-length code encoding unit 22. On the other hand, if inter-prediction is selected, the prediction method control unit 28 supplies the inter-predicted image Pred_Inter as a predicted image Pred to the adder 31 and the subtractor 32, and supplies the reference image index RI supplied from the inter-predicted image generation unit 26, and an estimated motion vector index PMVI and a motion vector residual MVD supplied from a motion vector redundancy elimination unit 29 (described later) as prediction parameters PP to the variable-length code encoding unit.
[0242] A subtractor 32 generates a prediction residual D by subtracting the prediction image Pred selected by the prediction method control unit 28 from the image to be coded. As described above, the prediction residual D generated by the subtractor 32 is DCT transformed and quantized by the transform and quantization unit 21. Meanwhile, an adder 31 generates a locally decoded image P by adding the prediction image Pred selected by the prediction method control unit 28 to the prediction residual D generated by the inverse quantization and inverse transform unit 23. The locally decoded image P generated by the adder 31 passes through a deblocking filter 33, an adaptive offset filter 80, and an adaptive filter 70, and is then stored in the buffer memory 24 as a filtered decoded image P_FL and is used as a reference image in inter prediction.
[0243] The motion vector redundancy elimination unit 29 eliminates redundancy in the motion vector mv detected by the motion vector detection unit 27. Specifically, (1) it selects an estimation method to be used for estimating the motion vector mv, (2) it derives an estimated motion vector pmv according to the selected estimation method, and (3) it generates a motion vector residual MVD by subtracting the estimated motion vector pmv from the motion vector mv. The motion vector redundancy elimination unit 29 supplies the generated motion vector residual MVD to the prediction method control unit 28 together with an estimated motion vector index PMVI indicating the selected estimation method.
[0244] When the difference in pixel values between adjacent pixels across a block boundary or a CU boundary in the decoded image P is smaller than a predetermined threshold, the deblocking filter 33 smoothes the image near the block boundary or the CU boundary by performing a deblocking process on the block boundary or the CU boundary in the decoded image P. The image deblocked by the deblocking filter 33 is output to the adaptive offset filter 80 as a deblocked decoded image P_DB.
[0245] The adaptive offset filter 80 generates an offset-filtered decoded image P_OF by performing adaptive offset filtering on the deblocked decoded image P_DB supplied from the deblocking filter 33. The generated offset-filtered decoded image P_OF is supplied to the adaptive filter 70. A specific configuration of the adaptive offset filter 80 will be described later, and therefore will not be described here.
[0246] The adaptive filter 70 generates a filtered decoded image P_FL by performing adaptive filtering on the offset-filtered decoded image P_OF supplied from the adaptive offset filter 80. The filtered decoded image P_FL that has been filtered by the adaptive filter 70 is stored in the buffer memory 24. The filter coefficients used by the adaptive filter 70 are determined so as to minimize the error between the filtered decoded image P_FL and the encoding target image #10. The filter coefficients determined in this manner are coded as filter parameters FP and transmitted to the video decoding device 1.
[0247] (adaptive offset filter 80) 15 is a block diagram showing the configuration of the adaptive offset filter 80. As shown in FIG. 15, the adaptive offset filter 80 includes an adaptive offset filter information setting unit 81 and an adaptive offset filter processing unit .
[0248] As shown in FIG. 15, the adaptive offset filter information setting unit 81 includes an offset calculation unit 811, an offset shift unit 816, an offset clip unit 812, an offset information selection unit 813, and an offset attribute setting unit 815.
[0249] (Offset calculation unit 811) The offset calculation unit 811 calculates offsets for all offset types and all classes for all QAOMUs up to a predetermined division depth included in the target processing unit (e.g., LCU). Here, the offset types and classes refer to the same as those described in the description of the video decoding device 1.
[0250] FIG. 16 is a flowchart showing the flow of processing by the offset calculation unit 811.
[0251] (Step S201) First, the offset calculation unit 811 starts a first loop in which the QAOMU number of the target QAOMU to be processed is used as a loop variable. For example, in the example shown in Figures 7(a) to 7(e), the first loop is a loop from QAOMU number = 0 to QAOMU number = 340.
[0252] (Step S202) Next, the offset calculation unit 811 starts a second loop in which the offset types selectable for the target QAOMU are used as loop variables. The second loop is a loop from offset type 1 to offset type 6.
[0253] (Step S203) Next, the offset calculation unit 811 starts a third loop using pixels included in the target QAOMU as units.
[0254] (Step S204) Next, the offset calculation unit 811 classifies the target pixel into one of a plurality of classes. More specifically, when the offset type, which is the second loop variable, is 1 to 4, the target pixel is classified into one of classes 1 to 4. The classification process in this step is the same as any one of classification process examples 1 to 4 performed by the class classification unit 624 included in the adaptive offset filter 60 in the video decoding device 1.
[0255] Furthermore, for the target QAOMU, the classification count count[part_idx][sao_type_index][class_idx], which is the number of times pixels are classified, is calculated for each class, where part_idx represents the QAOMU number.
[0256] (Step S205) Next, the offset calculation unit 811 calculates a differential pixel value for the target pixel by taking the difference between the pixel value of the deblocked decoded image P_DB for the target pixel and the pixel value of the target pixel for the encoding target image #10. More specifically, when the position of the target pixel is (x, y), the offset calculation unit 811 calculates P_DB(x, y)-Org(x, y). Here, P_DB(x, y) represents the pixel value of the deblocked decoded image P_DB for the target pixel, and Org(x, y) represents the pixel value of the target pixel for the encoding target image #10.
[0257] (Step S206) This step is the end of the third loop. When this step is completed, the pixel difference values for all pixels included in the target QAOMU will have been calculated.
[0258] (Step S207) Next, the offset calculation unit 811 calculates an offset by dividing the sum of the differential pixel values for each pixel included in the target QAOMU for each class by the number of classifications for that class. More specifically, the offset calculation unit 811 calculates the offsets offset[part_idx][sao_type_idx][class_idx] for the target QAOMU, target offset type, and target class using the following formula.
[0259] offset[part_idx][sao_type_idx][class_idx] = Σ(P_DB(x, y)-Org(x, y)) / count[part_idx][sao_type_idx][class_idx] Here, the symbol Σ indicates that the sum is taken for pixels classified into the object class specified by class_idx in the object QAOMU specified by part_idx and the object offset type specified by sao_type_idx.
[0260] (Step S208) This step is the end of the second loop.
[0261] (Step S209) This step is the end of the first loop.
[0262] Through the above process, the offset calculation unit 811 calculates offsets for all offset types and all classes for all QAOMUs up to a predetermined division depth included in the target LCU. For example, in the example shown in Figures 7(a) to 7(e), the offset calculation unit 811 calculates a total of ((Total number of QAOMUs with partition depth 0) + ... + (Total number of QAOMUs with partition depth 4)) × ((Number of EO offset types) × (Number of EO classes) + (Number of BO offset types) × (Number of BO classes)) = (1 + 4 + 16 + 64 + 256) × ((4 × 4) + (2 × 16)) = 16,368 (units) Here, the number of bits of each offset is, for example, 10 bits.
[0263] The offset calculation unit 811 supplies the offset information, which is made up of the offset calculated by the above processing, the offset type, the class, and QAOU structure information that indicates the division structure of the QAOU, to the offset shift unit 816 .
[0264] The video encoder 2 may be configured to encode a flag indicating which classification example was performed in step S204, and the adaptive offset filter 60 included in the video decoder 1 may be configured to refer to the flag and perform the same classification as the classification indicated by the flag. Alternatively, the video encoder 2 and the video decoder 1 may be configured to perform the same predetermined classification without using such a flag.
[0265] (Offset shift unit 816) The offset shift unit 816 quantizes each offset included in the offset information supplied from the offset calculation unit 811. Quantization converts the offset from the pixel bit depth precision to the offset bit depth precision by bit-shifting the offset to the right. Note that the shift amount in the shift process is determined by a shift value supplied by the offset attribute setting unit 815, which will be described later.
[0266] (Offset clip part 812) The offset clip unit 812 performs clip processing on the offset supplied from the offset shift unit 816 using either clip processing 1 or clip processing 2 as shown below, in order to limit the offset value range supplied from the offset attribute setting unit 815 described later.
[0267] (Clip processing 1) The offset clipping unit 812 performs clipping processing on each offset included in the offset information supplied from the offset shifting unit 816. The offset clipping unit 812 represents each offset in 4 bits by clipping each offset supplied from the offset shifting unit 816 to a value between −8 and 7, for example. Each clipped offset is supplied to the offset information selecting unit 813. The bit width to be clipped is set according to the bit depth of the image and the bit depth of the offset, as in the video decoding device 1.
[0268] By clipping each offset in this way, it is possible to reduce the memory size of the memory (not shown) in which each offset is stored. Also, it is possible to reduce the amount of code for the offset included in the coded data #1, thereby improving coding efficiency. Furthermore, it is possible to prevent excessive offsets from being added, thereby ensuring appropriate image quality.
[0269] (Clip Processing 2) The offset clipping unit 812 may also be configured to set the clipping range of each offset supplied from the offset shifting unit 816 to a different value depending on the offset type.
[0270] For example, if the offset type is edge offset, the number of offset bits is 8, and if the offset type is band offset, the number of offset bits is 4. More generally, when the number of offset bits is N when the offset type is edge offset, and when the number of offset bits is M when the offset type is band offset, the number of offset bits is determined so that N>M is satisfied.
[0271] By varying the number of bits of the offset depending on the offset type in this way, it is possible to improve the coding efficiency without requiring an excessive memory size for the memory for storing each offset.
[0272] The threshold value th for limiting the possible offset values is 2. m-1 Bigger, 2 m When m is less than 1, m-bit fixed-length coding can be used as the coding method for coding the offset. More specifically, truncated unary coding or truncated rice coding, in which th is the maximum value, can be used. Note that the maximum value th is determined by the offset value range supplied from the offset attribute setting unit 815.
[0273] This embodiment also includes clipping processing obtained by combining the above clipping processing 1 and 2. The adaptive offset filter 80 may not include the offset clipping unit 812.
[0274] (Offset information selection unit 813) The offset information selection unit 813 determines the combination of offset type, class, and offset that results in the lowest RD cost (Rate-Distortion cost), as well as the corresponding QAOU partition structure, and supplies QAOU information indicating the determined offset type, class, offset, and the corresponding QAOU partition structure to the variable-length code encoding unit 22. In addition, the offset information selection unit 813 supplies the determined offset to the adaptive offset filter processing unit 82 for each QAOU or each QAOMU.
[0275] The processing of offset information selection section 813 will be described in more detail below with reference to Figures 17 and 18. Figure 17 is a flowchart showing the flow of processing by offset information selection section 813.
[0276] (Step S301) First, the offset information selection unit 813 starts a first loop in which the QAOMU number of the target QAOMU to be processed is used as a loop variable.
[0277] (Step S302) Next, the offset information selection unit 813 starts a second loop in which the offset types selectable for the target QAOMU are used as loop variables. The second loop is a loop from offset type 1 to offset type 6.
[0278] (Step S303) Next, the offset information selection unit 813 calculates the pairwise squared error between the offset-filtered decoded image P_OF in the target QAOMU and the encoding target image #10 for the target offset type.
[0279] (Step S304) This step is the end of the second loop.
[0280] (Step S305) This step is the end of the first loop. When the first and second loops are completed, the squared errors for all offset types will be calculated for each QAOMU.
[0281] (Step S306) Next, the offset information selection unit 813 determines the QAOU division structure that results in the lowest RD cost from among the QAOU division structures that divide the target processing unit (for example, LCU) into QAOUs.
[0282] A specific example of the processing performed by the offset information selection unit 813 in this step will be described below with reference to FIGS. 18(a) to 18(e).
[0283] First, the offset information selection unit 813 calculates the RD cost when the partition depth is set to 0 and the RD cost when the partition depth is set to 1 (FIGS. 18(a) and 18(b)). In FIG. 18(a), it is assumed that the RD cost when the partition depth is 1 is smaller than the RD cost when the partition depth is 0 (FIG. 18(c)).
[0284] Next, the offset information selection unit 813 calculates the RD cost when the division depth is set to 2 (FIG. 18(d)).
[0285] Next, the offset information selection unit 813 compares the RD cost of the QAOMU of partition depth 1 with the RD cost of the QAOMU of partition depth 2 included in the QAOMU of partition depth 1, and if the RD cost of the QAOMU of partition depth 2 is smaller, it updates the QAOMU of partition depth 1 to a QAOMU of partition depth 2 (Figure 18(e)). This process is repeated until the maximum partition depth is reached. This determines a QAOU partitioning structure that results in a smaller RD cost.
[0286] (Offset attribute setting unit 815) The offset attribute setting unit 815 determines the offset bit depth using the pixel bit depth (not shown) as input. The offset value range and shift value are set based on the determined offset bit depth. The offset value range is supplied to the adaptive offset filter processing unit 82, and the shift value is supplied to the offset shift unit 816. The setting of the offset value range and shift value is the same process as that of the offset attribute setting unit 613 described above, so a description thereof will be omitted here.
[0287] (adaptive offset filter processing unit 82) The adaptive offset filter processing unit 82 adds an offset supplied from the offset information selection unit 813 to each pixel of the deblocked decoded image P_DB in the target QAOU. The adaptive offset filter processing unit 82 outputs an image obtained by performing processing on all QAOUs included in the deblocked decoded image P_DB as an offset-filtered decoded image P_OF. Note that the configuration of the adaptive offset filter processing unit 82 is the same as that of the adaptive offset filter processing unit 62, and therefore a description thereof will be omitted here. Each offset stored in an offset information storage unit included in the adaptive offset filter processing unit 82 (not shown) is limited to an offset value range set by an offset attribute setting unit 815.
[0288] Second Embodiment In embodiment 1, sao_offset[sao_curr_depth][ys][xs][i] included in encoded data #1 is a syntax that represents the specific value of the offset to be added to each pixel included in the target QAOU in offset filter processing using an adaptive offset filter.
[0289] On the other hand, the inventor has found that the amount of coding required for encoded data can be further reduced by predictively encoding the offset value used in the offset filter processing, i.e., by encoding the offset residual calculated using the offset value and a predicted value of the offset value.
[0290] In this embodiment, a video decoding device that performs offset filtering using a predictively coded offset, and a video coding device that predictively codes the offset used in the offset filtering will be described with reference to Fig. 19 to Fig. 21. Note that the description of the parts that have already been described in the first embodiment will be omitted.
[0291] (encoded data) The coded data according to this embodiment includes an offset residual sao_offset_residual[sao_curr_depth][ys][xs][i] instead of sao_offset[sao_curr_depth][ys][xs][i] included in coded data #1 according to embodiment 1. Other configurations of the coded data according to this embodiment are the same as those of coded data #1 according to embodiment 1. Hereinafter, the coded data according to this embodiment may also be referred to as coded data #3.
[0292] (sao_offset_residual) The offset residual sao_offset_residual[sao_curr_depth][ys][xs][i] is a weighted difference value between the offset value added to each pixel included in the target QAOU in the offset filter processing by the adaptive offset filter of this embodiment and the predicted value of that offset value, and is also expressed as sao_offset_residual[sao_type_idx][class_idx].
[0293] When the offset added to the target pixel included in the target QAOU is expressed as Offset[sao_type_idx][class_idx], the offset residual sao_offset_residual[sao_type_idx][class_idx] is sao_offset_residual[sao_type_idx][class_idx] = Offset[sao_type_idx][class_idx] - a*pred_offset[merge_tbl[sao_type_idx]][class_idx] Here, a is a weighting coefficient by which the predicted value pred_offset is multiplied, and merge_tbl is a function that takes sao_type_idx as an argument. Specific examples of a and merge_tbl will be described later, so a description thereof will be omitted here.
[0294] (Video decoding device) The video decoding device according to this embodiment includes an adaptive offset filter 60' instead of the adaptive offset filter 60 included in the video decoding device 1 according to Embodiment 1. Other configurations of the video decoding device according to this embodiment are the same as those of the video decoding device 1 according to Embodiment 1.
[0295] 19 is a block diagram showing the configuration of an adaptive offset filter 60' according to this embodiment. As shown in FIG. 19, the adaptive offset filter 60' includes an offset information decoding unit 611' instead of the offset information decoding unit 611 included in the adaptive offset filter 60.
[0296] (Offset information decoding unit 611') The offset information decoding unit 611' refers to the QAOU information included in the coded data #3 and decodes the offset information OI included in the QAOU information. Also, using the offset residual sao_offset_residual[sao_type_idx][class_idx] obtained by decoding the offset information OI and the predicted value pred_offset[merge_tbl[sao_type_idx]][class_idx], the offset Offset[sao_type_idx][class_idx] used in the adaptive offset filter processing is calculated as follows: Offset[sao_type_idx][class_idx] =a*pred_offset[merge_tbl[sao_type_idx]][class_idx] + sao_offset_residual[sao_type_idx][class_idx] The calculated offset Offset[sao_type_idx][class_idx] is stored in the offset information storage unit 621. Here, pred_offset[merge_tbl[sao_type_idx]][class_idx] is a predicted value of Offset[sao_type_idx][class_idx]. merge_tbl[sao_type_idx] is a table to which an index is assigned for sao_type_idx=1 to 6, and one or more sao_type_idx can be regarded as the same group.
[0297] (Example 1 of pred_offset) A first specific example of pred_offset[merge_tbl[sao_type_idx]][class_idx] will be described. In this example, the predicted value pred_offset[merge_tbl[sao_type_idx]][class_idx] is expressed as follows: pred_offset[merge_tbl[sao_type_idx]][class_idx] = Offset'[sao_type_idx][class_idx] Here, Offset'[sao_type_idx][class_idx] is a decoded offset, and represents an offset associated with the offset type index sao_type_idx and the class index class_idx.
[0298] In this way, in this example, the offset Offset'[sao_type_idx][class_idx], which is a decoded offset and is associated with the offset type index sao_type_idx and the class index class_idx, is used as the predicted value of Offset[sao_type_idx][class_idx].
[0299] (Example 2 of pred_offset) A second specific example of pred_offset[merge_tbl[sao_type_idx]][class_idx] will be described. In this example, the predicted value pred_offset[merge_tbl[sao_type_idx]][class_idx] is expressed as follows: pred_offset[merge_tbl[sao_type_idx]][class_idx] = (pred_offset'[merge_tbl[sao_type_idx]][class_idx]*W1 + Offset'[sao_type_idx][class_idx]*W2) >> log2(W1+W2) where pred_offset'[merge_tbl[sao_type_idx]][class_idx] represents the predicted value used to calculate the decoded offset Offset'[sao_type_idx][class_idx]. Also, "*" represents the multiplication operation symbol, and ">>" represents a right bit shift. Also, W1 and W2 represent weighting coefficients, and for example, W1=3 and W2=1 can be used. The specific values of W1 and W2 can be determined so as to achieve higher coding efficiency.
[0300] As is clear from the above equation, in this example, pred_offset' and Offset' are referenced to find pred_offset, pred_offset'' and Offset'' are referenced to find pred_offset', and so on, and the decoded predicted values and offsets are referenced recursively, so that a plurality of decoded offsets contribute to pred_offset. Therefore, excessive fluctuations in the predicted value are suppressed. As a result, even if an inappropriate predicted value is calculated due to the influence of noise, for example, the influence of such an inappropriate predicted value can be suppressed, thereby improving coding efficiency.
[0301] (Example 3 of pred_offset) A third specific example of pred_offset[merge_tbl[sao_type_idx]][class_idx] will be described. In this example, the predicted value pred_offset[merge_tbl[sao_type_idx]][class_idx] is expressed as pred_offset[merge_tbl[sao_type_idx]][class_idx] = clip3(-th, th, pred_offset[merge_tbl[sao_type_idx]][class_idx]) Here, clip3(A, B, C) indicates that the value C is clipped with the lower limit A and the upper limit B. The argument pred_offset[merge_tbl[sao_type_idx]] of clip3 is defined as in the above specific example 1 or 2, for example. The threshold th is defined as follows, depending on the bit depth bit_depth of the pixel value, for example:
[0302] th = 4 (bit_depth = 8) th = 8 (bit_depth > 8) In this way, in this example, by using predicted values clipped at the upper and lower limit values, predicted values that are too large or too small are not generated, thereby improving coding efficiency. Furthermore, since the absolute values of the upper and lower limit values are set to be large when the number of bits of the pixel value is large, appropriate clipping processing can be performed according to the bit depth of the pixel value, and deterioration of image quality can be prevented.
[0303] (Example 1 of merge_tbl) 20(a) is a table showing a first specific example of the function merge_tbl[sao_type_idx]. As shown in FIG. 20(a), merge_tbl[sao_type_idx] according to this example does not take a value when sao_type_idx=0, and takes values of 0 to 5 when sao_type_idx=1 to 6, respectively. Therefore, merge_tbl[sao_type_idx] according to this example is merge_tbl[sao_type_idx] = sao_type_idx - 1 It can also be expressed as:
[0304] By using merge_tbl[sao_type_idx] according to this example, the offset information decoding unit 611′ determines the predicted value pred_offset individually for each sao_type_idx and each class_idx, thereby making it possible to reduce the amount of code for the offset residual sao_offset_residual.
[0305] (Example 2 of merge_tbl) Fig. 20(b) is a table showing a second specific example of the function merge_tbl[sao_type_idx]. As shown in Fig. 20(b), merge_tbl[sao_type_idx] according to this example takes a value of 0 for edge offsets (sao_type_idx=1 to 4) and takes a value of 1 to 2 for band offsets (sao_type_idx=5 to 6).
[0306] For example, if sao_type_idx=1 (merge_tbl[sao_type_idx=1]=0) and class_idx=1 are specified when calculating the previous offset, and sao_type_idx=2 (merge_tbl[sao_type_idx=2]=0) and class_idx=1 are specified when calculating the next offset, the predicted value used when calculating the next offset will be the same as the predicted value used when calculating the previous offset.
[0307] By using merge_tbl[sao_type_idx] according to this example, the offset information decoding unit 611′ performs the following processing when an edge offset is specified and when a band offset is specified.
[0308] When an edge offset is specified A predicted value of an offset to be decoded is calculated from a decoded offset of the same class as the class associated with the offset to be decoded. Here, as long as the offset to be decoded and the predicted value are of the same class, the offset types may be different. Therefore, a predicted value set for calculating an offset of a certain offset type can be used to calculate an offset of a different offset type from the certain offset, thereby reducing the processing required for setting the predicted value.
[0309] If a band offset is specified A predicted value of the offset to be decoded is calculated from an offset of the same offset type and class as the offset type and class associated with the offset to be decoded.
[0310] By using merge_tbl[sao_type_idx] according to this example, it is possible to calculate an appropriate predicted value while reducing the amount of processing.
[0311] (Example of coefficient a) The weighting coefficient a by which the predicted value pred_offset is multiplied may be 1 regardless of the offset type, or may be a different value depending on the offset type.
[0312] for example, a=1 (edge offset) a=0.5 (for band offset) More generally, if the coefficient a when an edge offset is specified is expressed as a(edge), and the coefficient a when a band offset is specified is expressed as a(band), then a(edge)>a(band) It is sufficient to use one that satisfies the above.
[0313] The inventors have found that when an edge offset is specified, the correlation between the decoded offset and the offset to be decoded is greater than the correlation between the decoded offset and the offset to be decoded when a band offset is specified. In the above specific example, the influence of the correlation between the decoded offset and the offset to be decoded can be appropriately incorporated, thereby reducing the amount of coding for the offset residual.
[0314] (Video Encoding Device) The video coding device according to this embodiment includes an adaptive offset filter 80' instead of the adaptive offset filter 80 included in the video coding device 2 according to Embodiment 1. Other configurations of the video coding device according to this embodiment are the same as those of the video coding device 2 according to Embodiment 1.
[0315] Fig. 21 is a block diagram showing the configuration of an adaptive offset filter 80' according to this embodiment. As shown in Fig. 21, the adaptive offset filter 80' includes an offset residual derivation unit 814 in addition to the components included in the adaptive offset filter 80.
[0316] (Offset residual derivation unit 814) The offset residual derivation unit 814 calculates an offset residual by taking the difference between the offset supplied from the offset information selection unit 813 and the predicted value of the offset. The offset residual is coded by the variable-length code coding unit 22 as part of the QAOU information.
[0317] The predicted value set by the offset residual derivation unit 814 is the same as the predicted value set by the offset information decoding unit 611′ included in the video decoding device according to this embodiment, and therefore a description thereof will be omitted here.
[0318] (Appendix 1) The present invention can also be described as follows.
[0319] The image filter device of the present invention is an image filter device that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and is characterized by comprising: an offset attribute setting means that references offset type designation information included in encoded data and sets an offset attribute for the unit area to be processed; an offset decoding means that decodes an offset having a bit width corresponding to the offset value range included in the set offset attribute; and a filter means that adds the offset to each pixel value of the input image.
[0320] According to the image filter device configured as described above, the offset attribute setting means refers to the offset type designation information included in the encoded data, sets the offset attribute for the unit area to be processed, and the offset decoding means decodes an offset having a bit width according to the offset value range included in the set offset attribute, thereby effectively reducing the memory size required to store the offset.
[0321] Therefore, with the above configuration, it is possible to perform appropriate offset filtering while reducing the memory size for storing offsets.
[0322] The offset type designation information may be determined for each of the input images, for each of the unit areas, for each of a predetermined set of the input images, or for each of a predetermined set of the unit areas.
[0323] It is also preferable that the offset type designation information includes a bit depth of pixel values of the input image in each unit area, and that the offset decoding means decodes an offset having a bit width corresponding to the bit depth of the pixel values.
[0324] According to the above configuration, the offset decoding means decodes an offset having a bit width corresponding to the bit depth of the pixel value, thereby effectively reducing the memory size for storing the offset.
[0325] In addition, the offset type specification information may include a bit depth of the pixel values of the input image in each unit area, and the offset decoding means may be configured to decode an offset having a bit width capable of expressing a range of values according to the bit depth.
[0326] According to the above configuration, the offset decoding means decodes an offset having a bit width capable of expressing a range of values corresponding to the bit depth of the pixel values of the input image in each unit area, thereby effectively reducing the memory size for storing the offset.
[0327] The bit width that can express the range of values according to the bit depth above refers to the bit width when the values included in the range of the range are expressed in binary. For example, if the range is -2 3 ~2 3 When it is -1, the expressible bit width is 4 bits.
[0328] It is also preferable that the decoded offset is a quantized value, and that the filter means add a value obtained by dequantizing the offset using a parameter included in the offset attribute to each of the pixel values.
[0329] According to the above configuration, the decoded offset is a quantized value, and the filter means adds a value obtained by dequantizing the offset using a parameter included in the offset attribute to each pixel value, so that an offset according to the parameter included in the offset attribute is added to each image value.
[0330] Therefore, with the above configuration, it is possible to reduce the memory size for storing offsets and improve the coding efficiency.
[0331] The offset type designation information may include a shift value of a pixel value, and the filter means may add a value obtained by dequantizing the offset using the shift value instead of the offset.
[0332] According to the above configuration, the offset type specification information includes a shift value of a pixel value, and the filter means adds a value obtained by dequantizing the offset using the shift value instead of the offset, thereby obtaining an offset corresponding to the shift value of the pixel value. Therefore, it is possible to improve coding efficiency while reducing the memory size for storing offsets.
[0333] Note that the shift value of a pixel value refers to the difference between the pixel bit depth and the offset bit depth, and dequantizing the offset using the shift value refers to bit-shifting the offset to the left by the shift value and converting it from the offset bit depth to the pixel bit depth.
[0334] Preferably, the offset type designation information is determined for the input image.
[0335] According to the above configuration, the offset type designation information is determined for the input image, so that the image filtering device can perform appropriate offset processing for the input image.
[0336] Furthermore, an offset decoding device according to the present invention is an offset decoding device that decodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and is characterized by comprising: offset residual decoding means that decodes each offset residual from encoded data; predicted value derivation means that derives a predicted value of each offset from an offset that has already been decoded; and offset calculation means that calculates each offset from the predicted value derived by the predicted value derivation means and the offset residual decoded by the offset residual decoding means.
[0337] The offset decoding device configured as described above includes offset residual decoding means that decodes each offset residual from encoded data, predicted value derivation means that derives a predicted value of each offset from an already decoded offset, and offset calculation means that calculates each offset from the predicted value derived by the predicted value derivation means and the offset residual decoded by the offset residual decoding means. Therefore, it is possible to appropriately decode offsets from encoded data with a smaller amount of code than when each offset is encoded as is.
[0338] It is also preferable that the input image is composed of a plurality of unit areas, the offset residual decoding means decodes each offset residual in association with an offset type determined for each unit area and an offset class determined for each pixel, and the predicted value derivation means derives the predicted value of each offset from a decoded offset associated with the same offset type and offset class as the offset.
[0339] According to the above configuration, the predicted value of each offset is derived from a decoded offset associated with the same offset type and offset class as the offset, thereby improving prediction accuracy, and therefore, according to the above configuration, the offset can be appropriately decoded from coded data with a small code amount.
[0340] It is also preferable that the input image is composed of a plurality of unit areas, the offset residual decoding means decodes each offset residual in association with an offset type determined for each unit area and an offset class determined for each pixel, and the predicted value derivation means derives the predicted value of each offset from a decoded offset associated with the same first offset type group and the same offset class as the offset when the offset type associated with the offset belongs to a first offset type group, and from a decoded offset associated with the same offset type and offset class as the offset when the offset type associated with the offset belongs to a second offset type group.
[0341] According to the above configuration, when the offset type associated with each offset belongs to a first offset type group, the predicted value of each offset is derived from a decoded offset associated with the same offset type as the offset, and when the offset type associated with the offset belongs to a second offset type group, the predicted value is derived from a decoded offset associated with the same offset type and offset class as the offset, thereby improving prediction accuracy while reducing the amount of processing. Therefore, according to the above configuration, it is possible to appropriately decode offsets from coded data with a small amount of coding while reducing the amount of processing.
[0342] The first offset type refers to, for example, one in which each pixel in a unit area associated with the first offset type is classified into one of a plurality of classes, for example, depending on the state of the edge in the vicinity of the pixel, and the second offset type refers to one in which each pixel in a unit area associated with the second offset type is classified into one of a plurality of classes, for example, depending on the pixel value of the pixel.
[0343] Furthermore, it is preferable that the offset calculation means calculates each offset as a linear function of the predicted value derived by the predicted value derivation means and the offset residual decoded by the offset residual decoding means, and that the coefficient by which the predicted value is multiplied differs between when the offset type associated with the offset belongs to a first offset type group and when the offset type associated with the offset belongs to a second offset type group.
[0344] According to the above configuration, the coefficient by which the predicted value is multiplied differs depending on whether the offset type associated with the offset belongs to a first offset type group or a second offset type group, so that the offset can be calculated using a more appropriate coefficient depending on the offset type, thereby improving coding efficiency.
[0345] Preferably, the predicted value deriving means derives the predicted value of each offset by taking a weighted average of a decoded offset and the predicted value of the decoded offset.
[0346] According to the above configuration, the predicted value of each offset is derived by taking a weighted average of the decoded offset and the predicted value of the decoded offset, so that the predicted value of each offset is contributed by multiple decoded offsets. Therefore, excessive fluctuation of the predicted value is suppressed. As a result, even if an inappropriate predicted value is calculated due to the influence of noise, for example, the influence of such an inappropriate predicted value can be suppressed, thereby improving coding efficiency.
[0347] Preferably, the predicted value derivation means includes clipping means for clipping each derived predicted value at an upper limit and a lower limit according to the bit depth of each pixel value in the input image.
[0348] According to the above configuration, each derived predicted value is clipped at an upper limit and a lower limit according to the bit depth of each pixel value in the input image, so that predicted values that are too large or too small are not generated, thereby improving coding efficiency.
[0349] Furthermore, an image filter device according to the present invention is an image filter device that operates on an input image, and is characterized by comprising: calculation means for calculating a difference value between the pixel value of a target pixel in the input image and the pixel values of pixels surrounding the target pixel; bit shift means for bit-shifting the pixel value referenced by the calculation means or the difference value calculated by the calculation means to the right by a predetermined shift value; classification means for classifying the target pixel into one of a plurality of offset classes depending on the magnitude relationship between the difference value bit-shifted to the right by the bit shift means and 0; and offset means for adding an offset associated with the offset class classified by the classification means to the pixel value of the target pixel.
[0350] According to the image filter device configured as described above, the target pixel is classified into one of a plurality of offset classes according to the magnitude relationship between the right bit-shifted difference value and 0, and an offset associated with the offset class classified by the classification means is added to the pixel value of the target pixel. This makes the class classification process less susceptible to the influence of noise, and improves coding efficiency.
[0351] Furthermore, it is preferable that the predetermined shift value has a positive correlation with the bit depth of the pixel value of the target pixel.
[0352] According to the above configuration, the predetermined shift value has a positive correlation with the bit depth of the pixel value of the target pixel, so that it is possible to more effectively improve the coding efficiency.
[0353] Furthermore, the image filter device according to the present invention is an image filter device that acts on an input image, and is characterized by comprising: a calculation means that calculates a difference value between the pixel value of a target pixel in the input image and the pixel values of pixels surrounding the target pixel; a classification means that classifies the target pixel into one of a plurality of offset classes depending on the magnitude relationship between the difference value calculated by the calculation means and predetermined first and second thresholds; and an offset means that adds an offset associated with the offset class classified by the classification means to the pixel value of the target pixel.
[0354] The image filter device configured as described above classifies the target pixel into one of a plurality of offset classes depending on the magnitude relationship between the difference value calculated by the calculation means and predetermined first and second thresholds, and adds an offset associated with the offset class classified by the classification means to the pixel value of the target pixel, thereby making the class classification process less susceptible to noise and improving coding efficiency.
[0355] Preferably, the absolute values of the first and second thresholds have a positive correlation with the bit depth of the pixel value of the target pixel.
[0356] According to the above configuration, the absolute values of the first and second thresholds have a positive correlation with the bit depth of the pixel value of the target pixel, so that it is possible to more effectively improve the coding efficiency.
[0357] In addition, the image filter device of the present invention is an image filter device that acts on an input image composed of a plurality of unit areas, and includes a determination means for determining, from first and second offset types, an offset type to which a target unit area including a target pixel in the input image belongs; a classification means for classifying the target pixel into an offset class that does not add an offset or one of a plurality of offset classes that add an offset, depending on the offset type to which the target unit area belongs and the pixel value of the target pixel; and an offset means for adding, to the pixel value of the target pixel, an offset associated with the offset type to which the target unit area belongs and the offset class classified by the classification means, when the pixel value of the target pixel is within a predetermined range, the classification means classifies the target pixel into an offset class that adds an offset, regardless of whether the offset type to which the unit area including the target pixel belongs is the first or second offset type.
[0358] According to the image filtering device configured as above, when the pixel value of the target pixel is within a predetermined range, the target pixel is classified into an offset class to which an offset is added, regardless of whether the offset type to which the unit area including the target pixel belongs is the first or second offset type, thereby making it possible to effectively remove block noise. Therefore, according to the configuration, it is possible to improve coding efficiency.
[0359] Furthermore, the image filter device according to the present invention is an image filter device that adds an offset to each pixel value of an input image composed of a plurality of unit areas, and is characterized by comprising: a determination means that determines, from a plurality of offset types, an offset type to which the unit area to be processed belongs; an offset encoding means that determines an offset having a different bit width according to the offset type and encodes the offset; and a filter means that adds the determined offset to each pixel value of the input image.
[0360] According to the image filter device configured as described above, an offset type to which a unit region to be processed belongs is determined from among a plurality of offset types, offsets having different bit widths are determined according to the determined offset type, the determined offsets are added to each pixel of the input image, and the determined offsets are encoded.
[0361] Therefore, according to the above configuration, it is possible to perform appropriate offset filtering while reducing the memory size for storing offsets. Also, according to the above configuration, the amount of coding of encoded data is reduced, thereby improving coding efficiency.
[0362] Furthermore, an offset coding device according to the present invention is an offset coding device that codes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and is characterized by comprising: predicted value derivation means that derives a predicted value of each offset from an already-coded offset; offset residual calculation means that calculates an offset residual from each offset and the predicted value derived by the predicted value derivation means; and offset residual coding means that encodes the offset residual calculated by the offset residual calculation means.
[0363] The offset coding device configured as described above includes predicted value derivation means for deriving a predicted value of each offset from an already-coded offset, offset residual calculation means for calculating an offset residual from each offset and the predicted value derived by the predicted value derivation means, and offset residual coding means for coding the offset residual calculated by the offset residual calculation means, thereby making it possible to reduce the amount of code required for coded data.
[0364] Furthermore, the data structure of the coded data according to the present invention is a data structure of coded data referenced by an image filter that adds an offset to each pixel value of an input image consisting of a plurality of unit areas, and includes offset type designation information that designates the offset type to which each unit area belongs, and an offset having a different bit width depending on the offset type, and the image filter is characterized in that it references the offset type designation information included in the coded data, determines the offset type to which the unit area to be processed belongs, and decodes the offset having a different bit width depending on the determined offset type.
[0365] Since the coded data configured as described above includes offsets having different bit widths depending on the offset type, the amount of code for the coded data is reduced. Furthermore, the image filter that decodes the coded data refers to the offset type designation information, determines the offset type to which the unit region to be processed belongs, and decodes the offsets having different bit widths depending on the determined offset type, thereby reducing the memory size for storing the offsets and performing appropriate offset filter processing.
[0366] The offset type designation information may be determined for each of the input images, for each of the unit areas, for each of a predetermined set of the input images, or for each of a predetermined set of the unit areas.
[0367] Third Embodiment First, the offset information OI in this embodiment will be described with reference to Fig. 23. Fig. 23(a) is a diagram showing the syntax of the offset information OI (denoted as "sao_offset_param()" in Fig. 23(a)).
[0368] 23(a), the offset information OI includes the parameter "sao_type_idx[sao_curr_depth][ys][xs]". Furthermore, if the parameter "sao_type_idx[sao_curr_depth][ys][xs]" is not "0", the offset information OI includes the parameter "sao_offset[sao_curr_depth][ys][xs][i]".
[0369] (sao_curr_depth, ys, xs) The argument "sao_type_idx" and "sao_offset" "sao_curr_depth" is a parameter that represents the division depth of the QAOU, and "ys" and "xs" are parameters that represent the y-direction position and x-direction position of the QAOU (or QAOMU, described later), respectively.
[0370] The manner in which the QAOU is divided according to the value of "sao_curr_depth" is as described above with reference to FIG.
[0371] FIG. 23(b) is a diagram showing the syntax of QAOU information (denoted as "sao_split_param()" in FIG. 23(b)). As shown in the syntax of FIG. 23(b), if the division depth "sao_curr_depth" is smaller than the maximum value set by the predetermined "saoMaxDepth", the parameter "sao_split_flag" selects whether the QAOU is further divided. If divided, "sao_split_param()" for the next hierarchical depth is recursively called. If the division depth reaches the maximum value ("sao_curr_depth" is not smaller than "saoMaxDepth"), "0" is set to "sao_split_flag[sao_curr_depth][ys][xs]", and no further division is performed.
[0372] FIG. 44 shows another example of the syntax of the offset information and QAOU information.
[0373] Figure 44(a) shows the syntax of offset information. It has the same structure as Figure 23(a), but the value "component," which indicates the color component, is added to the argument of "sao_offset_param()" and the array subscripts of "sao_split_flag," "sao_type_idx," and "sao_offset." This makes it possible to perform different QAOU splits for each color component, such as luminance and chrominance, and to apply different offsets.
[0374] Figure 44(b) shows the syntax of QAOU information. As with Figure 44(a), this is the syntax in which the color component "component" is added as an argument to Figure 23(b).
[0375] Figure 44(c) shows the syntax for the entire adaptive offset filter, which calls the syntax in Figures 44(a) and 44(b). The parameter "sao_flag" is a flag that selects whether to apply an adaptive offset filter. The parameters for the subsequent adaptive offset filter are used only if the flag is true. If the flag is true, the syntax "sao_split_param()" and "sao_offset_param()" are called for each color component, specifying the top layer. Because this is the top layer, the arguments given to each syntax are sao_curr_depth = 0, ys = 0, and xs = 0. The value of "component" is 0 for luminance (Y), 1 for chrominance (Cb), and 2 for chrominance (Cr), distinguishing between the different color components. Note that the value of "component" may be any value that distinguishes the color components to be processed.
[0376] For color difference (Cb) and color difference (Cr), the corresponding flags "sao_flag_cb" and "sao_flag_cr" are used to select whether or not to apply an adaptive offset filter, and if not applied, the QAOU information and offset information corresponding to the color component are not stored.
[0377] In the syntax of Fig. 44 above, the argument "component" has been added, so in the explanation using Fig. 23 above, the arguments [sao_curr_depth][ys][xs] will be replaced with [sao_curr_depth][ys][xs][component] for processing. The same applies to the following explanations.
[0378] (Video Decoding Device 1') Next, a video decoding device 1′ according to this embodiment will be described with reference to Fig. 22 and Fig. 24 to Fig. 29. Note that components having the same functions as those described in the above embodiments are given the same reference numerals, and descriptions thereof will be omitted.
[0379] Like the video decoding device 1, the video decoding device 1' partially incorporates the technology adopted in H.264 / MPEG-4.AVC, the technology adopted in KTA software, a codec jointly developed by VCEG (Video Coding Expert Group), the technology adopted in TMuC (Test Model under Consideration) software, a successor codec, and the technology adopted in HM (HEVC Test Model) software. The video decoding device 1' is similar in configuration to the video decoding device 1, except that it has an adaptive offset filter 60' instead of the adaptive offset filter 60 in the video decoding device 1.
[0380] (Adaptive offset filter 60') Next, the adaptive offset filter 60' will be described in detail with reference to Fig. 22. Fig. 22 is a block diagram showing the configuration of the adaptive offset filter 60'. As shown in Fig. 22, the adaptive offset filter 60' includes an adaptive offset filter information decoding unit 61' and an adaptive offset filter processing unit 62'.
[0381] As shown in FIG. 22, the adaptive offset filter information decoding unit 61′ includes an offset information decoding unit 611 and a QAOU structure decoding unit 612.
[0382] The offset information decoding unit 611 references the QAOU information included in the coded data #1 and decodes the offset information OI included in the QAOU information. The offset information decoding unit 611 also associates the values of “sao_type_idx[sao_curr_depth][ys][xs][component]” and “sao_offset[sao_curr_depth][ys][xs][i]” obtained by decoding the offset information OI with the respective arguments (sao_curr_depth, ys, xs) and (sao_curr_depth, ys, xs, i) and supplies them to the offset information storage unit 621.
[0383] More specifically, the offset information decoding unit 611 decodes the code from the encoded data #1, converts the decoded code into a value of "sao_type_idx," associates the value with an argument, and supplies the value to the offset information storage unit 621. Here, the offset information decoding unit 611 changes the code decoding method and the conversion from the code to a value of "sao_type_idx" depending on the hierarchical depth of the QAOU to be processed. These conditions, such as the hierarchical depth of the QAOU, are called parameter conditions. Decoding of offset information according to general parameter conditions will be described later using Figures 41 and 42.
[0384] The code decoding method may use different maximum values when the hierarchical depth of the QAOU to be processed is less than a threshold and when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold, or may use the maximum value only when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold. Also, different binarizations may be used when the hierarchical depth of the QAOU to be processed is less than a threshold and when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold. Furthermore, different contexts may be used when the hierarchical depth of the QAOU to be processed is less than a threshold and when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold.
[0385] For example, if the hierarchical depth of the QAOU to be processed is smaller than a threshold, the code may be decoded using variable-length coding (ue(v)), and if the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold, the code may be decoded using truncated coding (te(v)) according to the number of offset types. Also, if the number of offset types is a power of 2, the code may be decoded using fixed-length coding. If the number of offset types is four, they can be expressed in 2 bits, so fixed-length coding using 2 bits is possible.
[0386] Furthermore, the offset information decoding unit 611 converts the decoded code into the value of "sao_type_idx" using conversion tables 801 and 802 as shown in FIG. 25. Conversion table 801 in FIG. 25(a) shows two conversion patterns. These two conversion patterns are used depending on the hierarchical depth of the QAOU to be processed. That is, the offset information decoding unit 611 uses conversion table 801A when the hierarchical depth of the QAOU to be processed is smaller than a threshold, and uses conversion table 801B when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold.
[0387] 25(a), the offset type "EO_0" ("sao_type_idx"=1) is associated with the code "1," the offset type "EO_1" ("sao_type_idx"=2) is associated with the code "2," and the offset type "EO_2" ("sao_type_idx"=3) is associated with the code "3." The same applies to codes 4 to 6.
[0388] 25(a), code "1" is associated with offset type "EO_0" ("sao_type_idx"=1), code "2" is associated with offset type "BO_0" ("sao_type_idx"=5), and code "3" is associated with offset type "BO_1" ("sao_type_idx"=6). Codes 4 to 6 are not used in conversion table 801B.
[0389] In this way, conversion table 801A includes all of the offset types used in adaptive offset (SAO), whereas conversion table 801B includes only some of the offset types used in adaptive offset (SAO). Therefore, when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold, only some of the offset types can be used.
[0390] This is because the area of a QAOU becomes smaller at deeper levels, so the characteristics of the pixel values within the QAOU become more uniform, and appropriate offsets can be derived without using many types. This also reduces the number of offset types used, which reduces the amount of memory required and improves coding efficiency by shortening the data length of the coded data indicating the offset type.
[0391] If the correspondence between codes and offset types in conversion table 801B is the same as the correspondence between codes and offset types in conversion table 801A, only conversion table 801A may be used.
[0392] Conversion table 802 in Figure 25(b) shows various examples of conversion tables similar to conversion table 801B that can be used instead of conversion table 801B. Like conversion table 801B, the types of conversion tables are limited in each case. Also, blank spaces indicate that the corresponding code is not used.
[0393] The conversion table 802A is an example that uses only edge offsets and does not include band offsets. The number of edge offsets is typically four, while the number of band offsets is typically 16. Thus, the number of edge offsets is smaller than the number of band offsets. Therefore, by limiting the use of band offsets, the amount of memory used to store offsets can be reduced. In particular, as the hierarchy becomes deeper, the number of offsets increases, resulting in a larger memory requirement. Furthermore, as the hierarchy becomes deeper, the band offset selection rate decreases. Therefore, by using hierarchy as a parameter condition, conversion table 802A that includes only edge offsets is used when the hierarchy is deep, and a conversion table (e.g., 801A) that includes edge offsets and band offsets is used when the hierarchy is shallow, it is possible to reduce the amount of memory required without reducing encoding efficiency. Furthermore, the cost calculation for unnecessary options can be omitted in the encoding device, thereby reducing the amount of processing.
[0394] Conversion table 802B is an example that uses only band offsets and does not include edge offsets. Band offsets are characterized by the fact that they require less computational effort than edge offsets, and do not require line memory to store reference pixels because they do not use pixels surrounding the target pixel. Therefore, the above effects can be achieved by using conversion table 802B according to parameter conditions. Conversion table 802C is an example that uses only one band offset, "BO_0" ("sao_type_idx" = 5).
[0395] Similarly to conversion table 801B, conversion table 802D is an example that uses one edge offset and two band offsets. Specifically, this is an example that uses offset types "EO_0" ("sao_type_idx"=1), "BO_0" ("sao_type_idx"=5), and "BO_1" ("sao_type_idx"=6), and associates band offset types with shorter codes (smaller code numbers) preferentially. Since band offset selection rates are higher when the hierarchy is shallower than when the hierarchy is deeper, encoding efficiency can be improved by using conversion table 802D when the hierarchy is shallow, using the hierarchy as a parameter condition, and associating frequently used types with shorter codes.
[0396] In addition to the examples shown in Figure 25, it is possible to change the association between codes and offset types depending on parameter conditions. An offset type different from any of the edge offsets or band offsets in conversion table 801A can be used alone or in combination with other offset types depending on conditions such as hierarchical depth. Specific examples include an offset type that combines the characteristics of EO and BO, an edge offset that detects edges at horizontal sample positions different from the conventional edge offset "EO_0," and a band offset with a band allocation different from the conventional band offsets "BO_0" and "BO_1," which will be described in another embodiment below.
[0397] The QAOU structure decoding unit 612 determines the division structure of the QAOU by decoding “sao_split_flag[sao_curr_depth][ys][xs]” contained in the QAOU information, and supplies the QAOU structure information representing the determined division structure of the QAOU to the offset information storage unit 621.
[0398] The adaptive offset filter 60' may also include an offset attribute setting unit 613 as described below. The offset attribute setting unit 613 determines an offset shift value. The offset of the encoded data is encoded with an offset bit depth (also referred to as SAO_DEPTH) that is less precise than the pixel bit depth (also referred to as PIC_DEPTH). In other words, the offset in the encoded data is quantized. The shift value indicates the amount of bit shift required for dequantization. The offset attribute setting unit 613 also determines the offset bit depth and offset value range. Here, the offset bit depth is determined from the pixel bit depth (also referred to as PIC_DEPTH), not shown, that is input to the offset attribute setting unit 613. The pixel bit depth indicates the value range of pixel values that constitute the input image of the adaptive offset filter 60' in bit width. When the pixel bit depth is N bits, the pixel values range from 0 to 2. N Range is -1.
[0399] The bit depth and shift value of SAO are calculated using the following formulas, but as will be described later, other values may be used depending on the parameter conditions.
[0400] SAO_DEPTH = MIN(PIC_DEPTH, 10) Shift value = PIC_DEPTH - MIN(PIC_DEPTH, 10) In one configuration, the range of the offset (here, the maximum value) is determined by the following formula:
[0401] Offset range = 2 SAO_DEPTH-K -1 Here, K is a predetermined constant (described later).
[0402] 22, the adaptive offset filter processing unit 62′ includes an offset information storage unit 621, a QAOU control unit 622, an offset type derivation unit 623, a classification unit 624, an offset derivation unit 625, and an offset addition unit 626.
[0403] The offset information storage unit 621 manages and stores the offset type specified for each QAOU and the specific values of the offset for each class selectable for that offset type based on the QAOU structure information, "sao_type_idx[sao_curr_depth][ys][xs]" and "sao_offset[sao_curr_depth][ys][xs][i]", and is configured with a map memory and a list memory.
[0404] The map memory and list memory will be described with reference to Fig. 24. Fig. 24 is a diagram showing examples of what is stored in the map memory and list memory, with Fig. 24(a) being a diagram for explaining an example of a QAOU index stored in the map memory and Fig. 24(b) being a diagram for explaining an example of information stored in the list memory.
[0405] The map memory 601 stores QAOU indices (described later) allocated to each offset minimum unit (also referred to as QAOMU: Quad Adaptive Offset Minimum Unit) determined according to the partitioning depth. FIG. 24(a) shows each QAOMU with a partitioning depth of 3 that constitutes the target processing unit (e.g., LCU) and the QAOU index allocated to each QAOMU. Note that in FIG. 24(a), indexes 0 to 9 are simply allocated to the QAOU without taking into account the partitioning depth of the QAOU. In the example shown in FIG. 24(a), the QAOU specified by QAOU index = I is denoted as QAOUI. In addition, thin lines in FIG. 24(a) indicate QAOMU boundaries, and thick lines indicate QAOU boundaries.
[0406] As shown in Figure 24(a), QAOU0 is made up of four QAOMUs, and these four QAOMUs are assigned a QAOU index of 0. On the other hand, QAOU3 is made up of one QAOMU, and this QAOMU is assigned a QAOU index of 3. In this way, the map memory stores the QAOU index assigned to each QAOMU.
[0407] Furthermore, the list memory 602 stores, for each QAOU index, an offset type associated with the QAOU index and specific values of offsets for each class selectable for the offset type, in association with each other.
[0408] This will be explained in detail with reference to Figure 24(b). Figure 24(b) shows the offset types associated with each of the QAOU indexes 0 to 9 and the offsets for each class that can be selected for each offset type. "xxx" in Figure 24(b) represents specific numerical values that may differ from one another.
[0409] Also, "BO_1" in FIG. 24(b) represents the offset type specified by "sao_type_idx"=5. Also, "EO_1" represents the offset type specified by "sao_type_idx"=1. In this way, edge offsets that are offset types specified by "sao_type_idx"=1, 2, 3, 4 are also written as "EO_1, 2, 3, 4", respectively, and band offsets that are offset types specified by "sao_type_idx"=5, 6 are also written as "BO_1, 2", respectively.
[0410] 24(b), when the offset type is a band offset, a total of 16 offsets, offset 1 to offset 16, are stored in the list memory for that offset type. Here, offset 1 to offset 16 refer to the values specified by "sao_offset[sao_curr_depth][ys][xs][1]" to "sao_offset[sao_curr_depth][ys][xs]
[16] ", respectively, when the value of "sao_type_idx[sao_curr_depth][ys][xs]" is "5" or "6".
[0411] On the other hand, when the offset type is an edge offset, the offsets stored in the list memory for that offset type are a total of four, offsets 1 to 4. Here, offsets 1 to 4 refer to the values specified by "sao_offset[sao_curr_depth][ys][xs][1]" to "sao_offset[sao_curr_depth][ys][xs][4]" respectively when the value of "sao_type_idx[sao_curr_depth][ys][xs]" is any of "1, 2, 3, or 4." Note that in the case of an edge offset, nothing is stored in offsets 5 to 16.
[0412] Each QAOMU is assigned a QAOMU number, which allows each QAOMU to be distinguished from others. In the following, the QAOMU number is N Q QAOMU is QAOMUN Q It can also be written as:
[0413] In this embodiment, the offset precision may be varied depending on the layer of the QAOU to be processed. The shift value used for inverse quantization also varies depending on the offset precision. In this case, the offset precision and shift value are also derived using the pixel bit depth PIC_DEPTH.
[0414] As an example of the accuracy of the offset, for example, when the depth of the QAOU hierarchy is smaller than the threshold, the accuracy of the offset, the shift value, SAO_DEPTH = MIN(PIC_DEPTH, 10) Shift value = PIC_DEPTH - MIN(PIC_DEPTH, 10) The accuracy of the offset when the depth of the QAOU hierarchy is equal to or greater than the threshold is defined as SAO_DEPTH = MIN(PIC_DEPTH, 8) Shift value = PIC_DEPTH - MIN(PIC_DEPTH, 8) In this way, the offset precision can be made different.
[0415] As mentioned above, the offset precision (offset bit depth, SAO_DEPTH) and the pixel bit depth (PIC_DEPTH), which expresses the range of pixel values constituting the input image in bit width, are closely related in terms of quantization error. The bit depth of the output image of the adaptive offset filter 60 is the pixel bit depth PIC_DEPTH, and SAO_DEPTH is the bit depth of the offset added to the pixel. Therefore, even if an offset with precision exceeding the pixel bit depth is used, it will be discarded in the output process, and there is no point in setting SAO_DEPTH above PIC_DEPTH. Conversely, if SAO_DEPTH is smaller than PIC_DEPTH, the input image can only be corrected coarser than the precision (PIC_DEPTH) at which the filter can correct it, reducing the filter effect.
[0416] Therefore, by limiting the quantized offset to an offset value range that can be expressed with a certain bit width, it is possible to limit the bit width for storing the quantized offset in the offset information storage unit 621. This makes it possible to achieve a reduction in memory size compared to when no limit is imposed. On the other hand, excessively narrowing the offset value range reduces the effect of the offset in correcting distortion in the decoded image, making it impossible to remove distortion in the decoded image even through offset addition processing, resulting in reduced coding efficiency.
[0417] Therefore, by setting the offset value range to an optimum range so that the coding efficiency does not decrease, it is possible to reduce the memory usage while maintaining the effect of the filter.
[0418] Then, the maximum bit length representing the value of the offset value range is set to CLIP_BIT, and the offset value range is set to -2 by calculating CLIP_BIT=SAO_DEPTH-K. CLIP_BIT-1 ~2 CLIP_BIT-1 When K is set to -1, according to experiments by the inventors, it was discovered that if K=4, there is no decrease in coding efficiency even if the offset range is limited by the offset value range.
[0419] When the pixel bit depth is 8, the offset bit depth SAO_DEPTH is also 8, and CLIP_BIT = 8 - K = 4. The fact that one offset can be stored in 4 bits means that in software that handles 8-bit bytes as units, one offset can be packed and stored in one byte, making it possible to easily reduce memory size.
[0420] If the precision of the set offset differs depending on the hierarchical level of the QAOU to be processed, the offset information storage unit 621 switches and secures the unit size of the offset storage area depending on the hierarchical depth of the QAOU to be processed.
[0421] Specifically, when the depth of the hierarchy of the QAOU to be processed is less than the threshold, the accuracy of the offset is n A bits (e.g., n A = 8 or 6), the accuracy of the offset when the depth of the hierarchy of the QAOU to be processed is greater than or equal to the threshold B bits (n A >n B , e.g., n B =n A When the offset information storage unit 621 is set to n, the offset information storage unit 621 allocates an area for storing an offset when the hierarchical depth of the QAOU to be processed is less than the threshold. AThe area to store the offset when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold is allocated in bits. B It is allocated in bit units.
[0422] If the depth of the hierarchy of the QAOU to be processed is equal to or greater than the threshold, when reading or writing an offset from or to the offset information storage unit 621, the offset is written in the following manner: (n A -n B ) bits rounded down, when reading (n A -n B It is preferable to configure the input / output by rounding up the offsets by 1 / 3. This is because it is not necessary to take into account the difference in offset precision in other modules when performing processing.
[0423] Furthermore, when the number of required classes varies depending on the hierarchical depth of the QAOU to be processed, the offset information storage unit 621 switches the list memory area to be secured according to the required number of classes. For example, as described below, consider the case of a band offset that is classified into 16 classes when the hierarchical depth of the QAOU to be processed is less than a threshold, and is classified into 8 classes when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold. In this case, the memory capacity required to secure classes when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold is half that required when the hierarchical depth of the QAOU to be processed is less than the threshold. Therefore, the offset information storage unit 621 switches the size of the list memory to be secured when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold, to half that required when the hierarchical depth of the QAOU to be processed is less than the threshold.
[0424] The QAOU control unit 622 controls each unit included in the adaptive offset filter processing unit 62'. The QAOU control unit 622 also refers to the QAOU structure information, divides the deblocked decoded image P_DB into one or more QAOUs, and scans each QAOU in a predetermined order. The QAOU control unit 622 also supplies the offset type derivation unit 623 with a QAOMU number indicating the target QAOMU to be processed.
[0425] The offset type derivation unit 623 refers to the map memory and list memory of the offset information storage unit 621, and derives the offset type specified by the QAOMU number supplied from the QAOU control unit 622. In addition, it supplies the derived offset type to the class classification unit 624.
[0426] The classifying unit 624 classifies each pixel included in the target QAOU into one of a plurality of classes selectable in the offset type supplied from the offset type derivation unit 623. The classifying unit 624 also supplies the offset type and a class index indicating the class into which each pixel has been classified to the offset derivation unit 625. Note that the specific classification process performed by the classifying unit 624 will be described later, and therefore will not be described here.
[0427] The offset derivation unit 625 references the list memory of the offset information storage unit 621 and derives an offset specified by the offset type and class index supplied from the classification unit 624 for each pixel included in the target QAOU. It also includes an offset inverse shift unit (not shown) that bit-shifts the offset to the left by the shift value set by the offset attribute setting unit 613. The offset inverse shift unit inversely quantizes the offset so that the bit depth of the offset matches the pixel bit depth. By performing this inverse quantization, it becomes possible to add the pixel value and the offset at the same bit depth in the addition process of the offset addition unit 626, which will be described later. The inversely quantized offset for each pixel is supplied to the offset addition unit 626.
[0428] The offset addition unit 626 adds, to each pixel of the deblocked decoded image P_DB in the target QAOU, the offset supplied from the offset derivation unit 625. The offset addition unit 626 outputs the image obtained by performing processing on all QAOUs included in the deblocked decoded image P_DB as the offset-filtered decoded image P_OF.
[0429] Next, the classification process by the classification unit 624 will be described with reference to Figures 26 to 29. Note that, in the following, a case will be described in which conditions such as the depth of the QAOU hierarchy are used as parameter conditions, but the configuration of a classification unit according to general parameter conditions will be described later with reference to Figure 34.
[0430] Figure 26 is a diagram for explaining offset processing by the adaptive offset filter 60, in which (a) is a graph showing the magnitude relationship between the pixel value pic[x] of the pixel x to be processed and the pixel value of pixel a or b, and the value of the function Sign corresponding to that magnitude relationship, (b) is a graph showing the magnitude relationship between the pixel value of the pixel x to be processed and the pixel values of pixels a and b, and the value of EdgeType corresponding to that magnitude relationship, (c) shows the correspondence between each graph shown in (b) and class_idx, and (d) to (f) are conversion tables showing the conversion from EdgeType to class_idx.
[0431] FIG. 27 is a diagram for explaining offset processing by the adaptive offset filter 60, in which (a) shows a rough outline of class classification when “sao_type_idx”=5, and (b) shows a rough outline of class classification when “sao_type_idx”=6.
[0432] Figure 28 is a diagram for explaining offset processing by the adaptive offset filter 60, where (a) schematically shows class classification when the hierarchical depth of the QAOU to be processed is less than the threshold, and (b) schematically shows class classification when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold.
[0433] Figure 29 shows an example of class classification when a band offset is specified, where (a) shows an example of class classification when the hierarchical depth of the QAOU to be processed is less than the threshold, and (b) shows an example of class classification when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold.
[0434] (When offset type = 1 to 4 (edge offset)) When the offset type supplied from the offset type derivation unit 623 is one of 1 to 4, the processing of the classification unit 624 is as described above with reference to FIG.
[0435] Therefore, as shown in Figure 26(a), in the magnitude relationship between pixel value pic[x] and the pixel value of pixel a or b, if pixel value pic[x] is smaller than the pixel value of pixel a or b, Sign(pic[x]-pic[a]) = -1; if they are the same, Sign(pic[x]-pic[a]) = 0; and if they are larger, Sign(pic[x]-pic[a]) = 1. In Figure 26(a), the black circle with pic[x] attached indicates the pixel value of the pixel x to be processed, and the black circle without pic[x] attached indicates the pixel value of the pixel a or b to be processed. In addition, the up and down direction in Figure 26(a) indicates the magnitude of the pixel values.
[0436] Next, the classification unit 624 derives EdgeType based on Sign(pic[x]-pic[a]) and Sign(pic[x]-pic[b]) using the following equation (1-1).
[0437] EgdeType=Sign(pic[x]-pic[a])+Sign(pic[x]-pic[b])+2 ···(1-1) As a result, as shown in FIG. 26(b), if the pixel values of both pixels a and b are greater than the pixel value pic[x], EdgeType=0. If the pixel value of one of pixels a and b is greater than the pixel value pic[x] and the pixel value of the other is the same, EdgeType=1. If the pixel value of one of pixels a and b is smaller than the pixel value pic[x] and the pixel value of the other is the same, EdgeType=3. If the pixel values of both pixels a and b are smaller than the pixel value pic[x], EdgeType=4. If the pixel value of one of pixels a and b is smaller than the pixel value pic[x] and the pixel value of the other is greater than the pixel value pic[x], or if the pixel values of pixels a and b are the same as the pixel value pic[x], EdgeType=2.
[0438] In Fig. 26(b), the black circle at the center of each graph indicates the pixel value of the pixel x to be processed, and the black circles on both ends indicate the pixel values of pixels a and b. Also, the up and down direction in Fig. 26(b) indicates the magnitude of the pixel values.
[0439] Next, the classification unit 624 derives the class index (class_idx) of the class to which the target pixel x to be processed should belong based on the derived EdgeType as follows.
[0440] class_idx=EoTbl[EdgeType] Here, EoTbl[EdgeType] is a conversion table used to derive class_idx from EdgeType. Specific examples of the conversion table EoTbl are shown in Figures 26(d) to 26(f).
[0441] The conversion table 1001X shown in FIG. 26(d) is a conversion table when the conversion table to be used is not changed depending on the hierarchical depth of the QAOU to be processed.
[0442] In addition, conversion table 1001A shown in Figure 26(e) and conversion table 1001B shown in Figure 26(f) are conversion tables used when changing the conversion table to be used depending on the hierarchical depth of the QAOU to be processed, and conversion table 1001A is used when the hierarchical depth of the QAOU to be processed is less than a threshold, and conversion table 1001B is used when the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold.
[0443] When the conversion table to be used is not changed depending on the hierarchical depth of the QAOU to be processed, as shown in conversion table 1001X, the classification unit 624 classifies the pixel x to be processed into class 0 ("class_idx"=0) when there is no edge in the area consisting of the pixel x to be processed, pixel a, and pixel b (hereinafter also referred to as the flat case), that is, when EdgeType=2. Also, it classifies EdgeType=0, 1, 3, 4 into class_idx=1, 2, 3, 4, respectively.
[0444] Furthermore, when the conversion table to be used is not changed depending on the hierarchical depth of the QAOU to be processed, and the hierarchical depth of the QAOU to be processed is smaller than the threshold, as shown in conversion table 1001A, the classification unit 624 classifies the pixel x to be processed into class 0 ("class_idx" = 0) when there is no edge in the area consisting of the pixel x to be processed, pixel a, and pixel b (hereinafter also referred to as the flat case), i.e., when EdgeType = 2. Also, EdgeType = 0, 1, 3, 4 are classified into class_idx = 1, 3, 4, 2, respectively. Also, when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold, as shown in conversion table 1001B, the classification unit 624 classifies the pixel x to be processed into class 0 ("class_idx" = 0) when there is no edge in the area consisting of the pixel x to be processed, pixel a, and pixel b (hereinafter also referred to as the flat case), i.e., when EdgeType = 2. Furthermore, EdgeType=0, 1 is classified as class_idx=1, and EdgeType=3, 4 is classified as class_idx=2. Therefore, in conversion table 1001B, one class_idx corresponds to a plurality of EdgeTypes.
[0445] It should be noted that conversion table 1001A may be the same as conversion table 1001X. However, when two conversion tables are used depending on the layer, if the same table defined in conversion table 1001X is used as conversion table 1001A, different Edgetypes will be assigned to the same class_idx between conversion table 1001A and conversion table 1001B, resulting in different processing depending on the layer. For example, when class_idx=2, if the layer depth is less than the threshold (when conversion table 1001X is used), Edgetype=1, and if the layer depth is equal to or greater than the threshold (when conversion table 1001B is used), Edgetype=4, resulting in different processing depending on the layer.
[0446] Therefore, by configuring the conversion table 1001A as shown in FIG. 26(e), the processing does not change between conversion tables 1001A and 1001B, that is, between layers.
[0447] (When offset type = 5 to 6 (band offset)) When the offset type supplied from the offset type derivation unit 623 is 5 or 6, the classification unit 624 classifies the pixel value of the processing target pixel x into one of a plurality of classes according to the pixel value pic[x] of the processing target pixel x.
[0448] When offset type = 5 (sao_type_idx = 5) The classification unit 624 classifies the pixel value pic[x] of the pixel x to be processed as follows: (max×1 / 4)≦pic[x]≦(max×3 / 4) satisfies the above condition, the pixel to be processed is classified into a class other than class 0. In other words, if the pixel value of the pixel to be processed is within the shaded area in FIG. 27(a), the pixel to be processed is classified into a class other than class 0. Note that the above max represents the maximum possible pixel value of the pixel to be processed x, and for example, max=255. Furthermore, when max=255, the above condition can also be expressed as 8≦(pic[x] / 8)≦23 or 4≦(pic[x] / 16)≦11.
[0449] When offset type = 6 (sao_type_idx = 6) The classification unit 624 classifies the pixel value pic[x] of the pixel x to be processed as follows: pic[x]≦(max×1 / 4) or (max×3 / 4)≦pic[x] satisfies the above condition, the pixel to be processed is classified into a class other than class 0. In other words, if the pixel value of the pixel to be processed is within the shaded area in FIG. 27(b), the pixel to be processed is classified into a class other than class 0. Note that the above max represents the maximum possible pixel value of the pixel to be processed x, and is, for example, max=255. Furthermore, when max=255, the above condition can also be expressed as (pic[x] / 8)≦7 or 24≦(pic[x] / 8), or as (pic[x] / 16)≦3 or 12≦(pic[x] / 16).
[0450] The classification process performed by the classification unit 624 will be described in more detail below.
[0451] When the offset type is one of 5 and 6, the classification unit 624 derives the class index (class_idx) of the class to which the processing target pixel x should belong, according to the hierarchical depth of the processing target QAOU, as follows: - When the hierarchical depth of the QAOU to be processed is less than the threshold class_idx=EoTbl[sao_type_idx][pic[x] / >>BoRefBit32] ·When the depth of the hierarchy of the QAOU to be processed is greater than or equal to the threshold class_idx = EoTbl[sao_type_idx][pic[x] / >>BoRefBit16] Here, EoTbl[sao_type_idx][pic[x] / >>BoRefBit32] and EoTbl[sao_type_idx][pic[x] / >>BoRefBit16] are conversion tables used to derive class_idx from the pixel value pic[x] of the pixel x to be processed and sao_type_idx. BoRefBit32 and BoRefBit16 are values derived from PIC_DEPTH - 5 and PIC_DEPTH - 4 respectively when the image bit depth is PIC_DEPTH, and are the quantization of the pixel value into 32 levels or 16 levels. The quantized pixel value is also described as pixquant. Shifting right by BoRefBit32 and BoRefBit16 corresponds to dividing by 1 << BoRefBit32 and 1 << BoRefBit16. This quantization width is 1 << (8 - 5) = 8 and 1 << (8 - 4) = 16 respectively when the bit depth of the pixel value is 8 bits. Hereinafter, the case where the quantization width is 8 will be described. Also, this quantization width is called the class width.
[0452] The class classification unit 624 performs class classification by changing the class width for classification according to the depth of the hierarchy of the QAOU to be processed. For example, as shown in FIG. 28(a), when the depth of the hierarchy of the QAOU to be processed is less than the threshold, the class classification unit 624 classifies the pixel values into 32 with the class width of "8" and performs class classification. Also, as shown in FIG. 28(b), when the depth of the hierarchy of the QAOU to be processed is greater than or equal to the threshold, the class classification unit 624 classifies the pixel values into 16 with the class width of "16" and performs class classification.
[0453] Next, a specific example of the conversion table EoTbl is shown in Figure 29. In each of Figures 29(a) and 29(b), "BO_1" indicates that "sao_type_index" = 5, and "BO_2" indicates that "sao_type_index" = 6. Furthermore, conversion table 1301 shown in Figure 29(a) is a conversion table used when the hierarchical depth of the QAOU to be processed is smaller than a threshold, and conversion table 1302 shown in Figure 29(b) is a conversion table used when the hierarchical depth of the QAOU to be processed is equal to or greater than a threshold.
[0454] When the hierarchical depth of the QAOU to be processed is smaller than the threshold value and "sao_type_index"=5, as shown in Figure 29(a), the classification unit 624 classifies the pixel x to be processed, whose pixel value pic[x] satisfies 8≦(pic[x] / 8)≦23, into one of the classes from class index 1 to 16 depending on the size of pic[x].
[0455] Also, when "sao_type_index"=6, the classification unit 624 classifies a processing target pixel x whose pixel value pic[x] satisfies pic[x] / 8)≦7 or 24≦(pic[x] / 8) into one of the classes from class index 1 to 16 according to the magnitude of pic[x].
[0456] Furthermore, when the hierarchical depth of the QAOU to be processed is equal to or greater than the threshold and "sao_type_index"=5, as shown in FIG. 29(b), the classification unit 624 classifies the pixel x to be processed whose pixel value pix[x] satisfies 4≦(pix[x] / 16)≦11 into one of the classes from class index 1 to 8 depending on the size of pix[x].
[0457] Also, when "sao_type_index" = 6, the classification unit 624 classifies the pixel x to be processed, whose pixel value pix[x] satisfies pix[x] / 16)≦3 or 12≦(pix[x] / 16), into one of the classes from class index 1 to 8 depending on the magnitude of pix[x]. (Configuration of offset information decoding unit 611) 41 is a block diagram of an offset information decoding unit 611 that changes the offset type to be used according to the type of adaptive offset parameter (parameter condition) and / or changes the number of classes classified according to the adaptive offset parameter condition. The offset information decoding unit 611 is configured with an adaptive offset type decoding unit 6111, a used offset type selection unit 6112, an offset type decoding unit 6113, an adaptive offset decoding unit 6114, a used offset number selection unit 6115, and an offset decoding unit 6116. Note that the parameter conditions are parameters other than values calculated from pixel values, and include the layer and offset type described above, as well as the block size (QAOU size), color components (components), and QP, which will be described in the appendix below.
[0458] The adaptive offset type decoding unit 6111 is a means for adaptively decoding the offset type from the QAOU information in the encoded data in accordance with the parameter conditions, and includes a use offset type selection unit 6112 and an offset type decoding unit 6113 .
[0459] The offset type selection unit 6112 is a means for selecting an offset type to be used in accordance with a parameter condition. One of the parameter conditions is the hierarchy, as described above. The number of offset types to be used when the hierarchy is shallow is smaller than the number of offsets to be used when the hierarchy is deep. The offset type selection unit 6112 inputs a conversion table such as that described in FIG. 25 to the offset type decoding unit 6113 in accordance with the parameter condition. The offset type selection unit 6112 also inputs the maximum number of usable offset types to the offset type decoding unit 6113.
[0460] The offset type decoding unit 6113 decodes the offset type from the coded data according to the input conversion table and maximum number. If the maximum number of offset types is N, the range of possible codes is limited to N, from 0 to N-1, so the number of bits required for coding the code can be reduced. For example, if the maximum number is 2,m-1 Bigger, 2 m When the maximum length is N-1, m-bit fixed-length coding can be used. Also, truncated unary coding with a maximum length of N-1 or truncated rice coding can be used.
[0461] The adaptive offset decoding unit 6114 is a means for adaptively decoding offsets from QAOU information in the encoded data according to parameter conditions, and includes a number-of-used-offsets selection unit 6115 and an offset decoding unit 6116. The number-of-used-offsets selection unit 6115 is a means for selecting the maximum number of offsets to be used and the offset precision according to the parameter conditions. One of the parameter conditions is the hierarchy, and the number of offsets to be used when the hierarchy is shallow is greater than the number of offsets to be used when the hierarchy is deep. For example, when the hierarchy is shallow, the number of offsets can be 16 as shown in FIG. 29(a), and when the hierarchy is deep, the number of offsets can be 8 as shown in FIG. 29(b). As described above, it is also possible to change the offset precision (bit depth) according to the hierarchy. The number-of-used-offsets selection unit 6115 inputs the maximum number of offsets and the offset precision to the offset decoding unit 6116. The offset decoding unit 6116 decodes the offsets according to the maximum number of offsets and the offset precision. Reducing the number of offsets reduces the amount of offset coding. Furthermore, similar to the offset type, once the precision of each offset is determined, the range of possible codes for encoding the offset is also limited, thereby reducing the number of bits required for encoding the code.
[0462] FIG. 42( a ) is a block diagram showing the configuration of the offset type selection unit 6112 .
[0463] The offset type selection unit 6112 includes an offset type conversion table selection unit 6117 , a first offset type conversion table storage unit 6118 , and a second offset type conversion table storage unit 6119 .
[0464] The offset type conversion table selection unit 6117 selects, in accordance with the parameter conditions, a conversion table provided in the first offset type conversion table storage unit 6118 or a conversion table provided in the second offset type conversion table storage unit 6119. In the example described above, 801A is the conversion table provided in the first offset type conversion table storage unit 6118, and 801B corresponds to the conversion table provided in the second offset type conversion table storage unit 6119.
[0465] FIG. 42(b) is a block diagram showing another configuration of the offset type selection unit.
[0466] The offset type selection unit 6112' includes an offset type conversion table selection unit 6117', an edge offset type and band offset type conversion table storage unit 6118', and a horizontal edge offset type and band offset type conversion table storage unit 6119'.
[0467] (Configuration of Classification Unit 624) FIG. 43 is a block diagram showing the configuration of the classification unit 624.
[0468] The classification unit 624 is made up of an adaptive edge offset classification unit 6241 , a usable edge offset class selection unit 6242 , an edge offset classification unit 6243 , an adaptive band offset classification unit 6244 , a usable band offset class / class width selection unit 6245 , and a band offset classification unit 6246 .
[0469] The classification unit 624 classifies each pixel into a class according to the parameter condition and the offset type. If the offset type indicates an edge offset, the pixel is classified by the adaptive edge offset classification unit 6241. If the offset type indicates a band offset, the pixel is classified by the adaptive band offset classification unit 6244.
[0470] The adaptive edge offset class classification unit 6241 is a means for adaptively classifying pixels into classes according to parameter conditions, and includes a used edge offset class selection unit 6242 and an edge offset class classification unit 6243. The used edge offset class selection unit 6242 selects the type of class to use. The used edge offset class selection unit 6242 inputs a pixel value classification method to the edge offset class classification unit 6243. Specifically, it inputs a method for deriving an intermediate value EdgeType, which is temporarily derived when classifying pixel values, and a conversion table used to derive class_idx from EdgeType. An example of a method for deriving an intermediate value EdgeType is described using Figures 26(a) and 26(b), and is referred to as a basic edge classification method. An edge classification method such as that described later in Figure 33 can also be used. As described above, one of the parameter conditions is the hierarchy, and the number of classes used when the hierarchy is shallow is selected so that it is greater than the number of classes used when the hierarchy is deep. Examples of conversion tables used to derive class_idx from EdgeType are 1001A and 1001B. It is also appropriate to switch the edge derivation method depending on the color component. In this case, for luminance, it is appropriate to use a basic edge classification method that uses edge classification methods for horizontal, vertical, and diagonal directions, and for chrominance, it is appropriate to use a horizontal edge classification method that limits the range of reference pixels used in edge classification to the horizontal direction as seen from the target pixel in order to reduce line memory. The edge offset classifying unit 6243 classifies pixels based on the given classification method and the conversion table used to derive class_idx from EdgeType.
[0471] The adaptive band offset class classifier 6244 is a means for adaptively classifying pixels into classes according to parameter conditions, and includes a used band offset class / class width selector 6245 and a band offset class classifier 6246. The used band offset class / class width selector 6245 inputs a pixel value classification method to the band offset class classifier 6246. Specifically, it inputs the class width, which is the quantization width used when classifying pixel values into intermediate values, and the conversion table used to derive class_idx from the intermediate value. One of the parameter conditions is the hierarchy as already described. When the hierarchy is shallow, the width of the class used is smaller than the width of the class used when the hierarchy is deep. The band offset class classifier 6246 classifies pixel values into classes according to the input class width and the conversion table used to derive class_idx from the intermediate value. The input class width may be not the class width itself but an integer corresponding to the class width. For example, when 1<<BoRefBit32 is used as the class width, the number of bits BoRefBit32 used for pixel quantization, which is the logarithm to the base 2, or a value for obtaining the number of bits used for pixel quantization from the pixel bit depth. For example, if BoRefBit32 = PIC_DEPTH - 5, 5 may be used instead of the class width.
[0472] In this way, the encoded data is adaptively decoded according to parameter conditions, and pixel class classification is performed.
[0473] As described above, in this embodiment, the number of class classifications is changed according to the depth of the hierarchy of the QAOU to be processed. More specifically, when the depth of the hierarchy of the QAOU to be processed is large, the number of classes for classification is smaller compared to the case when it is small.
[0474] Generally, the required memory amount is Memory amount = Offset data length × Number of classes × Number of QAOU. Therefore, by reducing the number of classes, the memory usage amount can be reduced.
[0475] Furthermore, in deeper layers, the area of the QAOU becomes smaller and the characteristics of the pixel values within the QAOU become closer to uniform, so the effect of the offset does not change much even if the number of classes is reduced.
[0476] In this embodiment, the offset precision is changed depending on the hierarchical depth of the QAOU to be processed. More specifically, when the hierarchical depth of the QAOU to be processed is large, the offset precision is lowered compared to when it is small. This reduces the amount of code when the hierarchical depth of the QAOU to be processed is large.
[0477] Since QAOUs in deeper layers contain fewer pixels, the quantization error of the entire QAOU is smaller than that of higher layers. Therefore, even if the offset accuracy is lowered in deeper layers, the effect of the offset does not change much.
[0478] (Video Encoding Device 2') Next, a video encoding device 2' that generates encoded data #1 by encoding a target image to be encoded will be described with reference to Figures 30 and 31. Like the video encoding device 2, the video encoding device 2' partially incorporates the method adopted in H.264 / MPEG-4.AVC, the method adopted in KTA software, a codec jointly developed by VCEG (Video Coding Expert Group), the method adopted in TMuC (Test Model under Consideration) software, a successor codec, and the technology adopted in HM (HEVC Test Model) software.
[0479] Also, the video encoding device 2' differs from the video encoding device 2 in that it is provided with an adaptive offset filter 80' instead of the adaptive offset filter 80 in the video encoding device 2, but otherwise has the same configuration.
[0480] (adaptive offset filter 80') Next, the adaptive offset filter 80' will be described with reference to Fig. 30. Fig. 30 is a block diagram showing the configuration of the adaptive offset filter 80'. As shown in Fig. 30, the adaptive offset filter 80' includes an adaptive offset filter information setting unit 81' and an adaptive offset filter processing unit 82'.
[0481] As shown in FIG. 30, the adaptive offset filter information setting unit 81′ includes an offset calculation unit 811, an offset clipping unit 812, and an offset information selection unit 813.
[0482] (Offset calculation unit 811) The offset calculation unit 811 calculates offsets for all offset types and all classes that exist according to the hierarchy of the QAOU to be processed, for all QAOUs up to a predetermined division depth included in the target processing unit (e.g., LCU). Here, the offset types and classes refer to the same as those described in the description of the video decoding device 1.
[0483] The offset calculation unit 811 supplies the offset information, which is made up of the offset calculated by the above processing, the offset type, the class, and QAOU structure information that indicates the division structure of the QAOU, to the offset clip unit 812.
[0484] (Offset clip part 812) The offset clipping unit 812 performs clipping processing on the offset supplied from the offset calculation unit 811 using either clipping processing 1 or clipping processing 2 as described below.
[0485] (Clip processing 1) The offset clipping unit 812 represents each offset in 4 bits by clipping each offset supplied from the offset calculation unit 811 to a value between −8 and 7, for example. Each clipped offset is supplied to an offset information selection unit 813. The bit width to be clipped is set according to the bit depth of the image and the bit depth of the offset, as in the video decoding device 1.
[0486] By clipping each offset in this way, it is possible to reduce the memory size of the memory (not shown) in which each offset is stored. Also, it is possible to reduce the amount of code for the offset included in the coded data #1, thereby improving coding efficiency. Furthermore, it is possible to prevent excessive offsets from being added, thereby ensuring appropriate image quality.
[0487] (Clip Processing 2) The offset clipping unit 812 may also be configured to set the clipping range of each offset supplied from the offset calculation unit 811 to a different value depending on the offset type.
[0488] For example, if the offset type is edge offset, the number of offset bits is 8, and if the offset type is band offset, the number of offset bits is 4. More generally, when the number of offset bits is N when the offset type is edge offset, and when the number of offset bits is M when the offset type is band offset, the number of offset bits is determined so that N>M is satisfied.
[0489] By varying the number of bits of the offset depending on the offset type in this way, it is possible to improve the coding efficiency without requiring an excessive memory size for the memory for storing each offset.
[0490] The threshold value th for limiting the possible offset values is 2. m-1 Bigger, 2 mWhen th is equal to or less than 1, m-bit fixed-length coding can be used as the coding method for encoding the offset. More specifically, truncated unary coding or truncated rice coding can be used, where th is the maximum value.
[0491] This embodiment also includes clipping processing obtained by combining the above clipping processing 1 and 2. The adaptive offset filter 80' may not include the offset clipping unit 812.
[0492] Furthermore, the offset clip unit 812 switches the clip range according to the hierarchical depth of the QAOU to be processed in accordance with the accuracy of the offset. Specifically, if the hierarchical depth of the QAOU to be processed is smaller than the threshold value, the offset clip unit 812 switches the clip range according to the accuracy of the offset. A bit, if the hierarchical depth of the QAOU to be processed is greater than or equal to the threshold, n B In this case, if the hierarchical depth of the QAOU to be processed is smaller than the threshold value, the offset clip unit 812 sets the clip range to -2 nA / 2 ~2 nA / 2 If the depth of the hierarchy of the QAOU to be processed is greater than or equal to the threshold, the clip range is set to -2. nA / 2 ~2 nA / 2 -1, and then the lower (n A -n B ) bit is set to "0." This allows the offset information selection unit 813, which performs processing using the offset clipped by the offset clipping unit 812, to perform processing without taking into account the accuracy of the offset.
[0493] (Offset information selection unit 813) The offset information selection unit 813 determines a combination of offset type, class, and offset that results in a smaller RD cost (Rate-Distortion cost), as well as a corresponding QAOU partition structure, and supplies QAOU information indicating the determined offset type, class, offset, and the corresponding QAOU partition structure to the variable-length code encoding unit 22. The offset information selection unit 813 also supplies the determined offset to the adaptive offset filter processing unit 82 for each QAOU.
[0494] The processing of the offset information selection unit 813 will be described in more detail below with reference to FIG.
[0495] Fig. 31 is a diagram showing an outline of calculating the squared error for each offset type for a QAOU with a QAOU index of "x". As shown in Fig. 31, the offset information selection unit 813 calculates the squared error for each offset type for all QAOUs. Then, the offset type for which the calculated squared error is the smallest is set as the offset type for the QAOU. In this way, the offset types are determined for all QAOUs (QAOMU numbers 0 to 340).
[0496] Next, the offset information selection unit 813 calculates the RD cost when the division depth is set to 0 and the RD cost when the division depth is set to 1. The specific calculation method is as described above with reference to FIG.
[0497] (Adaptive offset filter processing unit 82') The adaptive offset filter processing unit 82' adds an offset supplied from the offset information selection unit 813 to each pixel of the deblocked decoded image P_DB in the target QAOU. The adaptive offset filter processing unit 82' outputs an image obtained by performing processing on all QAOUs included in the deblocked decoded image P_DB as an offset-filtered decoded image P_OF. Note that the configuration of the adaptive offset filter processing unit 82' is the same as that of the adaptive offset filter processing unit 62', and therefore description thereof will be omitted here.
[0498] Alternatively, an adaptive clip type may be used. That is, an adaptive clip (AC) type may be provided as one of the offset types. In this case, there are three offset types: EO, BO, and AC. The adaptive clip type (AC) does not use an offset, but corrects pixel values using clipping with a lower limit value c1 and an upper limit value c2. Examples of the lower limit value c1 and the upper limit value c2 are c1=16 and c2=235, respectively.
[0499] By using an adaptive clip type, offset encoding processing and memory for storing a large number of offsets are not required. If the lower and upper limits of a clip are set adaptively rather than fixed, the lower and upper limits can be encoded. In this case, it is preferable to encode the difference from an appropriate fixed value, e.g., the lower limit is an offset from 16, and the upper limit is an offset from 235. Since the upper limit is a large value in particular, this prevents a decrease in encoding efficiency.
[0500] (Appendix 2) As described above, "depending on the hierarchical depth of the QAOU" can also be referred to as "depending on the size of the QAOU." In other words, the number of SAO types, the number of classes, and the offset precision may be varied depending on the size of the QAOU.
[0501] For example, when the size of the QAOU is less than NxN pixels, one or more of the number of SAO types, the number of classes, and the offset accuracy may be restricted more than when the size of the QAOU is NxN pixels or more. A specific example of N is N=64 (the size of the LCU).
[0502] In addition, examples of limiting the number of SAO types include limiting EO to horizontal and vertical types, limiting BO to one type (conversion table 802C), using only EO but not BO (conversion table 802A), using only horizontal types of EO and BO (conversion table 801B, conversion table 802D), etc. The offset information decoding unit 611 uses the conversion tables shown in parentheses. Note that the number of SAO classes and the offset accuracy can be limited in the same way as in the above-mentioned embodiment.
[0503] In this way, by limiting the type, number of types, number of classes, and offset precision of SAO, it is possible to reduce memory usage and processing load. In particular, by limiting the type types to BO or limiting EO to horizontal and vertical types, it is possible to reduce the processing load of the classifying unit of the encoding device and the decoding device. Furthermore, by limiting the number of types, it is possible to omit cost calculations for selecting the optimal type, thereby reducing the processing load of the encoding device. By limiting the type types to EO and limiting the number of classes and offset precision, it is possible to reduce memory usage for storing offsets. Furthermore, by limiting the type types to horizontal types EO and BO, it is possible to reduce temporary memory, such as line memory, for storing reference pixels used for classification and shorten the delay while waiting for the reference pixels to be decoded. Note that limiting the number of BO classes is more effective in reducing memory usage than limiting the number of EO classes.
[0504] Such restrictions can be realized by adaptively changing the operation of the offset information decoding unit 611 and the class classification unit 624 according to the parameter condition when the parameter condition is the size of the QAOU using the configuration of the means shown in Figures 41 to 43.
[0505] (Appendix 3) Alternatively, the size of the QAOU (hereinafter also referred to as the luminance unit) that adds an offset to the luminance value may be different from the size of the QAOU (hereinafter also referred to as the chrominance unit) that adds an offset to the chrominance, and the chrominance unit may be configured to limit the types of SAO types, number of types, number of classes, offset accuracy, and maximum level of division more than the luminance unit.
[0506] For example, in a data format where the resolutions of luminance and chrominance are different and the chrominance resolution is lower than that of luminance, such as the 4:2:0 format in a YUV image format, the chrominance division does not need to be as fine as that for luminance. Therefore, by limiting the SAO type, number of types, number of classes, offset precision, and maximum division level for chrominance units, it is possible to reduce memory usage and processing load. Note that the maximum level of the chrominance unit can be limited by, for example, making the maximum depth of the SAO tree structure shallower than that of the luminance unit.
[0507] Such restrictions can be realized by adaptively changing the operation of the offset information decoding unit 611 and the class classification unit 624 according to the parameter condition when the parameter condition is the size of the QAOU using the configuration of the means shown in Figures 41 to 43.
[0508] In particular, when performing SAO processing on both luminance and chrominance, a temporary memory such as a line memory for storing reference pixels used for classification for each color component is required. Because the luminance component is less important than the chrominance component, the line memory for the chrominance component can be reduced by setting the parameter condition to the chrominance component and limiting the types to horizontal types EO and BO. In this case, the offset information decoding unit 611 uses conversion tables such as conversion table 801B and conversion table 802D.
[0509] It is also particularly effective to set the parameter condition to the color difference component and reduce the offset precision compared to the luminance component. For example, the offset precision (and shift value) for the luminance component is SAO_DEPTH = MIN(PIC_DEPTH,AY) Shift value = PIC_DEPTH - MIN(PIC_DEPTH, AY) In the case of the color difference component, the offset precision and shift value are SAO_DEPTH = MIN(PIC_DEPTH, THC) Shift value = PIC_DEPTH - MIN(PIC_DEPTH, AC) When calculating the above, it is appropriate to use the variables AY and AC that control the precision, AY>AC. For example, AY=10 or 9, and AC=8. In this case, the offset precision of the luminance component is greater than that of the chrominance components. The shift value of the luminance component is smaller than that of the chrominance components.
[0510] (Appendix 4) Furthermore, when the value of the quantization parameter qp (qp value) of a CU is equal to or greater than a threshold, the type of SAO, the number of types, the number of classes, the offset precision, and the maximum number of division layers may be restricted. The qp value may use the initial QP value of the picture, or, when the QAOU to be processed by the SAO is along the boundary between an LCU or a CU, the qp value of the CU at the position corresponding to the upper left coordinate or center coordinate of the QAOU may be used.
[0511] The higher the qp value, the lower the image quality of the predicted image, making detailed classification and offset correction more difficult, so limiting the SAO type, number of types, number of classes, offset accuracy, and maximum division level has little effect on image quality. Therefore, if the number of SAO types, number of classes, offset accuracy, and maximum division level are limited when the qp value is equal to or greater than a threshold, it is possible to reduce memory usage and processing load without affecting image quality.
[0512] Such restrictions can be realized by adaptively changing the operations of the offset information decoding unit 611 and the classification unit 624 in accordance with the parameter condition when the parameter condition is QP using the configuration of the means shown in Figures 41 to 43.
[0513] (Appendix 5) Furthermore, for pictures of a particular type, such as B pictures or non-reference pictures (IDR pictures), the type of SAO, the number of types, the number of classes, the offset precision, and the maximum number of division layers may be restricted.
[0514] For I-pictures and P-pictures, the image quality of those pictures has a significant impact on subsequent pictures, so high SAO accuracy must be maintained. On the other hand, for other pictures, the type of SAO, the number of types, the number of classes, the offset accuracy, and the maximum division hierarchy may be restricted for these pictures (B-pictures, IDR-pictures). This reduces memory usage and processing load.
[0515] Such restrictions can be realized by adaptively changing the operation of the offset information decoding unit 611 and the class classification unit 624 according to the parameter condition when the parameter condition is the type of picture using the configuration of the means shown in Figures 41 to 43.
[0516] (Appendix 6) Furthermore, the number of SAO types, the number of classes, the offset precision, and the maximum number of division layers may be limited depending on the position of the QAOU on the screen.
[0517] For example, at the edges of the screen, the number of SAO types, the number of classes, the offset precision, and the maximum level of division may be limited.
[0518] Since the user is likely to notice the area near the center of the screen, lowering the image quality will directly result in a decrease in subjective image quality. However, even if the image quality is lowered at the periphery of the screen, the subjective image quality does not decrease as much as near the center of the screen.
[0519] Furthermore, if the SAO type, which requires sample points beyond the screen edge, is not used, the boundary determination process can be reduced.
[0520] Such restrictions can be realized by adaptively changing the operation of the offset information decoding unit 611 and the class classification unit 624 according to the parameter condition when the parameter condition is the position of the QAOU using the configuration of the means shown in Figures 41 to 43.
[0521] Fourth Embodiment Another embodiment of the present invention will be described below with reference to Fig. 32. This embodiment differs from the above-described embodiment in that EO and BO are switched according to the pixel value.
[0522] The inventors of the present application have discovered that EO is more effective than BO in the middle gradation range of pixels, while BO is more effective in other value ranges (low pixel value range and high pixel value range). Therefore, in this embodiment, BO is used in the low pixel value range and high pixel value range, and EO is used in the middle gradation range.
[0523] A specific description will be given with reference to Fig. 32. Fig. 32 is a diagram illustrating a configuration for switching between EO and BO based on pixel values, where (a) is a diagram illustrating an overview of the configuration for switching between EO and BO based on pixel values, (b) is a diagram illustrating specific switching values, and (c) is a diagram illustrating the contents of the list memory stored in the offset information storage unit 621.
[0524] 32(a), in this embodiment, BO is used when the pixel value (brightness value) is near 0 and near 255, and EO is used in other value ranges. That is, the SAO type is classified according to the pixel value, and an offset according to the pixel value is added when the pixel value is near 0 and near 255, and an offset according to the edge type is added in other areas.
[0525] As a result of experiments conducted by the inventors, it was found that EO and BO are biased in the range of pixel values used. In other words, it was found that EO is more prevalent in the mid-tone range. This means that in the low and high pixel value ranges, pixel values tend to have a greater influence on errors than edge type.
[0526] Therefore, in this embodiment, EO and BO are determined according to the pixel value range, and one SAO type is configured to utilize the part where the error correction effect is high in both EO and BO. This improves coding efficiency. Furthermore, since the number of SAO types and the total number of classes can be reduced, memory usage and processing load can be reduced.
[0527] Next, this embodiment will be described in more detail. First, unlike the above-described embodiment, this embodiment uses 1 to 4 for "sao_type_idx", which are defined as follows. "sao_type_idx"=1: (BO_EO_0) corresponds to EO_0+BO in the first embodiment "sao_type_idx"=2:(BO_EO_1) corresponds to EO_1+BO in the first embodiment "sao_type_idx"=3: (BO_EO_2) corresponds to EO_2+BO in the first embodiment "sao_type_idx"=4: (BO_EO_3) corresponds to EO_3+BO in the first embodiment Moreover, EO_0 to EO_3 and BO_0, BO_1 in the first embodiment are not used.
[0528] Then, as shown in Fig. 32(b), the classification unit 624 performs classification using BoTbl[BO_1] in the conversion table 1301 of Fig. 29. Then, if the pixel value is ¼ or less of max or ¾ or more of max, classification is performed using the conversion table 1301.
[0529] If the pixel value is between 1 / 4 and 3 / 4 of max, the edge type is determined according to EO_0 to EO_3 explained in the above embodiment, and classification is performed.
[0530] This allows the classification unit 624 to classify the classes by switching between BO and EO depending on the pixel value.
[0531] Further, the offset calculation unit 811 calculates the offset in the same manner as the offset calculation method described in the above embodiment, except that in this embodiment, the number of offset types is four, and therefore the calculation is performed with this point in mind.
[0532] In addition, the list memory 2101 stored in the offset information storage unit 621 stores the QAOU index, the offset type, and the specific offset value for each class selectable for that offset type, in association with each other, as shown in Figure 32 (c).
[0533] When using an offset type that combines the characteristics of both EO and BO, it is also possible to first perform class classification using EO, and then further classify a specific class (a class with a flat edge) using BO. Alternatively, it is also possible to use both EO and BO as described in the embodiment. Furthermore, it is also possible to reduce the number of types and classes by changing whether or not to provide an offset type that combines the characteristics of EO and BO depending on the condition described in the embodiment (whether or not the depth of the QAOU hierarchy is smaller than a threshold).
[0534] Fifth Embodiment Another embodiment of the present invention will be described below with reference to Figures 33, 34, and 42. This embodiment differs from the above-described embodiment in that, in EO classification, the pixels used for determining edges are limited to only those pixels present in the horizontal direction of the pixel being determined.
[0535] In the above embodiment, pixels above or below the target pixel are also used in determining edges, so a line buffer is required to store the pixel values of the pixels above the target pixel (pixels that have already been offset).
[0536] Therefore, if the pixels used for edge detection are limited to those located horizontally from the target pixel, there will be no need to refer to the upper side, which will reduce the amount of memory used for the line buffer.In addition, there will be no need to detect the upper boundary (such as the edge of the screen), which will reduce the amount of processing.
[0537] Furthermore, when only pixels existing in the horizontal direction are used, it is possible to reuse the processing results from the previous time, which further reduces the amount of processing. This will be explained with reference to Figure 33(a). Figure 33(a) shows pixels existing in the horizontal direction, and x0 to x3 are the pixel values of each pixel.
[0538] First, for a pixel with a pixel value x1, the difference between the pixel and its neighbors is as follows: s1=sign(x1-x0)-sign(x2-x1) Next, for the pixel with pixel value x2, the difference between the pixel on both sides is calculated as follows: s2=sign(x2-x1)-sign(x3-x2) Here, s1 and s2 are values used for classifying the edges at x1 and x2.
[0539] In this way, when calculating s2, the sign(x2-x1) used in s1 is reused, thereby reducing the amount of processing.
[0540] Next, details of this embodiment will be described. In this embodiment, there are two types of EO. That is, only when "sao_type_idx" = 1 or 2, it is considered to be an edge offset (EO). When "sao_type_idx" = 1 (EO_0), the edge type is derived by comparing with pixels on the left and right of the target pixel (FIG. 33(b)). When "sao_type_idx" = 2 (EO'_0), the edge type is derived by comparing with pixels located two pixels away on the left and right of the target pixel (FIG. 33(c)).
[0541] It should be noted that the band offset (BO) is used when "sao_type_idx"=3 or 4. This can be achieved by replacing the cases in the first embodiment where "sao_type_idx"=5 or 6 with "sao_type_idx"=3 or 4, respectively.
[0542] When "sao_type_idx" = 2, the type of edge is determined using pixels one pixel away from both sides of the target pixel in order to facilitate the detection of edges with a shallow angle relative to the horizontal. As shown in Figure 33(d), when the pixels on both sides of the target pixel are compared, the difference in pixel values may be small and the pixel may not be determined to be an edge. Even in such cases, if the difference with the pixel one pixel away is taken, it is possible to detect edges with a shallow angle relative to the horizontal.
[0543] Also, instead of using the pixel on either side of the target pixel, the difference between the pixel on the left and the pixel one pixel further to the right (Fig. 34(a)) can be used, or vice versa (Fig. 34(b)). This is particularly effective when the reference pixel is at the edge of the screen.
[0544] Furthermore, a configuration may be adopted that limits the cases where only horizontal pixels are used. For example, a configuration may be adopted in which only horizontal pixels are referenced only in the case of pictures that have little influence on other pictures, such as B pictures or non-reference pictures, and in other cases, the configuration is the same as in the first embodiment above. Alternatively, a configuration may be adopted in which only horizontal pixels are referenced near the edge of the screen or slice boundaries, and in other cases, the configuration is the same as in the first embodiment above. In this way, it is possible to reduce memory usage and also the amount of processing. Furthermore, since no reference is made upward, the boundary determination process near the edge of the screen or slice boundaries can be reduced.
[0545] Alternatively, a flag may be explicitly specified for each picture or block. For example, when there are many horizontal edges (FIG. 34(c)), performance degradation can be prevented by performing processing using the method described in the above embodiment.
[0546] In addition, whether or not to use only pixels present in the horizontal direction may be changed depending on the condition described in the above embodiment (whether or not the depth of the QAOU hierarchy is smaller than a threshold.) Furthermore, only when BO and EO are used in combination as described in the above embodiment, EO may be configured to use only pixels present in the horizontal direction.
[0547] Alternatively, the type of edge may be derived depending on whether the difference between the pixel and a pixel existing in the horizontal direction is greater than (or smaller than) a threshold value. Specifically, the classes may be classified according to the following formula:
[0548] Sign(z)=+1 (when z>th) Sign(z)=0 (when -th≦z≦th) Sign(z)=-1 (when z<-th) Here, th is a threshold value having a predetermined value.
[0549] In the case of pixel values representing color differences, edge offset may be configured to use only pixels present in the horizontal direction.
[0550] The effect of limiting edges to horizontal can be achieved even when only one horizontal edge classification method is used, for example, when only the method shown in FIG. 33(b) is used. As described above, when multiple different horizontal edge classification methods are combined, more precise edge classification is possible than when a single horizontal edge classification method, such as the method shown in FIG. 33(b), is used. Note that the combination of multiple horizontal edge classification methods is not limited to the case shown in FIGS. 33(b) and 33(c), where two examples are used by changing the distance between the target pixel and the reference pixel. It is also possible to use two thresholds for deriving edge types. For example, two horizontal edge classification methods may be provided, one for when the threshold th is 0 and the other for when it is 1.
[0551] The configuration for limiting the cases where only horizontal pixels are used can be realized by adaptively changing the operations of the offset information decoding unit 611 and the class classification unit 624 in accordance with parameter conditions using the configurations of the means shown in Figures 41 to 43 of embodiment 1. For example, in the offset information decoding unit 611 of Figure 41, the types of offset types selected by the offset type selection unit 6112 are limited to only horizontal edge classification methods in accordance with parameter conditions, and the offset type decoding unit 6113 decodes the limited types of offset types.
[0552] 42(b), the offset type conversion table selector 6117' selects, in accordance with the parameter conditions, a conversion table included in an edge offset type and band offset type storage unit 6118' or a conversion table included in a horizontal edge offset type and band offset type conversion table storage unit 6119'. In one example, if the color component is luminance, the conversion table included in the edge offset type and band offset type storage unit 6118' is selected, and if the color component is chrominance, the conversion table included in the horizontal edge offset type and band offset type conversion table storage unit 6119' is selected.
[0553] In the classification unit 624, an internal offset type selection unit 6112 selects an edge classification method that is limited to only the horizontal edge classification method according to the parameter conditions, and the pixels are classified in an edge offset classification unit 6243. In one example, when the color component is luminance, the basic edge classification method is selected, and when the color component is chrominance, the horizontal edge classification method is selected.
[0554] Sixth Embodiment Another embodiment of the present invention will be described below with reference to Figures 35 to 37. This embodiment differs from the above-described embodiment in that the offset accuracy is improved or the classes are divided finely near the center of the chrominance pixel values.
[0555] In an image, errors near achromatic colors tend to be noticeable in terms of subjective image quality. For each chrominance pixel value, the achromatic color is the center of the range, and in the case of an 8-bit bit depth, it is the color of the pixel with a pixel value of 128. Therefore, in this embodiment, in the case of BO, the offset precision is increased or a smaller class width is used to refine the class division around the chrominance pixel value of 128. Hereinafter, the range of chrominance pixel values near achromatic colors is referred to as the achromatic value range.
[0556] This makes it possible to increase the offset accuracy in the achromatic range, thereby improving the performance of offset correction in the achromatic range. This reduces the error from the original image in the achromatic range, thereby improving subjective image quality. Furthermore, by dividing the classes in the achromatic range narrower than in other ranges, offset correction in the achromatic range can be performed more precisely. This reduces the error from the original image, thereby improving subjective image quality.
[0557] In this embodiment, the offset accuracy of the achromatic color range is improved and the class division is subdivided, but the present invention is not limited to this. For values in a range that are likely to affect subjective image quality, the subjective image quality can be improved by subdividing the class division or improving the offset accuracy. Similarly, for luminance pixel values, the offset accuracy can be increased or the class division is subdivided for pixel value ranges where image quality degradation is likely to be noticeable in terms of subjective image quality, and similar effects can be achieved.
[0558] First, a case where the offset accuracy is improved will be described with reference to Fig. 35. Fig. 35 is a diagram showing an overview of a case where the offset accuracy is improved. As shown in Fig. 35, when the offset accuracy is improved, the offset accuracy near the chrominance pixel value of 128 is set to high accuracy, and the offset accuracy in other value ranges is set to low accuracy.
[0559] Further, the offset information storage unit 621 stores n B bits (e.g. n B = 8), and for offsets in the low-precision range, n A bits (e.g. n A If there is enough storage space, n B The bits may be unified, which makes implementation easier.
[0560] The offset clipping unit 812 also switches the clipping range between high-precision and low-precision offset ranges. For example, for low-precision offset ranges, the clipping range is set to -2 nA / 2 ~2 nA / 2 -1, and for the high-precision offset range, the clip range is -2 nB / 2 ~2 nB / 2 Let's set it to -1.
[0561] Next, the case where class classification is subdivided will be described with reference to Fig. 36. Fig. 36 is a diagram showing an overview of the case where class classification is subdivided, in which (a) shows a conversion table and (b) to (d) are diagrams for explaining class division.
[0562] When class classification is subdivided, an offset storage area corresponding to "sao_type_idx"=5 is secured in the list memory for chrominance in the offset information storage unit 621 according to the number of classifications.
[0563] In addition, in the case of BO, when deriving a class from a pixel value, the classification unit 624 also determines whether the pixel value of the target pixel is in the achromatic value range. Specifically, the classification is performed using, for example, one of the conversion tables 2501 shown in FIG. 36(a).
[0564] In the conversion table 2501, class classification is performed by "class_idx = BoTbl[sao_type_idx][pic[x] / 4]", and classes are assigned to finer pixel values than in the conversion tables 1301 and 1302 of FIG.
[0565] Furthermore, "BoTbl[BO_0][pix / 4](a)" of the conversion table 2501 shows an example in which the classes are divided into 16, the achromatic color value range is subdivided, and the mid-tone range (pix / 4 = 16 to 21, 42 to 47) is coarsened (FIG. 36(b)). Also, "BoTbl[BO_0][pix / 4](b)" shows an example in which the classes are divided into 16, the offset value range is narrowed, and the achromatic color value range is subdivided while maintaining the number of classes and the maximum class width (FIG. 36(c)). Also, "BoTbl[BO_0][pix / 4](c)" shows an example in which the classes are divided into 18, the value range near the achromatic color is subdivided, and the maximum class width is maintained (FIG. 36(d)). As another example, by making the class width for the mid-tone range relatively larger than that for the achromatic range and reducing the total number of classes, it is possible to reduce the offset storage area while maintaining the same correction accuracy for the achromatic range. This is possible because offset correction is used less frequently in the mid-tone range than in the achromatic range.
[0566] Furthermore, a configuration may be adopted in which both improved offset accuracy and finer classification of the achromatic color range are used.
[0567] Alternatively, the offset accuracy may be different between pixel values indicating luminance and pixel values indicating color difference, i.e., the offset accuracy for pixel values indicating color difference may be coarser than the offset accuracy for pixel values indicating luminance.
[0568] (Appendix 7) Alternatively, the offset may be added in a direction that brings the pixel closer to achromatic color (=color difference pixel value 128). That is, the offset adder 626 may reverse the sign of the offset to be added depending on whether the pixel value is equal to or greater than 128 or less than 128. For example, when the offset is a, x'=x+a(x<128), x'=xa(x≧128) may be used.
[0569] Furthermore, if the pixel value after adding the offset crosses 128, it may be configured to clip at 128. For example, when the pixel value is "126 (green side)" and the offset is "3", instead of adding the offset as is and setting x = 126 + 3 = 129, it may be set to x = clip(126 + 3, 0, 128) = 128. Here, clip(x, y, z) indicates the process of limiting the value of x to y ≦ x ≦ z.
[0570] Also, for example, if the pixel value is "129 (red side)" and the offset is "-4", instead of simply adding the offset and setting x=129+(-4)=125, it is also possible to set x=clip(129+(-4),128,255)=128.
[0571] (Appendix 8) Also, for color difference, an offset may be added separately for the mid-tone range and other value ranges. For example, as shown in FIG. 37(a), class classification may be performed taking into account achromatic pixel values. In the example shown in FIG. 37(a), when "sao_type_idx"=5(BO_0), a class is assigned to the mid-tone range, and when "sao_type_idx"=6(BO_1), a class is assigned to value ranges other than the mid-tone range.
[0572] Furthermore, as shown in Fig. 37(b), the classes may be classified asymmetrically into two ranges on either side of the achromatic pixel values. In the example shown in Fig. 37(b), the class width is the same as in the example shown in Fig. 37(a), but the separator position is changed.
[0573] Also, as shown in Figures 37(c) and 37(d), different class classifications may be used for each chrominance channel (Cr and Cb). In the example shown in Figures 37(c) and 37(d), the class widths are different for chrominance (Cr) and chrominance (Cb). The class width can be changed by subdividing the number of classes as in conversion table 2501.
[0574] Furthermore, as shown in FIG. 37(e), for color difference, classification may be performed using one type of BO.
[0575] Seventh Embodiment Another embodiment of the present invention will be described below with reference to Figures 38 to 40. This embodiment differs from the above-described embodiment in that the offset value is not the offset value itself, but is predictively coded, i.e., the offset residual calculated using the offset value and a predicted value of the offset value is coded, and "0" is set as the offset predicted value.
[0576] Generally, in SAO, the offset is coded according to the class that indicates the region classification. If there are no pixels classified into that class (if the class is empty), "0" is coded. Since the offsets of neighboring classes and neighboring regions usually have similar values, it is possible to reduce the amount of coding by coding the difference using the already decoded offset value as a predicted value. However, if the class is empty, the amount of coding increases.
[0577] Therefore, in this embodiment, the offset prediction value includes "0", one prediction value is selected from multiple prediction value candidates including "0", and the prediction difference is coded to reduce the amount of coding for the offset.
[0578] This allows an appropriate predicted value to be assigned even if the class is empty, even if there are pixels classified into that class, and even if the offset is coded, so that the amount of coding can be reduced by predictive coding.
[0579] The configuration of an offset information decoding unit 611′ according to this embodiment will be described with reference to Fig. 38. The offset information decoding unit 611′ is provided in place of the offset information decoding unit 611 of Fig. 22, and includes an offset residual decoding unit 651, an offset restoration unit 652, and a predicted value derivation unit 653. The predicted value derivation unit 653 includes a predicted candidate flag decoding unit 661, a fixed predicted value calculation unit 662, an encoded predicted value calculation unit 663, and a predicted value candidate selection unit 664.
[0580] The offset residual decoding unit 651 decodes the offset residual from the QAOU information included in the coded data #1, and supplies the decoded offset residual to the offset restoration unit 652.
[0581] The predicted value derivation unit 653 derives a predicted value of the offset. The predicted candidate flag decoding unit 661 decodes the predicted candidate flag from the QAOU information and supplies the decoded predicted candidate flag to the predicted value candidate selection unit 664. Note that the predicted candidate flag decoding unit 661 may be configured not to decode the predicted candidate flag when the previously decoded offset value is "0".
[0582] The fixed predicted value calculation unit 662 calculates a fixed value (here, “0”), which is an offset to be coded when there is no pixel classified into the class, as a predicted value, and supplies the calculated value to the predicted value candidate selection unit 664.
[0583] The encoding predicted value calculation unit 663 reads out the already decoded offset from the offset information storage unit 621 , calculates a predicted value, and supplies the calculated value to the predicted value candidate selection unit 664 .
[0584] The prediction value candidate selection unit 664 selects the value supplied from the fixed prediction value calculation unit 662 in accordance with the prediction candidate flag. The prediction value to be supplied to the offset restoration unit 652 is selected from the prediction values supplied thereto and the prediction values supplied from the encoding prediction value calculation unit 663 .
[0585] The offset restoration unit 652 restores the offset (Offset) from the predicted value (pred) supplied from the predicted value candidate selection unit 664 and the offset residual (sao_offset) supplied from the offset residual decoding unit 651 according to the following equation. “Offset”=“pred”+“sao_offset” Here, the reason why the amount of code increases when there is a class with no pixels to be classified (empty class) will be explained with reference to FIG. 39. FIG. 39 is a diagram showing an overview of the case when there is an empty class. As shown in FIG. 39, for a non-empty class, the offset of the class is coded. Then, for each class, the previous offset is used as a predicted value and the difference between the predicted value and the offset is coded. However, if there is an empty class, the predicted value becomes "0" and the difference value becomes large. This increases the amount of code.
[0586] Therefore, in this embodiment, the predicted value can be selected from "0" and "the immediately preceding offset (other than 0)" by using the predicted candidate flag.
[0587] The syntax for when a prediction candidate flag is used will be described with reference to Fig. 40. Fig. 40 is a diagram showing syntax 2901 for when a prediction candidate flag is used. As shown in Fig. 40, a prediction candidate flag "sao_pred_flag" is added, and if "sao_pred_flag" = 0, the offset decoded immediately before (not 0) is set as the predicted value offsetp, and if "sao_pred_flag" = 1 or the first offset, the predicted value offsetp = 0. Note that in syntax 2901, "sao_offset_delta" represents the difference d from the predicted value, and "sao_offset[sao_curr_depth][ys][xs]" = "offsetp + d".
[0588] Note that the prediction candidate flag may not be used depending on the offset type. For example, the prediction candidate flag may not be used in the case of EO, and may be used in the case of BO. This is because empty classes often occur in BO depending on the distribution of pixel values.
[0589] Alternatively, a configuration may be adopted in which it is determined whether or not to perform predictive coding depending on the offset type. For example, a configuration may be adopted in which predictive coding is performed in the case of EO, and predictive coding is not performed in the case of BO.
[0590] (Appendix 9) Furthermore, in the above-mentioned third to seventh embodiments, the intra prediction mode may be used to estimate, restrict, or rearrange the edge offset class for each LCU.
[0591] The edge direction selected as the EO type of SAO is considered to be correlated with the intra prediction mode. Therefore, the intra prediction mode of the CU at the position corresponding to the QAOU of SAO can be used to select the EO class.
[0592] For example, the intra prediction mode can be used to estimate and determine the EO class, limit candidates for the EO class, or rearrange the order (index) of the EO classes in descending order of likelihood of selection.
[0593] This can be easily achieved particularly when the size of the block QAOU in each layer of the SAO is the same as the size of the CU, for example, when the image is divided so that the maximum size of the QAOU in the SAO is equal to the LCU size.
[0594] (Appendix 10) Conventional adaptive offset filters have many offset types (types and classes), which may require a large memory size. Therefore, this embodiment provides an image filter device or the like that can reduce block distortion while suppressing an increase in memory size.
[0595] The image filter device of the present invention is an image filter device that adds an offset selected from a plurality of offsets to each pixel value of an input image composed of a plurality of unit areas, and is equipped with an offset determination means that determines, for each unit area, an offset to be added to the pixel value of a pixel included in each unit area, and a filter means that adds the offset determined by the offset determination means to the pixel value of the pixel included in the unit area, wherein, when the size of the unit area for which the offset is to be determined is smaller than a predetermined size, the offset determination means determines the offset to be added to the pixel value of the pixel included in the unit area from among offsets that have a more limited number of selectable offsets than when the size of the unit area is equal to or larger than the predetermined size.
[0596] According to the above configuration, when the size of the unit area for which the offset is to be determined is smaller than a predetermined size, the offset to be added is determined from among offsets that are more limited than when the size of the unit area is equal to or larger than the predetermined size.
[0597] When the size of a unit area is small, the number of pixels contained therein is small, and the pixels are likely to have similar values. Therefore, when the size of a unit area is small, even if the number of selectable offsets is limited, the impact on the image after the offsets are applied is small. Furthermore, by limiting the number of selectable offsets, the required memory capacity can be reduced.
[0598] Therefore, with the above configuration, it is possible to reduce memory usage while minimizing the impact on the image after applying the offset. Furthermore, by reducing the number of selectable offsets, it is possible to reduce the amount of coding and improve coding efficiency.
[0599] In order to solve the above problem, the image filter device of the present invention is an image filter device that adds an offset to each pixel value of an input image composed of a plurality of unit areas, and is equipped with an offset determination means that determines, for each unit area, an offset to be added to the pixel value of a pixel included in the unit area, and a filter means that adds the offset determined by the offset determination means to the pixel value of the pixel included in the unit area, wherein, when the size of the unit area for which the offset is to be determined is smaller than a predetermined size, the filter means adds an offset with lower precision than when the size of the unit area is equal to or larger than the predetermined size.
[0600] According to the above configuration, when the size of the unit area for which the offset is to be determined is smaller than a predetermined size, an offset with lower accuracy is added than when the size of the unit area is equal to or larger than the predetermined size.
[0601] When the size of a unit area is small, the number of pixels contained therein is small, and the pixels are likely to have similar values. Therefore, when the size of a unit area is small, even if the offset precision is made coarse, the impact on quantization error is small. Therefore, the impact on the image after the offset is applied is also small. Furthermore, by making the offset precision coarse, the required memory capacity can be reduced.
[0602] Therefore, with the above configuration, it is possible to reduce the amount of memory used while minimizing the impact on the image after the offset is applied. Furthermore, by reducing the accuracy of the offset, it is possible to reduce the amount of code and improve coding efficiency.
[0603] The image filter device of the present invention is an image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to each pixel value of an input image consisting of a plurality of unit areas, and is equipped with an offset determination means that determines, for each unit area, the type of offset to be added to the pixel values of the pixels included in each unit area, and a filter means that adds an offset corresponding to the type of offset determined by the offset determination means to the pixel values of the pixels included in the unit area, wherein the offset determination means determines the type of offset to be a band offset (BO) when the pixel value of the target pixel to which the offset is to be added is near the maximum and minimum values, and determines the type of offset to be an edge offset (EO) for pixels in other value ranges.
[0604] According to the above configuration, when adaptive offsets are applied, band offsets are applied to pixels whose pixel values are near the maximum and minimum values, and edge offsets are applied to pixels in other value ranges.
[0605] In the high pixel value range and the low pixel value range, pixel values tend to be more susceptible to errors than edges, so the above configuration increases the efficiency of error correction and improves coding efficiency.
[0606] Furthermore, if a band offset and an edge offset are used in combination in one type, the number of types of adaptive offset can be reduced, and the amount of memory used and the amount of processing can be reduced.
[0607] In the above configuration, the band offset refers to an offset process in which one of a plurality of offsets is added to the pixel value of a pixel to be processed depending on the magnitude of the pixel value of the pixel to be processed (the same applies hereinafter). Also, in the above configuration, the edge offset refers to an offset process in which one of a plurality of offsets is added to the pixel value of a pixel to be processed depending on the difference between the pixel value of the pixel to be processed and the pixel values of the pixels surrounding the pixel to be processed (the same applies hereinafter).
[0608] In the image filter device according to the present invention, the offset determination means may determine a band offset for pixels whose pixel values are in the ranges from the minimum value to one-quarter of the maximum value and from three-quarters of the maximum value to the maximum value, and may determine an edge offset for pixels in other value ranges.
[0609] According to the above configuration, it is possible to clearly distinguish between pixels to which a band offset is applied and pixels to which an edge offset is applied.
[0610] The image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to an input image, and is characterized by comprising: a classification means that performs edge judgment to determine a class when applying an edge offset (EO) by referring only to pixels existing in the horizontal direction of a target pixel; and a filter means that, when applying an edge offset (EO), adds an offset corresponding to the class classified by the classification means.
[0611] According to the above configuration, since only horizontal pixels are referenced to determine edges, the amount of memory required can be reduced compared to when pixels above are also referenced. In addition, since boundary determination above is no longer necessary, the amount of processing can also be reduced.
[0612] In the image filtering device according to the present invention, the classifying means may determine an edge by referring to a pixel located two pixels away from the target pixel in the horizontal direction.
[0613] According to the above configuration, a pixel two pixels away from the target pixel is referenced, so that an edge can be detected even if the angle of the edge is shallow.
[0614] The image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to an input image, and is characterized by comprising: a classification means that determines a class when applying a band offset (BO) by dividing the division width of a class near a median value, which is the median value between the maximum and minimum values of pixel values indicating color difference, more finely than other value ranges; and a filter means that, when applying a band offset (BO), adds an offset corresponding to the class classified by the classification means.
[0615] According to the above configuration, the division width of the class near the median value, which is the center value between the maximum and minimum values of the pixel value indicating the color difference, is divided more finely than other value ranges, and the class when applying the band offset (BO) is determined.
[0616] When the color difference pixel value is the median, the pixel is achromatic. Achromatic color errors are easily noticeable to the human eye, resulting in a decrease in subjective image quality. Therefore, by subdividing the class width around the median, as in the above configuration, it is possible to set fine offsets for pixels around the median. This improves subjective image quality.
[0617] In the image filtering device according to the present invention, the filtering means may be configured to set the pixel value after adding the offset to the median value if the median value exists between the pixel value before adding the offset and the pixel value after adding the offset.
[0618] With the above configuration, an offset is not added that exceeds the median value. A pixel with a median color difference pixel value is achromatic, and the color perceived by the human eye changes on either side of the median. Therefore, with the above configuration, it is possible to prevent the color perceived by the human eye from changing due to the addition of an offset.
[0619] The image filter device according to the present invention is an image filter device that applies an adaptive offset (SAO: Sample Adaptive Offset) to an input image, and is characterized by including a filter means that adds an offset with higher precision to pixels whose pixel values indicating color difference are near a median value, which is the median value between the maximum and minimum values, than to pixels in other value ranges.
[0620] According to the above configuration, an offset with higher accuracy than that of pixels in other ranges is added to pixels whose pixel values indicating color difference are near the median value, which is the median value between the maximum and minimum values.
[0621] When the color difference pixel value is the median, the pixel is achromatic. Achromatic color errors are easily noticeable to the human eye, resulting in a decrease in subjective image quality. Therefore, by improving the accuracy of the offset to be added near the median, as in the above configuration, it is possible to add a fine offset to pixels near the median. This improves the subjective image quality.
[0622] The offset decoding device according to the present invention is an offset decoding device that decodes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and is characterized by comprising: offset residual decoding means that decodes each offset residual from encoded data; predicted value derivation means that derives a predicted value of each offset from an offset that has already been decoded or a predetermined value; and offset calculation means that calculates each offset from the predicted value derived by the predicted value derivation means and the offset residual decoded by the offset residual decoding means.
[0623] According to the above configuration, since the offset is decoded from the residual, the amount of code can be reduced compared to when the offset is encoded as is. Furthermore, since the predicted value for determining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the amount of code for the differential data can be prevented from becoming larger than when the differential data is encoded as is.
[0624] The predetermined value may be, for example, "0."
[0625] The offset coding device according to the present invention is an offset coding device that codes each offset referenced by an image filter that adds an offset to each pixel value of an input image, and is characterized by comprising: predicted value derivation means that derives a predicted value of each offset from an already-encoded offset or a predetermined value; offset residual calculation means that calculates an offset residual from each offset and the predicted value derived by the predicted value derivation means; and offset residual coding means that encodes the offset residual calculated by the offset residual calculation means.
[0626] According to the above configuration, since the offset is decoded from the residual, the amount of code can be reduced compared to when the offset is encoded as is. Furthermore, since the predicted value for determining the residual is derived from the decoded offset or a predetermined value, by using only the decoded offset, the amount of code for the differential data can be prevented from becoming larger than when the differential data is encoded as is.
[0627] The data structure of encoded data according to the present invention is a data structure of encoded data referenced by an image filter that adds an offset to each pixel value of an input image consisting of a plurality of unit regions, and includes predicted value derivation information that indicates whether a predicted value is to be derived from a decoded offset or a predetermined value, and the image filter derives a predicted value and decodes the offset by referring to the predicted value derivation information included in the encoded data.
[0628] According to the above configuration, it is possible to determine whether the predicted value is to be a decoded offset or a predetermined value, based on the predicted value derivation information.
[0629] (Application example) The above-mentioned video decoding device 1 (1') and video encoding device 2 (2') can be installed and used in various devices that transmit, receive, record, and play back video. 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.
[0630] First, it will be explained with reference to FIG. 45 that the above-described video decoding device 1 and video encoding device 2 can be used for transmitting and receiving videos.
[0631] Fig. 45(a) is a block diagram showing the configuration of a transmitting device A equipped with a video encoding device 2. As shown in Fig. 45(a), the transmitting device A includes an encoding unit A1 that obtains encoded data by encoding a video, a modulation unit A2 that obtains a modulated signal by modulating a carrier wave with the encoded data obtained by the encoding unit A1, and a transmitting unit A3 that transmits the modulated signal obtained by the modulation unit A2. The above-mentioned video encoding device 2 is used as this encoding unit A1.
[0632] The transmitting device A may further include a camera A4 for capturing moving images, a recording medium A5 for recording moving images, an input terminal 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 A1. Figure 45(a) shows an example of a configuration in which the transmitting device A includes all of these components, but some of them may be omitted.
[0633] The recording medium A5 may be one that records unencoded moving images, or one that records moving images that have been encoded using an encoding method for recording that is different from the encoding method for transmission. In the latter case, it is preferable to interpose a decoding unit (not shown) between the recording medium A5 and the encoding unit A1, which decodes the encoded data read from the recording medium A5 according to the encoding method for recording.
[0634] Fig. 45(b) is a block diagram showing the configuration of a receiving device B equipped with a video decoding device 1. As shown in Fig. 45(b), the receiving device B includes a receiving unit B1 that receives a modulated signal, a demodulating unit B2 that obtains coded data by demodulating the modulated signal received by the receiving unit B1, and a decoding unit B3 that obtains video by decoding the coded data obtained by the demodulating unit B2. The above-mentioned video decoding device 1 is used as this decoding unit B3.
[0635] The receiving device B may further include a display B4 for displaying the moving image, a recording medium B5 for recording the moving image, and an output terminal B6 for outputting the moving image to the outside, as destinations for the moving image output by the decoding unit B3. Figure 45(b) shows an example of a configuration in which the receiving device B includes all of these, but some of them may be omitted.
[0636] The recording medium B5 may be for recording unencoded video, or may be encoded using 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 B3 and the recording medium B5, which encodes the video acquired from the decoding unit B3 according to the encoding method for recording.
[0637] 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 broadcasting, wired broadcasting, wireless communication, and wired communication.
[0638] 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 A / receiving device B that transmits and receives modulated signals via 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 A / receiving device B that transmits and receives modulated signals via cable broadcasting.
[0639] Furthermore, a server (such as a workstation) and a client (such as a television receiver, personal computer, or smartphone) of an Internet-based video-on-demand (VOD) service or video sharing service are examples of a transmitter A and a receiver B that transmit and receive modulated signals via communication (usually, a LAN uses either a wireless or wired transmission medium, while a WAN uses a wired transmission medium). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Smartphones also include multi-function mobile phone terminals.
[0640] The client of the video hosting service has the function of not only decoding the encoded data downloaded from the server and displaying it on a display, but also encoding the video images captured by the camera and uploading them to the server. In other words, the client of the video hosting service functions as both a transmitting device A and a receiving device B.
[0641] Next, it will be explained with reference to FIG. 46 that the above-described video decoding device 1 and video encoding device 2 can be used for recording and reproducing video.
[0642] Fig. 46(a) is a block diagram showing the configuration of a recording device C equipped with the above-mentioned video encoding device 2. As shown in Fig. 46(a), the recording device C includes an encoding unit C1 that obtains encoded data by encoding a video, and a writing unit C2 that writes the encoded data obtained by the encoding unit C1 onto a recording medium M. The above-mentioned video encoding device 2 is used as this encoding unit C1.
[0643] The recording medium M may be (1) a type that is built into the recording device C, such as an HDD (Hard Disk Drive) or an SSD (Solid State Drive), (2) a type that is connected to the recording device C, such as an SD memory card or a USB (Universal Serial Bus) flash memory, or (3) a type that is loaded into a drive device (not shown) built into the recording device C, such as a DVD (Digital Versatile Disc) or a BD (Blu-ray Disc: registered trademark).
[0644] The recording device C may further include a camera C3 for capturing moving images, an input terminal C4 for inputting moving images from the outside, a receiving unit C5 for receiving moving images, and an image processing unit C6 for generating or processing images, as a source of moving images to be input to the encoding unit C1. Although Fig. 46(a) illustrates a configuration in which the recording device C includes all of these components, some of them may be omitted.
[0645] The receiving unit C5 may receive unencoded video, or may receive encoded data encoded by a transmission encoding method different from the recording encoding method. In the latter case, a transmission decoding unit (not shown) that decodes the encoded data encoded by the transmission encoding method may be interposed between the receiving unit C5 and the encoding unit C1.
[0646] Examples of such a recording device C include a DVD recorder, a BD recorder, and an HD (Hard Disk) recorder (in this case, the input terminal C4 or the receiving unit C5 is the main source of the moving images).Other examples of such a recording device C include a camcorder (in this case, the camera C3 is the main source of the moving images), a personal computer (in this case, the receiving unit C5 or the image processing unit C6 is the main source of the moving images), and a smartphone (in this case, the camera C3 or the receiving unit C5 is the main source of the moving images).
[0647] Fig. 46(b) is a block diagram showing the configuration of a playback device D equipped with the above-mentioned video decoding device 1. As shown in Fig. 46(b), the playback device D includes a reading unit D1 that reads coded data written to a recording medium M, and a decoding unit D2 that obtains video by decoding the coded data read by the reading unit D1. The above-mentioned video decoding device 1 is used as this decoding unit D2.
[0648] The recording medium M may be (1) a type that is built into the playback device D, such as an HDD or SSD, (2) a type that is connected to the playback device 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 D, such as a DVD or BD.
[0649] Furthermore, the playback device D may further include, as destinations of the video output by the decoding unit D2, a display D3 that displays the video, an output terminal D4 that outputs the video to the outside, and a transmission unit D5 that transmits the video. Figure 46(b) shows an example of a configuration in which the playback device D includes all of these, but some of them may be omitted.
[0650] The transmitter D5 may transmit unencoded video, or may transmit encoded data encoded by a transmission encoding method different from the recording encoding method. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoder D2 and the transmitter D5, which encodes the video by the transmission encoding method.
[0651] Examples of such a playback device D include a DVD player, a BD player, and an HDD player (in this case, the output terminal D4 to which a television receiver or the like is connected is the main destination of the moving images). Other examples of such a playback device D include a television receiver (in this case, the display D3 is the main destination of the moving images), a desktop PC (in this case, the output terminal D4 or the transmission unit D5 is the main destination of the moving images), a laptop or tablet PC (in this case, the display D3 or the transmission unit D5 is the main destination of the moving images), a smartphone (in this case, the display D3 or the transmission unit D5 is the main destination of the moving images), and a digital signage (also called an electronic billboard or electronic bulletin board, and the display D3 or the transmission unit D5 is the main destination of the moving images).
[0652] (Software configuration) Finally, each block of the video decoding device 1 (1') and the video encoding device 2 (2'), in particular the variable-length code decoding unit 13, the motion vector restoration unit 14, the inter-prediction image generation unit 16, the intra-prediction image generation unit 17, the prediction method determination unit 18, the inverse quantization and inverse transform unit 19, the deblocking filter 41, the adaptive filter 50, the adaptive offset filter 60 (60'), the transform and quantization unit 21, the variable-length code encoding unit 22, the inverse quantization and inverse transform unit 23, the intra-prediction image generation unit 25, the inter-prediction image generation unit 26, the motion vector detection unit 27, the prediction method control unit 28, the motion vector redundancy elimination unit 29, the deblocking filter 33, the adaptive filter 70, and the adaptive offset filter 80 (80'), 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).
[0653] In the latter case, the video decoding device 1 and the video encoding device 2 each include a CPU that executes instructions of a control program that realizes each function, a ROM (read only memory) that stores the program, a RAM (random access memory) that expands the program, and storage devices (recording media) such as memory that stores the program and various data. The object of the present invention can also be achieved by supplying a recording medium on which program code (executable program, intermediate code program, source program) of the control program of the video decoding device 1 and the video encoding device 2, which is software that realizes the above-mentioned functions, is recorded in a computer-readable manner to the video decoding device 1 and the video encoding device 2, and having the computer (or CPU or MPU (micro processing unit)) read and execute the program code recorded on the recording medium.
[0654] Examples of the recording medium that can be used include tapes such as magnetic tape and cassette tape, 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), and CD-Rs (CD Recordable), 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).
[0655] Furthermore, the video decoding device 1 and the video encoding device 2 may be configured to be connectable to a communication network, and the program code may be supplied via the communication network. This communication network may be any network capable of transmitting the program code. For example, the Internet, an intranet, an extranet, a local area network (LAN), an integrated services digital network (ISDN), a value-added network (VAN), a community antenna television / cable television (CATV) communication network, a virtual private network, a telephone line network, a mobile communication network, a satellite communication network, etc. Furthermore, the transmission medium constituting this communication network may be any medium capable of transmitting the program code, and is not limited to a specific configuration or type. For example, the present invention can be implemented using wired te...
Claims
1. A video encoding device (2) An adaptive offset filter (80), setting an offset bit depth (SAO_DEPTH) of the offset value based on a bit depth (PIC_DEPTH) of the pixel value of the pixel; setting an offset range using the offset bit depth (SAO_DEPTH), where the maximum bit length representing the offset range is SAO_DEPTH-K, and the value of K is equal to 4; QAOU information, offset type designation information (OTI) that designates an offset type and an offset group including a plurality of offsets, the offsets being restricted to be within the offset value range; generating QAOU information, including: an adaptive offset filter (80) configured to: a variable-length code encoding unit (22) configured to generate encoded data (#3), the encoded data including the QAOU information including the offset constrained to be within the offset value range; A video encoding device (2) comprising:
2. 2. The apparatus of claim 1, wherein the adaptive offset filter (80) is specifically configured to set the offset bit depth (SAO_DEPTH) to be equal to the bit depth (PIC_DEPTH) of the pixel values when the bit depth (PIC_DEPTH) of the pixel values is 10 bits or less, and to set the offset bit depth (SAO_DEPTH) to be 10 bits when the bit depth (PIC_DEPTH) of the pixel values is 11 bits or more.
3. 3. The apparatus according to claim 1, wherein the offset range is within -2 (SAO_DEPTH-K-1) to 2 (SAO_DEPTH-K-1) -1.
4. The apparatus of claim 1 , wherein the adaptive offset filter (80) is further configured to perform a bitwise right shift on the offset value.
5. The apparatus of claim 4 , wherein the shift value is set based on the bit depth (PIC_DEPTH) of the pixel value.
6. A video encoding method setting an offset bit depth (SAO_DEPTH) of the offset value based on a bit depth (PIC_DEPTH) of the pixel value of the pixel; setting an offset range using the offset bit depth (SAO_DEPTH), where the maximum bit length representing the offset range is equal to SAO_DEPTH-K, and the value of K is equal to 4; QAOU information, offset type designation information (OTI) that designates an offset type and an offset group including a plurality of offsets, the offsets being restricted to be within the offset value range; generating QAOU information, generating encoded data (#3), the encoded data including the QAOU information including the offset constrained to be within the offset range; A video encoding method comprising:
7. 7. The method of claim 6, wherein when the bit depth (PIC_DEPTH) of the pixel value is 10 bits or less, the offset bit depth (SAO_DEPTH) is set to be equal to the bit depth (PIC_DEPTH) of the pixel value, and when the bit depth (PIC_DEPTH) of the pixel value is 11 bits or more, the offset bit depth (SAO_DEPTH) is set to be 10 bits.
8. The method according to claim 6 or 7, wherein the offset range is within −2 (SAO_DEPTH-K−1) to 2 (SAO_DEPTH-K−1) −1.
9. performing a bitwise right shift on the offset value.
9. The method of claim 6, further comprising:
10. The method of claim 9 , wherein the shift value is set based on the bit depth (PIC_DEPTH) of the pixel value.
Citation Information
Patent Citations
Quality-scalable encoding method
JP2010507941A
Image encoding apparatus and method for the same and image decoding apparatus and method for the same
US20090087111A1
Quality scalable coding
US20100020866A1
Image coding apparatus and method, and image decoding apparatus and method
WO2007114368A1