Integrated image reshaping and video coding

By approximating forward and inverse shaping functions through segmented linear functions, combining the outer and inner ring shaping architectures, the problem of high bit depth image coding is solved, and efficient video encoding and decoding is achieved, suitable for standard and high dynamic range video content.

CN117793378BActive Publication Date: 2025-05-06DOLBY LABORATORIES LICENSING CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410005914.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-06-19
Filing Date
2018-06-29
Publication Date
2025-05-06
Estimated Expiration
2038-06-29

AI Technical Summary

Technical Problem

Existing video encoding techniques are difficult to achieve efficient encoding and decoding when processing high bit depth images, especially high dynamic range (HDR) videos, and existing methods increase encoding complexity and cost.

Method used

The segmented linear function is used to approximate forward and reverse shaping functions, and only shaping processing is applied to the residual area. Combined with the outer ring, intra- and in-ring residual shaping architecture, the encoding efficiency is improved through signaling optimization and encoder optimization tools.

Benefits of technology

It reduces encoding complexity, improves encoding efficiency, adapts to different bit depths and codeword distributions, and supports efficient encoding of standard dynamic range and high dynamic range video content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117793378B_ABST
    Figure CN117793378B_ABST
Patent Text Reader

Abstract

The present disclosure relates to integrated image reshaping and video coding. Given a sequence of images represented by a first codeword, methods, processes and systems are presented for integrating reshaping into a next generation video codec for encoding and decoding images, wherein the reshaping allows a portion of the image to be encoded using a second codeword representation that allows for more efficient compression than using the first codeword representation. Various architectures are discussed, including: an out-of-loop reshaping architecture, an in-loop reshaping architecture for intra-pictures only, an in-loop reshaping architecture for prediction residuals, and a hybrid in-loop reshaping architecture. Syntactic methods for signaling reshaping parameters and image coding methods optimized with respect to reshaping are also presented.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application date of June 29, 2018, application number 201880012069.2, and invention name “Integrated Image Reshaping and Video Coding”.

[0002] CROSS-REFERENCE TO RELATED APPLICATIONS

[0003] This application claims priority to U.S. Provisional Patent Application Serial No. 62 / 686,738 filed on June 19, 2018, Serial No. 62 / 680,710 filed on June 5, 2018, Serial No. 62 / 629,313 filed on February 12, 2018, Serial No. 62 / 561,561 filed on September 21, 2017, and Serial No. 62 / 526,577 filed on June 29, 2017, each of which is incorporated herein by reference in its entirety. Technical Field

[0004] The present invention relates generally to image and video coding. More particularly, embodiments of the present invention relate to integrated image reshaping and video coding. Background Art

[0005] In 2013, the MPEG expert group in the International Organization for Standardization (ISO) together with the International Telecommunication Union (ITU) released a first draft of the HEVC (also known as H.265) video coding standard. Recently, the MPEG expert group released a proof to support the development of the next generation coding standard, which provides improved coding performance compared to existing video coding technologies.

[0006] As used herein, the term 'bit depth' refers to the number of pixels used to represent one of the color components of an image. Traditionally, images are encoded with 8 bits per color component per pixel (e.g., 24 bits per pixel); however, modern architectures can now support higher bit depths, such as 10 bits, 12 bits, or more.

[0007] In a traditional image pipeline, a nonlinear optoelectronic function (OETF) is used to quantize the captured image, which converts linear scene light into a nonlinear video signal (e.g., gamma-encoded RGB or YCbCr). The signal is then processed by an electro-optical transfer function (EOTF) at the receiver before being displayed on the display, which converts the video signal values ​​into output screen color values. Such nonlinear functions include the traditional "gamma" curve documented in ITU-R Rec. BT.709 and BT.2020, and the "PQ" (perceptual quantization) curve described in SMPTE ST 2084 and Rec. ITU-R BT.2100.

[0008] As used herein, the term "forward reshaping" refers to the process of sample-to-sample mapping or codeword-to-codeword mapping of a digital image from its original bit depth and original codeword distribution or representation (e.g., gamma or PQ, etc.) to an image of the same or different bit depth and different codeword distribution or representation. Reshaping allows for improved compressibility or improved image quality at a fixed bit rate. For example, without limitation, reshaping can be applied to 10-bit or 12-bit PQ encoded HDR video to improve coding efficiency in a 10-bit video coding architecture. In a receiver, after decompressing the shaped signal, the receiver can apply an "inverse reshaping function" to restore the signal to its original codeword distribution. As understood by the inventors herein, as development begins for next-generation video coding standards, improved techniques for integrated reshaping and encoding of images are expected. The methods of the present invention can be applied to a variety of video content, including but not limited to content in standard dynamic range (SDR) and / or high dynamic range (HDR).

[0009] The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any approach described in this section qualifies as prior art simply by virtue of its inclusion in this section. Similarly, unless otherwise indicated, issues identified with respect to one or more approaches should not be assumed to be identified in any prior art based on this section. Summary of the invention

[0010] According to one aspect of the present disclosure, a device for encoding an image is provided, the device comprising: an input unit, the input unit being used to access an input image represented by a first codeword; and a processor, wherein the processor: generates a forward shaping function, the forward shaping function maps pixels of the input image to a second codeword representation; generates an inverse shaping function based on the forward shaping function, wherein the inverse shaping function maps pixels from the second coded representation to the first coded representation; and for an input pixel region in the input image, the processor: based on A prediction region is calculated with reference to pixel data in a frame buffer or in a previously encoded spatial neighborhood; a shaped residual region is generated based on the input pixel region, the prediction region and the forward shaping function, wherein the forward shaping function is approximated by a piecewise linear function based on the value of the pixel, and wherein generating the shaped residual region comprises calculating: Res_r = a(Pred_sample)*(Orig_sample-Pred_sample), wherein Res_r represents a pixel of the shaped residual region, Pred_s ample represents pixels of the prediction area, Orig_sample represents pixels of the input image area, and a() represents the forward shaping function; generating a quantized shaped residual area based on the shaped residual area; generating a dequantized shaped residual area based on the quantized shaped residual area; generating a reconstructed pixel area based on the dequantized shaped residual area, the prediction area, the forward shaping function and the inverse shaping function, wherein generating the reconstructed pixel area includes calculating: Reco_sample=Inv(Res_d+Fwd(Pred_sample)), wherein Reco_sample represents pixels of the reconstructed pixel area, Res_d represents pixels close to the representative Res_r of the dequantized shaped residual area, and Inv() represents the inverse shaping function; and generating a reference pixel area to be stored on the reference frame buffer based on the reconstructed pixel area, wherein during encoding of the input image, the forward shaping function is only applied to the residual and not directly applied to the input image area.

[0011] According to another aspect of the present disclosure, a device for decoding a coded bit stream to generate an output image represented by a first code word is provided, the device comprising: an input unit, the input unit receiving an image partially coded by a second code word representation; and a processor, wherein the processor: receives shaping information of the coded image; generates a forward shaping function based on the shaping information, the forward shaping function maps pixels from the first code word representation to the second code word representation, wherein the forward shaping function is approximated by a piecewise linear function a() based on the value of the pixel; generates an inverse shaping function based on the shaping information, wherein the inverse shaping function maps pixels from the second code word representation to the first code word representation; and for a region of the coded image, the processor: generates a decoded shaped residual region; generates a prediction region based on pixels in a reference pixel buffer or in a previously decoded spatial neighborhood; generates a decoded shaped residual region based on the decoded shaped residual region, the prediction region, the forward shaping function and the inverse shaping function; The function generates a reconstructed pixel area, wherein generating the reconstructed pixel area includes calculating: Reco_sample=Inv(Res_d+Fwd(Pred_sample)), wherein Reco_sample represents the pixels of the reconstructed pixel area, s_d represents the pixels of the decoded shaped residual area, Inv() represents the inverse shaping function, Fwd() represents the forward shaping function, and Pred_sample represents the pixels of the prediction area; generating an output pixel area of ​​the output image based on the reconstructed pixel area; and storing the output pixel area in the reference pixel buffer, wherein during encoding of the image, the forward shaping function is applied only to the residual, and not directly to the input pixel area of ​​the image, by approximating the residual by the following formula: Res_r=a(Pred_sample)*Res_u, wherein Res_r represents the shaped residual, and Res_u represents the unshaped residual. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Embodiments of the invention are illustrated by way of example and not limitation in the accompanying drawings and in which like reference numerals refer to similar elements and in which:

[0013] Figure 1A Depicts an example process of a video transmission pipeline;

[0014] Figure 1B An example process for data compression using signal shaping according to the prior art is depicted;

[0015] Figure 2A depicts an example architecture of an encoder using canonical out-of-loop shaping according to an embodiment of the present invention;

[0016] Figure 2B depicts an example architecture of a decoder using canonical out-of-loop shaping according to an embodiment of the present invention;

[0017] Figure 2C depicts an example architecture of an encoder using canonical frame-only intra-loop shaping according to an embodiment of the present invention;

[0018] Figure 2D depicts an example architecture of a decoder using canonical frame-only intra-loop shaping according to an embodiment of the present invention;

[0019] Figure 2E depicts an example architecture of an encoder using in-loop shaping for prediction residuals according to an embodiment of the present invention;

[0020] Figure 2F depicts an example architecture of a decoder using in-loop shaping for prediction residuals according to an embodiment of the present invention;

[0021] Figure 2G depicts an example architecture of an encoder using hybrid in-loop shaping according to an embodiment of the present invention;

[0022] Figure 2H depicts an example architecture of a decoder using hybrid in-loop shaping according to an embodiment of the present invention;

[0023] Figure 3A depicts an example process for encoding video using an out-of-loop shaping architecture in accordance with an embodiment of the present invention;

[0024] Figure 3B depicts an example process for decoding video using an out-of-loop shaping architecture in accordance with an embodiment of the present invention;

[0025] Figure 3C depicts an example process for encoding video using an in-loop intra-only shaping architecture in accordance with an embodiment of the present invention;

[0026] Figure 3D depicts an example process for decoding video using an in-loop intra-only shaping architecture in accordance with an embodiment of the present invention;

[0027] Figure 3E An example process for encoding video using an in-loop shaping architecture for prediction residuals according to an embodiment of the present invention is depicted;

[0028] Figure 3F depicts an example process for decoding video using an in-loop shaping architecture for prediction residuals in accordance with an embodiment of the present invention;

[0029] Figure 4A Depicted is an example process for encoding video using any one or a combination of three shaping-based architectures in accordance with an embodiment of the present invention;

[0030] Figure 4B Depicted are example processes for decoding video using any one or a combination of three shaping-based architectures in accordance with embodiments of the present invention;

[0031] Figure 5A and Figure 5B Describes a shaping function reconstruction process in a video decoder according to an embodiment of the present invention;

[0032] Fig. 6A and Figure 6B Depicting an example of how a chroma QP offset value changes according to a luma quantization parameter (QP) of a PQ encoded signal and an HLG encoded signal according to an embodiment of the present invention; and

[0033] Figure 7 Depicted is an example of a pivot-based representation of a shaping function according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] This article describes a signal shaping and coding technique for the integration of out-of-loop and in-loop specifications for compressed images. In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the present invention. However, it is apparent that the present invention can be implemented without these specific details. In other cases, in order to avoid unnecessary obscuration, obscurity or confusion of the present invention, well-known structures and equipment are not described in detail.

[0035] Overview

[0036] Example embodiments described herein relate to integrated signal shaping and encoding for video. In an encoder, a processor receives an input image represented by a first codeword, the first codeword represented by an input bit depth N and an input codeword mapping (e.g., gamma, PQ, etc.). The processor selects an encoder architecture (wherein a shaper is an integral part of the encoder) from two or more candidate encoder architectures for compressing the input image using a second codeword representation that allows more efficient compression than the first codeword representation, wherein the two or more candidate encoder architectures include an out-of-loop shaping architecture, an in-loop shaping architecture for intra-pictures only, or an in-loop shaping architecture for prediction residuals, and the processor compresses the input image according to the selected encoder architecture.

[0037] In another embodiment, a decoder for generating an output image represented by a first codeword receives a coded bitstream, wherein at least a portion of the coded image is compressed by a second codeword representation. The decoder also receives associated shaping information. A processor receives signaling indicating a decoder architecture from two or more candidate decoder architectures for decompressing the input coded bitstream, wherein the two or more candidate decoder architectures include an out-of-loop shaping architecture, an in-loop shaping architecture for intra-pictures only, or an in-loop shaping architecture for prediction residuals, and the processor decompresses the coded image according to the received shaping architecture to generate the output image.

[0038] In another embodiment, in an encoder for compressing an image according to an in-loop architecture for predicting residuals, a processor accesses an input image represented by a first codeword and generates a forward shaping function that maps pixels of the input image from the first codeword to a second codeword. The processor generates an inverse shaping function that maps pixels represented by the second codeword to pixels represented by the first codeword based on the forward shaping function. Then, for an input pixel region in the input image: the processor performs the following operations:

