Spatial Interface Parameters
Spatial filters include basic filters 0–4, namely, nXsf0, nXsf1, nXsf2, nXsf3, and nXsf4, and any combination of these basic filters. Different types of spatial filters are used at different levels. The level 0 and level 1 filters (referred to as the SFi filter group) have strong edge-preserving capabilities, but are prone to strip noise. The level 2 and level 3 filters (referred to as the SFk filter group) have weak edge-preserving capabilities, but have fewer side effects.
- nXsf1, nXsf2, and nXsf4 are filter 1, filter 2, and filter 4, respectively, which have different features.
- Filter 1 and filter 2 feature stronger NR capability for strong edges of images but weaker NR capability for flat regions. (The grains are more obvious in flat regions compared with the performance of filter 4.)
- Filter 4 features stronger NR capability for flat regions, which can better remove grains in flat regions. It also features stronger edge-preserving capability (sharper image edge) but weaker NR capability for edges.
- For SFk filter group at level 2, filter 1 and filter 2 share strength parameter 2.
- The [nXsf1], [nXsf2], and [nXsf4] interfaces at each level have three parameters.
- The first and second parameters are used to adjust the filter strength, which ranges from 0 to 255. Generally, only the first parameter needs to be adjusted (the second parameter is set to 0). However, when the first parameter is set to a large value, the denoising strength still needs to be enhanced, and the second parameter can be adjusted as a supplement. (Note that the NR strength of filter 1 is related only to the first parameter.)
- The third parameter is used to adjust the NR mode when the brightness and darkness of an image are asymmetric. The default value is 128, which indicates the NR mode with symmetric brightness and darkness. A value less than 128 indicates a stronger tendency for NR in bright regions, and a value greater than 128 indicates a stronger tendency for NR in dark regions. A larger deviation from 128 indicates a greater strength of asymmetry. The value range is [0, 255].
- nXsf0, nXsf3 are the two filters whose parameters are not displayed in the GUI, that is, filter 0 and filter 3.
- Filter 0 is used for the input of the original input pixels of level 0.
- The performance of filter 3 is between that of filters 2 and 4.
- nXsf3 and nXsf4 use the same configuration parameters.
- kmode: specifies whether to determine the NR strength based on the luminance of level 2 and level 3 filters (that is, SFk filters).
- Value 0: Common mode. The NR strength cannot be determined based on the luminance.
- Value 1, 2, or 3: Filter 4 uses arrays (sbs_k[32] and sds_k[32]) to indicate different NR parameter curves for different luminance. Different kmode values indicate different luminance measurement methods. If the difference is minor, you are advised to retain the default value 1.
- sbs_k sds_k: are used at level 2 and level 3. The luminance is divided into 32 levels. You can adjust the strength of filter 4 at level 2 and level 3 for the image content corresponding to each luminance level. sbs_k and sds_k indicate the strength of spatial NR for the bright and dark regions, respectively. The value range is [0, 8191].
- nXsf5: is used to adjust filter 5. It indicates the mixed result of filters 1–4 and is used for combining NR or detail enhancement of different frequency bands. Four parameters are used to configure the NR strength of four filters in sequence, respectively.
- When the value of a filter parameter in the [nXsf5] interface is less than 64, the filter result is used for denoising. A smaller value indicates greater denoising strength.
- If the value is greater than 64, the filter result is used for detail enhancement. A larger value indicates a stronger strength.
- If the value is 64, the filter's impact on the final combination result is disabled. The value range is [0, 255].
- The final output of this interface is the blended result of four filter groups. If the average value of the four parameters is greater than 64, the result of detail enhancement is preferred. If the average value of the four parameters is less than 64, the result of NR is preferred.
- The value of this parameter has the following restriction: For all the parameters less than 64, the sum of the differences between their actual values and 64 must be less than 64.
- sfs5: is used at level 3 to set the strength of four filters in filter 5. A larger value indicates a stronger filtering or enhancement effect.
- dzsf5: controls the range of the effect that the result of filter 5 has in the image. A smaller value indicates a larger range. When this parameter is set to 999, the function of filter 5 is disabled. The value range is [0, 999].
- nXsf6: sets the result of filter 6. It is the mixed result of two groups of filters. The first two parameters of this interface are the serial numbers of the mixed filters (which can be selected from filters 0–5). The last parameter specifies the mixing mode. The value range is [0, 4]. When this parameter is set to 0, the output is the original value. Other values indicate four different mixing modes.
When this parameter is set to 1, it means to mix the filter results based on a weight specified by the third parameter (value range: [0, 15]). The larger the weight, the result of the last group of filters is preferred.
When this parameter is set to 2–4, the result of filter 2 is used as the output result. However, the tendency to the result of filter 1 is preferred.
- nXsfr6: takes effect when the fourth parameter of sf6 is set to 4. It is used for four constraint check mechanisms. A larger value indicates that the second result of nXsf6 is preferred. The value range is [0, 31]. The mechanism closest to the second result is used.
- nXsbr6: is used to asymmetrically adjust the brightness and darkness of filter 6. It takes effect only when the fourth parameter of nXsf6 is set to 4. The two parameters are used to control the blending ratio of the first and second results of nXsf6. Different blending ratios can be configured for the bright and dark conditions.
- nXsfn and nXsth/nXsthd: nXsfn indicates a filter type selected for a region based on the image features and is used with nXsth/nXsthd. nXsth/nXsthd indicates the upper and lower thresholds for distinguishing features of different regions. The value range of nXsfn is [0, 6], and that of nXsth/nXsthd is [0, 511]. The value of nXsth must be greater than or equal to that of nXsthd.
Assume that the nXsfn and nXsth/nXsthd parameters of a certain level of a spatial domain are sfn0, sfn1, sfn2, sth1/sth_d1, and sth2/sth_d2.
- If the second feature is less than sth_d2, the result of sfn2 is output.
- If the second feature value is greater than or equal to sth2 and the first feature value is less than sth_d1, the result of sfn1 is output.
- When the first feature is greater than sth1, the result of sfn0 is selected.
This method can be used to implement different processing effects for different regions. sth1/sth_d1 and sth2/sth_d2 use feature thresholds of different filters. They cannot be compared directly due to the measurement differences.
- sfr: controls the entire NR result of spatial filters. A larger value indicates a stronger spatial filtering effect. The value range is [0, 31]. When n is 0, spatial filtering is disabled.