| 1203 | } |
| 1204 | |
| 1205 | SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, |
| 1206 | float lumaSharpen, float chromaSharpen, |
| 1207 | float chromaHShift, float chromaVShift, |
| 1208 | int verbose) |
| 1209 | { |
| 1210 | SwsFilter *filter= av_malloc(sizeof(SwsFilter)); |
| 1211 | if (!filter) |
| 1212 | return NULL; |
| 1213 | |
| 1214 | if (lumaGBlur!=0.0) { |
| 1215 | filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0); |
| 1216 | filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0); |
| 1217 | } else { |
| 1218 | filter->lumH= sws_getIdentityVec(); |
| 1219 | filter->lumV= sws_getIdentityVec(); |
| 1220 | } |
| 1221 | |
| 1222 | if (chromaGBlur!=0.0) { |
| 1223 | filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0); |
| 1224 | filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0); |
| 1225 | } else { |
| 1226 | filter->chrH= sws_getIdentityVec(); |
| 1227 | filter->chrV= sws_getIdentityVec(); |
| 1228 | } |
| 1229 | |
| 1230 | if (chromaSharpen!=0.0) { |
| 1231 | SwsVector *id= sws_getIdentityVec(); |
| 1232 | sws_scaleVec(filter->chrH, -chromaSharpen); |
| 1233 | sws_scaleVec(filter->chrV, -chromaSharpen); |
| 1234 | sws_addVec(filter->chrH, id); |
| 1235 | sws_addVec(filter->chrV, id); |
| 1236 | sws_freeVec(id); |
| 1237 | } |
| 1238 | |
| 1239 | if (lumaSharpen!=0.0) { |
| 1240 | SwsVector *id= sws_getIdentityVec(); |
| 1241 | sws_scaleVec(filter->lumH, -lumaSharpen); |
| 1242 | sws_scaleVec(filter->lumV, -lumaSharpen); |
| 1243 | sws_addVec(filter->lumH, id); |
| 1244 | sws_addVec(filter->lumV, id); |
| 1245 | sws_freeVec(id); |
| 1246 | } |
| 1247 | |
| 1248 | if (chromaHShift != 0.0) |
| 1249 | sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5)); |
| 1250 | |
| 1251 | if (chromaVShift != 0.0) |
| 1252 | sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5)); |
| 1253 | |
| 1254 | sws_normalizeVec(filter->chrH, 1.0); |
| 1255 | sws_normalizeVec(filter->chrV, 1.0); |
| 1256 | sws_normalizeVec(filter->lumH, 1.0); |
| 1257 | sws_normalizeVec(filter->lumV, 1.0); |
| 1258 | |
| 1259 | if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG); |
| 1260 | if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG); |
| 1261 | |
| 1262 | return filter; |
nothing calls this directly
no test coverage detected