| 1 |
/* |
| 2 |
* Copyright (c) 2017, Intel Corporation |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
* copy of this software and associated documentation files (the "Software"), |
| 6 |
* to deal in the Software without restriction, including without limitation |
| 7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 9 |
* Software is furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice shall be included |
| 12 |
* in all copies or substantial portions of the Software. |
| 13 |
* |
| 14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
* OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
*/ |
| 22 |
#include "cm_def.h" |
| 23 |
|
| 24 |
CM_AVS_STATE_MSG_EX::CM_AVS_STATE_MSG_EX(): |
| 25 |
enableAllChannelAdaptiveFilter(false), |
| 26 |
enableRgbAdaptiveFilter(false), |
| 27 |
enable8TapAdaptiveFilter(false), |
| 28 |
enableUV8TapFilter(false), |
| 29 |
writebackFormat(true), // Results are returned in "sampleunorm" format. |
| 30 |
writebackMode(true), // AVS mode. |
| 31 |
stateSelection(0), // scaler8x8 state 0 is used. |
| 32 |
|
| 33 |
enableIef(false), // No image enhancement filtering. |
| 34 |
iefType(false), |
| 35 |
enableIefSmooth(false), |
| 36 |
r3cCoefficient(0.46875f), |
| 37 |
r3xCoefficient(0.1875f), |
| 38 |
r5cCoefficient(0.09375f), |
| 39 |
r5cxCoefficient(0.25f), |
| 40 |
r5xCoefficient(0.28125f), |
| 41 |
|
| 42 |
strongEdgeThreshold(8), |
| 43 |
strongEdgeWeight(6), |
| 44 |
weakEdgeThreshold(1), |
| 45 |
regularEdgeWeight(3), |
| 46 |
nonEdgeWeight(2), |
| 47 |
|
| 48 |
enableChromaKey(false), |
| 49 |
chromaKeyIndex(0), |
| 50 |
|
| 51 |
enableSkinTone(false), |
| 52 |
enableVySkinToneDetection(false), |
| 53 |
skinDetailFactor(false), |
| 54 |
skinTypesMargin(20), |
| 55 |
skinTypesThreshold(120), |
| 56 |
|
| 57 |
gainFactor(32), |
| 58 |
globalNoiseEstimation(0), |
| 59 |
mrBoost(false), |
| 60 |
mrSmoothThreshold(2), |
| 61 |
mrThreshold(5), |
| 62 |
steepnessBoost(false), |
| 63 |
steepnessThreshold(0), |
| 64 |
textureCoordinateMode(true), // Clamps to edge. |
| 65 |
maxHue(14), |
| 66 |
maxSaturation(31), |
| 67 |
angles(52), |
| 68 |
diamondMargin(4), |
| 69 |
diamondDu(0), |
| 70 |
diamondDv(0), |
| 71 |
diamondAlpha(1.5625f), |
| 72 |
diamondThreshold(35), |
| 73 |
rectangleMargin(3), |
| 74 |
|
| 75 |
defaultSharpnessLevel(255), |
| 76 |
enableXAdaptiveFilter(true), |
| 77 |
enableYAdaptiveFilter(true), |
| 78 |
maxDerivative4Pixels(0), |
| 79 |
maxDerivative8Pixels(20), |
| 80 |
transitionArea4Pixels(3), |
| 81 |
transitionArea8Pixels(5) |
| 82 |
{ |
| 83 |
rectangleMidpoint[0] = 110; |
| 84 |
rectangleMidpoint[1] = 154; |
| 85 |
vyInverseMargin[0] = 3300.0f/65536.0f; |
| 86 |
vyInverseMargin[1] = 1600.0f/65536.0f; |
| 87 |
piecewiseLinearYPoints[0] = 46; |
| 88 |
piecewiseLinearYPoints[1] = 47; |
| 89 |
piecewiseLinearYPoints[2] = 254; |
| 90 |
piecewiseLinearYPoints[3] = 255; |
| 91 |
piecewiseLinearYSlopes[0] = 31.0f/8.0f; |
| 92 |
piecewiseLinearYSlopes[1] = 31.0f/8.0f; |
| 93 |
piecewiseLinearPointsLower[0] = 46; |
| 94 |
piecewiseLinearPointsLower[1] = 216; |
| 95 |
piecewiseLinearPointsLower[2] = 236; |
| 96 |
piecewiseLinearPointsLower[3] = 236; |
| 97 |
piecewiseLinearPointsUpper[0] = 46; |
| 98 |
piecewiseLinearPointsUpper[1] = 66; |
| 99 |
piecewiseLinearPointsUpper[2] = 150; |
| 100 |
piecewiseLinearPointsUpper[3] = 236; |
| 101 |
piecewiseLinearSlopesLower[0] = -5.0f/256.0f; |
| 102 |
piecewiseLinearSlopesLower[1] = piecewiseLinearSlopesLower[2] |
| 103 |
= piecewiseLinearSlopesLower[3] = 0; |
| 104 |
piecewiseLinearSlopesUpper[0] = 1.0f; |
| 105 |
piecewiseLinearSlopesUpper[1] = 113.0f/256.0f; |
| 106 |
piecewiseLinearSlopesUpper[2] = -179.0f/256.0f; |
| 107 |
piecewiseLinearSlopesUpper[3] = 0; |
| 108 |
piecewiseLinearBiasesLower[0] = 133; |
| 109 |
piecewiseLinearBiasesLower[1] = piecewiseLinearBiasesLower[2] |
| 110 |
= piecewiseLinearBiasesLower[3] = 130; |
| 111 |
piecewiseLinearBiasesUpper[0] = 143; |
| 112 |
piecewiseLinearBiasesUpper[1] = 163; |
| 113 |
piecewiseLinearBiasesUpper[2] = 200; |
| 114 |
piecewiseLinearBiasesUpper[3] = 140; |
| 115 |
|
| 116 |
for (int i = 0; i < CM_NUM_COEFF_ROWS_SKL; ++i) { |
| 117 |
// Y horizontal |
| 118 |
table0X[i].filterCoeff_0_0 = table0X[i].filterCoeff_0_1 |
| 119 |
= table0X[i].filterCoeff_0_2 = table0X[i].filterCoeff_0_3 |
| 120 |
= table0X[i].filterCoeff_0_4 = table0X[i].filterCoeff_0_5 |
| 121 |
= table0X[i].filterCoeff_0_6 = table0X[i].filterCoeff_0_7 = 0.125f; |
| 122 |
// Y vertical |
| 123 |
table0Y[i].filterCoeff_0_0 = table0Y[i].filterCoeff_0_1 |
| 124 |
= table0Y[i].filterCoeff_0_2 = table0Y[i].filterCoeff_0_3 |
| 125 |
= table0Y[i].filterCoeff_0_4 = table0Y[i].filterCoeff_0_5 |
| 126 |
= table0Y[i].filterCoeff_0_6 = table0Y[i].filterCoeff_0_7 = 0.125f; |
| 127 |
// UV horizontal |
| 128 |
table1X[i].filterCoeff_0_0 = table1X[i].filterCoeff_0_1 |
| 129 |
= table1X[i].filterCoeff_0_2 = table1X[i].filterCoeff_0_3 |
| 130 |
= table1X[i].filterCoeff_0_4 = table1X[i].filterCoeff_0_5 |
| 131 |
= table1X[i].filterCoeff_0_6 = table1X[i].filterCoeff_0_7 = 0.125f; |
| 132 |
// UV vertical |
| 133 |
table1Y[i].filterCoeff_0_0 = table1Y[i].filterCoeff_0_1 |
| 134 |
= table1Y[i].filterCoeff_0_2 = table1Y[i].filterCoeff_0_3 |
| 135 |
= table1Y[i].filterCoeff_0_4 = table1Y[i].filterCoeff_0_5 |
| 136 |
= table1Y[i].filterCoeff_0_6 = table1Y[i].filterCoeff_0_7 = 0.125f; |
| 137 |
} |
| 138 |
return; |
| 139 |
}//------ |