History

avfilter/vf_tinterlace: fix mergex2, first frame is always considered odd

Paul B Mahol committed 6 years ago

Commit d363afb1 parent 24fea4d1 file · +2 −2Browse files

Unified · Split

libavfilter/vf_tinterlace.c+2−2
@@ -396,12 +396,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 395 unmodified lines
396396 copy_picture_field(tinterlace, out->data, out->linesize,
397397 (const uint8_t **)cur->data, cur->linesize,
398398 inlink->format, inlink->w, inlink->h,
399− FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_LOWER : FIELD_UPPER : FIELD_UPPER, tinterlace->flags);
399+ FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? (1 + inlink->frame_count_out) & 1 ? FIELD_LOWER : FIELD_UPPER : FIELD_UPPER, tinterlace->flags);
400400 /* write even frame lines into the lower field of the new frame */
401401 copy_picture_field(tinterlace, out->data, out->linesize,
402402 (const uint8_t **)next->data, next->linesize,
403403 inlink->format, inlink->w, inlink->h,
404− FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_UPPER : FIELD_LOWER : FIELD_LOWER, tinterlace->flags);
404+ FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? (1 + inlink->frame_count_out) & 1 ? FIELD_UPPER : FIELD_LOWER : FIELD_LOWER, tinterlace->flags);
405405 if (tinterlace->mode != MODE_MERGEX2)
406406 av_frame_free(&tinterlace->next);
407407 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t