[0039] computing at least one prediction region based on pixel data in a reference frame buffer or in a previously encoded spatial neighborhood;

[0040] generating a shaped residual region based on the input pixel region, the prediction region, and the forward shaping function;

[0041] generating an encoded (transformed and quantized) residual region based on the shaped residual region;

[0042] generating a decoded (inverse quantized and inverse transformed) residual region based on the encoded residual region;

[0043] generating a reconstructed pixel region based on the decoded residual region, the prediction region, the forward shaping function, and the inverse shaping function; and

[0044] A reference pixel region to be stored on a reference frame buffer is generated based on the reconstructed pixel region.

[0045] In another embodiment, in a decoder for generating an output image represented by a first codeword according to an in-loop architecture for predicting a residual, a processor receives a coded bitstream partially coded by a second codeword. The processor also receives associated shaping information. The processor generates a forward shaping function and an inverse shaping function based on the shaping information, wherein the forward shaping function maps pixels from the first codeword representation to the second codeword representation, and the inverse shaping function maps pixels from the second codeword representation to the first codeword representation. For a region of the coded image, the processor performs the following operations:

[0046] generating a decoded shaped residual region based on the encoded image;

[0047] generating a prediction region based on pixels in a reference pixel buffer or in a previously decoded spatial neighborhood;

[0048] generating a reconstructed pixel region based on the decoded shaped residual region, the prediction region, the forward shaping function, and the inverse shaping function;

[0049] generating an output pixel region based on the reconstructed pixel region; and storing the output pixel region in a reference pixel buffer.

[0050] Example Video Transmission Processing Pipeline

[0051] Figure 1A An example process of a conventional video transmission pipeline (100) is depicted, showing various stages from video capture to video content display. An image generation block (105) is used to capture or generate a sequence of video frames (102). The video frames (102) may be digitally captured (e.g., by a digital camera) or generated by a computer (e.g., using computer animation) to provide video data (107). Alternatively, the video frames (102) may be captured on film by a film camera. The film is converted to a digital format to provide video data (107). In a production stage (110), the video data (107) is edited to provide a video production stream (112).

[0052] The video data (112) of the production stream is then provided to a processor at box (115) for post-production editing. Box (115) post-production editing may include adjusting or modifying the color or brightness in specific areas of the image to enhance the image quality or achieve a specific look of the image in accordance with the creative intent of the video creator. This is sometimes referred to as "color timing" or "color grading." Other edits (e.g., scene selection and sequencing, image cropping, adding computer-generated visual effects, etc.) may be performed at box (115) to produce a final version of the product for distribution (117). During post-production editing (115), the video image is viewed on a reference display (125).

[0053] After post-production (115), the video data of the final product (117) may be transmitted to an encoding block (120) for downstream transmission to decoding and playback devices such as televisions, set-top boxes, movie theaters, etc. In some embodiments, the encoding block (120) may include an audio encoder and a video encoder such as those defined by ATSC, DVB, DVD, Blu-ray, and other transmission formats to generate an encoded bitstream (122). In the receiver, the encoded bitstream (122) is decoded by a decoding unit (130) to generate a decoded signal (132) that is an exact or close approximation of the signal (117). The receiver may be attached to a target display (140), which may have completely different characteristics from the reference display (125). In this case, a display management block (135) may be used to map the dynamic range of the decoded signal (132) to the characteristics of the target display (140) by generating a display mapping signal (137).

[0054] signal shaping

[0055] Figure 1B An example process for signal shaping according to the prior art (reference [1]) is depicted. Given an input frame (117), a forward shaping block (150) analyzes input constraints and coding constraints and generates a codeword mapping function that maps the input frame (117) to a requantized output frame (152). For example, the input (117) may be encoded according to some electro-optical transfer function (EOTF) (e.g., gamma). In some embodiments, metadata may be used to communicate information about the shaping process to a downstream device (such as a decoder). As used herein, the term "metadata" refers to any auxiliary information that is transmitted as part of an encoded bitstream and that assists a decoder in rendering a decoded image. Such metadata may include, but is not limited to, color space or gamut information, reference display parameters, and auxiliary signal parameters as described herein.

[0056] After encoding (120) and decoding (130), the decoded frame (132) can be processed by a backward (or inverse) shaping function (160) that converts the requantized frame (132) back to the original EOTF domain (e.g., gamma) for further downstream processing, such as the display management process (135) discussed above. In some embodiments, the backward shaping function (160) can be integrated with a dequantizer in the decoder (130), for example as part of a dequantizer in an AVC or HEVC video decoder.

[0057] As used herein, the term "shaper" may refer to a forward shaping function or an inverse shaping function to be used when encoding and / or decoding a digital image. Examples of shaping functions are discussed in references [1] and [2]. For the purposes of the present invention, it is assumed that a person skilled in the art can derive suitable forward shaping functions and inverse shaping functions based on the characteristics of the input video signal and the available bit depth of the encoding architecture and the decoding architecture.

[0058] In reference [1], a block-based in-loop image reshaping method for high dynamic range video coding is proposed. This design allows block-based reshaping to be performed within the coding loop, but at the cost of increased complexity. Specifically, the design requires maintaining two sets of decoded image buffers: one set for inversely reshaped (or non-reshaped) decoded pictures, which can be used for prediction without reshaping and for output to a display; and another set for forward reshaped decoded pictures, which are only used for prediction in the case of reshaping. Although the forward reshaped decoded pictures can be calculated in real time, the complexity cost is very high, especially for inter-frame prediction (motion compensation using sub-pixel interpolation). Typically, display picture buffer (DPB) management is complex and requires great care, so, as the inventors appreciate, a simplified method for encoding video is desired.

[0059] Embodiments of the shaping-based codec architectures presented herein can be divided into: an architecture with an external out-of-loop shaper, an architecture with an intra-only shaper in the loop, and an architecture with an in-loop shaper for prediction residual (also referred to as 'in-loop residual shaper' for short). A video encoder or decoder may support any one or a combination of these architectures. Each of these architectures may also be applied alone or in combination with any of the other architectures. Each architecture may be applied to a luminance component, a chrominance component, or a combination of luma and one or more chrominance components.

[0060] In addition to these three architectures, additional embodiments describe efficient signaling methods for metadata related to shaping and several encoder-based optimization tools for improving coding efficiency when shaping is applied.

[0061] Standard Out-of-Loop Shaper

