78 #define OFFSET(x) offsetof(MCDeintContext, x)
79 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
80 #define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
117 enc_ctx->
width = inlink->
w;
130 switch (mcdeint->
mode) {
177 int x,
y, i,
ret, got_frame = 0;
197 for (i = 0; i < 3; i++) {
205 for (y = 0; y < h; y++) {
206 if ((y ^ mcdeint->
parity) & 1) {
207 for (x = 0; x < w; x++) {
212 if (y > 0 && y < h-1){
213 int is_edge = x < 3 || x > w-4;
214 int diff0 = filp[-fils] - srcp[-srcs];
215 int diff1 = filp[+fils] - srcp[+srcs];
218 #define DELTA(j) av_clip(j, -x, w-1-x)
220 #define GET_SCORE_EDGE(j)\
221 FFABS(srcp[-srcs+DELTA(-1+(j))] - srcp[+srcs+DELTA(-1-(j))])+\
222 FFABS(srcp[-srcs+DELTA(j) ] - srcp[+srcs+DELTA( -(j))])+\
223 FFABS(srcp[-srcs+DELTA(1+(j)) ] - srcp[+srcs+DELTA( 1-(j))])
225 #define GET_SCORE(j)\
226 FFABS(srcp[-srcs-1+(j)] - srcp[+srcs-1-(j)])+\
227 FFABS(srcp[-srcs +(j)] - srcp[+srcs -(j)])+\
228 FFABS(srcp[-srcs+1+(j)] - srcp[+srcs+1-(j)])
230 #define CHECK_EDGE(j)\
231 { int score = GET_SCORE_EDGE(j);\
232 if (score < spatial_score){\
233 spatial_score = score;\
234 diff0 = filp[-fils+DELTA(j)] - srcp[-srcs+DELTA(j)];\
235 diff1 = filp[+fils+DELTA(-(j))] - srcp[+srcs+DELTA(-(j))];\
238 { int score = GET_SCORE(j);\
239 if (score < spatial_score){\
240 spatial_score= score;\
241 diff0 = filp[-fils+(j)] - srcp[-srcs+(j)];\
242 diff1 = filp[+fils-(j)] - srcp[+srcs-(j)];\
250 CHECK(-1) CHECK(-2) }} }}
251 CHECK( 1) CHECK( 2) }} }}
255 if (diff0 + diff1 > 0)
268 if (!((
y ^ mcdeint->parity) & 1)) {
269 for (x = 0; x < w; x++) {
270 frame_dec->data[i][x +
y*fils] =
271 outpic ->data[i][x +
y*dsts] =
inpic->data[i][x +
y*srcs];
276 mcdeint->parity ^= 1;
314 .priv_class = &mcdeint_class,