Image decoding device and image encoding device
Patent Information
- Application Number
- JP2021139492
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2020-12-23
- Filing Date
- 2021-08-30
- Publication Date
- 2024-09-02
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In existing image coding methods like H.264/AVC and HEVC, the Golomb-Rice coding for transform coefficients can lead to decreased coding efficiency when the absolute value of the transform coefficient is large and the Rice parameter is small, particularly in professional video applications where quantization width is small, resulting in saturation and reduced efficiency.
An image decoding device that decodes syntax elements representing transform coefficients using Golomb-Rice coding with weighted sum of surrounding coefficients, adjusting the Rice parameter through a correction term and shift value, which varies based on block size to improve coding efficiency.
The solution effectively addresses the efficiency loss by deriving appropriate Rice parameters, enhancing coding efficiency even for large transform coefficients, thereby improving image decoding performance.
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to an image decoding apparatus and an image encoding apparatus.
Background Art
[0002] To efficiently transmit or record an image, an image encoding apparatus that generates encoded data by encoding an image, and an image decoding apparatus that generates a decoded image by decoding the encoded data are used.
[0003] Specific image encoding methods include, for example, the H.264 / AVC and HEVC (High-Efficiency Video Coding) methods.
[0004] In such an image encoding method, an image (picture) constituting a moving image is managed by a hierarchical structure composed of a slice obtained by dividing the image, a coding tree unit (CTU) obtained by dividing the slice, a coding unit (sometimes called a Coding Unit: CU) obtained by dividing the coding tree unit, and a transform unit (TU) obtained by dividing the coding unit, and is encoded / decoded for each CU.
[0005] Also, in such an image encoding method, usually, a prediction image is generated based on a local decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes called a "difference image" or "residual image") obtained by subtracting the prediction image from the input image (original image) is encoded. Methods for generating a prediction image include inter-prediction (inter prediction) and intra-prediction (intra prediction).
[0006] Furthermore, Non-Patent Document 1 can be cited as an example of recent image coding and decoding technology. Non-Patent Document 1 describes a method to improve coding efficiency in which, when decoding syntax elements representing the absolute values of conversion coefficients, the absolute values of the conversion coefficients are converted to binary using Golomb-Rice coding and then decoded using bypass coding. Syntax elements include, for example, abs_remainder and dec_abs_level. Golomb-Rice coding is derived using Rice parameters derived by referencing the absolute values of surrounding coefficients. In particular, this is achieved by calculating the sum of the absolute values of surrounding coefficients and using the values clipped to 0-31 to derive the Rice parameters from a table. [Prior art documents] [Non-patent literature]
[0007] [Non-Patent Document 1] "Versatile Video Coding (Draft 10)", JVET-S2001, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11 [Overview of the project] [Problems that the invention aims to solve]
[0008] In the technology described in Non-Patent Document 1, when the absolute value of the conversion coefficient is large and the value of the Rice parameter is small, the amount of code increases due to binarization using Golomb-Rice coding, which can reduce coding efficiency. In particular, in professional video, the absolute value of the coefficient tends to be large because the quantization width is small. In such cases, if the Rice parameter is derived using the table in Non-Patent Document 1, there is an upper limit to the Rice parameter value, so if the conversion coefficient value is large, it saturates and the coding efficiency decreases. [Means for solving the problem]
[0009] To solve the above problems, an image decoding device according to one aspect of the present invention includes a TU decoding unit that decodes syntax elements (abs_remainder, dec_abs_level) representing the absolute value of the conversion coefficient from encoded data, and the TU decoding unit is characterized in that it decodes abs_remainder and dec_abs_level using Golomb-Rice coding with Rice parameters.
[0010] The TU decoding unit is characterized by weighting the sum of the absolute values of the decoded surrounding transformation coefficients, adding a correction term and a weighted term for the state variable, and then shifting the result by a shift value to derive the Rice parameter.
[0011] The aforementioned weights, correction terms, and weights related to state variables are characterized by differing depending on the block size.
[0012] By adopting this configuration, even when the absolute value of the conversion coefficient is large, the encoding efficiency is improved by deriving appropriate Rice parameters corresponding to the absolute value of the conversion coefficient. [Effects of the Invention]
[0013] With the above configuration, it is possible to solve any of the above problems. [Brief explanation of the drawing]
[0014] [Figure 1] This is a schematic diagram showing the configuration of the image transmission system according to this embodiment. [Figure 2] This figure shows the configuration of a transmitting device equipped with a video encoding device and a receiving device equipped with a video decoding device according to this embodiment. PROD_A shows the transmitting device equipped with a video encoding device, and PROD_B shows the receiving device equipped with a video decoding device. [Figure 3]It is a diagram showing the configuration of a recording device equipped with a moving image encoding device and a playback device equipped with a moving image decoding device according to this embodiment. PROD_C indicates a recording device equipped with a moving image encoding device, and PROD_D indicates a playback device equipped with a moving image decoding device. [Figure 4] It is a diagram showing the hierarchical structure of the data of the encoded stream. [Figure 5] It is a diagram showing an example of CTU division. [Figure 6] It is a schematic diagram showing the configuration of a moving image decoding device. [Figure 7] It is a flowchart for explaining the schematic operation of a moving image decoding device. [Figure 8] It is a schematic diagram showing the configuration of a TU decoding unit. [Figure 9] It is a diagram showing the syntax elements related to quantization transform coefficients. [Figure 10] It is a diagram showing the syntax elements related to quantization transform coefficients. [Figure 11a] It is a syntax table related to RRC. [Figure 11b] It is a syntax table related to RRC. [Figure 11c] It is a syntax table related to RRC. [Figure 12a] It is a syntax table related to TSRC. [Figure 12b] It is a syntax table related to TSRC. [Figure 13] It is a block diagram showing the configuration of a moving image encoding device. [Figure 14] It is a diagram related to the derivation of the Rice parameter. [Figure 15] It is a derivation table of a, b, c using the block index according to this embodiment [Figure 16] It is an example of deriving the Rice parameter from the intermediate estimated value val according to this embodiment. [Figure 17] It is an example of deriving the Rice parameter from locSumAbs(=locSumAbs0) according to this embodiment. [Figure 18] This is an example of a syntax table for the prediction coefficients of the rice parameters according to this embodiment. [Modes for carrying out the invention]
[0015] [Embodiment 1] Embodiments of the present invention will be described below with reference to the drawings.
[0016] Figure 1 is a schematic diagram showing the configuration of the image transmission system 1 according to this embodiment.
[0017] Image transmission system 1 is a system that transmits an encoded stream containing an image to be encoded, decodes the transmitted encoded stream, and displays the image. Image transmission system 1 consists of a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and an image display device (image display device) 41.
[0018] The video encoding device 11 receives image T as input.
[0019] Network 21 transmits the encoded stream Te generated by the video encoding device 11 to the video decoding device 31. Network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination thereof. Network 21 is not necessarily limited to a bidirectional communication network; it may also be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting or satellite broadcasting. Furthermore, network 21 may be replaced by a storage medium that records the encoded stream Te, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blu-ray Disc: registered trademark).
[0020] The video decoding device 31 decodes each of the encoded streams Te transmitted by the network 21 and generates one or more decoded images Td.
[0021] The image display device 41 displays all or part of one or more decoded images Td generated by the moving image decoding device 31. The image display device 41 includes, for example, a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. Examples of the form of the display include stationary, mobile, HMD, etc. Also, when the moving image decoding device 31 has high processing power, an image with high image quality is displayed, and when it has only lower processing power, an image that does not require high processing power and display ability is displayed.
[0022] <Operator> The operators used in this specification are described below.
[0023] >> is a right bit shift, << is a left bit shift, & is a bitwise AND, | is a bitwise OR, |= is an OR assignment operator, and || indicates a logical OR.
[0024] x?y:z is a ternary operator that takes y when x is true (non-zero) and z when x is false (0).
[0025] Clip3(a, b, c) is a function that clips c to a value between a and b. When c < a, it returns a, when c > b, it returns b, and in other cases, it returns c (where a <= b).
[0026] abs(a) is a function that returns the absolute value of a.
[0027] Int(a) is a function that returns the integer value of a.
[0028] floor(a) is a function that returns the smallest integer less than or equal to a.
[0029] ceil(a) is a function that returns the largest integer greater than or equal to a.
[0030] a / d represents the division of a by d (truncating the decimal part).
[0031] <Structure of the coded stream Te> Prior to a detailed description of the video encoding device 11 and video decoding device 31 according to this embodiment, the data structure of the encoded stream Te generated by the video encoding device 11 and decoded by the video decoding device 31 will be described.
[0032] Figure 4 shows the hierarchical structure of data in the encoded stream Te. The encoded stream Te includes, exemplarily, a sequence and multiple pictures that make up the sequence. Figure 4 shows, respectively, an encoded video sequence that defines sequence SEQ, an encoded picture that defines picture PICT, an encoded slice that defines slice S, encoded slice data that defines slice data, an encoded tree unit contained in the encoded slice data, and an encoded unit contained in the encoded tree unit.
[0033] (Encoded video sequence) In an encoded video sequence, a set of data that the video decoding device 31 references to decode the sequence SEQ to be processed is defined. As shown in the encoded video sequence in Figure 4, the sequence SEQ includes a Video Parameter Set, a Sequence Parameter Set SPS, a Picture Parameter Set PPS, a Picture Header, a Picture PICT, and Supplemental Enhancement Information SEI.
[0034] The Video Parameter Set (VPS) defines a set of encoding parameters common to multiple images in an image composed of multiple layers, as well as a set of encoding parameters associated with the multiple layers included in the image and each individual layer.
[0035] The sequence parameter set (SPS) defines a set of encoding parameters that the video decoding device 31 references to decode the target sequence. For example, the width and height of the picture are defined. Multiple SPSs may exist. In that case, one of the multiple SPSs is selected from the PPS.
[0036] The Picture Parameter Set (PPS) defines a set of encoding parameters that the video decoding device 31 references to decode each picture in the target sequence. For example, it includes a reference value for the quantization width used for decoding the picture (pic_init_qp_minus26), a flag indicating the application of weighted prediction (weighted_pred_flag), and a scaling list (quantization matrix). Multiple PPSs may exist. In that case, one of the multiple PPSs is selected for each picture in the target sequence.
[0037] The picture header defines encoding parameters common to all slices contained within a single encoded picture. These include, for example, the Picture Order Count (POC) and encoding parameters related to the splitting.
[0038] (Encoded picture) The encoded picture defines the set of data that the video decoding device 31 references to decode the picture PICT to be processed. The picture PICT includes slices 0 to NS-1 (NS being the total number of slices included in the picture PICT), as shown in the encoded picture in Figure 4.
[0039] In the following, if it is not necessary to distinguish between slices 0 through NS-1, the code subscripts may be omitted. The same applies to other data included in the coded stream Te described below that have subscripts.
[0040] (Encoded slice) In an encoded slice, a set of data that the video decoding device 31 references to decode the slice S to be processed is defined. As shown in the encoded slice in Figure 4, the slice includes a slice header and slice data.
[0041] The slice header contains a set of encoding parameters that the video decoding device 31 references to determine the decoding method for the target slice. The slice type specification information (slice_type), which specifies the slice type, is an example of the encoding parameters included in the slice header.
[0042] The slice types that can be specified by the slice type specification information include (1) I slices that use only intra prediction during encoding, (2) P slices that use unidirectional prediction or intra prediction during encoding, and (3) B slices that use unidirectional prediction, bidirectional prediction or intra prediction during encoding. Note that interpretation is not limited to single or bidirectional prediction, and prediction images may be generated using more reference pictures. Hereinafter, when referring to P slices and B slices, it refers to slices that contain blocks on which interpretation can be used.
[0043] The slice header may also include a reference to the picture parameter set PPS (pic_parameter_set_id).
[0044] (Encoded slice data) The encoded slice data defines the set of data that the video decoding device 31 references to decode the slice data to be processed. The slice data includes a CTU, as shown in the encoded slice header of Figure 4. A CTU is a fixed-size (e.g., 64x64) block that makes up a slice, and is sometimes called a Largest Coding Unit (LCU).
[0045] (Code tree unit) The coding tree unit in Figure 4 defines the set of data that the video decoding device 31 references to decode the CTU to be processed. The CTU is divided into coding units CU, which are the basic units of coding processing, by recursive quad tree partitioning (QT), binary tree partitioning (BT), or ternary tree partitioning (TT). BT and TT partitioning together are called multi-tree partitioning (MT). The nodes of the tree structure obtained by recursive quad tree partitioning are called coding nodes. The intermediate nodes of quad trees, binary trees, and ternary trees are coding nodes, and the CTU itself is defined as the top-level coding node.
[0046] The CT includes a splitting flag as part of the CT information, indicating whether or not to perform a QT split. Figure 5 shows an example of a split.
[0047] A CU is the terminal node of an encoding node and cannot be further subdivided. A CU is the basic unit of the encoding process.
[0048] (Encoding Unit) As shown in the coding unit of Figure 4, a set of data that the video decoding device 31 references to decode the coding unit to be processed is defined. Specifically, the CU consists of a CU header CUH, prediction parameters, transformation parameters, quantization transformation coefficients, etc. The prediction mode, etc., is defined in the CU header.
[0049] Prediction processing can be performed at the CU (Unit) level or at the subCU level, which is a further division of the CU. If the size of the CU and the subCU are equal, there is one subCU within the CU. If the CU is larger than the size of the subCU, the CU is divided into subCUs. For example, if the CU is 8x8 and the subCU is 4x4, the CU will be divided into four subCUs, each consisting of two horizontal and two vertical divisions.
[0050] The prediction types (prediction mode, CuPredMode) include at least two: intra-prediction (MODE_INTRA) and inter-prediction (MODE_INTER). It may also include intra-block copy prediction (MODE_IBC). Intra-prediction and intra-block copy prediction are predictions within the same picture, while inter-prediction refers to prediction processing performed between different pictures (e.g., between display times, between layer images).
[0051] The transformation and quantization processes are performed in units of CUs, but the quantization transformation coefficients may be entropy-encoded in subblock units such as 4x4.
[0052] The predicted image is derived from the prediction parameters associated with the block. These prediction parameters include intra-prediction and inter-prediction parameters.
[0053] (Configuration of the video decoding device) The configuration of the video decoding device 31 (Figure 6) according to this embodiment will be described below.
[0054] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (predictive image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (predictive image generation device) 308, an inverse quantization / inverse transform unit 311, and an addition unit 312. Note that, in accordance with the video encoding device 11 described later, there is also a configuration in the video decoding device 31 that does not include the loop filter 305.
[0055] The parameter decoding unit 302 further comprises a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), with the CU decoding unit 3022 comprising a TU decoding unit 3024. These may be collectively referred to as a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, and PPS, and slice headers (slice information) from the encoded data. The CT information decoding unit 3021 decodes CT from the encoded data. The CU decoding unit 3022 decodes CU from the encoded data. The TU decoding unit 3024 decodes the transform_skip_flag, QP update information (quantization correction value), and quantization transformation coefficients (residual_coding) from the encoded data.
[0056] The TU decoding unit 3024 decodes transform_skip_flag[x0][y0][cIdx] if the size of the transformation unit (tbWidth and tbHeight) is less than or equal to a predetermined maximum size (tbWidth <= MaxTsSize && tbHeight <= MaxTsSize).
[0057] The TU decoding unit 3024 decodes the QP update information and quantization transformation coefficients from the encoded data if the TU contains a prediction error (for example, if tu_cbf_luma[x0][y0] is 1). Multiple modes (e.g., RRC mode and TSRC mode) may be provided for the derivation of the quantization transformation coefficients. Specifically, different processing may be performed for the derivation of the prediction error using transformation (RRC: Regular Residual Coding) and for the derivation of the prediction error in transformation-skip mode without transformation (TSRC: Transform Skip Residual Coding). The QP update information is the difference value from the quantization parameter prediction value qPpred, which is the predicted value of the quantization parameter QP.
[0058] Furthermore, while the following examples use CTU and CU as processing units, processing may be performed in sub-CU units, or the system may be reinterpreted as blocks (CTU and CU) and sub-CU as sub-blocks (sub-CU), and processing may be performed in block or sub-block units.
[0059] The entropy decoding unit 301 performs entropy decoding on the encoded stream Te input from an external source and parses the individual codes (syntax elements). Entropy coding can be performed in two ways: one method uses a context (probability model) adaptively selected according to the type of syntax element and the surrounding circumstances to encode the syntax elements to a variable length, and the other uses a predetermined table or formula to encode the syntax elements to a variable length. An example of the former is CABAC (Context Adaptive Binary Arithmetic Coding). The parsed codes include prediction information for generating a predicted image and prediction errors for generating a difference image.
[0060] The entropy decoding unit 301 outputs the separated codes to the parameter decoding unit 302. The separated codes are, for example, the prediction mode CuPredMode. The control of which codes to decode is performed based on the instructions of the parameter decoding unit 302.
[0061] (Basic Flow) Figure 7 is a flowchart illustrating the general operation of the video decoding device 31.
[0062] (S1100: Parameter set information decoding) The header decoding unit 3020 decodes parameter set information such as VPS, SPS, PPS, SEI, and PH from the encoded data.
[0063] (S1200: Slice information decoding) The header decoding unit 3020 decodes the slice header (slice information) from the encoded data.
[0064] The video decoding device 31 then derives a decoded image for each CTU by repeating the processing from S1300 to S5000 for each CTU included in the target picture.
[0065] (S1300: CTU information decoding) The CT information decoding unit 3021 decodes the CTU from the encoded data.
[0066] (S1400: CT information decoding) The CT information decoding unit 3021 decodes the CT from the encoded data.
[0067] (S1500: CU Decoding) The CU decoding unit 3022 performs S1510 and S1520 to decode the CU from the encoded data. The CU decoding unit 3022 also decodes the difference CuQpDeltaVal of the quantization parameters in units of CU from the encoded data and derives the quantization parameters.
[0068] (S1510: CU information decoding) The CU decoding unit 3022 decodes CU information, prediction information, TU splitting flag split_transform_flag, CU residual flags cbf_cb, cbf_cr, cbf_luma, etc. from the encoded data.
[0069] (S1520: TU information decoding) The TU decoding unit 3024 decodes the QP update information and quantization conversion coefficients from the encoded data if the TU contains a prediction error.
[0070] (S2000: Predictive image generation) The predictive image generation unit 308 generates a predictive image for each block included in the target CU based on the prediction information.
[0071] (S3000: Inverse Quantization / Inverse Transform) The inverse quantization / inverse transform unit 311 performs inverse quantization / inverse transform processing for each TU included in the target CU.
[0072] (S4000: Decoded image generation) The summing unit 312 generates a decoded image of the target CU by adding the predicted image supplied from the predicted image generation unit 308 and the prediction error supplied from the inverse quantization / inverse transformation unit 311.
[0073] (S5000: Loop Filter) The loop filter 305 applies loop filters such as a deblocking filter, SAO (Sample Adaptive Filter), and ALF (Adaptive Loop Filter) to the decoded image to generate a decoded image.
[0074] (Derivation of quantization conversion coefficients, residual coding) In lossless encoding or when the inter-pixel correlation of the original image is small, encoding efficiency may be higher if no transformation is performed. The technique of not performing a transformation is called Transform Skip. Transform Skip, also known as Identical Transform, only scales the transformation coefficients according to the quantization parameters. Whether a transformation is being skipped is indicated using the syntax element transform_skip_flag. transform_skip_flag may also be indicated for each color component (cIdx) of Y, Cb, and Cr.
[0075] The derivation of the prediction error using a normal transformation (RRC: Regular Residual Coding) and the derivation of the prediction error in transformation-skip mode (TSRC: Transform Skip Residual Coding) differ in both the coding and decoding methods for the prediction error.
[0076] Figure 8 is a block diagram of the TU decoding unit 3024, which includes the RRC unit 30241 and the TSRC unit 30242. The RRC unit 30241 is a processing unit that derives the normal prediction error using transformations, and the TSRC unit 30242 is a processing unit that derives the prediction error in transformation skip mode.
[0077] Figure 9(a) shows that sps_transform_skip_enabled_flag is a flag indicating whether or not transform_skip_flag is notified at each TU. sps_transform_skip_enabled_flag=1 indicates that transform_skip_flag is not notified at each TU. sps_transform_skip_enabled_flag=0 indicates that transform_skip_flag is not notified at each TU. If sps_transform_skip_enabled_flag is not notified, it is presumed to be 0.
[0078] In Figure 10(b), transform_skip_flag[x0][y0][cIdx] indicates whether a transformation is applied to the block with top-left coordinates (x0,y0) and color component cIdx. If transform_skip_flag=1 (transformation skip mode), no transformation is applied to this block. If transform_skip_flag=0, whether a transformation is applied to this block depends on other parameters.
[0079] Figures 11 and 12 show the syntax for encoding conversion coefficients (prediction errors) in RRC and TSRC.
[0080] (RRC section, RRC mode) In a normal prediction error coding method that does not skip transformations (Figure 11), the RRC unit 30241 decodes a syntax element (not shown) indicating the LAST position and derives the LAST position (LastSignificantCoeffX, LastSignificantCoeffY). The LAST position is the position of the last non-zero coefficient when scanning the transformation coefficients of the TU from low-frequency components to high-frequency components. When encoding and decoding the transformation coefficients (coefficients) in order from high-frequency components, the LAST position indicates the position of the first quantization transformation coefficient to be decoded. Next, the RRC unit 30241 decodes sb_coded_flag by referring to the LAST position. sb_coded_flag is a flag indicating whether or not a subblock contains a non-zero coefficient. A subblock is a region obtained by dividing the TU into 4x4 units. If sb_coded_flag=1 (a non-zero coefficient is included in the subblock), the RRC unit 30241 decodes sig_coeff_flag. sig_coeff_flag is a flag indicating whether the coefficient value is non-zero. If sig_coeff_flag=1 (the coefficient value is non-zero), the RRC unit 30241 decodes abs_level_gtx_flag, par_level_flag, abs_remainder, and dec_abs_level. These are syntax elements that indicate the absolute value of the coefficient. abs_level_gtx_flag[n][j] is a flag indicating whether the absolute value of the coefficient at scan position n is greater than (j<<1)+1. If abs_level_gtx_flag[n][j] is not notified, it is assumed to be 0. par_level_flag[n] is the parity of the coefficient at scan position n. If par_level_flag[n][j] is not notified, it is assumed to be 0. abs_remainder[n] represents the remaining absolute value of the coefficient at scan position n and is decoded using the Golomb-Rice code. If abs_remainder[n] is not notified, it is assumed to be 0. dec_abs_level[n] is the absolute value of the residual used to derive the absolute value of the coefficient at scan position n. If dec_abs_level[n] is not notified, it is assumed to be 0.RRC section 30241 derives the absolute value of the coefficient from these syntax elements.
[0081] As described above, the RRC unit 30241 is characterized by decoding the LAST position in the subblock of the TU.
[0082] (TSRC section, TSRC mode) In the prediction error coding method when no transformation is performed (transformation skip mode) (Figure 12), the TSRC unit 30242 decodes the sb_coded_flag of each subblock. If sb_coded_flag=1 (the subblock contains a non-zero coefficient), the TSRC unit 30242 decodes the sig_coeff_flag[xC][yC] of the transformation coefficient at position (xC, xC) within the subblock. If sig_coeff_flag=1 (the coefficient value is non-zero), the TSRC unit 30242 decodes coeff_sign_flag, abs_level_gtx_flag, par_level_flag, and abs_remainder. These are syntax elements that indicate the absolute value of the coefficient, and their definitions are as described above. The TSRC unit 30242 derives the absolute value of the coefficient from these syntax elements.
[0083] As described above, a key feature of the TSRC unit 30242 is that it does not decode the LAST position in the subblock of the TU.
[0084] (Decryption of abs_remainder and dec_abs_level) The TU decoder 3024 decodes the syntax value of the absolute value of the residual (abs_remainder or dec_abs_level, hereinafter referred to as the residual) from the encoded data using the Rice parameter cRiceParam. For the binaryization of the syntax, a code composed of a prefix and a suffix is used. As the prefix and suffix, the alpha code of the Golomb-Rice code and fixed-length binaryization may be used. The suffix may use the EG(k) (Exponential-Golomb code) code. In the Golomb-Rice code, the prefix is encoded by dividing it into prefixValTR and suffixValTR, and in the EG(k) code, the suffix is encoded by dividing it into the exp part expVal and the escape part escapeVal. The quotients obtained by dividing the residual (abs_remainder or dec_abs_level) by 1<<cRiceParam and ((1<<expVal)-1)<<cRiceParam are encoded using prefixValTR and expVal, respectively. The remainders obtained by dividing the residual (abs_remainder or dec_abs_level) by 1<<cRiceParam and (1<<expVal<<cRiceParam) are encoded using suffixValTR and escapeVal, respectively. That is, the residual is encoded as follows.
[0085] ((prefixValTR + ((1<<expVal) -1) ) << cRiceParam) + suffixValTR + escapeVal When the residual is less than or equal to a predetermined value cMax, only prefixValTR and suffixValTR are encoded.
[0086] prefixVal = (prefixValTR<<cRiceParam) + suffixValTR When the residual is greater than a predetermined value (when suffixVal exists), in addition to prefixValTR indicating prefixVal equal to cMax, expVal and escapeVal are encoded.
[0087] prefixVal = (prefixValTR< <cRiceParam) = cMax suffixVal = (((1< <expVal)-1)<<cRiceParam) + escapeVal The residual can be expressed as follows. The residual when it can be expressed using only prefixes is given by the following formula.
[0088] Residual =((prefixValTR) << cRiceParam) + suffixValTR In all other cases (when it cannot be expressed by prefix alone, or when prefixValTR=6), the residual is given by the following formula.
[0089] Residual =((prefixValTR + (1< <expVal)-1 ) << cRiceParam) + escapeVal Alternatively, prefixVal and suffixVal can be defined as follows.
[0090] prefixVal = (prefixValTR << cRiceParam) + suffixValTR suffixVal = (((2< <expVal)-2) << cRiceParam) + escapeVal (flow) The TU decoding unit 3024 first derives the maximum value cMax of the prefix prefixVal from cRiceParam.
[0091] cMax = 6 << cRiceParam The TU decoding unit 3024 decodes the prefix value (prefixVal) from the encoded data based on the binaryization of Truncated Rice (TR) described later. The relationship between the prefix and the residual is as follows.
[0092] prefixVal = Min(cMax, abs_remainder[n]) Alternatively, the following is also acceptable.
[0093] prefixVal = Min(cMax, dec_abs_level) Next, if the residual is greater than cMax (i.e., the residual cannot be represented by prefixVal alone), the TU decoding unit 3024 further decodes suffixVal that satisfies the following relationship.
[0094] suffixVal = abs_remainder[n] - cMax Alternatively, the following is also acceptable.
[0095] suffixVal = dec_abs_level - cMax Specifically, the TU decoding unit 3024 decodes suffixVal from the encoded data based on the binarization of a Limited k-th order Exp-Golomb (EG(k)) if suffixVal exists (when the bit sequence of prefixVal in TR is a sequence of 1s of length 6, "111111"). Here, the Limited k-th order Exp-Golomb is defined as cRiceParam for the order k, maxPreExtLen for 11, and truncSuffixLen for 15. maxPreExtLen is not fixed at 11, but may be derived according to the range of the transformation coefficient log2TransformRange. For example, it may be derived using the following formula.
[0096] maxPreExtLen = (32 - 6) - log2TransformRange = 26 - log2TransformRange For example, if log2TransformRange is (Equation R-1) described later, it can also be derived as follows.
[0097] maxPreExtLen = extended_precision_processing_flag ? 26 - Max(15, BitDepth + BDOFFSET) : 11 (Binaryization of Truncated Rice (TR)) The input symbolVal of the TR binaryization is prefixVal. In the TR binaryization, the quotient of symbolVal (==prefixVal) divided by (1<<cRiceParam) is encoded as prefixValTR, and the remainder is encoded as suffixValTR. The relationship between the input symbolVal and prefixValTR of the TR code is as follows.
[0098] prefixValTR = symbolVal>>cRiceParam prefixValTR is converted into a bit sequence according to the following definition. When prefixValTR < (cMax>>cRiceParam), it is a bit sequence indexed by binIdx with a length of prefixValTR + 1. When binIdx < prefixValTR, the bin is "1", and when binIdx == prefixValTR, the bin is "0". Otherwise (when prefixValTR == (cMax>>cRiceParam)), it is a sequence of "1"s with a length of cMax>>cRiceParam. Note that a bin is a bit sequence consisting of "0" or "1", and binIdx is a value indicating the position from the beginning of the bit sequence, where binIdx = 0 corresponds to the beginning (the left end of the binary sequence). Examples of bit sequences (bins) when prefixValTR is 0 to 5 are shown below.
[0099] prefixValTR==0 bins=0 prefixValTR==1 bins=10 prefixValTR==2 bins=110 prefixValTR==3 bins=1110 prefixValTR==4 bins=11110 prefixValTR==5 bins=111110 … However, when symbolVal >= cMax (i.e., prefixVal == (6 << cRiceParam)), the following formula applies.
[0100] prefixValTR == 6 bins = 111111 The bins of prefixValTR of the TR symbol are truncated alpha symbols (unary symbols). Here, being truncated means that when it matches the maximum value, the last 0 is omitted.
[0101] When cMax is greater than symbolVal (symbolVal < cMax) and cRiceParam > 0, there is a suffixTR in the TR bit sequence, which is derived as follows. suffixValTR is the suffix of the TR bit sequence.
[0102] suffixValTR = symbolVal - (prefixValTR << cRiceParam) Also, the binary representation of the suffix of the TR bit sequence uses a fixed-length binary representation (described later) with the maximum value cMaxFL being (1 << cRiceParam) - 1.
[0103] Note that when symbolVal == cMax, the suffix of the residue uses the binary representation of EG(k) instead of suffixValTR of the above TR binary representation.
[0104] (Limited k-th order Exp-Golomb / EG(k) binary representation) The suffixVal of the residual may use the binary representation of EG(k). EG(k) is a binary representation obtained by taking the degree k (= cRiceParam) and maxPreExtLen as inputs, and is shown in the following pseudo-code. EG(k) consists of an exp part with a length of at most maxPreExtLen and an escape part of a fixed-length binary representation of escapeLength. preExtLen is a variable that counts the number of put(1)'s in the exp part and is equal to the value espVal encoded in the exp part. That is, expVal = preExtLen. The corresponding residual value is expVal << cRiceParam. escapeVal is the value encoded in the escape part. / / exp part codeValue = symbolVal >> k preExtLen = 0 while((preExtLen<maxPreExtLen) && (codeValue > ((2<<preExtLen) - 2))) { preExtLen++ put(1) } if(preExtLen == maxPreExtLen) escapeLength = truncSuffixLen else { escapeLength = preExtLen + k put(0) } / / escape part symbolVal = symbolVal - (((1<<preExtLen)-1)<<k) while((escapeLength--)>0) put((symbolVal>>escapeLength) & 1) Here, symbolVal is the input value, which is the residual minus prefixVal (==cMax). put(X) is the operation to create a bit string by adding X ("0" or "1") to the end of the bit string. The initial value of the bit string is empty ({}). escapeLength is a variable that indicates the bit position output from the escape part in symbolVal. The escape section may also be written as follows.
[0105] SymbolVal = SymbolVal - (((2< <preExtLen)-2)<<k) while((escapeLength--)>0) put((symbolVal>>escapeLength) & 1) (Fixed-length binaryization) Fixed-length binary conversion is performed using an unsigned integer sequence (binary sequence) of length fixedLength (Ceil(Log2(cMaxFL+1))) for a maximum value cMaxFL and a value symbolVal. Note that the zero at position binIdx corresponds to the most significant bit (MSB), and as binIdx increases, it approaches the least significant bit (LSB).
[0106] (Summary of residual decoding) The TU decoding unit 3024 decodes the residual, which consists of prefixVal and suffixVal.
[0107] The TU decoding unit 3024 derives cMax from cRiceParam, decodes prefixVal from the encoded data with cMax as the upper limit, and decodes suffixVal if it exists.
[0108] Specifically, the TU decoder 3024 decodes the prefixValTR of the TR binaryization. When symbolVal < cMax, cRiceParam > 0 (that is, prefixVal < cMax, prefixVal < 6), it further decodes the suffixValTR of the fixed-length binaryization from the encoded data. In this case, there is no suffixVal.
[0109] When the above suffixVal does not exist, the TU decoder 3024 derives abs_remainder[n] and dec_abs_level according to the following formula.
[0110] abs_remainder[n] = (prefixValTR << cRiceParam) + suffixValTR dec_abs_level[n]= (prefixValTR << cRiceParam) + suffixValTR In other cases (when prefixVal == cMax, prefixValTR == 6), the TU decoder 3024 decodes the suffixVal by EG(k) and derives abs_remainder[n] and dec_abs_level[n] according to the following formula.
[0111] abs_remainder[n] = cMax + suffixVal dec_abs_level[n] = cMax + suffixVal Here, when the suffixVal consists of the preExtLen of the exp part and the escapeVal of the escape part of EG(k), suffixVal = (preExtLen << cRiceParam) + escapeVal That's it.
[0112] To summarize, the TU decoder 3024 decodes the prefix prefixVal of the TR binaryization, the preExtLen of the exp part of EG(k), and the suffixVal consisting of the escapeVal of the escape part from the encoded data, and derives the residual (abs_remainder[n] or dec_abs_level[n]).
[0113] abs_remainder[n] = prefixVal + suffixVal = (prefixValTR << cRiceParam) + (prefixValTR < 6)? suffixValTR : (1 << expVal << cRiceParam) + escapeVal Here, when preExtLen = escapeVal = 0 in the case of (prefixValTR < 6), abs_remainder[n] = (prefixValTR + preExtLen) << cRiceParam + (prefixValTR < 6)? suffixValTR : escapeVal The derivation of dec_abs_level[n] is the same. Note that since the code obtained by concatenating the bins of predfixValTR of the truncated alpha code and the bins of predExtLen of the alpha code is also an alpha code, the prefixVal of TR and the exp part of EG(k) may be decoded as a single entity. In this case, an alpha code with a maximum length of maxPreExtLen + 6 is read from the encoded data, and the length prefixtmp (= prefixValTR + expVal) of the alpha code is decoded. Here, maxPreExtLen + 6 is the sum of the maximum length 6 of prefixValTR and the maximum length maxPreExtLen of the exp part of EG(k). The TU decoder 3024 may also derive the residual by dividing it into the quotient and remainder of 1 << cRiceParam as follows.
[0114] Residual = (prefixRes << cRiceParam) + suffixRes If prefixtmp is the length of the decoded alpha code, then prefixRes, the exponential part of the residual, is expressed by the following formula.
[0115] prefixRes = (prefixVal<6) ? prefixValTR : prefixValTR + (1< <expVal) - 1 If prefixtmp < 6, prefixValTR = prefixtmp; if prefixtmp >= 6, prefixValTR = 6 and expVal = prefixtmp - 6. Therefore, it can be derived as follows.
[0116] pocketRes = (prefixtmp<6) ? prefixtmp : 6 + (1<<(prefixtmp-6)) - 1 = (prefixtmp<6) ? prefixtmp : (1<<(prefixtmp-6)) + 5 Also, prefixRes = (prefixVal<6) ? prefixValTR : prefixValTR + (2< <expVal) - 2 In the case of a configuration using this method, pocketRes = (prefixtmp<6) ? prefixtmp : 6 + (2<<(prefixtmp-6)) - 2 = (prefixtmp<6) ? prefixtmp : (2<<(prefixtmp-6)) + 4 = (prefixtmp<6) ? prefixtmp : (1<<(prefixtmp-5)) + 4 Here, prefixtmp<6 can also be processed as prefixtmp<5. Also, since both suffixValTR and escapeVal are fixed-length binary representations, the former can be used as the fixedLength of cMaxFL and the latter as the fixedLength of escapeLength, and suffixRes can be decoded similarly.
[0117] (Quantization transformation coefficient) The TU decoding unit 3024 sequentially decodes abs_remainder from the encoded data for each position n, and derives the quantization conversion coefficient AbsLevel from AbsLevelPass1 and abs_remainder using the following formula. n is any position within the subblock that is below the last coefficient position in the scan order and before a predetermined number of bits are decoded.
[0118] AbsLevel[xC][yC] = AbsLevelPass1[xC][yC] + 2 * abs_remainder[n] Here, AbsLevel is the absolute value of the conversion coefficient (the absolute value of the difference between the conversion coefficients). AbsLevelPass1[xC][yC] is expressed as follows.
[0119] AbsLevelPass1[xC][yC] = sig_coeff_flag[xC][yC] + par_level_flag[n] + abs_level_gtx_flag[n][0] + 2 * abs_level_gtx_flag[n][1].
[0120] The TU decoding unit 3024, in cases other than those mentioned above (n when a predetermined number of bits are decoded), decodes dec_abs_level from the encoded data and derives AbsLevel using the following formula.
[0121] if (dec_abs_level[n] == ZeroPos[n]) AbsLevel[xC][yC] = 0 else if (dec_abs_level[n] < ZeroPos) AbsLevel[xC][yC] = dec_abs_level[n] + 1 else / *dec_abs_level[n] > ZeroPos[n]* / AbsLevel[xC][yC] = dec_abs_level[n] ZeroPos is derived using the following formula.
[0122] ZeroPos[n] = ( QState < 2 ? 1 : 2 ) << cRiceParam Here, QState represents the state of dependent quantization.
[0123] (Derivation of Rice parameters) Among the syntax elements representing the absolute values of the coefficients, abs_remainder and dec_abs_level are decoded by a bypass code (CABAC equal-probability code) from a value that has been converted to binary using Golomb-Rice coding (or Rice coding). abs_remainder is the difference with respect to the offset of the absolute value of the conversion coefficient, and dec_abs_level is the absolute value of the conversion coefficient.
[0124] Golomb-Rice coding encodes syntax elements by dividing them into two parts: a prefix and a reminder / suffix. The prefix uses alpha coding (unary coding), which allows for encoding values close to zero with a short code size. The suffix uses fixed-length binarization with the Rice parameter cRiceParam or EG(k) binarization. A larger Rice parameter results in longer bit lengths for smaller values and shorter bit lengths for larger values. The code size can be reduced by adjusting the Rice parameter according to the probability of the syntax element's value occurring.
[0125] In the video decoding and encoding devices of this embodiment, the values of the syntax elements to be decoded are predicted from the absolute values of the coefficients that have already been derived. Then, appropriate Rice parameters are derived from these predicted values. The details are shown below with reference to Figure 14.
[0126] Let the upper left coordinate of the current TU be (x0, y0), the current scan position be (xC, yC), the log2 values of the width and height of the TU be log2TbWidth and log2TbHeight respectively. Also, the array storing the absolute values of the coefficients is represented by AbsLevel[x][y] using the position (x, y). Figure 14(a) shows the positions of the decoded coefficients around the coefficient when decoding abs_remainder or dec_abs_level. Let the variable representing the sum of the absolute values of the surrounding coefficients be locSumAbs. Then, the TU decoding unit 3024 derives locSumAbs in the RRC as follows.
[0127] locSumAbs = 0 if(xC < (1<<log2TbWidth)-1) { locSumAbs += AbsLevel[xC+1][yC] if(xC < (1<<log2TbWidth)-2) locSumAbs += AbsLevel[xC+2][yC] if(yC < (1<<log2TbHeight)-1) locSumAbs += AbsLevel[xC+1][yC+1] } if(yC < (1<<log2TbHeight)-1) { locSumAbs += AbsLevel[xC][yC+1][[ID=2,3]] if(yC < (1<<log2TbHeight)-2) locSumAbs += AbsLevel[xC][yC+2] } locSumAbs0 = locSumAbs locSumAbs = Clip3(0, 31, locSumAbs-baseLevel*5) 1) When the coefficient position (xC+1, yC) is within the block (xC < (1<<log2TbWidth)-1), add the value of t1(AbsLevel[xC+1][yC]) to locSumAbs. 2) When in case 1), and further when the position (xC + 2, yC) is within the block (xC < (1 << log2TbWidth) - 2), add the value of t2(AbsLevel[xC + 2][yC]) to locSumAbs. 3) When in case 1), and further when the position (xC + 1, yC + 1) is within the block (yC < (1 << log2TbHeigh) - 1), add the value of t3(AbsLevel[xC + 1][yC + 1]) to locSumAbs. 4) When the position (xC, yC + 1) is within the block (yC < (1 << log2TbHeight) - 1), add the value of t4(AbsLevel[xC][yC + 1]) to locSumAbs. 5) When in case 4), and further when the position (xC, yC + 2) is within the block (yC < (1 << log2TbHeight) - 2), add the value of t5(AbsLevel[xC][yC + 2]) to locSumAbs. Update the locSumAbs calculated from the above processing with the variable baseLevel and clip processing as follows.
[0128] locSumAbs = Clip3(0, 31, locSumAbs - baseLevel * 5) Here, baseLevel is a variable related to the syntax type (abs_remainder or dec_abs_level). baseLevel may be set to 4 when decoding abs_remainder (tcoeff == 0), and 0 when decoding dec_abs_level (tcoeff == 1). tcoeff is a variable indicating whether the decoding target is abs_remainder or dec_abs_level.
[0129] Using the table shown in Fig. 14(b), derive the Rice parameters used for decoding abs_remainder and dec_abs_level from the derived locSumAbs.
[0130] The TU decoding unit 3024 does not use the surrounding decoded coefficients in TSRC and always sets the rice parameter cRiceParam to 1.
[0131] (Derivation of quantization conversion coefficients, dependent quantization) The inverse quantization / inverse conversion unit 311 inversely quantizes the conversion coefficients. Two quantization methods are provided: scalar quantization and dependent quantization. In the case of dependent quantization, the RRC unit 30241 may further perform part of the inverse quantization process.
[0132] The inverse quantization / inverse transformation unit 311 derives the linear scale value ls[x][y] as follows, depending on the quantization parameter qP, rectNonTsFlag, and the value of the quantization matrix m[][]. The inverse quantization / inverse transformation unit 311 switches the method of deriving ls[][] depending on whether dependent quantization is enabled and transformation skipping is disabled, or otherwise.
[0133] if (sh_dep_quant_used_flag && !transform_skip_flag) ls[x][y] = (m[x][y]*levelScale[rectNonTsFlag][(qP+1)%6]) << ((qP+1) / 6) else ls[x][y] = (m[x][y]*levelScale[rectNonTsFlag][qP%6]) << (qP / 6) rectNonTsFlag = (transform_skip_flag==0 && (((Log2(nTbW)+Log2(nTbH)) & 1)==1)) ? 1 : 0 bdShift1 = transform_skip_flag==1 ? 10 : BitDepth+rectNonTsFlag+((Log2(nTbW)+Log2(nTbH)) / 2)-5+sh_dep_quant_used_flag Furthermore, if the range of the coefficients is extended as described later, the following formula may be used for derivation. bdShift1 = BitDepth + rectNonTsFlag +(((Log2(nTbW)+Log2(nTbH))) / 2) + 10 - log2TransformRange + sh_dep_quant_used_flag (If not dependent quantization) In cases of non-dependent quantization, the conversion coefficients are uniquely derived from the quantization conversion coefficients and quantization parameters. For example, in Figure 11 or Figure 12, the conversion coefficient value d is derived as follows.
[0134] TransCoeffLevel[x0][y0][cIdx][xC][yC] = AbsLevel[xC][yC] * (1-2*coeff_sign_flag[n]) <Formula TC_REGULAR> dz[xC][yC] = TransCoeffLevel[x0][y0][cIdx][xC][yC] dnc[xC][yC] = (dz[xC][yC]*ls[xC][yC]+((1<<bdShift1)> >1)) >> bdShift1 d[xC][yC] = Clip3( CoeffMin, CoeffMax, dnc[xC][yC] ) Here, AbsLevel is the quantization conversion coefficient value, and ls and bdShift1 are parameters derived from the quantization parameter qP. CoeffMin and CoeffMax are the minimum and maximum values of the clipping, and are derived by the following formula.
[0135] CoeffMin = -(1 << log2TransformRange) CoeffMax = (1 << log2TransformRange) - 1 log2TransformRange indicates the range of the transformation coefficients. When log2TransformRange = 15, CoeffMin = -( 1 << 15 ) and CoeffMax = ( 1 << 15 ) - 1.
[0136] The range of the transformation coefficients, log2TransformRange, may also be set as follows, depending on BitDepth.
[0137] log2TransformRange = extended_precision_processing_flag ? Max(15, BitDepth + BDOFFSET) : 15 (Formula R-1) Here, BDOFFSET is a fixed value used to calculate the range of the conversion coefficients, and suitable values include 4, 5, and 6. extended_precision_processing_flag is a flag indicating whether or not to use an extended range as the range of the conversion coefficients.
[0138] (In the case of dependent quantization) On the other hand, as shown in Figure 11, dependent quantization has two quantizers with different levels. The parity of the intermediate values of the quantization conversion coefficients (AbsLevelPass1, AbsLevel) is used to switch between four states QState. Then, quantization and dequantization are performed according to the QState. Note that quantization and dequantization (scaling) using quantization parameters are performed separately.
[0139] QState = QStateTransTable[QState][AbsLevelPass1[xC][yC] & 1] TransCoeffLevel[x0][y0][cIdx][xC][yC] = (2*AbsLevel[xC][yC]-(QState>1 ? 1 : 0)) * (1-2*coeff_sign_flag[n]) <Formula TC_DQ> dz[xC][yC] = TransCoeffLevel[x0][y0][cIdx][xC][yC] dnc[xC][yC] = (dz[xC][yC]*ls[xC][yC]+((1<<bdShift1)> >1)) >> bdShift1 d[xC][yC] = Clip3( CoeffMin, CoeffMax, dnc[xC][yC] ) Here, QState is the state, and QStateTransTable[][] is the table used for state transitions, for example, QStateTransTable[][] = {{0,2},{2,0},{1,3},{3,1}}.
[0140] QState can also be derived using the following formula without using QStateTransTable[][].
[0141] QState =(32040 >>((QState << 2)+((AbsLevelPass1[xC][yC] & 1)<< 1)))& 3 Depending on the value of QState, different TransCoeffLevels (or d) can be derived even if the AbsLevel is the same. Since QState is derived by referring to the quantization transformation coefficient value decoded in the previous step, it is possible to perform (inverse) quantization with better coding efficiency by utilizing the correlation between coefficients compared to general scalar (inverse) quantization.
[0142] (Inverse transformation) The inverse core conversion unit 31123 performs a vertical conversion on the obtained residual d[][].
[0143] e[x][y] = Σ(transMatrix[y][j]×d[x][j]) (j = 0..nTbS - 1) The inverse core conversion unit 31123 shifts and clips the first intermediate value e[x][y] to derive the second intermediate value g[x][y].
[0144] g[x][y] = Clip3(CoeffMin, CoeffMax, (e[x][y] + 64) >> 7) CoeffMin and CoeffMax represent the minimum and maximum clipping values.
[0145] The inverse core conversion unit 31123 performs a conversion on the conversion coefficient d[ ][ ] or the corrected conversion coefficient d[ ][ ] to derive the prediction error r[][] (S5).
[0146] r[x][y] = Σ(TransMatrix[x][j]×g[j][y]) (j = 0..nTbS - 1) Then, a shift is performed on r[][] according to the bit depth, and an error resSamples[][] with the same accuracy as the predicted image derived by the predicted image generation unit 308 is derived. For example, the shift is expressed as follows.
[0147] resSamples[x][y] = (r[x][y] + (1 << (bdShift2 - 1))) >> bdShift2 (formula BD-1) Here, we derive bdShift2 = 5 + log2TransformRange - BitDepth. In the case of (Equation R-1), bdShift2 = extended_precision_processing_flag ? (5 + BDOFFSET) : Max(20 - BitDepth, 0) In conventional prediction error coding (RRC), a decoding start position for non-zero conversion coefficients, called the LAST position, is encoded to suit cases where non-zero conversion coefficients are concentrated in a certain region of low-frequency components. The quantization conversion coefficients are then decoded by scanning the lower-frequency components from the LAST position. Furthermore, since sine hiding and dependent quantization are used, the RRC unit 30241 derives parameters such as the sum of absolute values of conversion coefficients and the state of dependent quantization (QState) necessary for these processes. On the other hand, in prediction error coding using conversion skip mode (TSRC), since non-zero conversion coefficients are not concentrated in a certain region, the LAST position is not encoded, and the quantization conversion coefficients are decoded by scanning the entire block. Furthermore, sine hiding and dependent quantization are not used, and the TSRC unit 30242 does not derive the above parameters necessary for these processes.
[0148] Incidentally, even in conversion skip mode, using the standard prediction error encoding method may result in better encoding efficiency. For such cases, the standard prediction error may be used in conversion skip mode. For example, the sh_ts_residual_coding_disabled_flag shown in Figure 9 may be notified.
[0149] The sh_ts_residual_coding_disabled_flag indicates whether residual_ts_coding() in TSRC mode is used to decode the prediction errors of blocks to which transformation skipping is applied in the current slice (transformation skip blocks). sh_ts_residual_coding_disabled_flag=1 indicates that residual_coding() in RRC mode is used to parse the prediction errors of transformation skip blocks. sh_ts_residual_coding_disabled_flag=0 indicates that residual_ts_coding() is used to parse the prediction errors of transformation skip blocks. If sh_ts_residual_coding_disabled_flag is not notified, it is assumed to be 0.
[0150] As shown in Figure 10(b), if !transform_skip_flag[x0][y0][0] || sh_ts_residual_coding_disabled_flag, processing may be handled by the RRC unit 30241. Otherwise, processing may be handled by the TSRC unit 30242. In other words, in addition to the case where transform_skip_flag is 0, the RRC may also notify the conversion coefficient (prediction error) when sh_ts_residual_coding_disabled_flag is not 0.
[0151] By referring to sh_ts_residual_coding_disabled_flag, the normal prediction error encoding method (RRC mode) can be used even in conversion skip mode. (Embodiment 2) When the absolute value of the coefficient is large, a small Rice parameter value can lead to a large code amount and a decrease in coding efficiency. In particular, professional video has a small quantization width, so the absolute value of the coefficient tends to be large. In such cases, the Rice parameter values in the range shown in Figure 14(b) (0 to 3) are inappropriate. In this embodiment, in a method for deriving the Rice parameter using the absolute values of the transformation coefficients surrounding the target transformation coefficient, an appropriate Rice parameter is derived using linear prediction.
[0152] (Prediction of the absolute value of the coefficient) The TU decoding unit 3024 derives locSumAbs, the sum of the absolute values t1 to t5 of the surrounding transformation coefficients, in the same manner as in Embodiment 1. Using the weight a, correction term b, and shift value c in the following linear equation, it derives the predicted value val of the syntax element to be decoded (e.g., abs_remainder or dec_abs_level). a is the weight related to locSumAbs, a value derived from the magnitude of the surrounding transformation coefficients. Note that the value before subtracting baseLevel*5 (locSumAbs0) may be used as locSumAbs (the same applies below). baseLevel is a variable calculated according to abs_remainder or dec_abs_level.
[0153] val = (a * locSumAbs + b) >> c You may also clip `val` to an appropriate range.
[0154] val = Clip3(0, VMAX, (a * locSumAbs + b) >> c) ) Here, VMAX is a constant that represents the maximum value of val. a, b, and c may be collectively referred to as the linear prediction parameters. Below, we will explain an example of switching the linear prediction parameters used to derive the Rice parameters depending on the conditions.
[0155] (Parameter analysis for linear prediction using syntax elements) An example of switching the linear prediction parameters a, b, and c based on syntax elements is described. For example, the TU decoding unit 3024 may change the prediction method according to the syntax of the absolute value of the residual. That is, different parameter values may be used when decoding abs_remainder, which represents the difference with respect to the offset of the absolute value of the residual, and when decoding dec_abs_level, which is the absolute value of the residual. For example, if we use the variable tcoeff and represent decoding abs_remainder as tcoeff=0 and decoding dec_abs_level as tcoeff=1, then a, b, and c may be set as follows. if (tcoeff == 0) (formula LMC-1) { a = 3, b = 0, c = 4} / / abs_reminder else { a = 7, b = 16, c = 4} / / dec_abs_level Furthermore, c does not depend on the value of tcoeff (for example, it is always 4), and a and b may be as follows: if (tcoeff == 0) { a = 3, b = 0} else { a = 7, b = 16} Furthermore, the TU decoding unit 3024 may determine whether a syntax element is an abs_reminder or a dec_abs_level by using baseLevel instead of tcoeff. In other words, the TU decoding unit 3024 determines that if baseLevel == 4 (or baseLevel != 0), the syntax element is an abs_reminder, and otherwise (baseLevel == 0), the syntax element is a dec_abs_level. Then, it may perform processing for abs_reminder or processing for dec_abs_level (and so on).
[0156] (Case distinctions for linear prediction parameters based on syntax elements and block size) The TU decoding unit 3024 may switch the linear prediction parameters a, b, and c according to the block size (log2TbWidth, log2TbHeight) in addition to the syntax elements. For example, the weight a, correction term b, and shift value c may be set as follows, depending on the values of the surrounding transformation coefficients. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24, c = 4} else if (log2TbWidth + log2TbHeight < 6) { a = 4, b = 0, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 4, b = -24, c = 4} else if (log2TbWidth + log2TbHeight < 8) { a = 2, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16, c = 4} else { a = 2, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8, c = 4} else if (log2TbWidth + log2TbHeight < 6) { a = 7, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 8) { a = 6, b = 24, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 5, b = 32, c = 4} else { a = 5, b = 24, c = 4} Alternatively, the TU decoding unit 3024 may fix the shift value c (for example, c=4) and derive the weight a and correction term b according to the TU size. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24} else if (log2TbWidth + log2TbHeight < 6) { a = 4, b = 0} else if (log2TbWidth + log2TbHeight < 7) { a = 4, b = -24} else if (log2TbWidth + log2TbHeight < 8) { a = 2, b = 16} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16} else { a = 2, b = 16} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8} else if (log2TbWidth + log2TbHeight < 6) { a = 7, b = 16} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16} else if (log2TbWidth + log2TbHeight < 8) { a = 6, b = 24} else if (log2TbWidth + log2TbHeight < 9) { a = 5, b = 32} else { a = 5, b = 24} A key feature of the above is that the weight a is set to be smaller as the TU size increases. Furthermore, the TU decoding unit 3024 may increase the correction term b as the TU size increases, at least when tcoeff == 1 (baseLevel == 0). Alternatively, the block index bIdx may be derived using the following formula without using conditional branching. bIdx is an index derived from the block size and tcoeff.
[0157] bIdx = tcoeff * 6 + Clip3(0, 5, log2TbWidth + log2TbHeight - 5) The TU decoding unit 3024 may then use bIdx to derive a, b, and c from the table shown in Figure 15(a).
[0158] (Parameter differentiation for linear prediction based on syntax elements and block size (alternative pattern)) The branching based on block size is not limited to the above, and the TU decoding unit 3024 may use different values for a, b, and c. a is the weight related to the surrounding transformation coefficient values, b is the correction term b, and c is the shift value. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 8, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16, c = 4} else { a = 2, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 6, b = 24, c = 4} else { a = 5, b = 24, c = 4} The following is also acceptable. c = 4 if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 8} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16} else { a = 2, b = 16} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16} else if (log2TbWidth + log2TbHeight < 9) { a = 6, b = 24} else { a = 5, b = 24} A key feature of the above is that the weight a is set to be smaller as the TU size increases. In addition, the TU decoding unit 3024 may increase the correction term b as the TU size increases, at least when tcoeff == 1 (when baseLevel == 0).
[0159] Similarly to the above, the block index bIdx may be derived using the following formula without using conditional branching.
[0160] bIdx = tcoeff * 4 + Clip3(0, 3, (log2TbWidth + log2TbHeight - 3) / 2 ) The TU decoding unit 3024 may then use bIdx to derive a, b, and c from the table shown in Figure 15(b).
[0161] (Case distinction of linear prediction parameters based on syntax elements and transformation coefficient positions) Furthermore, the TU decoding unit 3024 may switch the linear prediction parameters according to the current scan position (xC, yC) in addition to the syntax elements. For example, a weight a related to the surrounding transformation coefficients, a correction term b, and a shift value c may be set as shown in the following equation. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (xC + yC < 3) { a = 4, b = 0, c = 4} else if (xC + yC < 6) { a = 3, b = 16, c = 4} else if (xC + yC < 15) { a = 3, b = 8, c = 4} else { a = 2, b = 16, c = 4} else if (xC + yC < 3) { a = 7, b = 16, c = 4} else if (xC + yC < 6) { a = 7, b = 16, c = 4} else if (xC + yC < 15) { a = 5, b = 32, c = 4} else { a = 5, b = 24, c = 4} The following is also acceptable. c = 4 if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (xC + yC < 3) { a = 4, b = 0} else if (xC + yC < 6) { a = 3, b = 16} else if (xC + yC < 15) { a = 3, b = 8} else { a = 2, b = 16} else if (xC + yC < 3) { a = 7, b = 16} else if (xC + yC < 6) { a = 7, b = 16} else if (xC + yC < 15) { a = 5, b = 32} else { a = 5, b = 24} The TU decoding unit 3024 may set the weight a to a smaller value as the scan position shifts to a higher frequency side, that is, as the sum of xC + yC increases.
[0162] (Case distinctions for linear prediction parameters based on syntax elements and subblock positions) Furthermore, the TU decoding unit 3024 may switch the linear prediction parameters according to the current subblock position subSetId, rather than the pixel-level scan position, in addition to the syntax elements. A subblock is, for example, one of four regions obtained by dividing the target block into four parts, and subSetId indicates the position of each subblock within the block. For example, the top left is 0, the top right is 1, the bottom left is 2, and the bottom right is 3. The TU decoding unit 3024 may set, for example, a weight a related to the surrounding transformation coefficients, a correction term b, and a shift value c as shown in the following equation. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (subSetID == 0) { a = 4, b = 8, c = 4} else if (subSetID == 1) { a = 4, b = 0, c = 4} else if (subSetID == 2) { a = 4, b = -24, c = 4} else { a = 2, b = 16, c = 4} else if (subSetID == 0) { a = 7, b = 16, c = 4} else if (subSetID == 1) { a = 7, b = 16, c = 4} else if (subSetID == 2) { a = 5, b = 32, c = 4} else { a = 5, b = 24, c = 4} The following is also acceptable. c = 4 if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (subSetID == 0) { a = 4, b = 8} else if (subSetID == 1) { a = 4, b = 0} else if (subSetID == 2) { a = 4, b = -24} else { a = 2, b = 16} else if (subSetID == 0) { a = 7, b = 16} else if (subSetID == 1) { a = 7, b = 16} else if (subSetID == 2) { a = 5, b = 32} else { a = 5, b = 24} The TU decoding unit 3024 may set the weight a to a smaller value as the subblock position shifts to a higher frequency side.
[0163] (Case distinction of linear prediction parameters based on syntax elements and color components) Furthermore, the TU decoding unit 3024 may switch the linear prediction parameters according to the current color component (cIdx) in addition to tcoeff. For example, a weight a related to the surrounding transformation coefficients, a correction term b, and a shift value c may be set as shown in the following equation. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (cIdx == 0) { a = 3, b = 8, c = 4} else { a = 2, b = 8, c = 4} else if (cIdx == 0) { a = 7, b = 24, c = 4} else { a = 6, b = 24, c = 4} (Case distinctions for linear prediction parameters based on syntax elements, color components, and block size) Furthermore, the TU decoding unit 3024 may switch the linear prediction parameters according to the block size, in addition to tcoeff and the current color component (cIdx). For example, the weight a, correction term b, and shift value c may be set as shown in the following equation. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (cIdx == 0) if (log2TbWidth + log2TbHeight < 5) { a = 5, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 3, b = 0, c = 4} else { a = 2, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 5) { a = 5, b = 0, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 3, b = 0, c = 4} else { a = 3, b = 16, c = 4} else if (cIdx == 0) if (log2TbWidth + log2TbHeight < 5) { a = 9, b = 24, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 7, b = 16, c = 4} else { a = 5, b = 24, c = 4} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 16, c = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 24, c = 4} else if (log2TbWidth + log2TbHeight < 9) { a = 7, b = 16, c = 4} else { a = 5, b = 24, c = 4} It may also be as follows. c = 4 if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (cIdx == 0) if (log2TbWidth + log2TbHeight < 5) { a = 5, b = 16} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 16} else if (log2TbWidth + log2TbHeight < 9) { a = 3, b = 0} else { a = 2, b = 16} else if (log2TbWidth + log2TbHeight < 5) { a = 5, b = 0} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 16} else if (log2TbWidth + log2TbHeight < 9) { a = 3, b = 0} else { a = 3, b = 16} else if (cIdx == 0) if (log2TbWidth + log2TbHeight < 5) { a = 9, b = 24} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16} else if (log2TbWidth + log2TbHeight < 9) { a = 7, b = 16} else { a = 5, b = 24} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 16} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 24} else if (log2TbWidth + log2TbHeight < 9) { a = 7, b = 16} else { a = 5, b = 24} The TU decoding unit 3024 may set the weight a to a smaller value as the block size increases.
[0164] (Case distinctions for linear prediction parameters based on syntax elements and intra / interface) The TU decoding unit 3024 may switch the linear prediction parameters according to the current block's prediction mode (CuPredMode), in addition to the parameters (tcoeff, baseLevel). The linear prediction parameters are a, b, c, and parA, parB, parD, parE, etc., as described later. For example, the parameters may be switched depending on whether CuPredMode is MODE_INTRA, MODE_INTER, or MODE_IBC, or depending on whether it is MODE_INTRA or not. Different trends tend to appear in the correlation of the transformation coefficients depending on the block's prediction mode. Therefore, by switching the parameters for each block depending on the prediction mode, the predicted value becomes less likely to deviate from the original value (the absolute value of the coefficient to be decoded). As a result, the coding efficiency is improved.
[0165] (Another example of predicting the absolute value of a coefficient) The TU decoding unit 3024 may obtain a predicted value val of the syntax element to be decoded using an equation other than the above linear equation. The TU decoding unit 3024 derives locSumAbs, the sum of the absolute values t1 to t5 of the surrounding transformation coefficients, in the same process as in Embodiment 1. Here, weight d is used for the weight a, correction term b, and shift value c related to locSumAbs. d is a weight related to the state variable remstat (described later), which changes according to the subblock. Then, the predicted value val is derived using the following linear equation, depending on locSumAbs and remstat.
[0166] val = (a * locSumAbs + b + d * remstat) >> c You may also clip `val` to an appropriate range.
[0167] val = Clip3(0, VMAX, (a * locSumAbs + b + d * remstat) >> c) ) Here, VMAX is a constant indicating the maximum value of val. a, b, c, and d may be collectively referred to as the parameters of linear prediction. By adding remstat, the predicted value is less likely to deviate from the original value (the absolute value of the coefficient to be decoded), resulting in improved coding efficiency. Hereinafter, remstat will be described, and an example of switching the parameters of linear prediction used for deriving the Rice parameter according to conditions will be described. Also, the state variable may be derived in TU units.
[0168] (Derivation of state variable) The TU decoder 3024 measures in advance the average value of the absolute value of the coefficient for each decoded block as the state variable remstat. Then, remstat may be further used to derive the predicted value val and the value of cRiceParam for the next sub-block. remstat may be a variable representing the magnitude of the absolute value of the coefficient first decoded for each sub-block. Also, remstat may be a variable representing the magnitude of each coefficient. (Example 1 of derivation of state variable) For example, if the value of the decoded transform coefficient exceeds a specific value TH1, the TU decoder 3024 may increment remstat. Conversely, if it is less than a specific value TH2, remstat may be decremented. For example, set as follows.
[0169] TH1 = 3 << (remstat / 4) TH2 = (1 << (remstat / 4)) / 2 Then, using the absolute value of the coefficient AbsLevel, remstat may be updated as follows. remstat is initialized for each slice or tile, and the initial value is set to 0. Also, instead of AbsLevel, the syntax value decoded and encoded from the encoded data may be used. For example, AbsLevel may be replaced with abs_remainder or dec_abs_level for derivation.
[0170] if (AbsLevel >= TH1) remstat++ else if ((AbsLevel < TH2) && (remstat > 0)) remstat-- ++ and -- represent incrementing and decrementing a value. That is, remstat++ represents remstat = remstat+1, and remstat-- represents remstat = remstat-1.
[0171] The TU decoding unit 3024 may set different values for remstat depending on the block size, color components, and whether or not transformation is used (transform_skip_flag).
[0172] TH1 = 3 << (remstat[sbType] / 4) TH2 = 1 << (remstat[sbType] / 4) / 2 if (AbsLevel >= TH1) remstat[sbType]++ else if ((AbsLevel < TH2) && (remstat[sbType] > 0)) remstat[sbType]-- sbType is a variable derived using the block size, color component, and transform_skip_flag. For example, when deriving sbType using the color component and transform_skip_flag, if transform_skip_flag == 0, the following expression can also be used.
[0173] sbType = 2 * (cIdx == 0) ? 1 : 0 Otherwise, the following formula may be used.
[0174] sbType = (2 * (cIdx == 0) ? 1 : 0) + 1 Alternatively, the following formula may be used.
[0175] sbType = (2 * (cIdx == 0) ? 1 : 0) + transform_skip_flag In this case, sbType does not depend on the block size.
[0176] Alternatively, the TU decoding unit 3024 may derive sbType using only transform_skip_flag as shown in the following equation.
[0177] sbType = transform_skip_flag Furthermore, when there are four types of block sizes, two types of color components, and transform_skip_flag=0..1, sbType will have 16 counters. In this case, the variable bgrp, which indicates the block size, is derived as follows. bgrp = (log2BlockWidth + log2BlockHeight < 5) ? 0 : ((log2BlockWidth + log2BlockHeight < 7) ? 1 : ((log2BlockWidth + log2BlockHeight < 9) ? 2 : 3)) If transform_skip_flag == 0, the following expression may also be used.
[0178] sbType = bgrp * 4 + 2 * (cIdx == 0) ? 1 : 0) Otherwise, the following formula may be used.
[0179] sbType = bgrp * 4 + 2 * (cIdx == 0) ? 1 : 0) + 1 Alternatively, the following formula may be used.
[0180] sbType = bgrp * 4 + 2 * (cIdx == 0)? 1 : 0) + transform_skip_flag (Derivation Example 2 of State Variable) Also, the TU decoder unit 3024 may update remstat according to the update rate WS.
[0181] remstat = (WS * AbsLevel + (((1 << WSHIFT) - WS) * remstat) + (1 << (WSHIFT - 1))) >> WSHIFT remstat is updated by the weighted sum of the absolute value of the transform coefficient to be decoded (AbsLevel) and the variable (remstat) regarding the already decoded transform coefficient. WS is a weighting coefficient, and WSHIFT is a value for integer processing of the asymptotic formula. For example, when WS = 1 and WSHIFT = 2, the following is the asymptotic formula.
[0182] remstat = (AbsLevel + (3 * remstat) + 2) >> 2 When the above formula is expressed in decimal arithmetic, it is as follows.
[0183] remstat = 0.25 * AbsLevel + 0.75 * remstat The TU decoder unit 3024 may set different values for remstat according to the block size, color component, and whether to use transformation (transform_skip_flag). sbType is calculated in the same way as (Derivation Example 1 of State Variable). For example, when WS = 1 and WSHIFT = 2, the following formula may be used.
[0184] remstat[sbType] = (AbsLevel + (3 * remstat[sbType]) + 2) >> 2 For example, when WSHIFT = 3, the following formula may be used. WS = 1..7.
[0185] remstat[sbType] = (WS*AbsLevel + (8-WS) * remstat[sbType]) + 4) >> 3 Alternatively, the above AbsLevel may be derived by replacing it with the syntax value abs_remainder or dec_abs_level that constitutes the residual.
[0186] Compared to deriving remstat using only AbsLevel, deriving remstat by weighting the remstat of the previous subblock and the AbsLevel of the current subblock results in remstat that is less susceptible to sudden changes (noise) in AbsLevel and therefore more stable.
[0187] As described above, the TU decoding unit 3024 may derive remstat as a variable representing the state of the magnitude of each coefficient, either on a per-variable basis or on a per-subblock basis. A specific example of deriving it on a per-subblock basis will be explained below.
[0188] (Example 1 of deriving remstat at the subblock level) The TU decoding unit 3024 may derive the state variable remstat according to the following pseudocode, and then derive the rice parameter cRiceParam. for subblock / / for(i = lastSubBlock; i >= 0; i--) { Determine sbType for decoding each coefficient / / for(n = numSbCoeff - 1; n >= 0; n--) { cRiceParam = funcRiceParam(remstat[sbType], locSumAbs) The residuals are decoded based on cRiceParam to derive AbsLevel. if the first coefficient of the subblock / / (n == numSbCoeff - 1) remstat[sbType] = (AbsLevel + 3 * remstat[sbType]) >> 2 Here, funcRiceParam is a function that derives cRiceParam from remstat and lossSumAbs, and any method described in this application can be used. Let i be the loop variable of the subblock, n be the loop variable within the subblock, lastSubBlock be the maximum value of the subblock, and numSbCoeff be the number of variables within the subblock. When counting toward 0 with numSbCoeff-1 as the initial value, the TU decoding unit 3024 updates remstat using AbsLebel only when n == numSbCoeff - 1, which is the first coefficient of the subblock.
[0189] Alternatively, the configuration may update remstat only when the last variable (n==0) is reached, rather than when the first coefficient of the subblock is reached. In the above configuration, remstat is updated only once per subblock. Therefore, it has the effect of minimizing the latency associated with the derivation of remstat while deriving cRiceParam, which minimizes the binary length of the residual, from remstat, which shows the magnitude of the residual with high accuracy.
[0190] (Example 2 of deriving remstat at the subblock level) The TU decoding unit 3024 may derive the state variable remstat according to the following pseudocode, and then derive the rice parameter cRiceParam. for subblock / / for(i = lastSubBlock; i >= 0; i--) { Determine sbType remstat0 = remstat[sbType] for decoding each coefficient / / for(n = numSbCoeff - 1; n >= 0; n--) { cRiceParam = funcRiceParam(remstat0, locSumAbs) The residuals are decoded based on cRiceParam to derive AbsLevel. remstat[sbType] = (AbsLevel + 3 * remstat[sbType]) >> 2 In addition, the derivation of remstat[sbType] may be performed only once for each subblock in the above example.
[0191] remstat[sbType] = (AbsLevel + 3 * remstat[sbType]) >> 2 The above formula may also be replaced with the following.
[0192] if the name coefficient of the subblock remstat[sbType] = (AbsLevel + 3 * remstat[sbType]) >> 2 Here, remstat0 is set once in the subblock using remstat[sbType]. remstat[sbType] is updated each time a transformation coefficient is decoded, but remstat0 is used as an argument to the function that derives cRiceParam as a function of remstat and lossSubAbs. In other words, the remstat that depends on the value absLevel of the immediately preceding transformation coefficient is not used to derive cRiceParam, which is used for decoding the residual. Therefore, latency associated with depending on the immediately preceding transformation coefficient can be reduced. Note that although remstat itself is updated for each variable, it has no dependency on the decoding of the immediately following residual and can be processed in parallel, so no latency occurs.
[0193] In the above configuration, remstat0 is updated only once per subblock. Therefore, it has the effect of minimizing the latency associated with the derivation of remstat0 while deriving cRiceParam, which minimizes the binary length of the residual, from remstat, which shows the magnitude of the residual with high accuracy.
[0194] (Example 3 of deriving remstat at the subblock level) The TU decoding unit 3024 may derive the state variable remstat according to the following pseudocode, and then derive the rice parameter cRiceParam. for subblock / / for(i = lastSubBlock; i >= 0; i--) { Determine sbType remstat0 = remstat[sbType] for decoding each coefficient / / for(n = numSbCoeff - 1; n >= 0; n--) { cRiceParam = funcRiceParam(remstat0, locSumAbs) The residuals are decoded based on cRiceParam to derive AbsLevel. remstat0 = (AbsLevel + 3 * remstat0) >> 2 if the name coefficient of the subblock remstat[sbType] = (AbsLevel + 3 * remstat[sbType]) >> 2 Here, remstat0 is set once per subblock using remstat[sbType]. remstat0 is updated each time a transformation coefficient is decoded. Then, remstat0 is used as an argument to the function funcRiceParam. Since remstat shows the magnitude of the residual with high precision, it is possible to derive a cRiceParam with a short binary length for the residual. On the other hand, remstat[sbType] is updated once per subblock. This suppresses the phenomenon in which the derived cRiceParam value differs greatly from the cRiceParam that gives the optimal binary length when the coefficients change significantly across subblocks, thereby improving encoding efficiency.
[0195] (Example 4: Deriving remstat for each coefficient unit) The TU decoding unit 3024 may derive the state variable remstat according to the following pseudocode, and then derive the rice parameter cRiceParam. for subblock / / for(i = lastSubBlock; i >= 0; i--) { Determine sbType for decoding each coefficient / / for(n = numSbCoeff - 1; n >= 0; n--) { cRiceParam = funcRiceParam(remstat[sbType], locSumAbs) The residuals are decoded based on cRiceParam to derive AbsLevel. remstat[sbType] = (AbsLevel + 3 * remstat[sbType]) >> 2 In the above configuration, the TU decoding unit 3024 uses AbsLebel to update remstat[sbType] for each sbType after decoding each conversion coefficient. The function funcRiceParam then uses remstat[sbType] as an argument. Since remstat[sbType] is derived for each conversion coefficient, it is possible to derive a cRiceParam that shortens the binary length of the residual. remstat[sbType] is the average magnitude of the residual of the conversion coefficient. Therefore, this has the effect of improving coding efficiency.
[0196] (Case distinctions for linear prediction parameters based on syntax elements and block size) The TU decoding unit 3024 may switch the linear prediction parameters according to tcoeff. For example, in the derivation example 2 of the state variable, the weight a related to the surrounding transformation coefficients, the correction term b, the shift value c, and the weight d related to the state variable remstat may be set as follows. if (tcoeff == 0) (formula LMC-2) / / abs_reminder, baseLevel != 0 { a = 3, b = 0, c = 4, d = 7} else { a = 7, b = 16, c = 4, d = 5} You can also set it as follows: if (tcoeff == 0) { a = 3, b = 0, c = 4, d = 5} else { a = 7, b = 16, c = 4, d = 3} (Example of RRC configuration using remstat) The TU decoding unit 3024 may switch the linear prediction parameters in addition to tcoeff, depending on the block size. For example, in the derivation example 1 of the state variable, the weight a related to the surrounding transformation coefficients, the correction term b, the shift value c, and the weight d related to the state variable remstat may be set as follows. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24, c = 4, d = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 8, c = 4, d = 2} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16, c = 4, d = 1} else { a = 2, b = 16, c = 4, d = 1} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8, c = 4, d = 3} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, c = 4, d = 2} else if (log2TbWidth + log2TbHeight < 9) { a = 6, b = 24, c = 4, d = 0} else { a = 5, b = 24, c = 4, d = 1} The following is also acceptable. c = 4 if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24, d = 4} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 8, d = 2} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16, d = 1} else { a = 2, b = 16, d = 1} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8, d = 3} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, d = 2} else if (log2TbWidth + log2TbHeight < 9) { a = 6, b = 24, d = 0} else { a = 5, b = 24, d = 1} The TU decoding unit 3024 may set the weight d to be smaller as the block size increases.
[0197] Furthermore, the TU decoding unit 3024 may use remstat only when the block size is smaller than the threshold TH3. if (log2TbWidth + log2TbHeight >= TH3) val = (a * locSumAbs + b) >> c else val = (a * locSumAbs + b + d * remstat) >> c Furthermore, in the derivation example 2 of the state variable, weight a, correction term b, shift value c, and weight d may be set as follows. if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24, c = 4, d = 6} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 8, c = 4, d = 5} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16, c = 4, d = 3} else { a = 2, b = 16, c = 4, d = 3} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8, c = 4, d = 5} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, c = 4, d = 5} else if (log2TbWidth + log2TbHeight < 9) { a = 6, b = 24, c = 4, d = 1} else { a = 5, b = 24, c = 4, d = 1} The following is also acceptable. c = 4 if (tcoeff == 0) / / abs_reminder, baseLevel != 0 if (log2TbWidth + log2TbHeight < 5) { a = 4, b = 24, d = 6} else if (log2TbWidth + log2TbHeight < 7) { a = 3, b = 8, d = 5} else if (log2TbWidth + log2TbHeight < 9) { a = 2, b = 16, d = 3} else { a = 2, b = 16, d = 3} else if (log2TbWidth + log2TbHeight < 5) { a = 8, b = 8, d = 5} else if (log2TbWidth + log2TbHeight < 7) { a = 7, b = 16, d = 5} else if (log2TbWidth + log2TbHeight < 9) { a = 6, b = 24, d = 1} else { a = 5, b = 24, d = 1} The TU decoding unit 3024 may set the weight d to be smaller as the block size increases.
[0198] Furthermore, the TU decoding unit 3024 may use remstat only when the block size is smaller than the threshold TH3. if (log2TbWidth + log2TbHeight >= TH3) val = (a * locSumAbs + b) >> c else val = (a * locSumAbs + b + d * remstat) >> c (Case distinctions for linear prediction parameters based on syntax elements and intra / interface) Furthermore, the TU decoding unit 3024 may switch the linear prediction parameters according to the current block's prediction mode (CuPredMode), in addition to the parameters (tcoeff, baseLevel). The linear prediction parameters may be a, b, c, and d. For example, they may be switched depending on whether CuPredMode is MODE_INTRA, MODE_INTER, or MODE_IBC, or they may be switched depending on whether it is MODE_INTRA or not. Different trends tend to appear in the correlation of the transformation coefficients depending on the block's prediction mode. Therefore, by switching the parameters for each block depending on the prediction mode, the predicted value becomes less likely to deviate from the original value (the absolute value of the coefficient to be decoded). As a result, the coding efficiency is improved.
[0199] (Prediction of the absolute value of the coefficients in the case of TSRC) In this embodiment, even in TSRC, a method may be used to derive the Rice parameter using the absolute values of the coefficients surrounding the target coefficient. Here, the prediction error coding method in transformation skip mode reverses the coefficient scan order compared to the normal prediction error coding method. That is, the TU decoding unit 3024 scans the coefficients from the top left to the bottom right in TSRC. Therefore, the TU decoding unit 3024 derives the sum of the absolute values t1 to t5 of the surrounding coefficients, locSumAbs, in TSRC as follows. Figure 14(c) shows the current scan position (xC, yC) and the surrounding coefficients t1 to t5.
[0200] locSumAbs = 0 if( xC > 0 ) { locSumAbs += AbsLevel[xC - 1][yC] if( xC > 1 ) locSumAbs += AbsLevel[xC - 2][yC] if( yC > 1 ) locSumAbs += AbsLevel[xC - 1][yC - 1] } if( yC > 0 ) { locSumAbs += AbsLevel[xC][yC - 1] if( yC > 1 ) locSumAbs += AbsLevel[xC][yC - 2] } locSumAbs0 = locSumAbs locSumAbs = Clip3( 0, 31, locSumAbs - baseLevel * 5 ) 1) When the coefficient position (xC-1, yC) is within a block (xC > 0), add t1(AbsLevel[xC-1][yC]) to locSumAbs. 2) When 1), if the position (xC-2, yC) is also inside the block (xC > 1), add t2(AbsLevel[xC-2][yC]) to locSumAbs. 3) When the position (xC-1, yC-1) is also inside the block (yC > 0), add t3(AbsLevel[xC-1][yC-1]) to locSumAbs. 4) When position (xC, yC-1) is inside a block (yC > 0), add t4(AbsLevel[xC][yC-1]) to locSumAbs. 5) When 4) is true, if the position (xC, yC-2) is also inside the block (yC > 1), add t5(AbsLevel[xC][yC-2]) to locSumAbs.
[0201] The TU decoding unit 3024 uses the locSumAbs (locSumAbs0) obtained above and applies the weight a, correction term b, and shift value c related to locSumAbs to the following linear equation to derive the predicted value val of the syntax element to be decoded (e.g., abs_remainder).
[0202] val = (a * locSumAbs + b) >> c You may also clip `val` to an appropriate range.
[0203] val = Clip3(0, VMAX, (a * locSumAbs + b) >> c) ) Here, VMAX is a constant that represents the maximum value of val. a, b, and c may be collectively referred to as the linear prediction parameters. For example, the TU decoding unit 3024 may set the linear prediction parameters a, b, and c as follows.
[0204] a = 4, b = 64, c = 4 (formula LMTSRC-1) (Example of TSRC configuration using remstat) The TU decoding unit 3024 may use remstat to obtain a predicted value val of the syntax element to be decoded, similar to the prediction of the absolute value of the coefficients in the case of RRC. That is, the weight a, correction term b, and shift value c related to locSumAbs are used, along with the weight d related to the state variable remstat. Then, the predicted value val is derived using the following linear equation, depending on locSumAbs and remstat.
[0205] val = (a * locSumAbs + b + d * remstat) >> c You may also clip `val` to an appropriate range.
[0206] val = Clip3(0, VMAX, (a * locSumAbs + b + d * remstat) >> c) ) Here, VMAX is a constant that represents the maximum value of val. a, b, c, and d can be collectively referred to as the parameters of linear prediction. Adding remstat makes the predicted value less likely to deviate from the original value (the absolute value of the coefficient to be decoded), thus improving coding efficiency.
[0207] For example, the TU decoding unit 3024 may set the linear prediction parameters a, b, c, and d as follows.
[0208] a = 4, b = 64, c = 4, d = 1 (formula LMTSRC-2) The TU decoding unit 3024 may derive the linear prediction parameters a, b, c, and d such that weight a is 0. For example, they may be set as follows:
[0209] a = 0, b = 0, c = 4, d = 22 (formula LMTSRC-3) Alternatively, you can set it as follows:
[0210] a = 0, b = 24, c = 4, d = 15 (formula LMTSRC-4) In other words, the TU decoding unit 3024 may derive the predicted value val of the conversion coefficient from remstat using the following formula.
[0211] val = (22 * remstat) >> 4) val = (24 + 15 * remstat) >> 4) It can be further simplified as follows:
[0212] val = (11 * remstat) >> 3) val = (12 + 8 * remstat) >> 3) It can be further simplified as follows:
[0213] val = (3 * remstat) >> 1) val = (3 + 2 * remstat) >> 1) In the prediction error coding method for the transformation skip mode, there may be no correlation between the coefficients of the block in question and the surrounding coefficients. In such cases, it may be possible to improve coding efficiency by removing the weight a (a=0) and using only remstat.
[0214] (Another way to derive locSumAbs) The locSumAbs of the coefficient decoded immediately before the target conversion coefficient may be stored in the variable prevLocSumAbs, and the locSumAbs of the target conversion coefficient may be derived using prevLocSumAbs. locSumAbs is the sum of the absolute values t1 to t5 of multiple conversion coefficients around the target conversion coefficient. For example, the TU decoding unit 3024 may store the sum of t1 to t5 in locSumAbs as shown in the following equation, and then update locSumAbs.
[0215] locSumAbs = t1 + t2 + t3 + t4 + t5 locSumAbs = (locSumAbs + prevLocSumAbs) >> 1 By taking the average of the sum of coefficients around the target transformation coefficient (LocSumAbs) and the sum of coefficients around the previously decoded transformation coefficient (prevLocSumAbs), abrupt changes in LocSumAbs are suppressed, resulting in a less susceptible effect to noise.
[0216] The update rate (weighting coefficient) WL is not limited to 0.5, but may be any other value.
[0217] locSumAbs = (WL * locSumAbs + ((1 << WLSHIFT) - WL) * prevLocSumAbs + 1<<(WLSHIFT-1)) >> WLSHIFT WLSHIFT is a value used to perform integer operations on the derivation of locSumAbs based on the update rate.
[0218] (Rice parameter derivation formula) When performing binarization of a given value using Golomb-Rice coding, it is possible to uniquely determine the Rice parameter that minimizes the length of the binary. The TU decoding unit 3024 derives the Rice parameter cRiceParam from the predicted value val obtained above using the following formula.
[0219] cRiceParam = val < 3 ? 0 : floor(log2(val / 3)) + 1(formula LMC-3) Logarithms with base 2, and their integer values obtained by calling the floor function, can be rapidly calculated by CPU software and hardware using built-in instructions such as BitScanReverse or clz. Therefore, as shown in the example above, using logarithms with base 2 has the effect of easily deriving the Rice parameter.
[0220] Furthermore, considering hardware implementation, the division operation may be replaced with a shift operation to derive the rice parameter cRiceParam. Figure 16 shows an example of a general formula for deriving cRiceParam from the predicted value val according to this embodiment. As shown in Figure 16(a), cRiceParam may also be derived using the slope parA, offset parB, and shift value parC. For example, in (Equation LMC-3), cRiceParam may be derived as follows.
[0221] cRiceParam = floor(log2((val * 5) >> 4)) + 1(formula LMC-4) Here, the coefficient of val in (Equation LMC-3), which is 1 / 3, is approximated and replaced with 5 / 16, but it can also be replaced with 1 / 4, 3 / 8, 5 / 16, 11 / 32, or 21 / 64. In other words, val / 3 can be replaced with val>>2, (val*3)>>3, (val*5)>>4, (val*11)>>5, or (val*21)>>6 and the calculation can be performed (and so on). Also, to avoid using 0 as an argument for log2, the following is also acceptable.
[0222] cRiceParam = val * 5 < 16 ? 0 : floor(log2((val * 5) >> 4)) + 1 The following is also acceptable.
[0223] cRiceParam = val < 3 ? 0 : floor(log2((val * 5) >> 4)) + 1 Alternatively, by moving the shift operation outside of log2 in Figure 16(a), cRiceParam may be derived using the slope parA and offset parB, as shown in Figure 16(b). For example, in (Equation LMC-3), cRiceParam may be derived as follows.
[0224] cRiceParam = floor(log2(val * 5)) - 3 Also, to avoid using 0 as an argument for log2, the following is also acceptable.
[0225] cRiceParam = val == 0 ? 0 : floor(log2(val * 5)) - 3 Alternatively, the minimum value may be clipped to 0 or greater, and the maximum value to NC or less. NC could be, for example, 15.
[0226] cRiceParam = Clip3(0, NC, cRiceParam) Through the above process, even when the absolute value of the conversion coefficient becomes large, the coding efficiency is improved by deriving appropriate Rice parameters corresponding to the absolute value.
[0227] (Example of a derivation formula 1) The calculations for linear prediction of locSubAbs and the derivation of cRiceParam may be merged as a single series of calculations.
[0228] val = (a * locSumAbs + b) >> c cRiceParam = floor(log2((val * 5) >> 4)) + 1 These equations may also be derived in a single equation. For example, the TU decoding unit 3024 may derive cRiceParam from the sum of products and shifts of locSumAbs, the base-2 logarithm, and the offset, as follows.
[0229] cRiceParam = floor(log2((aK * locSumAbs + bK) >> cK)) + 1 More generally, as shown in Figure 17(a), cRiceParam can be expressed by the following formula using the slope parA (=aK), offset parB (=bK), shift value parC (=cK), and offset parE.
[0230] cRiceParam = floor(log2( (parA * locSumAbs + parB) >> parC )) + parE Here, to avoid the argument of log2 being less than 1, cRiceParam can be derived from the following formula.
[0231] cRiceParam = locSumAbs < TK ? 0 : floor(log2( (parA * locSumAbs + parB) >> parC )) + parE Furthermore, to avoid the argument of log2() being less than 1, the following expression can also be used, where 1 is added to the term inside log2.
[0232] cRiceParam = floor(log2( ((parA * locSumAbs + parB) >> parC) + 1 )) + parE Note that here, aK = 5 * a, bK = 5 * b, and cK = (c+4). Here, a, b, and c can be derived using the same method as in this application. Also, TK is a threshold to avoid the argument of log2 being less than 1, and TK may be locSumAbs such that (aK * locSumAbs + bK) >> cK = 1. In other words, TK may also be derived as follows.
[0233] TK = ceil(((1< <cK) - bK) / aK) For example, using (Equation LMC-1), the TU decoding unit 3024 may derive cRiceParam as follows.
[0234] if (baseLevel != 0) / / a = 3 (aK=15), b = 0 (bK=0), c = 4 (cK=8) cRiceParam = locSumAbs < 18 ? 0 : floor(log2((15 * locSumAbs + 0) >> 8)) + 1 else / / a = 7 (aK=35), b = 16 (bK=80), c = 4 (cK=8) cRiceParam = locSumAbs < 6 ? 0 : floor(log2((35 * locSumAbs + 80) >> 8)) + 1 Here, `baseLevel != 0` means that the syntax element of the residual being targeted is `abs_reminder`, and this can also be determined by checking `tcoeff == 0` (and so on).
[0235] In the case of TSRC, the TU decoding unit 3024 may also derive cRiceParam as follows using (formula LMTSRC-1).
[0236] cRiceParam = floor(log2((20 * locSumAbs + 320) >> 8)) + 1 The expression can also be rearranged as follows:
[0237] cRiceParam = floor(log2((5 * locSumAbs + 80) >> 6)) + 1 (Example 1 of a derivation formula when using remstat) The above (Example 1 of the derivation formula) may also be applied when using remstat.
[0238] The TU decoding unit 3024 may derive cRiceParam from the sum of products of locSumAbs and remstat, and the addition of the shift, the base-2 logarithm, and the offset, as follows:
[0239] cRiceParam = floor(log2((aK * locSumAbs + bK + dK * remstat) >> cK)) + 1 More generally, as shown in Figure 17(d), cRiceParam can be derived from the following equation using the slope parA (=aK), offset parB (=bK), slope parD (=dK), shift value parC (=cK), and offset parE.
[0240] cRiceParam = floor(log2( (parA * locSumAbs + parB + parD * remstat) >> parC )) + parE Here, to avoid the argument of log2 being less than 1, cRiceParam can be derived from the following formula.
[0241] cRiceParam = parA * locSumAbs + parD * remstat < (1 << parC) - parB ? 0 : floor(log2( (parA * locSumAbs + parB + parD * remstat) >> parC )) + parE Note that here, aK = 5 * a, bK = 5 * b, cK = (c+4), and dK = 5 * d may also be used. The derivation methods shown in (Example of RRC configuration using remstat) and (Example of TSRC configuration using remstat) of this application can be used as is to derive a, b, c, and d. For example, in the case of (Equation LMC-2), cRiceParam may be derived as follows.
[0242] if (baseLevel != 0) / / a = 3 (aK=15), b = 0 (bK=0), c = 4 (cK=8), d = 7 (dK=35) cRiceParam = 15 * locSumAbs + 35 * remstat < 256 ? 0 : floor(log2((15 * locSumAbs + 0 + 35 * remstat) >> 8)) + 1 else / / a = 7 (aK=35), b = 16 (bK=80), c = 4 (cK=8), d = 5 (dK=25) cRiceParam = 35 * locSumAbs + 25 * remstat < 176 ? 0 : floor(log2((35 * locSumAbs + 80 + 25 * remstat) >> 8)) + 1 In the case of TSRC, the TU decoding unit 3024 may also derive cRiceParam using any of (Equation LMTSRC-2), (Equation LMTSRC-3), or (Equation LMTSRC-4) as follows. Here, aK = 4 * 5 = 20, bK = 64 * 5 = 320, and cK = 4 + 4 = 8.
[0243] cRiceParam = floor(log2((20 * locSumAbs + 320 + 5 * remstat) >> 8)) + 1 cRiceParam = remstat < 3 ? 0 : floor(log2(( 110 * remstat) >> 8)) + 1 cRiceParam = remstat < 2 ? 0 : floor(log2((120 + 75 * remstat) >> 8)) + 1 Furthermore, the minimum value may be clipped to 0 or greater, and the maximum value to NC or less.
[0244] cRiceParam = Clip3(0, NC, cRiceParam) In the above derivation example 1, cRiceParam can be derived in a simple formula from the logarithm of the values derived from the linear forms of locSumAbs, slope aK, and bias bK, as well as the shift. Furthermore, slope aK and bias bK can be changed according to the syntax value, block size, and position within the block.
[0245] As already explained, base-2 logarithms, and their integer values obtained by calling the floor function, can be rapidly calculated by CPU software and hardware using built-in instructions called BitScanReverse or clz. Therefore, as in the example above, using base-2 logarithms has the effect of easily deriving the Rice parameter.
[0246] (Example of a derivation formula 2) Furthermore, in (Example 1 of the derivation formula), the TU decoding unit 3024 may derive cRiceParam from the sum of the products of locSumAbs, the shift, the base-2 logarithm, and the offset by moving the shift operation outside of log2, using the following formula.
[0247] cRiceParam = floor(log2(aK * locSumAbs + bK)) - cK2 Here, we can also write cK2 = (c+4-1) = c+3.
[0248] Also, since cRiceParam only needs to be 0 or greater, the following is also acceptable. TK is the same value as (Example 1 of the derivation formula).
[0249] cRiceParam = locSumAbs < TK ? 0 : floor(log2(aK * locSumAbs + bK)) - cK2 cRiceParam = Max(0, floor(log2(aK * locSumAbs + bK)) - cK2) For example, using (Equation LMC-1), the TU decoding unit 3024 may derive cRiceParam as follows.
[0250] if (baseLevel != 0) / / a = 3, b = 0, c = 4 cRiceParam = Max(0, floor(log2(15 * locSumAbs + 0)) - 7) else / / a = 7, b = 16, c = 4 cRiceParam = Max(0, floor(log2(35 * locSumAbs + 80)) - 7) In addition to setting the minimum value to 0 or greater, you can also clip the maximum value to NC or less.
[0251] cRiceParam = Clip3(0, NC, floor(log2(35 * locSumAbs + 80)) - 7) As a further simplified configuration, the TU decoding unit 3024 may derive cRiceParam as follows.
[0252] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2(15 * locSumAbs)) - 7) else cRiceParam = Max(0, floor(log2(9 * locSumAbs) + 20) - 5) As a further simplified configuration, the TU decoding unit 3024 may derive cRiceParam as follows.
[0253] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2(4 * locSumAbs)) - 5) else cRiceParam = Max(0, floor(log2(9 * locSumAbs) + 20) - 5) As an equivalent process to the above equation, the TU decoding unit 3024 may derive cRiceParam as follows.
[0254] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2(locSumAbs)) - 3) else cRiceParam = Max(0, floor(log2(9 * locSumAbs) + 20) - 5) More generally, as shown in Figure 17(b), the TU decoding unit 3024 may derive cRiceParam from the following equation using locSumAbs, slope parA (=aK), offset parB (=bK), and offset parE (=-cK2).
[0255] cRiceParam = floor(log2( (parA * locSumAbs + parB) ) + parE) In the case of TSRC, the TU decoding unit 3024 may also derive cRiceParam as follows using (formula LMTSRC-1).
[0256] cRiceParam = Max(0, floor(log2(5 * locSumAbs + 80)) - 5) As shown in Figure 17(e), the TU decoding unit 3024 may derive cParam from the following equation using locSumAbs, remstat, and slope parA (=aK), offset parB (=bK), slope parD (=dK), and offset parE (=-cK2).
[0257] cRiceParam = floor(log2( (parA * locSumAbs + parB + parD * remstat)) + parE For example, using (Equation LMC-2), the TU decoding unit 3024 may derive cRiceParam as follows.
[0258] if (baseLevel != 0) / / a = 3, b = 0, c = 4, d = 7 cRiceParam = Max(0, floor(log2(15 * locSumAbs + 35 * remstat)) - 7) else / / a = 7, b = 16, c = 4, d = 5 cRiceParam = Max(0, floor(log2(35 * locSumAbs + 80 + 25 * remstat)) - 7) Furthermore, the TU decoding unit 3024 may derive cRiceParam using values other than the above parA, parB, parD, and parE, as follows.
[0259] if (baseLevel != 0) / / parA = 1, parB = 1, parD = 13, parE = -5 cRiceParam = Max(0, floor(log2(locSumAbs + 1 + 13 * remstat)) - 5) else / / parA = 6, parB = 11, parD = 14, parE = -5 cRiceParam = Max(0, floor(log2(6 * locSumAbs + 11 + 14 * remstat)) - 5) In other words, when using remstat, the same offset value parE may be used for both baseLevel!=0 (abs_reminder) and baseLevel==0 (dec_abs_level) (and so on). Also, the value of the slope parD for remstat in the case of baseLevel!=0 (abs_reminder) may be smaller than the value of parD in the case of baseLevel==0 (dec_abs_level).
[0260] Alternatively, cRiceParam can be derived as follows.
[0261] if (baseLevel != 0) / / parA = 1, parB = 0, parD = 12, parE = -5 cRiceParam = Max(0, floor(log2(locSumAbs + 12 * remstat)) - 5) else / / parA = 6, parB = 10, parD = 12, parE = -5 cRiceParam = Max(0, floor(log2(6 * locSumAbs + 10 + 12 * remstat)) - 5) Alternatively, the TU decoding unit 3024 may derive cRiceParam as follows.
[0262] if (baseLevel != 0) / / parA = 1, parB = 0, parD = 12, parE = -5 cRiceParam = Max(0, floor(log2(locSumAbs + 12 * remstat)) - 5) else / / parA = 6, parB = 0, parD = 13, parE = -5 cRiceParam = Max(0, floor(log2(6 * locSumAbs + 13 * remstat)) - 5) Furthermore, the TU decoding unit 3024 may derive cRiceParam as follows, using the example of (parameter distinction of syntax elements and intra / inter) in (example of RRC configuration using remstat).
[0263] if (baseLevel != 0) if (CuPredMode == MODE_INTRA) cRiceParam = Max(0, floor(log2(15 * locSumAbs + 35 * remstat)) - 7) else / / CuPredMode == MODE_INTER, MODE_IBC cRiceParam = Max(0, floor(log2(locSumAbs + 12 * remstat)) - 5) else / / baseLevel == 0 if (CuPredMode == MODE_INTRA) cRiceParam = Max(0, floor(log2(35 * locSumAbs + 80 + 25 * remstat)) - 7) else / / CuPredMode == MODE_INTER, MODE_IBC cRiceParam = Max(0, floor(log2(6 * locSumAbs + 13 * remstat)) - 5) As shown above, the slope value for locSumAbs in the case of an intranet may be greater than the slope value for an internet network. Similarly, the slope value for remstat in the case of an intranet may be greater than the slope value for an internet network.
[0264] In the case of TSRC, the TU decoding unit 3024 may also derive cRiceParam as follows, using any of (formula LMTSRC-2), (formula LMTSRC-3), or (formula LMTSRC-4).
[0265] cRiceParam = Max(0, floor(log2(20 * locSumAbs + 320 + 5 * remstat) - 7) cRiceParam = Max(0, floor(log2( 110 * remstat) - 7) cRiceParam = Max(0, floor(log2(120 + 75 * remstat) - 7) The above example (Derivation Equation 2) has the effect of allowing cRiceParam to be derived in a simple formula from the logarithm of locSumAbs and the values derived from the linear forms of aK and bK, and cK2. Furthermore, aK and bK can be changed according to the syntax value, block size, and position within the block.
[0266] (Example of a derivation formula 3) In (Example 2 of the derivation formula), by approximating the value of the slope aK as a power of 2, cRiceParam can be easily calculated by shifting. In other words, the TU decoding unit 3024 may derive cRiceParam from the shift and addition of locSumAbs, and the addition of the base-2 logarithm and offset, as follows.
[0267] cRiceParam = Max(0, floor(log2((locSumAbs< <aS) + bK)) - cK2) Here, aS = floor(log2(aK) + 0.5). Max() is an operation to ensure that the minimum value of the derived cRiceParam is greater than or equal to 0. Further clipping may be performed considering the minimum value.
[0268] cRiceParam = Clip3(0, NC, floor(log2((locSumAbs< <aS) + bK)) - cK2) Here, the maximum value NC used for clipping can be, for example, 15.
[0269] More specifically, the TU decoding unit 3024 may round the value (15,35) of (Equation LMC-1) to a power of 2 (16,32) to derive cRiceParam as follows.
[0270] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2(locSumAbs<<4)) - 7) else cRiceParam = Max(0, floor(log2(locSumAbs<<5) + 80) - 7) For further simplification, the TU decoding unit 3024 may derive cRiceParam as follows.
[0271] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2(locSumAbs)) - 3) else cRiceParam = Max(0, floor(log2(locSumAbs) + 5) - 2) More generally, as shown in Figure 17(c), cRiceParam can be derived from the following equation using the shift value parS (=aS), offset parB (=bK), and offset parE (=-cK2).
[0272] cRiceParam = floor(log2( (locSumAbs< <parS) + parB)) + parE In the case of TSRC, the TU decoding unit 3024 may also derive cRiceParam by rounding the value of (Equation LMTSRC-1) to a power of 2 and using locSumAbs, shift processing, and log2 processing as follows.
[0273] cRiceParam = Max(0, floor(log2((locSumAbs<<2) + 80)) - 5) For further simplification, the TU decoding unit 3024 may derive cRiceParam as follows.
[0274] cRiceParam = Max(0, floor(log2(locSumAbs + 20)) - 3) The TU decoding unit 3024 may derive cRiceParam from the following equation using locSumAbs, remstat, slope shift value parS (=aS), offset parB (=bK), shift value parT (=dT), and offset parE (=-cK2), as shown in Figure 17(f).
[0275] cRiceParam = floor(log2( (locSumAbs< <parS) + parB + (remstat<<parT) )) + parE For example, using (Equation LMC-2), the TU decoding unit 3024 may derive cRiceParam as follows.
[0276] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2((locSumAbs<<4) + (remstat<<5)) ) - 7) else cRiceParam = Max(0, floor(log2((locSumAbs<<5) + 80 + (remstat<<5))) - 7) For further simplification, the TU decoding unit 3024 may derive cRiceParam as follows.
[0277] if (baseLevel != 0) / / tcoeff == 0 cRiceParam = Max(0, floor(log2(locSumAbs + (remstat<<1)) ) - 3) else cRiceParam = Max(0, floor(log2(locSumAbs + 1 + remstat)) - 2) In the case of TSRC, the TU decoding unit 3024 may also derive cRiceParam as follows using any of (formula LMTSRC-2), (formula LMTSRC-3), or (formula LMTSRC-4).
[0278] cRiceParam = Max(0, floor(log2(5 * locSumAbs + 80 + remstat) - 5)) cRiceParam = Max(0, floor(log2(remstat))) cRiceParam = Max(0, floor(log2(15 + 10 * remstat) - 4)) cRiceParam = Max(0, floor(log2(4 + 3 * remstat) - 2)) In the above derivation example 3, the effect is that cRiceParam can be derived in a simple formula from the linear form of locSumAbs, the shift value aS, and the bias bK, as well as the shift.
[0279] (Transmission of linear prediction parameters) The header decoding unit 3020 may decode weight a, correction term b, and weight d related to the state variable remstat from the encoded data, which are used to predict the rice parameter. Alternatively, the TU decoding unit 3024 may derive the rice parameter cRiceParam using the values of the linear prediction parameters and one of the above derivation methods, for example, derivation examples 1 to 3, and decode the residual absolute value difference abs_remainder and the residual absolute value dec_abs_level. The linear prediction parameters are the decoded linear prediction weight a, correction term b, weight d, etc.
[0280] More specifically, the above-mentioned parA, parB, parC, parE, parS, or a part thereof, may be decoded from the encoded data, and cRiceParam may be derived by linear prediction such as equations (a), (b), and (c) in Figure 17.
[0281] Figure 18(a) shows an example of a parameter syntax table for this embodiment. The header decoding unit 3020 decodes the flag rice_adaptation_enabled_flag, which indicates whether or not to notify rice parameters, from the SPS or PPS or slice header. If rice_adaptation_enabled_flag is 1, it decodes slice_rice_paramA_minus1, slice_rice_paramB, slice_paramC, and slice_paramD. For example, parA = slice_rice_paramA_minus1+1, parB = slice_rice_paramB, parC = slice_rice_paramC, and parD = slice_rice_paramD are derived. Furthermore, cRiceParam may be derived using parA, parB, parC, parD and locAbsSum (=locAbsSum0) according to the formula in Figure 17(a). Note that only slice_rice_paramA_minus1 has a fixed offset, which is the difference value from 1. However, it is not limited to this, and the syntax elements slice_rice_paramA_minusVA, slice_rice_paramA_minusVB, slice_rice_paramA_minusVC, and slice_rice_paramA_minusVD using predetermined offsets VA, VB, VC, and VD may be decoded and parA, parB, parC, and parD may be derived as follows.
[0282] parA = slice_rice_paramA_minusVA + VA parB = slice_rice_paramB_minusVB + VB parC = slice_rice_paramC_minusVC + VC parD = slice_rice_paramD_minusVD + VD Furthermore, the parameters used to decode abs_remainder and the parameters used to decode dec_abs_level may be decoded using different syntax. For example, slice_rice_rem_paramA, slice_rice_rem_paramB, slice_rice_rem_paramC, and slice_rice_rem_paramD may be decoded. Then, in the case of abs_reminder, the rice parameters may be derived using these parameters, and abs_reminder may be decoded. Alternatively, slice_rice_abs_paramA, slice_rice_abs_paramB, slice_rice_abs_paramC, and slice_rice_abs_paramD may be decoded. Then, in the case of dec_abs_level, the rice parameters may be derived using these parameters, and dec_abs_level may be decoded. Figures 18(b) and (c) show examples where different syntax is used for abs_remainder and dec_abs_level, although the types of parameters are different.
[0283] Furthermore, in the case of TSRC, a different syntax may be decoded and used to derive the rice parameters used to decode the residuals of TSRC. For example, all or part of slice_rice_ts_paramA, slice_rice_ts_paramB, slice_rice_ts_paramC, and slice_rice_ts_paramD may be decoded. Then, parA, parB, parC, and parD may be derived, and the residual abs_reminder of TSRC may be decoded.
[0284] Figure 18(b) shows an example of a parameter syntax table for this embodiment. The header decoding unit 3020 decodes the flag rice_adaptation_enabled_flag, which indicates whether or not to notify rice parameters, from the SPS or PPS or slice header. If rice_adaptation_enabled_flag is 1, it decodes slice_rice_xxx_paramA_minus1, slice_rice_xxx_paramB, and slice_rice_xxx_paramD. As shown in the figure, xxx is set to either rem or abs. The parameters used to decode abs_remainder and the parameters used to decode dec_abs_level may be decoded using different syntax elements. For example, parA = slice_rice_xxx_paramA_minus1 + 1, parB = slice_rice_xxx_paramB, and parD = slice_rice_xxx_paramD. In abs_remainder, xxx is set to rem, and in other cases, xxx is set to abs. Here too, the syntax values may be encoded using predetermined offsets. In this case, the header decoding unit 3020 adds predetermined offsets VA, VB, and VD to the decoded syntax, respectively. Furthermore, cRiceParam may be derived using parA, parB, parD and locAbsSum (=locAbsSum0) according to the formula in Figure 17(b).
[0285] Figure 18(c) shows an example of a parameter syntax table for this embodiment. The header decoding unit 3020 decodes the flag rice_adaptation_enabled_flag, which indicates whether or not to notify rice parameters, from the SPS or PPS or slice header. If rice_adaptation_enabled_flag is 1, it decodes slice_rice_xxx_paramS_minus1, slice_rice_xxx_paramB, and slice_rice_xxxparamD. For example, parS = slice_rice_xxx_paramS_minus1 + 1, parB = slice_xxx_rice_paramB, and parD = slice_xxx_rice_paramD. As already explained, different syntax elements may be used for abs_remainder and dec_abs_level, and the parameters may be switched depending on whether it is abs_remainder or dec_abs_level. Alternatively, predetermined offsets VS, VB, and VD may be added to the decoded syntax elements, respectively. Furthermore, cRiceParam may be derived using parS, parB, parD and locAbsSum (=locAbsSum0) according to the formula in Figure 17(c).
[0286] The header decoding unit and TU decoding unit 3024 may transmit parameters for each sequence, regardless of the above. Alternatively, parameters may be transmitted for each picture or for each slice. By transmitting appropriate parameters according to the state of the sequence, picture, slice, etc., the predicted value becomes less likely to deviate from the original value (the absolute value of the coefficient to be decoded), resulting in improved encoding efficiency.
[0287] The inverse quantization / inverse transformation unit 311 scales (inverse quantizes) the quantization transformation coefficients input from the entropy decoding unit 301 to obtain the transformation coefficients d[][]. These quantization transformation coefficients are obtained by quantizing the prediction error in the encoding process by performing transformations such as DCT (Discrete Cosine Transform) and DST (Discrete Sine Transform). If transform_skip_flag is 0, the inverse quantization / inverse transformation unit 311 performs inverse frequency transformations such as inverse DCT and inverse DST on the scaled transformation coefficients d[][] to calculate the prediction error res[][]. If transform_skip_flag is 1, the inverse quantization / inverse transformation unit 311 sets res[x][y]=d[x][y]. The inverse quantization / inverse transformation unit 311 outputs the prediction error to the summing unit 312.
[0288] Note that since inverse transformations and transformations are paired operations, they can be interpreted as interchangeable. Alternatively, if an inverse transformation is called a transformation, then a transformation can be called a forward transformation. For example, if an inverse inseparable transformation is called an inseparable transformation, then an inseparable transformation can be called a forward inseparable transformation. Also, a separable transformation is simply called a transformation.
[0289] The summing unit 312 adds the predicted image of the block input from the prediction image generation unit 308 and the prediction error input from the inverse quantization / inverse transform unit 311 pixel by pixel to generate a decoded image of the block. The summing unit 312 stores the decoded image of the block in the reference picture memory 306 and also outputs it to the loop filter 305.
[0290] (Configuration of the video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Figure 13 is a block diagram showing the configuration of the video encoding device 11 according to this embodiment. The video encoding device 11 includes a prediction image generation unit 101, a subtraction unit 102, a transformation / quantization unit 103, an inverse quantization / inverse transformation unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, a reference picture memory (reference image storage unit, frame memory) 109, an encoding parameter determination unit 110, a parameter encoding unit 111, and an entropy encoding unit 104.
[0291] The predictive image generation unit 101 generates a predictive image for each CU, which is a region obtained by dividing each picture of image T. The predictive image generation unit 101 operates in the same way as the predictive image generation unit 308 already described, so its explanation is omitted.
[0292] The subtraction unit 102 subtracts the pixel values of the predicted image of the block input from the predicted image generation unit 101 from the pixel values of image T to generate a prediction error. The subtraction unit 102 outputs the prediction error to the conversion / quantization unit 103.
[0293] The conversion / quantization unit 103 calculates conversion coefficients by frequency conversion for the prediction error input from the subtraction unit 102, and derives quantized conversion coefficients by quantization. The conversion / quantization unit 103 outputs the quantized conversion coefficients to the entropy coding unit 104 and the inverse quantization / inverse conversion unit 105.
[0294] The inverse quantization / inverse transformation unit 105 is the same as the inverse quantization / inverse transformation unit 311 (Figure 10) in the video decoding device 31, and therefore its explanation is omitted. The calculated prediction error is output to the summing unit 106.
[0295] The entropy coding unit 104 receives quantization conversion coefficients from the conversion / quantization unit 103 and coding parameters from the parameter coding unit 111. The coding parameters are, for example, CuPredMode, which indicates the prediction mode. CuPredMode may be MODE_INTRA, which indicates intra-prediction, MODE_INTER, which indicates inter-prediction, or MODE_INTRA, MODE_INTER, or MODE_IBC, which indicates intra-block copy prediction, where blocks on the screen are copied to create the predicted image.
[0296] The entropy coding unit 104 entropy codes the division information, prediction parameters, quantization conversion coefficients, etc., to generate and output an encoded stream Te.
[0297] The parameter coding unit 111 includes a header coding unit 1110 (not shown), a CT information coding unit 1111, a CU coding unit 1112 (predictive mode coding unit), and an inter-predictive parameter coding unit 112 and an intra-predictive parameter coding unit 113. The CU coding unit 1112 further includes a TU coding unit 1114.
[0298] The following describes the general operation of each module. The parameter coding unit 111 performs encoding processing on parameters such as header information, partitioning information, prediction information, and quantization conversion coefficients.
[0299] The CT information encoding unit 1111 encodes QT, MT (BT, TT) division information, etc., from the encoded data.
[0300] The CU encoding unit 1112 encodes CU information, prediction information, TU partitioning flag, CU residual flag, etc.
[0301] The TU encoding unit 1114 encodes the QP update information and quantization conversion coefficients when the TU contains a prediction error.
[0302] The CT information coding unit 1111 and the CU coding unit 1112 supply syntax elements such as inter-prediction parameters, intra-prediction parameters, and quantization conversion coefficients to the entropy coding unit 104.
[0303] The addition unit 106 generates a decoded image by adding the pixel values of the predicted image of the block input from the predicted image generation unit 101 and the prediction error input from the inverse quantization / inverse transform unit 105 for each pixel. The addition unit 106 stores the generated decoded image in the reference picture memory 109.
[0304] The loop filter 107 applies a deblocking filter, SAO, and ALF to the decoded image generated by the summing unit 106. Note that the loop filter 107 does not necessarily have to include the above three types of filters; for example, it may consist of only a deblocking filter.
[0305] SAO is a filter that adds an offset according to the classification result on a sample-by-sample basis, while ALF is a filter that uses the sum of products of the transmitted filter coefficients and the reference image (or the difference between the reference image and the target pixel).
[0306] The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in predetermined locations for each target picture and CU.
[0307] The reference picture memory 109 stores the decoded images generated by the loop filter 107 at predetermined locations for each target picture and CU.
[0308] The coding parameter determination unit 110 selects one set from among several sets of coding parameters. The coding parameters are the QT, BT, or TT segmentation information, prediction parameters, or parameters that are to be coded and generated in relation to these. The prediction image generation unit 101 generates a prediction image using these coding parameters.
[0309] The coding parameter determination unit 110 calculates an RD cost value for each of the multiple sets, which indicates the amount of information and the coding error. The coding parameter determination unit 110 selects the set of coding parameters that minimizes the calculated cost value. As a result, the entropy coding unit 104 outputs the selected set of coding parameters as a coded stream Te. The coding parameter determination unit 110 stores the determined coding parameters in the prediction parameter memory 108.
[0310] Furthermore, some parts of the video encoding device 11 and video decoding device 31 in the above-described embodiment, such as the entropy decoding unit 301, parameter decoding unit 302, loop filter 305, prediction image generation unit 308, inverse quantization / inverse transformation unit 311, addition unit 312, prediction image generation unit 101, subtraction unit 102, transformation / quantization unit 103, entropy encoding unit 104, inverse quantization / inverse transformation unit 105, loop filter 107, encoding parameter determination unit 110, and parameter encoding unit 111, may be implemented using a computer. In that case, a program for realizing this control function may be recorded on a computer-readable recording medium, and the program recorded on this recording medium may be loaded into a computer system and executed. Hereinafter, "computer system" refers to a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. Furthermore, "computer-readable recording media" refers to portable media such as flexible disks, magneto-optical disks, ROMs, and CD-ROMs, as well as storage devices such as hard disks built into computer systems. In addition, "computer-readable recording media" may also include those that dynamically hold programs for a short period of time, such as communication lines used when transmitting programs over networks such as the Internet or communication lines such as telephone lines, and those that hold programs for a certain period of time, such as volatile memory inside computer systems that act as servers or clients in such cases. Moreover, the above-mentioned programs may be for the purpose of realizing some of the functions described above, and may also be able to realize the above-mentioned functions in combination with programs already recorded in the computer system.
[0311] Furthermore, some or all of the video encoding device 11 and video decoding device 31 in the above-described embodiment may be implemented as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the video encoding device 11 and video decoding device 31 may be individually implemented as a processor, or some or all of them may be integrated into a single processor. In addition, the method of implementing the integrated circuit is not limited to LSIs; it may also be implemented using dedicated circuits or general-purpose processors. Furthermore, if an integrated circuit technology that can replace LSIs emerges due to advances in semiconductor technology, an integrated circuit using that technology may be used.
[0312] Although one embodiment of this invention has been described in detail above with reference to the drawings, the specific configuration is not limited to that described above, and various design changes can be made without departing from the spirit of this invention.
[0313] [Application Examples] The video encoding device 11 and video decoding device 31 described above can be installed and used in various devices that transmit, receive, record, and play back video. The video may be natural video captured by a camera or the like, or it may be artificial video (including CG and GUI) generated by a computer or the like.
[0314] First, with reference to Figure 2, we will explain how the aforementioned video encoding device 11 and video decoding device 31 can be used for transmitting and receiving video.
[0315] Figure 2 shows a block diagram illustrating the configuration of the transmitter PROD_A equipped with the video encoding device 11. As shown in the figure, the transmitter PROD_A includes an encoding unit PROD_A1 that obtains encoded data by encoding video, a modulation unit PROD_A2 that obtains a modulated signal by modulating a carrier wave with the encoded data obtained by the encoding unit PROD_A1, and a transmitter PROD_A3 that transmits the modulated signal obtained by the modulation unit PROD_A2. The video encoding device 11 described above is used as this encoding unit PROD_A1.
[0316] The transmitting device PROD_A may further include a camera PROD_A4 for capturing moving images, a recording medium PROD_A5 for recording the moving images, an input terminal PROD_A6 for receiving moving images from an external source, and an image processing unit A7 for generating or processing images, as sources for supplying moving images to the encoding unit PROD_A1. In the figure, a configuration in which the transmitting device PROD_A includes all of these is shown as an example, but some may be omitted.
[0317] The recording medium PROD_A5 may contain unencoded video footage, or it may contain video footage encoded using a recording encoding method different from the transmission encoding method. In the latter case, a decoding unit (not shown) may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1 to decode the encoded data read from the recording medium PROD_A5 according to the recording encoding method.
[0318] Figure 2 also shows a block diagram illustrating the configuration of the receiver PROD_B equipped with the video decoding device 31. As shown in the figure, the receiver PROD_B comprises a receiver PROD_B1 that receives a modulated signal, a demodulation unit PROD_B2 that obtains encoded data by demodulating the modulated signal received by the receiver PROD_B1, and a decoding unit PROD_B3 that obtains a video by decoding the encoded data obtained by the demodulation unit PROD_B2. The video decoding device 31 described above is used as this decoding unit PROD_B3.
[0319] The receiving device PROD_B may further include a display PROD_B4 for displaying the video, a recording medium PROD_B5 for recording the video, and an output terminal PROD_B6 for outputting the video to the outside, as recipients of the video output from the decoding unit PROD_B3. In the figure, a configuration in which the receiving device PROD_B includes all of these is shown as an example, but some may be omitted.
[0320] The recording medium PROD_B5 may be for recording unencoded video, or it may be encoded using a recording encoding method different from the transmission encoding method. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_B3 and the recording medium PROD_B5, which encodes the video acquired from the decoding unit PROD_B3 according to the recording encoding method.
[0321] The transmission medium for transmitting the modulated signal may be wireless or wired. Furthermore, the transmission method for transmitting the modulated signal may be broadcasting (referring here to a transmission method where the destination is not predetermined) or communication (referring here to a transmission method where the destination is predetermined). In other words, the transmission of the modulated signal may be achieved by wireless broadcasting, wired broadcasting, wireless communication, or wired communication.
[0322] For example, a terrestrial digital broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals wirelessly. Similarly, a cable television broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals via wired broadcasting.
[0323] Furthermore, servers (workstations, etc.) and clients (television receivers, personal computers, smartphones, etc.) of internet-based VOD (Video On Demand) services and video sharing services are examples of transmitting devices PROD_A and receiving devices PROD_B that transmit and receive modulated signals via communication (typically, either wireless or wired is used as the transmission medium in a LAN, and wired is used as the transmission medium in a WAN). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Smartphones also include multi-function mobile phone terminals.
[0324] Furthermore, the video sharing service client has the function of decrypting encoded data downloaded from the server and displaying it on the screen, as well as the function of encoding video images captured by the camera and uploading them to the server. In other words, the video sharing service client functions as both a transmitting device PROD_A and a receiving device PROD_B.
[0325] Next, with reference to Figure 3, we will explain how the aforementioned video encoding device 11 and video decoding device 31 can be used for recording and playing back video.
[0326] Figure 3 shows a block diagram illustrating the configuration of the recording device PROD_C equipped with the aforementioned video encoding device 11. As shown in the figure, the recording device PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding video, and a writing unit PROD_C2 that writes the encoded data obtained by the encoding unit PROD_C1 to the recording medium PROD_M. The aforementioned video encoding device 11 is used as this encoding unit PROD_C1.
[0327] The recording medium PROD_M may be (1) a type built into the recording device PROD_C, such as an HDD (Hard Disk Drive) or SSD (Solid State Drive), (2) a type connected to the recording device PROD_C, such as an SD memory card or USB (Universal Serial Bus) flash memory, or (3) a type loaded into a drive device (not shown) built into the recording device PROD_C, such as a DVD (Digital Versatile Disc: registered trademark) or BD (Blu-ray Disc: registered trademark).
[0328] Furthermore, the recording device PROD_C may also include a camera PROD_C3 for capturing moving images, an input terminal PROD_C4 for receiving moving images from an external source, a receiving unit PROD_C5 for receiving moving images, and an image processing unit PROD_C6 for generating or processing images, as sources of moving images to be input to the encoding unit PROD_C1. In the figure, a configuration in which the recording device PROD_C includes all of these is shown as an example, but some may be omitted.
[0329] The receiving unit PROD_C5 may receive unencoded video footage, or it may receive encoded data encoded using a transmission encoding scheme different from the recording encoding scheme. In the latter case, it is preferable to interpose a transmission decoding unit (not shown) between the receiving unit PROD_C5 and the encoding unit PROD_C1 to decode the encoded data encoded using the transmission encoding scheme.
[0330] Examples of such recording devices PROD_C include DVD recorders, BD recorders, and HDD (Hard Disk Drive) recorders (in this case, the input terminal PROD_C4 or the receiver PROD_C5 is the main source of moving images). Camcorders (in this case, the camera PROD_C3 is the main source of moving images), personal computers (in this case, the receiver PROD_C5 or the image processing unit C6 is the main source of moving images), and smartphones (in this case, the camera PROD_C3 or the receiver PROD_C5 is the main source of moving images) are also examples of such recording devices PROD_C.
[0331] Figure 3 also shows a block diagram illustrating the configuration of the playback device PROD_D equipped with the aforementioned video decoding device 31. As shown in the figure, the playback device PROD_D includes a reading unit PROD_D1 that reads encoded data written to the recording medium PROD_M, and a decoding unit PROD_D2 that obtains a video by decoding the encoded data read by the reading unit PROD_D1. The aforementioned video decoding device 31 is used as this decoding unit PROD_D2.
[0332] The recording medium PROD_M may be (1) a type built into the playback device PROD_D, such as an HDD or SSD; (2) a type connected to the playback device PROD_D, such as an SD memory card or USB flash memory; or (3) a type loaded into a drive device (not shown) built into the playback device PROD_D, such as a DVD or BD.
[0333] Furthermore, the playback device PROD_D may also include a display PROD_D3 for displaying the video, an output terminal PROD_D4 for outputting the video externally, and a transmission unit PROD_D5 for transmitting the video, as recipients of the video output from the decoding unit PROD_D2. In the figure, a configuration in which the playback device PROD_D includes all of these is shown as an example, but some may be omitted.
[0334] The transmitting unit PROD_D5 may transmit unencoded video footage, or it may transmit encoded data encoded using a transmission encoding scheme different from the recording encoding scheme. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_D2 and the transmitting unit PROD_D5 to encode the video footage using the transmission encoding scheme.
[0335] Examples of such playback devices PROD_D include DVD players, BD players, HDD players, etc. (in this case, the output terminal PROD_D4 to which a television receiver etc. is connected becomes the main destination of the video). Other examples of such playback devices PROD_D include television receivers (in this case, the display PROD_D3 becomes the main destination of the video), digital signage (also called electronic billboards or electronic display boards, etc., where the display PROD_D3 or the transmitter PROD_D5 becomes the main destination of the video), desktop PCs (in this case, the output terminal PROD_D4 or the transmitter PROD_D5 becomes the main destination of the video), laptop or tablet PCs (in this case, the display PROD_D3 or the transmitter PROD_D5 becomes the main destination of the video), and smartphones (in this case, the display PROD_D3 or the transmitter PROD_D5 becomes the main destination of the video).
[0336] (Hardware implementation and software implementation) Furthermore, each block of the video decoding device 31 and video encoding device 11 described above may be implemented in hardware by logic circuits formed on an integrated circuit (IC chip), or it may be implemented in software using a CPU (Central Processing Unit).
[0337] In the latter case, each of the above devices includes a CPU that executes program instructions to realize each function, a ROM (Read Only Memory) that stores the program, a RAM (Random Access Memory) that loads the program, and a storage device (recording medium) such as memory that stores the program and various data. Furthermore, the objective of the embodiment of the present invention can also be achieved by supplying each of the above devices with a recording medium on which the program code (executable program, intermediate code program, source program) of the control program of each of the above devices, which is software that realizes the above functions, is recorded in a way that can be read by a computer, and the computer (or CPU or MPU) reads and executes the program code recorded on the recording medium.
[0338] Examples of recording media that can be used include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy disks and hard disks, optical disks such as CD-ROMs (Compact Disc Read-Only Memory), MO disks (Magneto-Optical discs), MDs (Mini Discs), DVDs (Digital Versatile Discs), CD-Rs (CD Recordable), and Blu-ray Discs (Blu-ray Discs), 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), and flash ROMs, or logic circuits such as PLDs (Programmable logic devices) and FPGAs (Field Programmable Gate Arrays).
[0339] Furthermore, each of the above devices may be configured to be connectable to a communication network, and the program code may be supplied via the communication network. This communication network is not particularly limited, as long as it is capable of transmitting the program code. For example, the Internet, intranet, extranet, LAN (Local Area Network), ISDN (Integrated Services Digital Network), VAN (Value-Added Network), CATV (Community Antenna television / Cable Television) communication network, Virtual Private Network, telephone line network, mobile communication network, satellite communication network, etc., can be used. Also, the transmission medium constituting this communication network is not limited to a specific configuration or type, as long as it is capable of transmitting the program code. For example, it can be used with wired connections such as IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carriers, cable TV lines, telephone lines, and ADSL (Asymmetric Digital Subscriber Line) lines, as well as wireless connections such as IrDA (Infrared Data Association), infrared (like remote controls), Bluetooth®, IEEE 802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance®), mobile phone networks, satellite lines, and terrestrial digital broadcasting networks. Furthermore, embodiments of the present invention can also be realized in the form of computer data signals embedded in a carrier wave, where the above program code is embodied through electronic transmission.
[0340] The embodiments of the present invention are not limited to those described above, and various modifications are possible within the scope of the claims. That is, embodiments obtained by combining technical means that have been appropriately modified within the scope of the claims are also included in the technical scope of the present invention. [Industrial applicability]
[0341] Embodiments of the present invention can be suitably applied to a video decoding device that decodes encoded data in which image data has been encoded, and to a video encoding device that generates encoded data in which image data has been encoded. Furthermore, they can be suitably applied to the data structure of encoded data generated by the video encoding device and referenced by the video decoding device. [Explanation of Symbols]
[0342] 31. Video Decoder 301 Entropy Decoder 302 Parameter Decoding Unit 3020 Header Decoding Section 308 Predictive Image Generation Unit 311 Inverse Quantization / Inverse Transformation Section 312 Addition section 11. Video Encoding Device 101 Predictive Image Generation Unit 102 Subtraction Unit 103 Conversion / Quantization Section 104 Entropy coding unit 105 Inverse Quantization / Inverse Transformation Section 107 Loop Filter 110 Encoding parameter determination unit 111 Parameter coding section 1110 Header Encoding Section 1111 CT information encoder 1112 CU coding unit (predictive mode coding unit) 1114 TU encoder 311 Inverse Quantization / Inverse Transformation Section 3111 Inverse quantization section 3112 Inverse Transformer
Claims
1. A TU decoding unit that decodes syntax elements abs_remainder and dec_abs_level for calculating absolute values related to transform coefficients from the encoded data, The image decoding device, wherein the TU decoding unit decodes the syntax elements abs_remainder and dec_abs_level using Golomb-Rice coding using a Rice parameter.
2. a TU encoding unit that encodes syntax elements abs_remainder and dec_abs_level for calculating absolute values related to transform coefficients; The image coding device, wherein the TU coding unit codes the syntax elements abs_remainder and dec_abs_level by Golomb-Rice coding using a Rice parameter.