[0062] Figure 2A and Figure 2BAn architecture for a video encoder (200A_E) and a corresponding video decoder (200A_D) with a "normative" out-of-loop shaper is depicted. The term "normative" indicates that unlike previous designs where shaping was considered a pre-processing step and thus outside the specification description of coding standards such as AVC, HEVC, etc., in this embodiment, forward shaping and inverse shaping are part of the specification requirements. Figure 1B The architecture for testing the bitstream conformance according to the standard after decoding (130) is different. Figure 2B In the reverse shaping block (265) (e.g., in Figure 1B The consistency is then tested after the output 162 in .

[0063] In the encoder (200A_E), two new blocks are added to a conventional block-based encoder (e.g., HEVC): a block for estimating a forward shaping function (205), and a forward picture shaping block (210) for applying forward shaping to one or more color components of an input video (117). In some embodiments, these two operations may be performed as part of a single picture shaping block. Parameters (207) associated with determining an inverse shaping function in a decoder may be passed to a lossless encoder block (e.g., CABAC 220) of a video encoder so that the parameters may be embedded in the encoded bitstream (122). The shaped picture stored in the DPB (215) is used to perform operations related to intra-frame or inter-frame prediction (225), transform and quantization (T and Q), inverse transform and inverse quantization (Q -1 and T -1 ) and all operations related to loop filtering.

[0064] In the decoder (200A-D), two new canonical blocks are added to the conventional block-based decoder: a block (250) for reconstructing the inverse shaping function based on the encoded shaping function parameters (207), and a block (265) for applying the inverse shaping function to the decoded data (262) to generate a decoded video signal (162). In some embodiments, the operations associated with blocks 250 and 265 may be combined into a single processing block.

[0065] Figure 3AAn example process (300A_E) for encoding a video using an out-of-loop shaping architecture (200A_E) according to an embodiment of the present invention is depicted. If shaping is not enabled (path 305), encoding proceeds as known in prior art encoders (e.g., HEVC). If shaping is enabled (path 310), the encoder may have the option of either applying a predetermined (default) shaping function (315) or adaptively determining a new shaping function (325) based on picture analysis (320) (e.g., as described in references [1] to [3]). After forward shaping (330), the remainder of the encoding follows a conventional encoding pipeline (335). If adaptive shaping (312) is employed, metadata associated with the inverse shaping function is generated as part of an "encode shaper" step (327).

[0066] Figure 3B An example process (300A_D) for decoding video using an out-of-loop shaping architecture (200A_D) according to an embodiment of the present invention is depicted. If shaping is not enabled (path 355), after decoding the picture (350), an output frame is generated (390) as in a conventional decoding pipeline. If shaping is enabled (path 360), in step (370), the decoder determines whether to apply a predetermined (default) shaping function (375) or adaptively determine an inverse shaping function (380) based on received parameters (e.g., 207). After inverse shaping (385), the remainder of the decoding follows a conventional decoding pipeline.

[0067] Canonical Intra-Ring Only Intra-Shaper

[0068] Figure 2C An example architecture of an encoder (200B_E) using canonical intra-frame only intra-loop shaping according to an embodiment of the present invention is depicted. The design is very similar to the design proposed in reference [1]; however, in order to reduce complexity, especially when it comes to the use of DPB memories (215 and 260), only intra pictures are encoded using this architecture.

[0069] The main difference of encoder 200B_E compared to out-of-loop shaping (200A_E) is that the DPB (215) stores the inverse shaped pictures instead of the shaped pictures. In other words, the decoded intra pictures need to be inverse shaped (by the inverse shaping unit 265) before they are stored in the DPB. The reasoning behind this approach is that if intra pictures are encoded with shaping, the improved performance of encoding intra pictures will propagate to (implicitly) improve the encoding of inter pictures even if inter pictures are not encoded with shaping. In this way, one can take advantage of shaping without having to deal with the complexity of in-loop shaping of inter pictures. Since the inverse shaping (265) is part of the inner loop, the inverse shaping can be implemented before the in-loop filter (270). The advantage of adding the inverse shaping before the in-loop filter is that in this case, the design of the in-loop filter can be optimized based on the characteristics of the original picture instead of based on the characteristics of the forward shaped picture.

[0070] Figure 2D An example architecture for a decoder (200B_D) using canonical intra-frame-only in-loop shaping according to an embodiment of the present invention is depicted. Figure 2D As depicted in , determining the inverse shaping function ( 250 ) and applying the inverse shaping ( 265 ) are now performed prior to in-loop filtering ( 270 ).

[0071] Figure 3C An example process (300B_E) for encoding video using an in-loop intra-only shaping architecture according to an embodiment of the present invention is depicted. As depicted, Figure 3C The operation process and Figure 3A The operational flows in share many elements. Now, by default, shaping is not applied for inter-coded pictures. For intra-coded pictures, if shaping is enabled, the encoder again has the option of using the default shaping curve or applying adaptive shaping (312). If the picture is shaped, inverse shaping (385) is part of the process and the associated parameters are encoded in step (327). Figure 3D The corresponding decoding process (300B_D) is depicted in FIG.

[0072] like Figure 3D As depicted in , shaping-related operations are enabled only for received intra pictures and only when intra shaping is applied at the encoder.

[0073] In-loop reshaper for prediction residuals

[0074] In coding, the term 'residual' refers to the difference between the prediction of a sample or data element and its original or decoded value. For example, given an original sample (denoted as Orig_sample) from the input video (117), intra-frame or inter-frame prediction (225) can generate a corresponding predicted sample (227) denoted as Pred_sample. If there is no shaping, the unshaped residual (Res_u) can be defined as:

[0075] Res_u=Orig_sample-Pred_samle. (1)

[0076] In some embodiments, it may be beneficial to apply shaping to the residual domain. Figure 2E An example architecture for an encoder (200C_E) using in-loop shaping for prediction residuals according to an embodiment of the present invention is depicted. Let Fwd() denote the forward shaping function, and let Inv() denote the corresponding inverse shaping function. In an embodiment, the shaped residual (232) may be defined as:

[0077] Res_r=Fwd(Orig_sample)-Fwd(Pred_samle). (2)

[0078] Accordingly, at the output (267) of the inverse reshaper (265), the reconstructed sample (267) denoted as Reco_sample can be expressed as:

[0079] Reco_sample=Inv(Res_d+Fwd(Pred_samle)), (3)

[0080] Here, Res_d represents the residual (234) after in-loop encoding and decoding in 200C_E, which is a close approximation of Res_r.

[0081] Note that although the reshaping is applied to the residual, the actual input video pixels are not reshaped. Figure 2F The corresponding decoder (200C_D) is depicted. Note that Figure 2F As depicted in and based on equation (3), the decoder needs access to both the forward shaping function and the inverse shaping function, which can be extracted using the received metadata (207) and the "Shaper Decode" block (250).

[0082] In an embodiment, in order to reduce complexity, equations (2) and (3) can be simplified. For example, assuming that the forward shaping function can be approximated by a piecewise linear function and the absolute difference between Predsample and Orig_sample is relatively small, equation (2) can be approximated as:

[0083] Res_r=a(Pred_sample)*(Orig_sample-Pred_sample), (4)

[0084] Where a(Pred_sample) represents a scaling factor based on the value of Pred_sample. According to equations (3) and (4), equation (3) can be approximated as:

[0085] Reco_sample=Pred_sample+(1 / a(Pred_sample))*Res_r, (5)

[0086] Therefore, in an embodiment, only the scaling factor a(Pred_sample) for the piecewise linear model needs to be transmitted to the decoder.

[0087] Figure 3E and Figure 3F Depicted is an example process flow for encoding (300C_E) and decoding (300C_D) video using in-loop shaping of prediction residuals. The process is similar to Figure 3A and Figure 3B The processes are very similar to those described in and therefore require no explanation.

[0088] Table 1 summarizes the key features of the three proposed architectures.

[0089] Table 1: Key features of the considered shaping architectures

[0090]

[0091]

[0092] Figure 4A and Figure 4B Depicted are example encoding and decoding process flows for encoding and decoding using a combination of the three proposed architectures. Figure 4A As depicted in , if shaping is not enabled, the input video is encoded according to known video coding techniques (e.g., HEVC, etc.) without using any shaping. Otherwise, the encoder may select any of the three methods primarily proposed depending on the capabilities of the target receiver and / or the input characteristics. For example, in an embodiment, the encoder may switch between these methods at a scene level, where a 'scene' is represented as a sequence of consecutive frames with similar luminance characteristics. In another embodiment, high-level parameters are defined at a sequence parameter set (SPS) level.

[0093] like Figure 4BAs depicted in , the decoder can call any decoding process in the corresponding decoding process according to the received shaping information signaling to decode the incoming encoded bit stream.

[0094] Hybrid Intra-Ring Plastic Surgery

[0095] Figure 2G An example architecture (200D_E) for an encoder using a hybrid in-loop shaping architecture is depicted. This architecture combines elements from both the in-loop intra-only shaping architecture (200B_E) and the in-loop residual architecture (200C_E) discussed previously. In this architecture, the in-loop intra-frame shaping encoding architecture (e.g., Figure 2C 200B_E) in the above embodiment, the intra slice is encoded with only one difference: for the intra slice, the inverse picture shaping (265-1) is performed after the loop filtering (270-1). In another embodiment, the intra slice may be subjected to in-loop filtering after the inverse shaping; however, experimental results show that such an arrangement may produce worse coding efficiency than performing the inverse shaping after the loop filtering. The remaining operations remain the same as discussed above.

[0096] As discussed above, according to the in-loop residual coding architecture (e.g., Figure 2E 200C_E) in the code to encode the inter-frame slice. Figure 2G As depicted in , intra / inter slice switching allows switching between these two architectures depending on the type of slice to be encoded.

[0097] Figure 2H An example architecture (200D_D) for a decoder using hybrid in-loop shaping is depicted. Again, according to the in-loop intra-frame shaping decoder architecture (e.g., Figure 2D 200B_D in ) to decode the intra slice, where, again for the intra slice, loop filtering (270-1) precedes the inverse picture shaping (265-1). According to the intra-loop residual coding architecture (e.g., Figure 2F 200C_D) in the decoder to decode the inter-frame slice. Figure 2H As depicted in , intra / inter slice switching allows switching between these two architectures depending on the slice type in the coded video picture.

[0098] By calling Figure 2G The encoding process depicted in 300D-E, Figure 4A can be easily extended to also include hybrid in-loop shaping encoding methods. Similarly, by calling Figure 2H The decoding process 300D-D depicted in Figure 4B It can be easily extended to also include hybrid in-loop shaping decoding methods.

[0099] Slice-level shaping

[0100] Embodiments of the present invention allow adaptation at various slice levels. For example, in order to reduce computation, shaping may be enabled only for intra slices or only for inter slices. In another embodiment, shaping may be enabled based on the value of a temporal ID (e.g., the variable TemporalId of HEVC (reference

[11] ), where TemporalId = nuh_temporal_id_plus1-1). For example, if the TemporalId of the current slice is less than or equal to a predefined value, the slice_reshaper_enable_flag of the current slice may be set to 1, otherwise, the slice_reshaper_enable_flag will be 0. In order to avoid sending a slice_reshaper_enable_flag parameter for each slice, the sps_reshaper_temporal_id parameter may be specified at the SPS level, so that the value of the slice_reshaper_enable_flag parameter may be inferred.

[0101] For slices with reshaping enabled, the decoder needs to know which reshaping model to use. In one embodiment, the reshaping model defined at the SPS level can always be used. In another embodiment, the reshaping model defined in the slice header can always be used. If the reshaping model is not defined in the current slice, the reshaping model used in the most recently decoded slice that used reshaping can be applied. In another embodiment, the reshaping model can always be specified in intra slices, regardless of whether reshaping is used for intra slices. In such an implementation, the parameters slice_reshaper_enable_flag and slice_reshaper_model_present_flag need to be disassociated. An example of such a slice syntax is depicted in Table 5.

[0102] Signaling of shaped information

[0103] Information related to forward and / or reverse shaping may be present at different information layers, for example, in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, supplementary information (SEI), or any other high-level syntax. By way of example and not limitation, Table 2 provides an example of high-level syntax in an SPS for signaling whether shaping is enabled, whether shaping is adaptive, and which of the three architectures is being used.

[0104] Table 2: Example of shaping information in SPS

[0105]

[0106] Additional information may also be carried at some other layer, such as in a slice header. The shaping function may be described by a lookup table (LUT), a piecewise polynomial, or other kind of parameterized model. The type of shaping model used to convey the shaping function may be signaled by an additional syntax element (e.g., a reshaping_model_type flag). For example, consider a system using two different representations: model_A (e.g., reshaping_model_type = 0) represents the shaping function as a set of piecewise polynomials (e.g., see reference [4]), while in model_B (e.g., reshaping_model_type = 1), the shaping function is adaptively derived by assigning codewords to different luma bands based on picture luma characteristics and visual importance (e.g., see reference [3]). Table 3 provides an example of syntax elements in a slice header of a picture to assist the decoder in determining the appropriate shaping model being used.

[0107] Table 3: Example syntax for shaping signaling in slice header

[0108]

[0109] The following three tables describe alternative examples of bitstream syntax for signal shaping at the sequence layer, slice layer or coding tree unit (CTU) layer.

[0110] Table 4: Example of shaping information in SPS

[0111]

[0112] Table 5: Example syntax for shaping signaling in slice header

[0113]

[0114] Table 6: Example syntax for shaping signaling in a CTU

[0115]

[0116] For Tables 4 to 6, the example semantics can be expressed as:

[0117] sps_reshaper_enable_flag equal to 1 specifies that the reshaper is used in the coded video sequence (CVS). sps_reshaper_enabled_flag equal to 0 specifies that the reshaper is not used in the CVS.

[0118] slice_reshaper_enable_flag equal to 1 specifies that the reshaper is enabled for the current slice. slice_reshaper_enable_flag equal to 0 specifies that the reshaper is not enabled for the current slice.

[0119] sps_reshaper_signal_type indicates the original codeword distribution or representation. By way of example and not limitation, sps_reshaper_signal_type equal to 0 specifies SDR(gamma); sps_reshaper_signal_type equal to 1 specifies PQ; and sps_reshaper_signal_type equal to 2 specifies HLG.

[0120] reshaper_CTU_control_flag equal to 1 indicates that the reshaper is allowed to be adapted for each CTU. reshaper_CTU_control_flag equal to 0 indicates that the reshaper is not allowed to be adapted for each CTU. When reshaper_CUT_control_flag is not present, the value shall be inferred to be 0.

[0121] reshaper_CTU_flag equal to 1 specifies that the reshaper is used for the current CTU. reshaper_CUT_flag equal to 0 specifies that the reshaper is not used for the current CTU. When reshaper_CTU_flag is not present, the value shall be inferred to be equal to slice_reshaper_enabled_flag.

[0122] sps_reshaper_model_present_flag is equal to 1, indicating that sps_reshaper_model() exists in sps. sps_reshaper_model_present_flag is equal to 0, indicating that sps_reshaper_model() does not exist in SPS.

[0123] slice_reshaper_model_present_flag equal to 1 indicates that slice_reshaper_model() is present in the slice header. slice_reshaper_model_present_flag equal to 0 indicates that slice_reshaper_model() is not present in the SPS. sps_reshaper_chromaAdj equal to 1 indicates that chroma QP adjustment is done using chroma DQP. sps_reshaper_chromaAdj equal to 2 indicates that chroma QP adjustment is done using chroma scaling.

[0124] sps_reshaper_ILF_opt indicates whether the in-loop filter is applied in the original or shaped domain for intra and inter slices. For example, using a two-bit syntax, where the least significant bit refers to an intra slice:

[0125] sps_reshaper_ILF_opt In-loop filter operation 0 0 For both intra and inter frames in the original domain 0 1 For inter-frames, in the original domain; for intra-frames, in the shaped domain 1 0 For inter-frames, in the shaped domain; for intra-frames, in the raw domain 1 1 For both intra and inter frames, the

[0126] In some embodiments, this parameter can be adjusted at the slice level. For example, in an embodiment, when slice_reshaper_enable_flag is set to 1, the slice can include slice_reshape_ILFOPT_flag. In another embodiment, in the SPS, if sps_reshaper_ILF_opt is enabled, the sps_reshaper_ILF_Tid parameter can be included. If the TemporalID of the current slice <= sps_reshaper_ILF_Tid and slice_reshaper_enable_flag is set to 1, the in-loop filter is applied in the shaped domain. Otherwise, the in-loop filter is applied in the unshaped domain.

[0127] In Table 4, chroma QP adjustment is controlled at the SPS level. In an embodiment, chroma QP adjustment can also be controlled at the slice level. For example, in each slice, when slice_reshaper_enable_flag is set to 1, a syntax element slice_reshape_chromaAdj_flag can be added. In another embodiment, in the SPS, if sps_reshaper_chromaAdj is enabled, a syntax element sps_reshaper_ChromaAdj_Tid can be added. If the TemporalID of the current slice <= sps_reshaper_ChromaAdj_Tid and slice_reshaper_enable_flag is set to 1, chroma adjustment is applied. Otherwise, chroma adjustment is not applied. Table 4B depicts an example variation of Table 4 using the syntax described previously.

[0128] Table 4B: Example syntax for shaped signaling using time ID in SPS

[0129]

[0130] sps_reshaper_ILF_Tid specifies the highest TemporalID for applying the in-loop filter on the shaped slices in the shaping domain. sps_reshaper_chromaAdj_Tid specifies the highest TemporalID for applying the chroma adjustment on the shaped slices.

[0131] In another embodiment, a reshape model ID (e.g., reshape_model_id) may be used to define the reshape model, for example, as part of a slice_reshape_model() function. The reshape model may be signaled at the SPS level, the PPS level, or the slice header level. If signaled in the SPS or PPS, the value of reshape_model_id may also be inferred from sps_seq_parameter_set_id or pps_pic_parameter_set_id. An example of how to use reshape_model_id for a slice that does not carry slice_reshape_model() (e.g., slice_reshaper_model_present_flag is equal to 0) is shown in Table 5B below, which is a variation of Table 5.

[0132] Table 5B: Example syntax for reshape signaling using reshape_model_id in slice header

[0133]

[0134] In the example syntax, the parameter reshape_model_id specifies the value of the reshape_model being used. The value of reshape_model_id should be in the range of 0 to 15.

[0135] As an example of using the proposed syntax, consider an HDR signal encoded using PQ EOTF, where shaping is used at the SPS level, no specific shaping is used at the slice level (shaping is used for all slices), and CTU adaptation is allowed only for inter slices. Then:

[0136] sps_reshaper_signal_type=1(PQ);

[0137] sps_reshaper_model_present_flag=1;

[0138] / / Note: For inter-frame slicing, slice_reshaper_enable_flag can be manipulated to enable and disable the reshaper.

[0139]

[0140]

[0141] In another example, consider an SDR signal where shaping is applied only at slice level and only for intra slices. CTU shaping adaptation is allowed only for inter slices. Then:

[0142]

[0143] At the CTU level, in an embodiment, CTU-level shaping may be enabled based on the luminance characteristics of the CTU. For example, for each CTU, the average luminance (e.g., CTU_avg_lumm_value) may be calculated, compared with one or more thresholds, and based on the results of these comparisons, it is decided whether to turn on or off the shaping. For example,

[0144] if CTU_avg_lumm_value < THR1, or

[0145] if CTU_avg_lumm_value > THR2, or

[0146] if THR3 < CTU_avg_lumm_value < THR4,

[0147] then for this CTU, reshaper_CTU_Flag = 1.

[0148] In an embodiment, instead of using the average luminance, some other luminance characteristic of the CTU may be used, such as the minimum luminance, the maximum luminance, or the average luminance, variance, etc. The chrominance-based characteristics of the CTU may also be applied, or the luminance characteristics and chrominance characteristics may be combined with thresholds.

[0149] As described above (e.g., with respect to Figure 3A , Figure 3B and Figure 3C in the steps), the embodiment may support a default or static shaping function, or adaptive shaping. A "default shaper" may be used to perform a predefined shaping function, thus reducing the complexity of analyzing each picture or scene when obtaining the shaping curve. In this case, there is no need to signal the inverse shaping function at the scene, picture, or slice level. The default shaper may be implemented by using a fixed mapping curve stored in the decoder to avoid any signaling, or it may be signaled once as part of the sequence-level parameter set. In another embodiment, the previously decoded adaptive shaping function may be reused in the order of encoding for subsequent pictures. In another embodiment, the shaping curve may be signaled in a different way from the previously decoded manner. In other embodiments, (e.g., for in-loop residual shaping that requires both Inv() and Fwd() functions to perform inverse shaping), only one of the Inv() function or the Fwd() function may be signaled in the bitstream, or alternatively, both functions may be signaled to reduce the decoder complexity. Tables 7 and 8 provide two examples for signaling shaping information.

[0150] In Table 7, the shaping function is transmitted as a set of second order polynomials. This is a simplified syntax of the Exploratory Test Model (ETM) (reference [5]). An earlier variant can also be found in reference [4].

[0151] Table 7: Example syntax for piecewise representation of shaping function (model_A)

[0152]

[0153] reshape_input_luma_bit_depth_minus8 specifies the sample bit depth of the input luma component for the reshaping process. coeff_log2_offset_minus2 specifies the number of decimal places used for the reshaping coefficient calculation of the luma component. The value of coeff_log2_offset_minus2 should be in the range of 0 to 3 (inclusive).

[0154] reshape_num_ranges_minus1 incremented by 1 specifies the number of ranges in the piecewise reshaping function. When reshape_num_ranges_minus1 is not present, its value is inferred to be 0. reshape_num_ranges_minus1 should be in the range of 0 to 7 (inclusive for the luma component).

[0155] reshape_equal_ranges_flag is equal to 1, specifying that the piecewise reshape function is split into NumberRanges segments of approximately equal length, and the length of each range is not explicitly signaled. reshape_equal_ranges_flag is equal to 0, specifying that the length of each range is explicitly signaled.

[0156] reshape_global_offset_val is used to obtain the offset value used to specify the starting point of the 0th range.

[0157] reshape_range_val[i] is used to get the length of the i-th range of the luminance component.

[0158] reshape_continuity_flag specifies the continuity property of the shaping function for the luma component. If reshape_continuity_flag is equal to 0, zero-order continuity is applied to the piecewise linear inverse shaping function between consecutive pivot points. If reshape_continuity_flag is equal to 1, first-order smoothness is used to obtain a full second-order polynomial inverse shaping function between consecutive pivot points.

[0159] reshape_poly_coeff_order0_int[i] specifies the integer value of the i-th segment 0-order polynomial coefficient of the luma component.

[0160] reshape_poly_coeff_order0_frac[i] specifies the fractional value of the 0th-order polynomial coefficient of the i-th segment of the luma component.

[0161] reshape_poly_coeff_order1_int specifies the integer values ​​of the 1st-order polynomial coefficients for the luma component.

[0162] reshape_poly_coeff_order1_frac specifies the fractional values ​​of the 1st-order polynomial coefficients of the luma component.

[0163] Table 8 describes an example embodiment of an alternative parameterized representation based on model_B discussed previously (reference [3]).

[0164] Table 8: Example syntax for parameterized representation of shaping function (model_B)

[0165]

[0166] In Table 8, in an embodiment, the syntax parameters may be defined as: reshape_model_profile_type specifies the distribution type to be used during the reshaper construction process.

[0167] reshape_model_scale_idx specifies the index value of the scaling factor (denoted as ScaleFactor) to be used during the reshape function construction process. The value of ScaleFactor allows for improved control of the reshape function to improve overall coding efficiency. For discussions on the reshape function reconstruction process (e.g., Figure 5A and Figure 5B ) provides additional details about the use of this ScaleFactor. As an example and not limitation, the value of reshape_model_scale_idx should be in the range of 0 to 3 (including the endpoints). In an embodiment, the mapping relationship between scale_idx and ScaleFactor as shown in the following table is given by the following formula:

[0168] ScaleFactor=1.0-0.05*reshape_model_scale_idx.

[0169] reshape_model_scale_idx ScaleFactor 0 1.0 1 0.95 2 0.9 3 0.85

[0170] In another embodiment, for a more efficient fixed-point implementation,

[0171] ScaleFactor=1-1 / 16*reshape_model_scale_idx.

[0172] reshape_model_scale_idx ScaleFactor 0 1.0 1 0.9375 2 0.875 3 0.8125

[0173] reshape_model_min_bin_idx specifies the minimum bin index to be used during reshape construction.

[0174] The value of reshape_model_min_bin_idx should be in the range of 0 to 31, inclusive.

[0175] reshape_model_max_bin_idx specifies the maximum bin index to be used during reshape construction.

[0176] The value of reshape_model_max_bin_idx should be in the range of 0 to 31, inclusive.

[0177] reshape_model_nnm_band specifies the number of bands to use during reshaper construction.

[0178] The value of reshape_model_num_band should be in the range of 0 to 15, inclusive.

[0179] reshape_model_band_profile_delta[i] specifies the delta value to be used to adjust the distribution of the i-th frequency band during the reshape construction process. The value of reshape_model_band_profile_delta[i] should be in the range of 0 to 1, inclusive.

[0180] Compared to reference [3], the syntax in Table 8 is much more efficient by defining a set of "default distribution types" (such as highlights, midtones and shadows). In an embodiment, each type has a predefined visual band importance distribution. The predefined bands and corresponding distributions can be implemented as fixed values ​​in the decoder, or they can also be signaled using a high-level syntax (such as sequence parameter sets). At the encoder, each image is first analyzed and classified into one of the distribution types. The distribution type is signaled through the syntax element "reshape_model_profile_type". In adaptive shaping, in order to capture the full range of image dynamics, the default distribution is further adjusted by increments for each luma band or a subset of luma bands. The increment value is based on the visual importance of the luma band and is signaled through the syntax element "reshape_model_band_profile_delta".

[0181] In one embodiment, the delta value can only take the value 0 or 1. At the encoder, visual importance is determined by comparing the percentage of band pixels in the entire image with the percentage of band pixels in a "dominant band", where a local histogram can be used to detect the dominant band. If the pixels in a band are concentrated in a small local box, then the band is likely to be visually important in that box. The counts of the dominant bands are summed and normalized to form a meaningful comparison to obtain the delta value for each band.

[0182] In the decoder, the shaper function reconstruction process must be called to obtain the shaping LUT based on the method described in reference [3]. Therefore, the complexity is higher compared to the simpler piecewise approximation model that only needs to evaluate the piecewise polynomial function to calculate the LUT. The benefit of using a parameterized model syntax is that the bit rate at which the shaper is used can be significantly reduced. For example, based on typical test content, the model depicted in Table 7 requires 200 to 300 bits to signal the shaper, while the parameterized model (as shown in Table 8) only uses about 40 bits.

[0183] In another embodiment, the forward shaping lookup table may be derived from a parameterized model of dQP values ​​as depicted in Table 9. For example, in an embodiment,

[0184] dQP=clip3(min, max, scale*X+offset), where min and max represent the boundaries of dQP, scale and offset are two parameters of the model, and X represents a parameter obtained based on signal brightness (e.g., the brightness value of a pixel, or for a box, a measure of the box brightness (e.g., its minimum value, maximum value, mean value, variance, standard deviation, etc.)). For example, without limitation,

[0185] dQP=clip3(-3, 6, 0.015*X-7.5).

[0186] Table 9: Example syntax for parameterized representation of shaping functions (Model C)

[0187]

[0188] In an embodiment, the parameters in Table 9 may be defined as follows:

[0189] full_range_input_flag specifies the range of the input video signal. full_range_input_flag of 0 corresponds to a standard dynamic range input video signal. full_range_input_flag of 1 corresponds to a full range input video signal. When full_range_input_flag is not present, it is inferred to be 0.

[0190] Note: As used herein, the term "full range video" means that the valid codewords in the video are not "limited". For example, for 10-bit full range video, the valid codewords are between 0 and 1023, where 0 is mapped to the lowest brightness level. In contrast, for 10-bit "standard range video", the valid codewords are between 64 and 940, and 64 is mapped to the lowest brightness level.

[0191] For example, the calculations for "full range" and "standard range" can be calculated as follows:

[0192] For the normalized luminance value Ey' in [0 1], it is encoded with BD bits (e.g., BD=10, 12, etc.):

[0193] Full range: Y = clip3 (0, (1 < <BD)-1,Ey’*((1<<BD)-1)))

