| 207 | #undef BIT_DEPTH |
| 208 | |
| 209 | static int hb_decomb_init(hb_filter_object_t *filter, |
| 210 | hb_filter_init_t *init) |
| 211 | { |
| 212 | filter->private_data = calloc(1, sizeof(struct hb_filter_private_s)); |
| 213 | if (filter->private_data == NULL) |
| 214 | { |
| 215 | hb_error("decomb: calloc failed"); |
| 216 | return -1; |
| 217 | } |
| 218 | hb_filter_private_t *pv = filter->private_data; |
| 219 | pv->input = *init; |
| 220 | hb_buffer_list_clear(&pv->out_list); |
| 221 | |
| 222 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(init->pix_fmt); |
| 223 | pv->depth = desc->comp[0].depth; |
| 224 | pv->bps = pv->depth > 8 ? 2 : 1; |
| 225 | pv->max_value = (1 << pv->depth) - 1; |
| 226 | |
| 227 | pv->deinterlaced = 0; |
| 228 | pv->blended = 0; |
| 229 | pv->unfiltered = 0; |
| 230 | pv->frames = 0; |
| 231 | pv->ready = 0; |
| 232 | |
| 233 | pv->mode = MODE_DECOMB_YADIF | MODE_DECOMB_BLEND | MODE_DECOMB_CUBIC; |
| 234 | pv->magnitude_threshold = 10; |
| 235 | pv->variance_threshold = 20; |
| 236 | pv->laplacian_threshold = 20; |
| 237 | pv->dilation_threshold = 4; |
| 238 | pv->erosion_threshold = 2; |
| 239 | pv->noise_threshold = 50; |
| 240 | pv->maximum_search_distance = 24; |
| 241 | pv->post_processing = 1; |
| 242 | pv->parity = PARITY_DEFAULT; |
| 243 | |
| 244 | if (filter->settings) |
| 245 | { |
| 246 | hb_value_t *dict = filter->settings; |
| 247 | |
| 248 | // Get comb detection settings |
| 249 | hb_dict_extract_int(&pv->mode, dict, "mode"); |
| 250 | |
| 251 | // Get deinterlace settings |
| 252 | hb_dict_extract_int(&pv->parity, dict, "parity"); |
| 253 | if (pv->mode & MODE_DECOMB_EEDI2) |
| 254 | { |
| 255 | hb_dict_extract_int(&pv->magnitude_threshold, dict, |
| 256 | "magnitude-thresh"); |
| 257 | hb_dict_extract_int(&pv->variance_threshold, dict, |
| 258 | "variance-thresh"); |
| 259 | hb_dict_extract_int(&pv->laplacian_threshold, dict, |
| 260 | "laplacian-thresh"); |
| 261 | hb_dict_extract_int(&pv->dilation_threshold, dict, |
| 262 | "dilation-thresh"); |
| 263 | hb_dict_extract_int(&pv->erosion_threshold, dict, |
| 264 | "erosion-thresh"); |
| 265 | hb_dict_extract_int(&pv->noise_threshold, dict, |
| 266 | "noise-thresh"); |
nothing calls this directly
no test coverage detected