AVFilterBufferRef *cur;
AVFilterBufferRef *next;
AVFilterBufferRef *prev;
- AVFilterBufferRef *out;
int (*filter_line)(const uint8_t *prev, const uint8_t *cur, const uint8_t *next, int w);
const AVPixFmtDescriptor *csp;
}
}
- if (alpha[0] / (float)alpha[1] > idet->interlace_threshold){
+ if (alpha[0] > idet->interlace_threshold * alpha[1]){
type = TFF;
- }else if(alpha[1] / (float)alpha[0] > idet->interlace_threshold){
+ }else if(alpha[1] > idet->interlace_threshold * alpha[0]){
type = BFF;
- }else if(alpha[1] / (float)delta > idet->progressive_threshold){
+ }else if(alpha[1] > idet->progressive_threshold * delta){
type = PROGRSSIVE;
}else{
type = UNDETERMINED;
idet->prev = idet->cur;
idet->cur = idet->next;
idet->next = picref;
+ link->cur_buf = NULL;
if (!idet->cur)
return 0;
return 0;
if (!idet->csp)
- idet->csp = &av_pix_fmt_descriptors[link->format];
+ idet->csp = av_pix_fmt_desc_get(link->format);
if (idet->csp->comp[0].depth_minus1 / 8 == 1)
idet->filter_line = (void*)filter_line_c_16bit;
idet->poststat[UNDETERMINED]
);
- if (idet->prev) avfilter_unref_buffer(idet->prev);
- if (idet->cur ) avfilter_unref_buffer(idet->cur );
- if (idet->next) avfilter_unref_buffer(idet->next);
+ avfilter_unref_bufferp(&idet->prev);
+ avfilter_unref_bufferp(&idet->cur );
+ avfilter_unref_bufferp(&idet->next);
}
static int query_formats(AVFilterContext *ctx)