[0194] Standard range: Y=clip3(0,(1< <BD)-1,round(1<<(BD-8)*(219*Ey’+16)))

[0195] This syntax is similar to the “video_full_range_flag” syntax in the HEVC VUI parameters as described in section E.2.1 of the HEVC (H.265) specification (reference

[11] ).

[0196] dQP_model_scale_int_prec specifies the number of bits used to represent dQP_model_scale_int.

[0197] dQP_model_scale_int_prec equal to 0 indicates that dQP_model_scale_int is not signaled and is inferred to be zero.

[0198] dQP_model_scale_int specifies the integer value of the dQP model scale.

[0199] dQP_model_scale_frac_prec_minus16 plus 16, specifies the number of bits used to represent dQP_model_scale_frac.

[0200] dQP_model_scale_frac specifies the fractional value of the dQP model scaling.

[0201] The variable dQPModelScaleAbs is obtained as follows:

[0202] dQPModelScaleAbs=dQP_model_scale_int<<(dQP_model_scale_frac_prec_minus16+16)+dQP_model_scale_rac

[0203] dQP_model_scale_sign specifies the sign of the dQP model scale. When dQPModelScaleAbs is equal to 0, dQP_model_scale_sign is not signaled and is inferred to be 0.

[0204] dQP_model_offset_int_prec_minus3 plus 3 specifies the number of bits used to represent dQP_model_offset_int.

[0205] dQP_model_offset_int specifies the integer value of the dQP model offset.

[0206] dQP_model_offset_frac_prec_minus1 plus 1 specifies the number of bits used to represent dQP_model_offset_frac.

[0207] dQP_model_offset_frac specifies the fractional value of the dQP model offset.

[0208] The variable dQPModelOffsetAbs is obtained as follows:

[0209] dQPModelOffsetAbs=dQP_model_offset_int<<(dQP_model_offset_frac_prec_minus1+1)+dQP_model_offset_frac

[0210] dQP_model_offset_sign specifies the sign of the dQP model offset. When dQPModelOffsetAbs is equal to 0, dQP_model_offset_sign is not signaled and is inferred to be 0.

[0211] dQP_model_abs_prec_minus3 plus 3 specifies the number of bits used to represent dQP_model_max_abs and dQP_model_min_abs.

[0212] dQP_model_max_abs specifies an integer value for the dQP model maximum value.

[0213] dQP_model_max_sign specifies the sign of the dQP model maximum value. When dQP_model_max_abs is equal to 0, dQP_model_max_sign is not signaled and is inferred to be 0.

[0214] dQP_model_min_abs specifies an integer value for the dQP model minimum value.

[0215] dQP_model_min_sign specifies the sign of the dQP model minimum value. When dQP_model_min_abs is equal to 0, dQP_model_min_sign is not signaled and is inferred to be 0.

[0216] Decoding process of model C

[0217] Given the syntax elements of Table 9, the shaping LUT can be obtained as follows.

[0218] The variable dQPModelScaleFP is obtained as follows:

[0219] dQPModelScaleFP=((1-2*dQP_model_scale_sign)*dQPModelScaleAbs)<<(dQP_model_offset_frac_prec_minus1+1).

[0220] The variable dQPModelOffsetFP is obtained as follows:

[0221] dQPModelOffsetFP=((1-2*dQP_model_offset_sign)*dQPModelOffsetAbs)<<(dQP_model_scale_frac_prec_minus16+16).

[0222] The variable dQPModelShift is obtained as follows:

[0223] dQPModelShift=(dQP_modeI_offset_frac_prec_minus1+1)+(dQP_model_scale_frac_prec_minus16+16).

[0224] The variable dQPModelMaxFP is obtained as follows:

[0225] dQPModelMaxFP=((1-2*dQP_model_max_sign)*dQP_model_max_abs)< <dQPModelShift

[0226] The variable dQPModelMinFP is obtained as follows:

