@@ -303,7 +303,14 @@ static int config_output(AVFilterLink *outlink)
s->csp = av_pix_fmt_desc_get(outlink->format);
s->filter = filter;
- if (s->csp->comp[0].depth > 8) {
+ ff_yadif_init_filter_line(s, s->csp->comp[0].depth);
+
+ return 0;
+}
+
+av_cold void ff_yadif_init_filter_line(YADIFContext *s, int bit_depth)
+{
+ if (bit_depth > 8) {
s->filter_line = filter_line_c_16bit;
s->filter_edges = filter_edges_16bit;
} else {
@@ -312,10 +319,8 @@ static int config_output(AVFilterLink *outlink)
}
#if ARCH_X86
- ff_yadif_init_x86(s);
+ ff_yadif_init_x86(s, bit_depth);
#endif
-
- return 0;
}
@@ -47,11 +47,9 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
void *next, int w, int prefs,
int mrefs, int parity, int mode);
-av_cold void ff_yadif_init_x86(YADIFContext *yadif)
+av_cold void ff_yadif_init_x86(YADIFContext *yadif, int bit_depth)
{
int cpu_flags = av_get_cpu_flags();
- int bit_depth = (!yadif->csp) ? 8
- : yadif->csp->comp[0].depth;
if (bit_depth >= 15) {
if (EXTERNAL_SSE2(cpu_flags))
@@ -86,7 +86,8 @@ typedef struct YADIFContext {
int current_field; ///< YADIFCurrentField
} YADIFContext;
-void ff_yadif_init_x86(YADIFContext *yadif);
+void ff_yadif_init_filter_line(YADIFContext *s, int bit_depth);
+void ff_yadif_init_x86(YADIFContext *yadif, int bit_depth);
int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame);