The present invention relates generally to images. More particularly, an embodiment of the present invention relates to the joint adaptation of the base layer and the enhancement layer quantizers in layered coding of video with enhanced dynamic range (EDR).
Display technologies being developed by Dolby Laboratories, Inc., and others, are able to reproduce images having high dynamic range (HDR). Such displays can reproduce images that more faithfully represent real-world scenes than conventional displays characterized by approximately three orders of magnitude of dynamic range (e.g., standard dynamic range SDR.)
Dynamic range (DR) is a range of intensity (e.g., luminance, luma) in an image, e.g., from darkest darks to brightest brights. As used herein, the term ‘dynamic range’ (DR) may relate to a capability of the human psychovisual system (HVS) to perceive a range of intensity (e.g., luminance, luma) in an image, e.g., from darkest darks to brightest brights. In this sense, DR relates to a ‘scene-referred’ intensity. DR may also relate to the ability of a display device to adequately or approximately render an intensity range of a particular breadth. In this sense, DR relates to a ‘display-referred’ intensity. Unless a particular sense is explicitly specified to have particular significance at any point in the description herein, it should be inferred that the term may be used in either sense, e.g. interchangeably.
As used herein, the term high dynamic range (HDR) relates to a DR breadth that spans the some 14-15 orders of magnitude of the human visual system (HVS). For example, well adapted humans with essentially normal (e.g., in one or more of a statistical, biometric or opthamological sense) have an intensity range that spans about 15 orders of magnitude. Adapted humans may perceive dim light sources of as few as a mere handful of photons. Yet, these same humans may perceive the near painfully brilliant intensity of the noonday sun in desert, sea or snow (or even glance into the sun, however briefly to prevent damage). This span though is available to ‘adapted’ humans, e.g., those whose HVS has a time period in which to reset and adjust.
In contrast, the DR over which a human may simultaneously perceive an extensive breadth in intensity range may be somewhat truncated, in relation to HDR. As used herein, the terms ‘enhanced dynamic range’ (EDR), ‘visual dynamic range,’ or ‘variable dynamic range’ (VDR) may individually or interchangeably relate to the DR that is simultaneously perceivable by a HVS. As used herein, EDR may relate to a DR that spans 5-6 orders of magnitude. Thus while perhaps somewhat narrower in relation to true scene referred HDR, EDR nonetheless represents a wide DR breadth. As used herein, the term ‘simultaneous dynamic range’ may relate to EDR.
To support backwards compatibility with existing 8-bit video codecs, such as those described in the ISO/IEC MPEG-2 and MPEG-4 specifications, as well as new HDR display technologies, multiple layers may be used to deliver HDR video data from an upstream device to downstream devices. In one approach, generating an 8-bit base layer version from the captured HDR version may involve applying a global tone mapping operator (TMO) to intensity (e.g., luminance, luma) related pixel values in the HDR content with higher bit depth (e.g., 12 or more bits per color component). In another approach, the 8-bit base layer may be created using an adaptive linear or non-linear quantizer. Given a BL stream, a decoder may apply an inverse TMO or a base layer-to-EDR predictor to derive an approximated EDR stream. To enhance the quality of this approximated EDR stream, one or more enhancement layers may carry residuals representing the difference between the original HDR content and its EDR approximation, as it will be recreated by a decoder using only the base layer.
Legacy decoders may use the base layer to reconstruct an SDR version of the content. Advanced decoders may use both the base layer and the enhancement layers to reconstruct an EDR version of the content to render it on more capable displays. As appreciated by the inventors here, improved techniques for layered-coding of EDR video are desirable for efficient video coding and superior viewing experience.
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 of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, issues identified with respect to one or more approaches should not assume to have been recognized in any prior art on the basis of this section, unless otherwise indicated.
An embodiment of the present invention is illustrated by way of example, and not in way by limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:
Joint adaptation of base layer and enhancement layer quantizers as applied to the layered coding of EDR video streams is described herein. A dual-layer EDR video encoder comprises an EDR-to-base layer quantizer (BL quantizer, BLQ) and a residual or enhancement layer quantizer (EL quantizer, ELQ). Given an EDR input to be coded by the encoder, this specification describes methods that allow for a joint selection of the parameters in both the BL and EL quantizers so that coding of the BL and EL streams is optimized. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are not described in exhaustive detail, in order to avoid unnecessarily obscuring the present invention.
Overview
Example embodiments described herein relate to the joint adaptation of BL and EL Quantizers as applied to the layered coding of EDR video sequences. An encoder receives one or more input pictures of enhanced dynamic range (EDR) to be encoded in a coded bit stream comprising a base layer and one or more enhancement layer. The encoder comprises a base layer quantizer (BLQ) and an enhancement layer quantizer (ELQ) and selects parameters of the BLQ and the ELQ by a joint BLQ-ELQ adaptation method which comprises the following steps: given a plurality of candidate sets of parameters for the BLQ, for each candidate set, computes a joint BLQ-ELQ distortion value based on a BLQ distortion function, an ELQ distortion function, and at least in part on the number of input pixels to be quantized by the ELQ. The encoder selects as the output BLQ parameter set the candidate set for which the computed joint BLQ-ELQ distortion value satisfies a distortion test criterion (e.g., it is the smallest). Example ELQ, BLQ, and joint BLQ-ELQ distortion functions are provided.
In some embodiments the BLQ operation may be subdivided into clipping modes, such as a high-clipping mode and a low-clipping mode, each with its own output BLQ parameters. A joint BLQ-ELQ distortion value may be computed for each clipping mode and a final output set of BLQ parameters is selected based on the computed BLQ-ELQ distortion values.
Example Dual-Layer EDR Coding System
In some embodiments, a base layer and one or more enhancement layers may be used, for example by an upstream device (e.g., an EDR image encoder 100 of
In some embodiments, the coded base layer image data 125 may not be backward compatible to legacy coded SDR formats; instead, the base layer image data, together with the enhancement layer image data, is optimized for reconstructing high quality EDR images for viewing on EDR displays.
The EDR image encoder (100) is configured to receive an input EDR image (102). As used herein, an “input EDR image” refers to wide or high dynamic range image data (e.g., raw image data captured by a high-end image acquisition device and the like) that may be used to derive an EDR version of the input image. The input EDR image 102 may be in any color space that supports a high dynamic range color gamut. In an embodiment, the input EDR image is a 12+ bit RGB image in an RGB color space. As used herein, for an image with multiple color components (e.g., RGB or YCbCr), the term n-bit image (e.g., 12-bit or 8-bit image) denotes an image where each pixel of its color components is represented by an n-bit pixel. For example, in an 8-bit RGB image, each pixel comprises of three color components, each color component (e.g., R, G, or B) is represented by 8-bits, for a total of 24 bits per color pixel.
Each pixel may optionally and/or alternatively comprise up-sampled or down-sampled pixel values for one or more of the channels in the color space. It should be noted that in some embodiments, in addition to three primary colors such as red, green and blue, different primary colors may be concurrently used in a color space as described herein, for example, to support a wide color gamut; in those embodiments, image data as described herein includes additional pixel values for those different primary colors and may be concurrently processed by techniques as described herein.
The EDR image encoder (100) may be configured to transform pixel values of the input EDR image 102 from a first color space (e.g., an RGB color space) to a second color space (e.g., a YCbCr color space). The color space transformation may be performed, for example, by a color transforms unit (115). The same unit (115) may also be configured to perform chroma subsampling (e.g., from YCbCr 4:4:4 to YCbCr 4:2:0).
EDR-to base layer quantizer (from now on to be referred to as BL quantizer, BLQ) 110 converts color-transformed EDR input V 117 to a BL image (112) of lower depth (e.g., an 8-bit image). As illustrated in
BL image encoder (120) is configured to encode/format the BL image (112) to generate a coded BL image 125. In some embodiments, the image data in the base layer image container is not for producing SDR images optimized for viewing on SDR displays; rather, the image data in the base layer image container is optimized to contain an optimal amount of base layer image data in a lower bit depth image container for the purpose of minimizing an overall bit requirement for the coded EDR image and to improve the overall quality of the final decoded image (197). BL encoder may be any of the known video encoders, such as those specified by the ISO/IEC MPEG-2, MPEG-4, part 2, or H.264 standards, or other encoders, such as Google's VP8, Microsoft's VC-1, and the like.
BL decoder (130) in the EDR image encoder (100) decodes the image data in the base layer image container into a decoded base layer image 135. Signal 135 represents the decoded BL as will be received by a compliant receiver. The decoded base layer image 135 is different from the BL image (112), as the decoded base layer image comprises coding changes, rounding errors and approximations introduced in the encoding and decoding operations performed by the BL encoder (120) and the BL decoder (130).
Predictor (or inverse BL quantizer) unit 140 performs one or more operations relating to predicting EDR signal 117 based on the decoded BL stream 135. The predictor 140 attempts to implement the reverse of operations performed in the BLQ 110. The predictor output 142 is subtracted from the EDR input 117 to generate residual 152.
In an example embodiment, an enhancement layer quantizer (EL quantizer, ELQ) 160 in the EDR image encoder (100) is configured to quantize the EDR residual values (152) from a 12+ bit digital representation to a lower digital representation (e.g., 8-bit images) using an ELQ function determined by one or more ELQ parameters. The ELQ function may be linear, piece-wise linear, or non-linear. Examples of non-linear ELQ designs are described in PCT application PCT/US2012/034747, “Non-linear VDR residual quantizer,” filed Apr. 24, 2012, by G-M Su et al., which is incorporated herein by reference in its entirety.
Enhancement layer (EL) encoder 170 is configured to encode the residual values in an enhancement layer image container, the coded EL stream 172. EL encoder 170 may be any of the known video encoders, such as those specified by the ISO/IEC MPEG-2, MPEG-4, part 2, or H.264 standards, or other encoders, such as Google's VP8, Microsoft's VC-1, and the like. EL and BL encoders may be different or they may be the same.
The set of parameters used in BLQ 110 and ELQ 160 may be transmitted to a downstream device (e.g., the EDR image decoder 105) as a part of supplemental enhancement information (SEI) or other similar metadata carriages available in video bitstreams (e.g., in the enhancement layers) as metadata 144. As defined herein, the term “metadata” may relate to any auxiliary information that is transmitted as part of the coded bit-stream and assists a decoder to render a decoded image. Such metadata may include, but are not limited to, information as: color space or gamut information, dynamic range information, tone mapping information, or other predictor, up-scaling, and quantizer operators, such as those described herein.
As depicted in
An EL decoder 175, corresponding to the EL Encoder 170, is being used to decode received coded EL stream 172 to generate decoded quantized residual stream 177. The decoded stream 177 is passed to an inverse EL quantizer (IELQ) 185 to generate residual 187. Inverse ELQ 185 maps the 8-bit output of signal 177 to a 12+ bit residual 187, which is added to the predicted EDR stream 192 to generate a final decoded EDR signal 197, representing a close approximation of the original EDR signal 117. EDR signal 197 may also be post-processed by color transform and post-processing filters (not shown) to match the signal requirements required for rendering on a suitable EDR display.
As depicted in
Example Base Layer Quantizer
Denote with vi pixel values of a EDR input V (e.g., V 117 in
where vL and vH denote the minimum and maximum pixels values among the vi pixel values, CL and CH denote low-clipping and high-clipping output quantizer parameter values, Or denotes a rounding offset, i denotes the pixel index, and clip3( ) denotes a clipping function to limit the output value within a pair of thresholds [TH TH] (where normally TL=0 and TH=255). The pixels whose quantized value si fall within [TL, TH] are encoded in the base layer (BL), the remaining pixels are encoded in the enhancement layer (EL).
As illustrated in
From equation (1), the de-quantization (prediction or inverse quantization) process in BL to EDR predictors 140 and 190, may be expressed as
where
ELQ Parameters as a Function of the BLQ Parameters
As depicted in
RH=vH−QBL−1(TH) (3)
where, QBL−1 denotes the inverse the BL quantization function. From equation (3), for a BL quantizer as defined by equation (2)
When CL<0, the maximal EDR residual comes from clipping the lower dark values and
RL=QBL−1(TL)−vL.
From equation (5), for a BL quantizer as defined in equation (2)
Taking into account that the BL quantizer may affect both the low darks and the highlights, the maximum absolute value of the input residual into the EL quantizer may be expressed as
Rmax=(1+Δ)max {|RH|,|RL|} (7)
where Δ denotes an optional safety margin that takes into consideration distortions in the BL quantizer and the BL encoder. Experiments have shown that Δ=0.2 works well for most cases of practical interest.
Intuitively, given the EDR encoder 100, for a fixed BL quantizer, one would expect the mean value of EDR residual signal 152 to be close to 0 and residuals to have a symmetric distribution across their mean; however, in practice, the range of the BL quantizer may be constantly adjusted to match the input characteristics, thus the distribution of residuals may be have a very one-sided distribution.
Given an 8-bit EL encoder 170, EL quantizer 160 should not output more than 256 possible values. However, in some embodiments one may want to restrict the number of levels even more, say to L. For a given BL quantizer 110, the L and O parameters of the ELQ quantizer may be defined as
where α and δ are again optional safety margin parameters (e.g., α=0 and δ=0.1).
Distortion Analysis for Fixed BL Quantization Parameters
In order to optimize the selection of BL and EL quantization parameters, a number of distortion measures are defined as follows. In some embodiments, for each quantizer, the corresponding distortion measure is proportional to the ratio of the input data range over the output data range.
Let [CH(n), CL(n)] denote n sets of [CH CL] parameters for the BL quantizer 110. Given input data range
RBL(n)=QBL(n)−1(TH)−QBL(n)−1(TL), (10)
for the BL quantizer defined in equation (1), a distortion metric for the BL quantizer may be defined as
Hence, when CH(n)−CL(n) increases, gBL(n) decreases, and the BL distortion will be smaller.
Let gH(n) and gL(n) denote two distortion measures (or metrics) for the EL quantizer, one when highlights are clipped and one when low-darks (or simply lows) are clipped. Let
then, based on equations (4) (9), the high-clipping cost metric may be denoted as
and the low-clipping cost metric may be denoted as
From equations (11)-(14), increasing CH(n) will increase gH(n) and decrease gBL(n). Similarly, decreasing CL(n) will increase gL(n) and decrease gBL(n). When the clipping is dominated by clipping highlights (e.g., CL(n)=0) an overall joint BLQ-ELQ “high-clipping” cost distortion function (or metric) may be defined as
GH(CH(n))=NBL(n)gBL(n)+NEL−H(n)gH(n), (15)
where NEL−H(n) denotes the number of (highlight) pixels which for a given CH(n) will be quantized in the enhancement layer; that is,
NEL−H(n)=|ΦEL−H(n)|, (16)
and
φEL−H(n)={p|vpε[QBL(n)−1(TH),vH]}. (17)
Similarly, in equation (15), NBL(n) denotes the number of low dark pixels which will be quantized in the enhancement layer; that is
NBL(n)=|ΦBL(n)|, (18)
where
ΦBL(n)={p|vpε[QBL(n)−1(TL),QBL(n)−1(TH))}. (19)
Then, the optimal C*H may be found by searching for the value among the set of candidate CH(n) values to minimize the GH (CH(n)) cost function; that is,
When the clipping is dominated by low-blacks clipping (e.g., CH(n)=255), an overall joint BLQ-ELQ “low-clipping” cost distortion function may be defined as
GL(CL(n))=NBL(n)gBL(n)+NEL−L(n)gL(n), (21)
where NEL−L(n) denotes the number of pixels that will be quantized in the enhancement layer stream for a given choice of CL(n); that is, given
ΦEL−L(n)={p|vpε[vL,QBL(n)−1(TL)]}, (22)
then
NEL−L(n)=|ΦEL−L(n)|. (23)
Given (21), an optimal C*L may be found by searching for the value among the set of candidate CL(n) values that minimizes the GL(CL(n)) cost function; that is
Some embodiments may also apply different cost functions. For example, in some embodiments the joint BLQ-ELQ cost function for clipping the lows may be defined using second-order terms, as in
GL(CL(n))=NBL(n)gBL(n)gBL(n)+NEL−L(n)gL(n)gL(n). (25)
Regardless of the joint cost function being used, one may determine the optimal C*L and C*H values in the BL quantizer as follows:
if GL (C*L)<GH(C*H), then select low clipping as the dominant clipping and choose C*L else select high clipping as the dominant clipping and choose C*H.
In step 610, one may define the initial TH and TL values (e.g., TH=255, TL=0). To find the remaining BLQ parameters (e.g., CL and CH), process 600 may be split in two processing branches: the high-clipping branch 620H and the low-clipping branch 620L. An encoder may select to perform operations only in one of the two branches, or it may select to perform the operations in both branches. The operations in the two branches may be performed sequentially or in parallel.
The high-clipping processing branch 620H assumes CL is fixed (e.g., CL=0) and uses a number of iterative steps to find the preferred CH among a series of candidate CH(n) values. Similarly, the low-clipping processing branch 620L assumes CH is fixed (e.g., CH=255) and uses a number of iterative steps to find the preferred output CL among a series of candidate CL(n) values. The number of candidates CH(n) and CL(n) values may depend on a variety of factors, including: prior quantization parameters, input metadata, available processing power, and the like. For example, without loss of generality, an embodiment may consider as CH(n) the set of {255, 260, . . . , 700} and as CL(n) the set of {−600, −595, . . . , 1}.
For each of the candidate CH(n) values, the high-clipping processing branch 620H comprises the following steps:
For each of the candidate CL(n) values, the low-clipping processing branch 620L comprises the following steps:
Some embodiments may utilize alternative distortion test criterions to determine the output CL and CH values. For example, assuming a monotonic increase (or decrease) of candidate CL values, an embodiment may use a local-minima criterion, where it outputs C*L=CL(n) and terminates loop computations if
GL(CL(n−1))>GL(C*L) and GL(C*L)<GL(CL(n+1)).
Similarly assuming a monotonic increase (or decrease) of candidate CH values, an embodiment may use a local-minima criterion, where it outputs C*H=C*H(n) and terminates loop computations if
GH(CH(n−1))>GH(C*H) and GH(C*H)<GH(CH(n+1)).
Assuming a single dominant clipping (low or high), the dominant clipping mode and final BLQ parameters may be selected as follows (step 630):
if GL(C*L)<GH(C*H), then select low clipping as the dominant clipping (e.g., CL=C*L and CH=255)
else select high clipping as the dominant clipping (e.g., CL=0 and CH=C*H)
In another embodiment, one may consider simultaneous dual clipping. In such a scenario the joint BLQ-ELQ adaptation process needs to operate on pairs of CH(n) and CL(n) values. For example, for each CH(n) value, an encoder may attempt to test each one of the CL(n) values. For example, if each of these sets comprise N possible candidate values, while process 600 may require 2N iterations, under this embodiment the joint adaptation method may require N2 iterations; thus this optimization adaptation process may be very compute intensive. Table 1 depicts in pseudo code an example joint BLQ-ELQ adaptation according to an embodiment.
This process is very similar to process 600, except that instead of computing two single-ended ELQ distortion metrics (gH(n) and gL(n)), one computes a dual-ended ELQ distortion metric given by
Layer Decomposition for Chroma Components
As described earlier, in coding EDR video signals using a layered coding system, (e.g., as the one depicted in
For example, for an input vi, comprising, without loss of generality, a luma component viy and chroma components viCb and viCr, consider a picture area with input luminance values viy to be quantized to the BL signal values siy=255. After applying a luminance quantizer as depicted in
In BL: sBL,iy=255,sBL,iCb=QBLCb(viCb),sBL,iCr=QBLCr(viCr), and (27)
In EL: sEL,iy=QELy(viy−QBL−1y(255)),sEL,iCb≈0,sEL,iCr≈0. (28)
Thus, in this example, all chroma information is coded in the base layer, while luminance residual values above 255 and some small chroma residuals (due to potential chroma prediction errors) are coded in the enhancement layer.
In modern video codecs, as the ones described in the MPEG AVC/H.264 or HEVC specifications, a macroblock (MB) is defined as a collection of both luminance (luma) and chroma values. To improve coding efficiency, luma and chroma components within a macroblock typically share multiple variables, such as quantization parameter values (e.g., QP), the coding mode (e.g., inter or intra), and motion vectors. In most cases, an encoder will make coding decisions based on the luminance values and will ignore the chroma values. This approach performs well for natural images, but may fail when the luminance values are clipped. For example, given a large clipped luma area, the motion vectors of a macroblock in that area often tends to become zero, as there is no perceived motion on those pure constant luma areas, which forces the corresponding chroma components to be encoded in intra coding mode, with a higher QP. Furthermore, some MBs may be coded as skip mode MBs during the mode decision. Consequently, the chroma components in the luma-clipped areas may show significant coding artifacts, such as blocking artifacts and/or ringing artifacts.
In one embodiment, one may alleviate the high quantization in chroma by using separate luma and chroma QP values. For example, in AVC coding, one may use the parameter chroma_qp_offset, which allows an encoder to set a chroma QP in terms of the luma QP. For example, one may set chroma_qp_offset=−12 to force chroma QP values to be lower than the luma QP values. However, chroma_qp_offset is a picture-level flag; that is, it applies to the whole frame, hence, other unclipped areas within a frame will use unnecessarily low QP values, which may result in overall higher bit rate.
Thus, as recognized by the inventors, there is a need to adjust the layered decomposition of the chroma components so that it takes into consideration decisions related to the layered decomposition of their corresponding luma values. Two such decomposition methods are described next.
Layered Decomposition of Chroma Based on Separation Thresholds
Given a set of pixel values for which the encoder has already determined that the luminance values need to be encoded in the EL, in one embodiment, the encoder may decide to encode all corresponding chroma pixel values in the EL as well. For example, from equations (27) and (28), one way to code the BL and EL layers would be:
In BL: sBL,iy=255,sBL,iCb=D1,sBL,iCr=D2,and (29)
In EL: sEL,iy=QELy(viy−QBL−1,y(255)),sEL,iCb=QELCb−QBL−1,Cb(D1)),sEL,iCr=QELCr(viCr−QBL−1,Cr(D2)), (30)
where D1 and D2 are constants selected to minimize the residual error values in the chroma components. Such an approach may work; however, it also forces unnatural sharp edges between the BL and EL coding areas in the chroma, which may yield chroma artifacts in the decoded stream. In a preferred embodiment, given a luma mask, that is a mask that defines which luminance values will be coded in the EL, an encoder may not code all the corresponding chroma values in the EL as well. Instead, it may try to identify a subset that will be coded in the EL, while the remaining chroma pixels will be coded in the BL. The following operations may be performed separately for each of the chroma components (e.g., Cb and Cr).
As depicted in
That is,
milε{0,1}.
Tl denotes a predetermined threshold. For example, in one embodiment, during luma high clipping Tl=255, and during luma low clipping Tl=0. Then, a clipping map Ml may be defined as
Ml=[mil].
When chroma is sub-sampled, that is, pl≠pc, the luma clipping map Ml needs to also be resampled to match the size of the down-sampled chroma component. Let
{tilde over (M)}c=downsample(Ml)
denote the down-sampled clipped-luma mask. The downsample( ) function can be similar to the down-sampling function being used to determine the pictures chroma pixels, e.g., from YCbCr 4:4:4 to YCbCr 4:2:0. After the down-sampling, the elements, {tilde over (m)}ic, in {tilde over (M)}c may not be Boolean values. Then, a simple thresholding operation, such as
mic=({tilde over (m)}ic>0),
may be used to determine the initial chroma mask (710)
Mc=[mic].
Denote as φ(0) an initial set for which the chroma mask values equal to 1. Then
φ(0)={i|mic=1,∀i}.
Denote the number of pixels having chroma mask value as 1 in Mc as
Denote as Ω the set containing pixel with chroma mask value 0, then
Ω={i|mic=0,∀i}.
Let vmax(0)=max {vic, ∀i ε Φ(0)} denote the maximal value within the set Φ(0) and let vmin(0)=min {vic, ∀i ε Φ(0)} denote the minimal value within the set Φ(0), then in one embodiment, a search for a separation threshold for the layer decomposition of the chroma channels (either high-clipping 715 or low-clipping 725) may be computed as follows.
High-Clipping Threshold Search
In this step (715), the algorithm searches iteratively for a separation value (or threshold) vsvc which is lower than a subset of the chroma pixel values defined by the initial chroma mask. The chroma pixel values above vsvc will then be coded in the EL while the rest will be coded in the BL. In an embodiment, starting from vsvc=vmin(0), during each iteration, a new value is assigned to vsvc (e.g., vsvcε [vmin(0), vmax(0)]) and an updated chroma mask is computed. For example, during the n-th iteration, the updated mask is defined as:
Φ(n)={i|vic≧vsvc,∀i}.
If mi(n) denotes whether pixel i belongs to Φ(n), then
The purpose of this search is to identify a subset of pixels belonging to Φ(0), but with chroma pixel values that can't be found in Ω. Mathematically, this can be expressed as follows: for
Φ(n)⊂Φ(0),
search for Φ(n) so that
Ψ(n)=Φ(n)∩Ω
is an empty set, or in practice, a near-empty set. This can be computed as
If |Ψ(n)|>0, then the process is repeated for a new value of vsvc. If |Ψ(n)|=0, then vsvc may be used to determine the BL quantizer parameters for the chroma component in step 735. Note however, that determining such a threshold is not guaranteed. In that case, the algorithm may attempt to determine a low-clipping threshold in step 725.
In determining a threshold, coding efficiency should also be taken into consideration. If the number of clipped chroma pixels is much lower than the number of clipped luma pixels, then a large number of chroma pixels still needs to be encoded in the BL, which contradicts our initial goal. Hence, in an embodiment, a more appropriate test for determining whether a high-clipping threshold has been found is to test also whether
|Φ(n)|>α|Φ(0)|,
where α may be approximately equal to 0.5.
Low Clipping Threshold Search
In case the search for a high-clipping threshold fails, then a new search for a low-clipping threshold may be initiated in step 725. As before, in each iteration, a new threshold value of vsvc is selected, such that vsvcε [vmin(0), vmax(0)]. Based on the selected threshold, a new chroma mask for chroma pixels to be clipped is determined. For example, at the n-th iteration, the updated chroma mask may be defined as
Φ(n)={i|vic≦vsvc,∀i}
If mi(n) denotes whether pixel i belongs to Φ(n), then
Given
if |Ψ(n)|=0 (or close to 0), then vsvc may be used to determine the low-clipping threshold. Chroma pixel values below the low-clipping threshold will be coded in the EL layer while the remaining chroma pixel values will be encoded in the BL. Note however, that determining such a threshold is not guaranteed. In that case, the algorithm may attempt to determine the chroma values to be coded in the EL using a smooth transition area algorithm (740), as will be described later on in this specification.
While the process of
Table 1 lists in pseudo-code an example implementation of steps in
Quantization of Chroma Channels Based on Separation Thresholds
where, without loss of generality, a color channel is indicated as a superscript. Equations (31) and (32) can be fully defined by determining the BLQ chroma quantization parameters {CHCb, CLCb} and {CHCr, CLCr}.
Let the dynamic range for each color component in the BL signal be defined as
DRBLY=CHY−CLY,
DRBLCb=CHCb−CLCb,
DRBLCr=CHCr−CLCr, (33)
Let also the dynamic range for each color component in the EDR signal be defined as
DREDRY=vHY−vLY,
DREDRCb=HCb−vLCb,
DREDRCr=vHCr−vLCr, (34)
In an embodiment, the dynamic range of the BL signal may be expressed in terms of the dynamic range in the EDR stream, such as
where βCb and βCr are optional constants that can be used to control the quantizer. In an embodiment, βCb=βCr=1.
Then, the initial value of {CHCb, CLCb} and {CHCr, CLCr} can be derived as
Note that, potentially, clip3( ) operations may be needed to constrain the chroma range of equation (36) within valid values (e.g., 0 to 255).
Given {CHCb, CLCb} and {CHCr, CLCr}, the separation value determined earlier, may be expressed as:
These two values (e.g., CsvCb and CsvCr) may control a shifting offset. The value of this shifting offset depends on whether high clipping or low clipping is performed (see
CoffsetCb=255−CsvCb,
CoffsetCr=255−CsvCr, (38)
For low clipping, BL values are shifted downwards, such that the original values less than CsvCb and CsvCr are clipped to 0. A shifting offset may be computed as:
CoffsetCb=−CsvCb,
CoffsetCr=−CsvCr, (39)
Given these offsets, BLQ parameters{CHCb, CLCb} and {CHCr, CLCr} may be adjusted as:
CHCb=round(CHCb+CoffsetCb),
CLCb=round(CLCb+CoffsetCb),
CHCr=round(CHCr+CoffsetCr),
CLCr=round(CLCr+CoffsetCr), (40)
Quantization of Chroma Channels Based on Smooth Transition Area Search
As noted earlier, coding in the EL all chroma values that correspond to an area of luma samples may yield sharp chroma edges that are hard to compress and may result in a variety of chroma artifacts. In an embodiment,
Given the original chroma mask (e.g., Mc, as computed in step 710), for each chroma component, we compute quantized chroma values (e.g., siCb and siCr), so that chroma pixel values are within the bit-depth boundaries of our BL codec (e.g., [0 255]). These quantized values may be computed using the steps described earlier, for example, using equations (31-36).
Since Mc may contain holes or irregular shapes which may degrade the encoding efficiency, in step 750, a first closing morphological operation is contacted to determine a “close” area. Denote this area as Mg (see
Next (755), given Mg, an erosion morphological operation is applied to determine an area smaller than Mc which is set to a constant value, e,g., 128. This area is denoted as Mf (see
To further reduce the potential sharp edges in EL, starting again from Mc, the final EL area is determined using a second closing morphological operation (step 765), which yields the final area to be coded, denoted as Me (see
As an example, the following parameter values may be used when computing the functions in Table 2. For the morphological structure element for the first closing, pg=10. For the morphological structure element for erosion, pf=30. For the morphological structure element for the second closing, pe=30. For the Gaussian filter parameters, hg=11, and σg=1. For the constant value inside Mf, cf=128. The constant value inside Mf can be adapted so that it minimizes the maximal residual in EL.
Example Computer System Implementation
Embodiments of the present invention may be implemented with a computer system, systems configured in electronic circuitry and components, an integrated circuit (IC) device such as a microcontroller, a field programmable gate array (FPGA), or another configurable or programmable logic device (PLD), a discrete time or digital signal processor (DSP), an application specific IC (ASIC), and/or apparatus that includes one or more of such systems, devices or components. The computer and/or IC may perform, control, or execute instructions relating to joint adaptation of BL and EL quantizers, such as those described herein. The computer and/or IC may compute any of a variety of parameters or values that relate to joint adaptation of BL and EL quantizers as described herein. The image and video embodiments may be implemented in hardware, software, firmware and various combinations thereof.
Certain implementations of the invention comprise computer processors which execute software instructions which cause the processors to perform a method of the invention. For example, one or more processors in a display, an encoder, a set top box, a transcoder or the like may implement joint adaptation of BL and EL quantizers methods as described above by executing software instructions in a program memory accessible to the processors. The invention may also be provided in the form of a program product. The program product may comprise any medium which carries a set of computer-readable signals comprising instructions which, when executed by a data processor, cause the data processor to execute a method of the invention. Program products according to the invention may be in any of a wide variety of forms. The program product may comprise, for example, physical media such as magnetic data storage media including floppy diskettes, hard disk drives, optical data storage media including CD ROMs, DVDs, electronic data storage media including ROMs, flash RAM, or the like. The computer-readable signals on the program product may optionally be compressed or encrypted.
Where a component (e.g. a software module, processor, assembly, device, circuit, etc.) is referred to above, unless otherwise indicated, reference to that component (including a reference to a “means”) should be interpreted as including as equivalents of that component any component which performs the function of the described component (e.g., that is functionally equivalent), including components which are not structurally equivalent to the disclosed structure which performs the function in the illustrated example embodiments of the invention.
Equivalents, Extensions, Alternatives and Miscellaneous
Example embodiments that relate to joint adaptation of BL and EL quantizers are thus described. In the foregoing specification, embodiments of the present invention have been described with reference to numerous specific details that may vary from implementation to implementation. Thus, the sole and exclusive indicator of what is the invention, and is intended by the applicants to be the invention, is the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction. Any definitions expressly set forth herein for terms contained in such claims shall govern the meaning of such terms as used in the claims. Hence, no limitation, element, property, feature, advantage or attribute that is not expressly recited in a claim should limit the scope of such claim in any way. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
This application claims the benefit of filing date to U.S. Provisional Application Ser. No. 61/658,632 filed on Jun. 12, 2012, and U.S. Provisional Application Ser. No. 61/714,322, filed on Oct. 16, 2012, both of which are hereby incorporated by reference in their entirety.
Number | Name | Date | Kind |
---|---|---|---|
5049990 | Kondo | Sep 1991 | A |
5642341 | Stork | Jun 1997 | A |
5872865 | Normile | Feb 1999 | A |
9098906 | Bruls | Aug 2015 | B2 |
20030058931 | Zhang | Mar 2003 | A1 |
20030108102 | Demos | Jun 2003 | A1 |
20100195901 | Andrus | Aug 2010 | A1 |
20130108183 | Bruls | May 2013 | A1 |
20130148029 | Gish | Jun 2013 | A1 |
Number | Date | Country |
---|---|---|
2012147022 | Nov 2012 | WO |
2012148883 | Nov 2012 | WO |
2013067101 | May 2013 | WO |
Number | Date | Country | |
---|---|---|---|
20130329778 A1 | Dec 2013 | US |
Number | Date | Country | |
---|---|---|---|
61658632 | Jun 2012 | US | |
61714322 | Oct 2012 | US |