[0227] dQPModelMinFP=((1-2*dQP_model_min_sign)*dQP_model_min_abs)<<dQPModelShift.

[0228] for Y=0:maxY / / For example, for 10-bit video, maxY=1023

[0229] {

[0230] dQP[Y]=clip3(dQPModelMinFP, dQPModelMaxFP, dQPModelScaleFP*Y+dQPModelOffsetFP);

[0231] slope[Y]=exp2((dQP[Y]+3) / 6); / / exp2 fixed-point implementation, where exp2(x)=2^(x);

[0232] }

[0233] If (full_range_input_flag == 0) / / If the input is standard range video

[0234] For Y outside the standard range (i.e., Y = [0:63] and [940:1023]), set slope[Y] = 0;

[0235] CDF[0] = slope[0];

[0236] for Y=0:maxY-1

[0237] {

[0238] CDF[Y+1]=CDF[Y]+slope[Y]; / / CDF[Y] is the integral of slope[Y]

[0239] }

[0240] for Y=0:maxY

[0241] {

[0242] FwdLUT[Y]=round(CDF[Y]*maxY / CDF[maxY]); / / Round and normalize to get FwdLUT

[0243] }

[0244] In another embodiment, the forward shaping function can be represented as a set of luma pivot points (In_Y) and their corresponding codewords (Out_Y), as depicted in Table 10. To simplify encoding, a linear piecewise representation is used to describe the input luma range in terms of a starting pivot and a sequence of equally spaced subsequent pivots. Figure 7 An example representing a forward shaping function for 10-bit input data is depicted in .

[0245] Table 10: Example syntax for pivot-based representation (Model D) for shaping functions

[0246]

[0247] In an embodiment, the parameters in Table 10 may be defined as follows:

[0248] full_range_input_flag specifies the range of the input video signal. full_range_input_flag being 0 corresponds to a standard range input video signal. full_range_input_flag being 1 corresponds to a full range input video signal. When full_range_input_flag is not present, it is inferred to be 0.

[0249] bin_pivot_start specifies the pivot value for the first equal-length interval (710). When full_range_input_flag is equal to 0, bin_pivot_start should be greater than or equal to the minimum standard range input, and should be less than the maximum standard range input. (For example, for 10-bit SDR input, bin_pivot_start (710) should be between 64 and 940).

[0250] bin_cw_start specifies the mapped value ( 715 ) of bin_pivot_start ( 710 ) (eg, bin_cw_start=FwdLUT[bin_pivot_start]).

[0251] log2_num_equal_bins_minus3 plus 3 specifies the number of equal-length bins after the starting pivot (710). The variables NumEqualBins and NumTotalBins are defined as follows:

[0252] NumEqualBins=1<<(log2_num_equal_bins_minus3+3)

[0253] If full_range_input_flag == 0

[0254] NumTotalBins=NumEqualBins+4

[0255] otherwise

[0256] NumTotalBins=NumEqualBins+2

[0257] Note: Experimental results show that most forward shaping functions can be represented using eight equal-length segments; however, complex shaping functions may require more segments (e.g., 16 segments or more).

[0258] equal_bin_pivot_delta specifies the length of the equal-length bins (e.g., 720-1, 720-N). NumEqualBins*equal_bin_pivot_delta should be less than or equal to the valid input range. (For example, if full_range_input_flag is 0, then for 10-bit input, the valid input range should be 940-64=876; if full_range_input_flag is 1, then for 10-bit input, the valid input range should be 0 to 1023.)

[0259] bin_cw_in_first_equal_bin specifies the number of mapped codewords (725) in the first equal-length interval (720-1). Bin_cw_delta_abs_prec_minus4 plus 4 specifies the number of bits used to represent bin_cw_delta_abs[i] for each subsequent equal interval.

[0260] bin_cw_delta_abs[i] specifies the value of bin_cw_delta_abs[i] for each subsequent equal-length interval. bin_cw_delta[i] (e.g., 735) is the difference between the codeword (e.g., 740) in the current equal-length interval i (e.g., 720-N) and the codeword (e.g., 730) in the previous equal-length interval i-1.

[0261] bin_cw_delta_sign[i] specifies the sign of bin_cw_delta_abs[i]. When bin_cw_delta_abs[i] is equal to 0, bin_cw_delta_sign[i] is not signaled and is inferred to be 0. Variable bin_cw_delta[i] = (1-2*bin_cw_delta_sign[i])*bin_cw_delta_abs[i]

[0262] Decoding process of model D

[0263] Given the syntax elements of Table 10, for 10-bit input, the shaping LUT can be obtained as follows: Define constants:

[0264] minIN=minOUT=0;

[0265] maxIN=maxOUT=2^BD–1=1023 for 10-bit case / / BD=bit depth

[0266] minStdIN = 64 for 10 bits

[0267] maxStdIN = 940 for 10 bits

[0268] Step 1: For j = 0 to NumTotalBins, get the pivot value In_Y[j]

[0269]

[0270] Step 2: For j = 0 to NumTotalBins, get the mapping value Out_Y[j]

[0271]

[0272] bin_cw[j]=bin_cw[j-1]+bin_cw_delta[j-4]; / / bin_cw_delta[i] starts from idx 0

[0273] Step 3: Linear interpolation to get all LUT entries

[0274] Initialization: FwdLUT[]

[0275]

[0276] Typically, shaping can be turned on or off for each slice. For example, shaping can be enabled only for intra slices and disabled for inter slices. In another example, shaping can be disabled for the inter slice with the highest temporal level. (Note: As an example, as used herein, the temporal sublayer can match the definition of the temporal sublayer in HEVC.) When defining the shaper model, in one example, the shaper model can be signaled only in the SPS, but in another example, the slice shaper model can be signaled in the intra slice. Alternatively, the shaper model can be signaled in the SPS and the slice shaper model can be allowed to update the SPS shaper model for all slices, or the slice shaper model can be allowed to update the SPS shaper model only for intra slices. For an inter slice following an intra slice, either the SPS shaper model or the intra slice shaper model can be applied.

[0277] As another example, Figure 5A and 5B The shaping function reconstruction process in the decoder according to an embodiment is depicted. The process uses the method described herein and in reference [3], where the visual rating range is [0 5].

[0278] like Figure 5A As shown, first (step 510), the decoder extracts the reshape_model_profile_type variable and sets the appropriate initial band distribution for each interval (steps 515, 520 and 525). For example, in pseudo code:

[0279] If (reshape_modeI_profile_type == 0) R[b i ]=R brigh t[b i ];

[0280] else if (reshape_model_profile_type == 1) R[b i ]=R dark[b i ];

[0281] Otherwise R[b i ]=R mid [b i ].

[0282] In step 530, the decoder uses the received reshape_model_band_profile_delta[b i ] values ​​to adjust each band distribution as follows:

[0283] for(i=0:reshape_model_num_band-1)

[0284] {R[b i ]=R[b i ]+reshape_model_band_profile_delta[b i ]}.

[0285] In step 535, the decoder propagates the adjusted value to each bin profile as follows: If bin[j] belongs to band b i , R_bin[j]=R[b i ].

[0286] In step 540, the interval distribution is modified as follows:

[0287] If (j>reshape_model_max_bin_idx) or (j <reshape_modeI_min_bin_idx)

[0288] Then {R_bin[j]=0}.

[0289] In parallel, in steps 545 and 550, the decoder may extract parameters to calculate the scaling factor value and candidate codewords for each bin[j] as follows:

[0290] ScaleFactor=1.0-0.05*reshape_model_scale_idx

[0291] CW_dft[j] = codeword in the interval if default shaping is used

[0292] CW_PQ[j]=TotalCW / TotalNumBins.

[0293] When calculating the ScaleFactor value, for fixed point implementations, instead of using a scaling factor of 0.05, 1 / 16 = 0.0625 may be used instead.

[0294] continue Figure 5B In step 560, the decoder starts pre-assigning codewords (CW) to each interval based on the interval distribution, as shown below:

[0295] If R_bin[j]==0, CW[j]=0

[0296] If R_bin[j]==1, CW[j]=CW_dft[j] / 2;

[0297] If R_bin[j]==2, CW[j]=min(CW_PQ[j], CW_dft[j]);

[0298] If R_bin[j]==3, CW[j]=(CW_PQ[j]+CW_dft[j]) / 2;

[0299] If R_bin[j]>=4, CW[j]=max(CW_PQ[j], CW_dft[j]);

[0300] In step 565, the total used codewords are calculated and the codeword (CW) assignment is refined / completed as follows:

[0301] CW used =Sum(CW[j]):

[0302] If CW used >TotaICW, rebalance CW[j] = CW[j] / (CW used / TotalCW);

[0303] otherwise

[0304] {

[0305] CW_remain=TotaICW-CW used ;

[0306] CW_remain is assigned to the bin with the largest R_bin[j]);

[0307] }

[0308] Finally, in step 565, the decoder: a) generates a forward shaping function (e.g., FwdLUT) by accumulating CW[j] values, b) multiplies the ScaleFactor value with the FwdLUT value to form the final FwdLUT (FFwdLUT), and c) generates an inverse shaping function InvLUT based on the FFwdLUT.

[0309] In a fixed-point implementation, the calculation of ScaleFactor and FFwdLUT can be expressed as:

[0310] ScaleFactor = (1 < <SF_PREC)-reshape_model_scale_idx

[0311] FFwdLUT=(FwdLUT*ScaleFactor+(1<<(FP_PREC+SF_PREC-1)))>>(FP_PREC+SF_PREC), where SF_PREC and FP_PREC are predefined precision-dependent variables (e.g., SF_PREC=4, and FP_PREC=14), and “c=a<<n” means performing a binary shift operation on a by n bits (or c=a*(2 n )), and "c=a>>n" means performing a binary shift operation on a and shifting it right by n bits (or c=a / (2 n )).

[0312] Chroma QP derivation

[0313] Chroma coding performance is closely related to luma coding performance. For example, in AVC and HEVC, tables are defined for specifying the relationship between the quantization parameters (QP) of luma components and chroma components, or between brightness and chroma. The specification also allows the use of one or more chroma QP offsets to more flexibly define the QP relationship between luma and chroma. When shaping is used, the luma value is modified, so the relationship between luma and chroma can also be modified. In order to maintain and further improve coding efficiency during shaping, in an embodiment, at the coding unit (CU) level, a chroma QP offset is obtained based on the shaping curve. This operation needs to be performed at both the decoder and the encoder.

[0314] As used herein, the term "coding unit" (CU) refers to a coding frame (e.g., a macroframe, etc.). For example, without limitation, in HEVC, a CU is defined as "a luma sample coding frame, two corresponding chroma sample coding frames of a picture with three sample arrays, or a sample coding frame of a monochrome picture or a sample coding frame of a picture coded using three separate color planes and a syntax structure for coding samples".

[0315] In an embodiment, the chroma quantization parameter (QP) (chromaQP) value may be obtained as follows:

[0316] 1) Based on the shaping curve, the equivalent brightness dQP mapping, dQPLUT is obtained:

[0317] for CW=0:MAX_CW_VALUE-1

[0318] dQPLUT[CW]=-6*log2(slope[CW]);

[0319] Where slope[CW] represents the slope of the forward shaping curve at each CW (codeword) point, and MAX_CW_VALUE is the maximum codeword value for a given bit depth, for example, for a 10-bit signal, MAX_CW_VALUE=1024 (2 10 ).

[0320] Then, for each coding unit (CU):

[0321] 2) Calculate the average brightness of the coding unit, expressed as AvgY:

[0322] 3) Calculate the chromaDQP value based on dQPLUT[], AvgY, shaping architecture, inverse shaping function Inv() and slice type, as shown in Table 11 below:

[0323] Table 11: Example chromaDQP values ​​according to shaping architecture

[0324]

[0325] 4) Calculate chromaQP as:

[0326] chromaQP=QP_luma+chromaQPOffset+chromaDQP;

[0327] Where chromaQPOffset represents the chroma QP offset and QP_luma represents the luma QP of the coding unit. Note that the value of the chroma QP offset can be different for each chroma component (e.g., Cb and Cr), and the chroma QP offset value is transmitted to the decoder as part of the encoded bitstream.

[0328] In an embodiment, dQPLUT[] can be implemented as a predefined LUT. Assume that all codewords are divided into N intervals (e.g., N = 32), and each interval contains M = MAX_CW_VALUE / N codewords (e.g., M = 1024 / 32 = 32). When new codewords are assigned to each interval, they can limit the number of codewords to 1 to 2*M, so they can pre-compute dQPLUT[1…2*M] and save the computed results as a LUT. This method can avoid any floating-point calculations or approximations of fixed-point calculations. The method can also save encoding / decoding time. For each interval, a fixed chromaQPOffset is used for all codewords in that interval. The DQP value is set to be equal to dQPLUT[L], where L is the number of codewords in the interval, where 1 ≤ L ≤ 2*M.

[0329] The dQPLUT values can be pre-computed as follows:

