# A Display-Adaptive Pipeline for Dynamic Range Expansion of Standard Dynamic Range Video Content
## 3 Materials and Methods: A Pipeline for Dynamic Range Expansion of Video Sequences
### Dynamic Range Expansion
For instance, a value of 0.214 is assigned for an LDR content encoded in the sRGB linear color space. Meanwhile, parameter \(m_{\rm o}\) determines the middle-gray value intended for the resulting HDR frame, which essentially governs its overall brightness. The mid-level output value is computed using basic features derived from the filtered LDR input frame. In our previous research described in [13; 32], we conducted a subjective experiment where a group of LDR images were expanded into HDR using our proposed expansion operator. For each image, the participants were asked to set the value of the  
Figure 4: Dynamic range expansion based on mid-level tone mapping. The overall perception of brightness of the expanded luminance (\(L_{\rm w}\)) can be modified by fixing the mid-level in parameter (\(m_{\rm i}\)) and varying the mid-level out (\(m_{\rm o}\)). Higher values of \(m_{\rm o}\) (right side of the image) will make \(L_{\rm w}\) brighter, and lower values (left part of the image) will make it darker. Parameters \(d\) and \(a\) can be used to fine-tune the results, increasing the overall contrast and appearance of the highlights, respectively. middle-gray output that generated an HDR image closer to the corresponding HDR ground truth, i.e., an HDR image with similar overall brightness. In this experiment, we collected data on the middle-gray levels in the output used for inverse tone mapping a wide variety of scenes. We then applied a multi-linear regression approach to model the relationship between the middle-gray value in the output (as the dependent variable) and various first-order statistical features (as independent variables). From this analysis, our resulting regression model revealed that the estimation of \(m_{\text{o}}\) could be achieved by employing simple image statistics extracted from the LDR input as follows:  
\[m_{\text{o}}=0.017254+0.097477L_{\text{h}}+0.008453C-0.028491P_{\text{ov}}, \tag{4}\]  
where \(L_{\text{h}}\) is the geometric mean, \(C\) is the contrast, and \(P_{\text{ov}}\) is the percentage of over-exposed pixels in the filtered LDR input frame. These parameters are computed as follows:  
\[L_{\text{h}} =\exp\left(\frac{1}{N}\sum_{i=1}^{N}\log(L_{i}+\varepsilon)\right)\] \[C =\sqrt{\frac{1}{N}\sum_{i=1}^{N}(\log(L_{i}+\varepsilon)-\log(L_{ \text{avg}}+\varepsilon))^{2}}\] \[\frac{m_{\text{i}}^{a}}{m_{\text{i}}^{ad}b+c}=m_{\text{o}}, \tag{2}\]0  
where \(L_{\text{avg}}\) is the average luminance value, \(L_{\text{min}}\) is the minimum, and \(L_{\text{max}}\) is the maximum luminance value in the filtered LDR input frame. \(N\) is the total number of pixels, \(\varepsilon\) is a small constant to avoid undefined values (here \(\varepsilon=0.0001\)), and \(N_{\text{ov}}\) is the total number of overexposed pixels. The overexposed pixels refer to those pixels with at least one color channel greater than or equal to \(0.996=254/255\). These values are computed after excluding 5% of the pixels on the dark and bright sides, considered outliers. As described in our previous research detailed in [32], and as reflected in Equation (4), the geometric mean (\(L_{\text{h}}\)), which is the parameter that represents the perceptual overall brightness of the input image, had the highest positive relation with the middle-gray value in the output. This finding underscores the influence of perceived brightness on the middle-gray adjustment in dynamic range expansion processes. To prevent the resulting inverse tone-mapped HDR video sequences from flickering as a result of abrupt changes between frames in the estimated mid-level values, the mid-level output value used to expand the dynamic range of the current frame (\(m_{\text{o},i}\)) is adjusted using a weighted average as follows:  
\[\frac{m_{\text{i}}^{a}}{m_{\text{i}}^{ad}b+c}=m_{\text{o}}, \tag{2}\]1  
where \(m_{\text{o},i-1}\) denotes the mid-level out value used to expand the dynamic range of the previous frame, \(m_{\text{o}}\) is the mid-level out value determined using Equation (4), and \(p\) is the weight value.