[0330] for i = 1:2*M

[0331] slope[i] = i / M;

[0332] dQPLUT[i] = -6 * log2(slope[i]);

[0333] End

[0334] When calculating dQPLUT[x], different quantization schemes can be used to obtain integer QP values, such as: round(), ceil(), floor(), or a mixture of them. For example, a threshold TH can be set, and if Y < TH, floor() is used to quantize the dQP value, otherwise, when Y ≥ TH, ceil() is used to quantize the dQP value. The use of such quantization schemes and the corresponding parameters can be predefined in the codec, or can be signaled in the bitstream for adaptation. An example syntax that allows mixing a quantization scheme with a threshold as discussed previously is shown below:

[0335]

[0336] The quant_scheme_signal_table() function can be defined at different levels of the integer syntax (e.g., sequence level, slice level, etc.) according to adaptation needs.

[0337] In another embodiment, the chromaDQP value may be calculated by applying a scaling factor to the residual signal in each coding unit (or more specifically transform unit). This scaling factor may be a luma-dependent value and may be calculated a) digitally, e.g., as a first-order derivative (slope) of a forward shaping LUT (see, e.g., equation (6) in the next section), or b) as:

[0338]

[0339] When using dQP(x) to calculate Slope(x), dQP can maintain floating point precision without integer quantization. Alternatively, a variety of different quantization schemes can be used to calculate quantized integer dQP values. In some embodiments, this scaling can be performed at the pixel level rather than at the frame level, where each chroma residual can be scaled by a different scaling factor obtained using the co-located luma prediction value of that chroma sample. Thus,

[0340] Table 12: Example chroma dQP values ​​using scaling for hybrid in-loop shaping architecture

[0341]

[0342] For example, if CSCALE_FP_PREC = 16

[0343] Forward scaling: After generating the chroma residual, but before transforming and quantizing:

[0344] -C_Res = C_orig - C_pred

[0345] -C_Res_scaled=C_Res*S+(1<<(CSCALE_FP_PREC-1)))>>CSCALE_FP_PREC

[0346] Inverse scaling: After chroma inverse quantization and inverse transform, but before reconstruction:

[0347] -C_Res_inv = (C_Res_scaled < <CSCALE_FP_PREC) / S

[0348] -C_Reco=C_Pred+C_Res_inv;

[0349] Where S is S_cu or S_px.

[0350] Note: In Table 12, when calculating Scu, the average brightness of the box (AvgY) is calculated before the inverse shaping is applied. Alternatively, the inverse shaping can be applied before calculating the average brightness, for example, Scu = SlopeLUT [Avg (Inv [Y])]. This alternative calculation order also applies to calculating the values ​​in Table 11; that is, calculating Inv (AvgY) can be replaced by calculating Avg (Inv [Y]) values. The latter method may be considered more accurate, but increases the computational complexity.

[0351] Encoder optimization for shaping

[0352] This section discusses various techniques for improving the coding efficiency of the encoder by jointly optimizing shaping parameters and encoder parameters when shaping is part of the standardized decoding process (as described in one of the three candidate architectures). In general, encoder optimization and shaping have their own limitations in solving coding problems in different places. In traditional imaging and coding systems, there are two types of quantization: a) sample quantization in the baseband signal (e.g., gamma or PQ coding), and b) transform-related quantization (part of compression). Shaping is between them. Picture-based shaping is usually updated based on the picture and only allows sample value mapping based on its brightness level without considering any spatial information. In block-based codecs (such as HEVC), transform quantization (e.g., for brightness) is applied within a spatial frame and can be adjusted spatially, so the encoder optimization method must apply the same set of parameters to the entire frame containing samples with different brightness values. As understood by the inventors and described herein, joint shaping and encoder optimization can further improve coding efficiency.

[0353] Inter / Intra mode decision

[0354] In traditional coding, inter / intra mode decisions are based on calculating a distortion function (dfiunc()) between the original sample and the predicted sample. Examples of such functions include the sum of squared errors (SSE), the sum of absolute differences (SAD), etc. In an embodiment, such distortion metrics may be used using shaped pixel values. For example, if the original dfunct() uses Orig_sample(i) and Pred_sample(i), then when shaping is applied, dfunct() may use their corresponding shaped values ​​Fwd(Orig_sample(i)) and Fwd(Pred_sample(i)). This approach allows for more accurate inter / intra mode decisions, thereby improving coding efficiency.

[0355] LumaDQP using shaping

[0356] In the JCTVC HDR Common Test Conditions (CTC) document (reference [6]), lumaDQP and chromaQPoffsets are two encoder settings used to modify the quantization (QP) parameters of the luma and chroma components to improve HDR coding efficiency. In the present invention, several new encoder algorithms are proposed to further improve the original proposal. For each lumaDQP adaptation unit (e.g., 64×64 CTU), a dQP value is calculated based on the average input luma value of the unit (as shown in Table 3 of reference [6]). The final quantization parameter QP for each coding unit within the lumaDQP adaptation unit should be adjusted by subtracting the dQP. The dQP mapping table is configurable in the encoder input configuration. The input configuration is denoted as dQP inp .

[0357] As discussed in references [6] and [7], in existing coding schemes, the same lumaDQP LUT dQP inp For both intra and inter pictures. Intra and inter pictures may have different properties and quality characteristics. In the present invention, it is proposed to adjust the lumaDQP setting based on the picture coding type. Therefore, there are two dQP mapping tables that are configurable in the encoder input configuration and are denoted as dQP inpIntra and dQP inpInter .

[0358] As discussed previously, when using the in-loop intra shaping method, since no shaping is performed on inter pictures, it is important to apply some lumaDQP settings to inter-coded pictures to achieve similar quality as if the inter pictures were shaped by the same shaper as for intra pictures. In one embodiment, the lumaDQP settings for inter pictures should match the characteristics of the shaping curve used for intra pictures.

[0359] make

[0360] Slope(x)=Fwd'(x)=(Fwd(x+dx)-Fwd(x-dx)) / (2dx), (6)

[0361] represents the first-order derivative of the forward shaping function, then in the embodiment, represents the automatically obtained dQP auto The (x) value can be calculated as follows:

[0362] If Slope(x) = 0, then dQP auto (x)=0, otherwise

[0363] QDQ auto (x) = 6log2(Slope(x)), (7)

[0364] Among them, dQP auto (x) can be clipped to a reasonable range, such as [-66].

[0365] If lumaDQP is enabled for intra pictures that use shaping (i.e., external dQP is set inpIntra ), then the lumaDQP for inter-frame pictures should take this into account. In an embodiment, the dQP obtained from the shaper can be auto (Equation (7)) and dQP for intra pictures inpIntra Set the sum to calculate the final inter-frame dQP final In another embodiment, in order to take advantage of intra-frame quality propagation, the dQP used for inter-frame pictures can be final Set to dQP auto or only in small increments (by setting dQP inpInter ) and add it to dQP auto .

[0366] In an embodiment, when shaping is enabled, the following general rules for setting luma dQP values ​​may apply:

[0367] (1) Luminance dQP mapping tables can be set independently for intra and inter pictures (based on picture coding type);

[0368] (2) If the picture in the coding loop is in the shaping domain (e.g., an intra picture in an intra-frame shaping scheme in the loop or all pictures in an out-of-loop shaping scheme), then the input brightness to delta QP mapping dQP is also required. inp Transform to the shaped domain dQP rsp .Right now

[0369] QDQ rsp (x) = dQP inp [Invx)]. (8)

[0370] (3) If the pictures within the coding loop are in the unshaped domain (e.g., inversely shaped or unshaped, e.g., inter pictures in an in-loop intra-shaping architecture or all pictures in an in-loop residual shaping architecture), then the input luma to delta QP mapping does not require conversion and can be used directly.

[0371] (4) Automatic inter-frame delta QP derivation is only valid for the in-loop intra-frame shaping architecture. In this case, the actual delta QP used for inter-frame pictures is the sum of the automatically obtained and input values:

[0372] QDQ final [x] = dQP inp [x]+dQP auto [x], (9)

[0373] And dQP final [x] can be clipped to a reasonable range, such as [-1212];

[0374] (5) The luma to dQP mapping table can be updated in each picture or when the shaping LUT changes. The actual dQP adaptation (obtaining the corresponding dQP for quantization of a box based on the average luma value of the box) can happen at the CU level (configurable by the encoder).

[0375] Table 13 summarizes the dQP settings for each of the three proposed architectures.

[0376] Table 13: dQP settings

[0377]

[0378] Rate-Distortion Optimization (RDO)

[0379] In the JEM6.0 software (reference [8]), when lumaDQP is enabled, a weighted distortion based on RDO (rate-distortion optimization) pixels is used. The weight table is fixed based on the luma value. In an embodiment, the weight table should be adaptively adjusted based on the lumaDQP setting calculated as proposed in the previous section. Two weights for the sum of squared errors (SSE) and the sum of absolute differences (SAD) are proposed as follows:

[0380]

[0381] The weight calculated by equation (10a) or equation (10b) is the total weight based on the final dQP, which includes both the input lumaDQP and the dQP obtained from the forward shaping function. For example, based on equation (9), equation (10a) can be written as:

[0382]

[0383] The total weight can be separated into the weight calculated by the input lumaDQP:

[0384]

[0385] And the weights from the reshape:

[0386]

[0387] When the total weight is calculated using the total dQP by first calculating the weight from the shaping, the total weight is not calculated due to the clipping operation to obtain an integer dQP. autoInstead, using the slope function directly to compute the weights from the shaping can maintain higher weight accuracy and is therefore more advantageous.

[0388] The weight obtained from the input lumaDQP is denoted as W dQP Let f'(x) represent the first derivative (or slope) of the forward shaping curve. In an embodiment, the total weight takes into account both the dQP value and the shape of the shaping curve, so the total weight value can be expressed as:

[0389] weight total =Clip3( 0 .0,30.0,W dQP *f′(x) 2 ). (11)

[0390] A similar method can also be applied to chrominance components. For example, in an embodiment, for chrominance, dQP[x] can be defined according to Table 13.

[0391] Interaction with other coding tools

[0392] This section provides several examples of suggested changes required for other coding tools when shaping is enabled. There may be interactions with any possible existing or future coding tools to be included in the next generation video coding standard. The examples given below are not limiting. In general, the video signal domains (shaped, unshaped, inverse shaped) during the encoding step need to be identified, and the operations that process the video signal at each step need to take into account the shaping effects.

[0393] Cross-component linear model prediction

[0394] In CCLM (Cross-Component Linear Model Prediction) (reference [8]), the luminance reconstruction signal rec can be used L '(i, j) to get the predicted chrominance sample pred c (i, j):

[0395] predc(i,j)=α·rec L ′(i, j)+β. (12)

[0396] When shaping is enabled, in embodiments, it may be necessary to discriminate whether the luma reconstruction signal is in the shaped domain (e.g., out-of-loop shaper or in-loop intra-frame shaper) or in the unshaped domain (e.g., in-loop residual shaper). In one embodiment, the reconstructed luma signal may be implicitly used as is without any additional signaling or operation. In other embodiments, if the reconstructed signal is in the unshaped domain, the reconstructed luma signal may be converted to also be in the unshaped domain, as shown below:

[0397] pred c (i, j) = α·Inv(rec L ′(i, j))+β. (13)

[0398] In other embodiments, a bitstream syntax element may be added to signal which field is desired (shaped or unshaped), which may be determined by the RDO process, or the decision may be made based on decoded information, thereby saving the overhead required for explicit signaling. The corresponding operation may be performed on the reconstructed signal based on the decision.

[0399] Shaper with residual prediction tool

[0400] In the HEVC Range Extension profile, a residual prediction tool is included. The chroma residual signal is predicted from the luma residual signal at the encoder side as:

[0401] Δr C (x, y) = r C (x, y)-(α×r′ L (x,y))>>3, (14)

[0402] And the chroma residual signal is compensated at the decoder side as:

[0403] r′ C (x, y) = Δr′ c (x,y)+(α×r′ L (x, y))>>3, (15)

[0404] Among them, r c Represents the chrominance residual sample at position (x, y), r′ L Represents the reconstructed residual samples of the luminance component, Δr c Represents the prediction signal using inter-color prediction, Δr′ C Indicates that in Δr c The reconstructed signal after encoding and decoding, and r′ C Represents the reconstructed chrominance residual.

[0405] When shaping is enabled, one may need to consider which luma residual to use for chroma residual prediction. In one embodiment, the "residual" may be used as is (either shaped or unshaped based on the shaper architecture). In another embodiment, the luma residual may be forced into one domain (such as in the unshaped domain) and the appropriate mapping performed. In another embodiment, the appropriate processing may be obtained by the decoder, or the appropriate processing may be explicitly signaled as described above.

[0406] Shaper with adaptive limiting

[0407] Adaptive clipping (Ref. [8]) is a new tool that is introduced to signal the original data range about the content dynamics and to perform adaptive clipping instead of fixed clipping (based on internal bit depth information) at each step in the compression workflow where clipping occurs (e.g., in transform / quantization, loop filtering, output).

[0408] T cli p=Clip BD (T,bitdepth,C)=Clip3(min C , max C , T), (16)

[0409] Where x=Clip3(min, max, c) means:

[0410]

[0411] and

[0412] C is the component ID (usually Y, Cb, or C r )

[0413] ·min c is the lower limit used in the current slice of component ID C

[0414] ·max c is the clipping limit used in the current slice of component ID C

[0415] When shaping is enabled, in embodiments, it may be necessary to find out which domain the data stream is currently in and perform clipping correctly. For example, if clipping is processed in the shaping domain data, the original clipping boundaries need to be converted to the shaping domain:

[0416] T clip =Clip BD (T, bitdepth, C) =

[0417] =Clip3(Fwd(min c ), Fwd(max c ), T). (17)

[0418] Typically, there is a need for the shaping architecture to handle each slicing step correctly.

[0419] Shaper and loop filter

[0420] In HEVC and JEM6.0 software, loop filters such as ALF and SAO require the use of reconstructed luma samples and uncompressed "original" luma samples to estimate the best filter parameters. When shaping is enabled, in an embodiment, the domain in which you want to perform filter optimization can be specified (explicitly or implicitly). In one embodiment, filter parameters on the shaped domain can be estimated (relative to the shaped original when the reconstruction is in the shaped domain). In other embodiments, filter parameters on the unshaped domain can be estimated (relative to the original when the reconstruction is in the unshaped domain or in the inverse shaped domain).

[0421] For example, depending on the in-loop shaping architecture, the in-loop filter optimization (ILFOPT) options and operations may be described by Tables 14 and 15.

[0422] Table 14. Loop filter optimization in the intra-frame only in-loop shaping architecture and in-loop hybrid shaping

[0423]

[0424]

[0425]

[0426] Table 15. Loop filter optimization in the in-loop residual shaping architecture

[0427]

[0428] Although most of the detailed discussion herein relates to methods performed on luma components, those skilled in the art will appreciate that similar methods may be performed on chroma color components and chroma-related parameters such as chromaQPOffset (see, e.g., reference [9]).

[0429] Intra-circle shaping and region of interest (ROI)

[0430] Given an image, as used herein, the term 'region of interest' (ROI) refers to a region of the image that is considered to be of particular interest. In this section, novel embodiments are presented that support only shaping within the loop of the region of interest. That is, in an embodiment, shaping may be applied only inside the ROI and not outside. In another embodiment, different shaping curves may be applied inside the region of interest and outside the region of interest.

[0431] The use of ROIs is motivated by the need to balance bitrate with image quality. For example, consider a video sequence of a sunset. In the upper half of the image, the sun can be located on a relatively uniformly colored sky (so the pixels in the sky background can have very low variance). In contrast, the lower half of the image can depict a moving wave. From the viewer's perspective, the upper part may be considered far more important than the lower part. On the other hand, since the variance of the pixels of a moving wave is large, the moving wave is difficult to compress and more bits are required per pixel; however, one may want to allocate more bits to the sun portion than to the wave portion. In this case, the upper half can be denoted as the region of interest.

[0432] ROI Description

[0433] Today, most codecs (e.g., AVC, HEVC, etc.) are block-based. To simplify the implementation, regions can be specified in units of boxes. Without limitation, using HEVC as an example, regions can be defined as multiple coding units (CUs) or coding tree units (CTUs). One ROI or multiple ROIs can be specified. Multiple ROIs can be different or overlapping. ROIs are not necessarily rectangular. Syntax for ROI can be provided at any level of interest (such as slice level, picture level, video stream level, etc.). In an embodiment, the ROI is first specified in a sequence parameter set (SPS). Then in the slice header, small ROI changes can be allowed. Table 16 depicts an example of the syntax in which an ROI is specified as multiple CTUs in a rectangular region. Table 17 describes the syntax of a modified ROI at the slice level.

[0434] Table 16: SPS syntax for ROI

[0435]

[0436] Table 17: Slice header syntax for ROI

[0437]

[0438] sps_reshaper_active_ROI_flag is equal to 1, specifying that a ROI is present in the coded video sequence (CVS). sps_reshaper_active_ROI_flag is equal to 0, specifying that a ROI is not present in the CVS.

[0439] reshaper_active_ROI_in_CTUsize_left, reshaper_active_ROI_in_CTUsize_right, reshaper_active_ROI_in_CTUsize_top, and reshaper_active_ROI_in_CTUsize_bottom each specify the picture samples in the ROI according to the rectangular area specified in picture coordinates. For the left and top, the coordinates are equal to offset*CTUsize, and for the right and bottom, the coordinates are equal to offset*CTUsize-1.

[0440] reshape_model_ROI_modification_flag is equal to 1, specifying that the ROI is modified in the current slice. reshape_model_ROI_modification_flag is equal to 0, specifying that the ROI is not modified in the current slice.

[0441] reshaper_ROI_mod_offset_left, reshaper_ROI_mod_offset_right, reshaper_ROI_mod_offset_top, and reshaper_ROI_mod_offset_bottom specify the left / right / top / bottom offset values ​​from reshaper_active_ROI_in_CTUsize_left, reshaper_active_ROI_in_CTUsize_right, reshaper_active_ROI_in_CTUsize_top, and reshaper_active_ROI_in_CTUsize_bottom, respectively.

[0442] For multiple ROIs, the example syntax for a single ROI in Tables 16 and 17 can be extended with an index (or ID) for each ROI, similar to the scheme in HEVC for defining multiple pan-scan rectangles using SEI messages (see HEVC specification, reference

[11] , section D.2.4).

[0443] ROI processing in intra-frame shaping only within the loop

[0444] For intra-only shaping, the ROI portion of the picture is shaped first, and then encoding is applied to it. Since shaping is applied only to the ROI, you may see the boundary between the ROI and non-ROI portions of the picture. Figure 2C or Figure 2D270 in ) may cross the boundary, so special attention must be paid to the ROI for loop filter optimization (ILFOPT). In an embodiment, it is proposed to apply the loop filter only when the entire decoded picture is in the same domain. That is, the entire picture is either entirely in the shaped domain or entirely in the unshaped domain. In one embodiment, on the decoder side, if the loop filter is applied on the unshaped domain, the inverse shaping should be applied to the ROI part of the decoded picture first, and then the loop filter is applied. Next, the decoded picture is stored in the DPB. In another embodiment, if the loop filter is applied on the shaped domain, the shaping should be applied to the non-ROI part of the decoded picture first, and then the loop filter is applied, and then the entire picture is inversely shaped. Next, the decoded picture is stored in the DPB. In another embodiment, if the loop filter is applied on the shaped domain, the ROI part of the decoded picture can be inversely shaped first, then the entire picture is shaped, then the loop filter is applied, and then the entire picture is inversely shaped. Next, the decoded picture is stored in the DPB. The three methods are summarized in Table 18. From a computational perspective, method "A" is simpler. In an embodiment, the activation of ROI can be used to specify the order in which inverse shaping and loop filtering (LF) are performed. For example, if ROI is actively used (e.g., SPS syntax flag = true), then in the inverse shaping ( Figure 2C and Figure 2D 265 in the block 265) and then execute LF ( Figure 2C and Figure 2D 270 in FIG. 14 ). If no ROI is actively used, LF is performed before inverse reshaping.

[0445] Table 18. Loop Filter (LF) Options Using ROI

[0446]

[0447]

[0448] ROI Processing in In-Loop Prediction Residual Shaping

[0449] For in-loop (prediction) residual shaping architectures (see, for example, Figure 2F 200C_D in), at the decoder, using equation (3), the processing can be expressed as:

[0450] If (the current CTU belongs to ROI)

[0451] Reco_sample = Inv(Res_d + Fwd(Pred_sample)), (see equation (3))

[0452] otherwise

[0453] Reco_sample=Res_d+Pred_sample

[0454] Finish

[0455] ROI and Encoder Considerations

[0456] In the encoder, it is necessary to check whether each CTU belongs to the ROI. For example, for intra-loop prediction residual shaping, a simple check based on equation (3) can perform the following:

[0457] If (the current CTU belongs to ROI)

[0458] The weighted distortion in RDO is applied to the luminance. The weight is obtained based on equation (10)

[0459] otherwise

[0460] Apply unweighted distortion in RDO to luminance

[0461] Finish

[0462] An example encoding workflow that takes ROI into account during reshaping may include the following steps:

[0463] -For intra pictures:

[0464] -Apply forward shaping to the ROI area of ​​the original image

[0465] - Encode intra frames

[0466] - Apply inverse shaping to the ROI region of the reconstructed image before the loop filter (LF)

[0467] - Loop filtering is performed in the unshaped domain as follows (e.g., see method "C" in Table 18), which includes the following steps:

[0468] Apply forward shaping to the non-ROI region of the original picture (so that the entire original picture is shaped for loop filter reference)

[0469] Apply forward shaping to the entire image area of ​​the reconstructed image

[0470] Get loop filter parameters and apply loop filtering

[0471] Apply inverse shaping to the entire picture area of ​​the reconstructed picture and store it in the DPB. At the encoder side, since LF needs to have an uncompressed reference image for filter parameter estimation, the processing of LF reference for each method is shown in Table 19:

[0472] Table 19. Processing of LF references for ROI

[0473]

[0474] -For inter-pictures:

[0475] - When encoding an inter frame, for each CU inside the ROI, prediction residual shaping and weighted distortion are applied to luma; for each CU outside the ROI, no shaping is applied

[0476] - Perform loop filter optimization as before (as if no ROI was used) (option 1):

[0477] Perform forward shaping on the entire image area of ​​the original image

[0478] Forward shaping of the entire image area of ​​the reconstructed image

[0479] Get loop filter parameters and apply loop filtering

[0480] Apply inverse reshaping to the entire picture area of ​​the reconstructed picture and store it in the DPB

[0481] Reshaping of HLG encoded content

[0482] The term HybridLog-Gamma or HLG refers to another transfer function defined in Rec.BT.2100 for mapping high dynamic range signals. HLG was developed to maintain backward compatibility with traditional standard dynamic range signals encoded using traditional gamma functions. When comparing the codeword distribution between PQ encoded content and HLG encoded content, the PQ mapping tends to allocate more codewords in dark and bright areas, while most HLG content codewords appear to be allocated in the middle range. Two methods can be used to perform HLG brightness shaping. In one embodiment, the HLG content can be simply converted to PQ content, and then all the PQ-related shaping techniques discussed previously can be applied. For example, the following steps can be applied:

[0483] 1) Map HLG brightness (e.g., Y) to PQ brightness. Let the transformed function or LUT be HLG2PQLUT(Y)

[0484] 2) Analyze the PQ brightness value and obtain a forward shaping function or LUT based on PQ. It is represented as PQAdpFLUT(Y)

[0485] 3) Combine these two functions or LUTs into a single function or LUT: HLGAdpFLUT[i] = PQAdpFLUT

[0486] [HLG2PQLUT[i]].

[0487] Since the HLG codeword distribution is completely different from the PQ codeword distribution, this approach may produce suboptimal shaping results. In another embodiment, the HLG shaping function is derived directly from the HLG samples. The same framework as for the PQ signal can be applied, but the CW_Bins_Dft table is changed to reflect the characteristics of the HLG signal. In an embodiment, using the midtone distribution for the HLG signal, several CW_Bins_Dft tables can be designed according to user preferences. For example, when it is preferred to preserve highlights, for alpha=1.4,

[0488] g_DftHLGCWBin0={8, 14, 17, 19, 21, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 44, 30}.

[0489] When preserving midtones (or mid-range) is preferred:

[0490] g_DftHLGCWBin1={12, 16, 16, 20, 24, 28, 32, 32, 32, 32, 36, 36, 40, 44, 48, 52, 56, 52, 48, 44, 40, 36, 36, 32, 32, 32, 26, 26, 20, 16, 16, 12}.

[0491] When preserving skin tones is preferred:

[0492] g_DftHLGCWBin2={12, 16, 16, 24, 28, 32, 56, 64, 64, 64, 64, 56, 48, 40, 32, 32, 32, 32, 32, 32, 28, 28, 24, 24, 20, 20, 20, 20, 20, 16, 16, 12};

[0493] From a bitstream syntax perspective, in order to distinguish PQ-based shaping from HLG-based shaping, a new parameter denoted as sps_reshaper_signal_type is added, where the value sps_reshaper_signal_type indicates the type of signal being shaped (e.g., 0 for gamma-based SDR signal, 1 for PQ-encoded signal, and 2 for HLG-encoded signal).

[0494] Examples of syntax tables for HDR shaping in the SPS and slice headers for both PQ and HLG, with all the features discussed previously (e.g., ROI, loop filter optimization (ILFOPT), and ChromaDQPAdjustment), are shown in Tables 20 and 21.

[0495] Table 20: Example SPS syntax for shaping

[0496]

[0497] sps_in_loop_filter_opt_flag equal to 1 specifies that the in-loop filter optimization is to be performed in the shaped domain in the coded video sequence (CVS).

[0498] sps_in_loop_filter_opt_flag equal to 0 specifies that in-loop filter optimization is to be performed in the unshaped domain in the CVS. sps_luma_based_chroma_qp_offset_flag equal to 1 specifies that a luma-based chroma QP offset is derived (e.g., according to Table 11 or Table 12) and applied to chroma encoding of each CU in a coded video sequence (CVS). sps_luma_based_chroma_qp_offset_flag equal to 0 specifies that luma-based chroma QP offset is not enabled in the CVS.

[0499] Table 21: Example syntax for reshaping at the slice level

[0500]

[0501] Improve chroma quality

[0502] Supporters of HLG-based encoding argue that HLG-based encoding provides better backward compatibility with SDR signaling. Therefore, in theory, HLG-based signals can use the same encoding settings as traditional SDR signals. However, when viewing HLG-encoded signals in HDR mode, some color artifacts can still be observed, especially in achromatic colors. c ) areas (such as white and gray). In an embodiment, such artifacts can be reduced by adjusting the chromaQPOffset value during encoding. It is recommended that for HLG content, a less aggressive chromaQP adjustment be applied than when encoding the PQ signal. For example, in reference

[10] , a model for assigning QP offsets for Cb and Cr based on luma QP and factors based on captured color primaries and represented color primaries is described as:

[0503] QPoffsetCb=Clip3(-12,0,Round(c cb *(k*QP+l))), (18a)

[0504] QPoffsetCr=Clip3(-12,0,Round(ccr *(k*QP+l))), (18b)

[0505] Where, if the capture color primary is the same as the representation color primary, then c cb = 1, if the capture color primaries are equal to the P3D65 primaries and the presentation color primaries are equal to the Rec.ITU-R BT.2020 primaries, then c cb = 1.04, and if the capture color primaries are equal to the Rec.ITU-R BT.709 primaries and the representation primaries are equal to the Rec.ITU-R BT.2020 primaries, then c cb = 1.14. Similarly, if the capture color primary is the same as the representation color primary, then c cr = 1, if the capture color primaries are equal to the P3D65 primaries and the presentation color primaries are equal to the Rec.ITU-RBT.2020 primaries, then c cr =1.39, and if the capture color primaries are equal to the Rec.ITU-R BT.709 primaries and the representation primaries are equal to the Rec.ITU-R BT.2020 primaries, then c cr = 1.78. Finally, k = -0.46 and l = 0.26.

[0506] In an embodiment, it is proposed to use the same model but with different parameters to produce less drastic changes in chromaQPOffset. For example, without limitation, in an embodiment, for Cb in equation (18a), c cb =1, k = -0.2 and l = 7, and for Cr in equation (18b), c cr =1, k=-0.2, and l=7. Fig. 6A and Figure 6B Depicted are examples of how chromaQPOffset values ​​change depending on the luma quantization parameter (QP) for PQ (Rec.709) and HLG. The changes in PQ-related values ​​are more significant than those in HLG. Fig. 6A corresponds to Cb (Equation (18a)), and Figure 6B Corresponding to Cr (Equation (18b)).

[0507] References

[0508] Each of the references listed herein is incorporated by reference in its entirety.

[0509] [1] PCT application PCT / US2016 / 025082, filed on March 30, 2016, for In-Loop Block-Based Image Reshaping in High Dynamic Range Video Coding, also published by GM.Su as WO 2016 / 164235.

[0510] [2] D. Baylon, Z. Gu, A. Luthra, K. Minoo, P. Yin, F. Pu, T. Lu, T. Chen, W. Husak, Y. He, L. Kerofsky, Y. Ye, B. Yi, “Response to Call for Evidence for HDR and WCG Video Coding: Arris, Dolby and InterDigital,” document m36264, July 2015, Warsaw, Poland.

[0511] [3] U.S. patent application 15 / 410,563, Content-Adaptive Reshaping for High Codeword representation Images, filed by T. Lu et al. on January 19, 2017.

[0512] [4] PCT application number PCT / US2016 / 042229, Signal Reshaping and Coding for HDR and Wide Color Gamut Signals, filed on July 14, 2016, also published as WO 2017 / 011636 by P. Yin et al.

[0513] [5] K. Minoo et al., “Exploratory Test Model for HDR extension of HEVC”, MPEG Output Document, JCTVC-W0092(m37732), 2016, San Diego, USA.

[0514] [6]E.Francois, J.Sole, J. P. Yin, “Common Test Conditions for HDR / WCG video coding experiments,” JCTVC Document Z1020, Geneva, January 2017.

[0515] [7] A. Segall, E. Francois, and D. Rusanovskyy, “JVET common test conditions and evaluation procedures for HDR / WCG Video,” JVET-E1020, ITU-T Meeting, Geneva, January 2017.

[0516] [8] JEM 6.0 software: https: / / jvet.hhi.fraunhofer.de / svn / svn HMJEMSoftware / tags / HM-16.6-JEM-6.0

[0517] [9] T. Lu et al., U.S. Provisional Patent Application Serial No. 62 / 406,483, “Adaptive Chroma Quantization in Video Coding for Multiple Color Imaging Formats,” filed on October 11, 2016, also filed as U.S. Patent Application Serial No. 15 / 728,939, published as U.S. Patent Application Publication US2018 / 0103253.

[0518]

[10] J. Samuelsson et al. (eds.), “Conversion and coding practices for HDR / WCG Y'CbCr4:2:0 Video with PQ Transfer Characteristics,” JCTVC-Y1017, ITU-T / ISO Conference, Chengdu, October 2016.

[0519]

[11] ITU-T H.265, “High efficiency video coding”, ITU, version 4.0, (12 / 2016).

[0520] Example Computer System Implementation

[0521] Embodiments of the present invention may be implemented using computer systems, systems configured with electronic circuits and components, integrated circuit (IC) devices such as microcontrollers, field programmable gate arrays (FPGAs), or other configurable or programmable logic devices (PLDs), discrete time or digital signal processors (DSPs), application specific ICs (ASICs), and / or apparatus including one or more such systems, devices, or components. The computer and / or IC may execute, control, or perform instructions related to integrated signal shaping and image encoding, such as those described herein. The computer and / or IC may calculate any of the various parameters or values ​​associated with the signal shaping and encoding processes described herein. The image and video embodiments may be implemented in hardware, software, firmware, and various combinations thereof.

[0522] Certain embodiments of the present invention include a computer processor that executes software instructions that cause the processor to perform the method of the present invention. For example, one or more processors in a display, an encoder, a set-top box, a transcoder, etc. can implement the method related to the integrated signal shaping and image encoding as described above by executing software instructions in a program memory accessible to the processor. The present invention can also be provided in the form of a program product. The program product may include any non-transient medium carrying a set of computer-readable signals, wherein the set of computer-readable signals includes instructions that cause the data processor to perform the method of the present invention when executed by a data processor. The program product according to the present invention may take any of a variety of forms. The program product may include, for example, a physical medium, such as a magnetic data storage medium including a floppy disk, a hard disk drive, an optical data storage medium including a CD ROM, a DVD, an electronic data storage medium including a ROM, a flash RAM, etc. The computer-readable signals on the program product may be optionally compressed or encrypted.

[0523] Where components (e.g., software modules, processors, components, devices, circuits, etc.) are mentioned above, unless otherwise specified, references to such components (including references to "means") should be interpreted to include equivalents (e.g., functionally equivalent) of any components that perform the functions of the described components, including components that are not structurally equivalent to the disclosed structures that perform the functions in the illustrated example embodiments of the invention.

[0524] Equivalents, extensions, substitutes and others

[0525] Thus described are example embodiments related to efficient integrated signal shaping and image coding. In the foregoing specification, embodiments of the present invention have been described with reference to many specific details, which may vary depending on the implementation. Therefore, the sole and exclusive indication of the invention, and intended by the applicant as the invention, is the claim issued from this application in the specific form in which this set of claims is issued, including any subsequent amendments. Any definitions expressly set forth herein for terms contained in such claims shall govern the meaning of such terms used in the claims. Therefore, limitations, elements, characteristics, features, advantages or attributes not expressly cited in a claim should not limit the scope of such claim in any way. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.

Claims

1. A device for encoding an image, the device comprising: An input unit, the input unit being used to access an input image represented by a first codeword; as well as A processor, wherein the processor: generating a forward shaping function that maps pixels of the input image to a second codeword representation; generating an inverse shaping function based on the forward shaping function, wherein the inverse shaping function maps pixels from the second encoded representation to the first encoded representation; and For an input pixel region in the input image, the processor: Computing a prediction region based on pixel data in a reference frame buffer or in a previously encoded spatial neighborhood; Generating a shaped residual region based on the input pixel region, the prediction region, and the forward shaping function, wherein the forward shaping function is approximated by a piecewise linear function based on the values ​​of the pixels, and wherein generating the shaped residual region comprises calculating: Res_r=a(Pred_sample)*(Orig_sample-Pred_sample), Wherein, Res_r represents the pixels of the shaped residual area, Pred_sample represents the pixels of the prediction area, Orig_sample represents the pixels of the input image area, and a() represents the forward shaping function; generating a quantized shaped residual region based on the shaped residual region; generating a dequantized and shaped residual region based on the quantized and shaped residual region; A reconstructed pixel region is generated based on the dequantized and shaped residual region, the prediction region, the forward shaping function, and the inverse shaping function, wherein generating the reconstructed pixel region comprises calculating: Reco_sample=Inv(Res_d+Fwd(Pred_sample)), wherein Reco_sample represents a pixel of the reconstructed pixel region, Res_d represents a pixel close to the representative Res_r of the dequantized and shaped residual region, and Inv() represents the inverse shaping function; and generating a reference pixel region to be stored on the reference frame buffer based on the reconstructed pixel region, Therein, during encoding of the input image, the forward shaping function is only applied to the residual and not directly to the input image region.

2. The device according to claim 1, wherein: The processor also: generating a shaper signaling bit stream, the shaper signaling bit stream representing the forward shaping function and / or the inverse shaping function; and The shaper bitstream is multiplexed with an encoded bitstream generated based on the input image to generate an output bitstream.

3. The device according to claim 1, wherein: Generating the quantized and shaped residual region includes: applying a forward coding transform to the shaped residual region to generate transformed data; and A forward encoding quantizer is applied to the transformed data to generate quantized data.

4. The device according to claim 3, wherein: Generating the dequantized and shaped residual region comprises: applying an inverse coding quantizer to the quantized data to generate inverse quantized data; and An inverse coding transform is applied to the inverse quantized data to generate the dequantized shaped residual region.

5. The device according to claim 1, wherein: Generating the reference pixel region to be stored on the reference frame buffer includes applying a loop filter to the reconstructed pixel region.

6. An apparatus for decoding a coded bit stream to generate an output image represented by a first codeword, the apparatus comprising: An input unit, wherein the input unit receives an image encoded by a second codeword; as well as A processor, wherein the processor: Receiving shaping information of the encoded image; generating a forward shaping function based on the shaping information, the forward shaping function mapping a pixel from the first codeword representation to the second codeword representation, wherein the forward shaping function is approximated by a piecewise linear function a() based on the value of the pixel; generating an inverse shaping function based on the shaping information, wherein the inverse shaping function maps pixels from the second codeword representation to the first codeword representation; and For a region of the encoded image, the processor: generating a decoded and shaped residual region; generating a prediction region based on pixels in a reference pixel buffer or in a previously decoded spatial neighborhood; Generating a reconstructed pixel region based on the decoded and shaped residual region, the prediction region, the forward shaping function, and the inverse shaping function, wherein generating the reconstructed pixel region comprises calculating: Reco_sample=Inv(Res_d+Fwd(Pred_sample)), Wherein, Reco_sample represents the pixels of the reconstructed pixel area, Res_d represents the pixels of the decoded and shaped residual area, Inv() represents the inverse shaping function, Fwd() represents the forward shaping function, and Pred_sample represents the pixels of the prediction area; generating an output pixel region of the output image based on the reconstructed pixel region; and storing the output pixel region in the reference pixel buffer, Wherein, during encoding of the image, the forward shaping function is applied only to the residual, and not directly to the input pixel region of the image, by approximating the residual by the following formula: Res_r=a(Pred_sample)*Res_u, Wherein, Res_r represents the shaped residual, and Res_u represents the unshaped residual.

Citation Information

Patent Citations

  • Content-adaptive reshaping for high dynamic range images

    US10165275B2

  • Adaptive chroma quantization in video coding for multiple color imaging formats

    US20180103253A1

  • Signal reshaping and coding for HDR and wide color gamut signals

    WO2017011636A1

  • HDR and WCG coding architecture with SDR backwards compatibility in a single bitstream for video coding

    US20170111643A1

  • In-loop block-based image reshaping in high dynamic range video coding

    WO2016164235A1