vf_fieldorder: reindent

pull/8/head
Anton Khirnov 12 years ago
parent 565e4993c6
commit 49dd71a6f1
  1. 72
      libavfilter/vf_fieldorder.c

@ -133,46 +133,46 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame)
frame->video->top_field_first == s->dst_tff) frame->video->top_field_first == s->dst_tff)
return ff_filter_frame(outlink, frame); return ff_filter_frame(outlink, frame);
av_dlog(ctx, av_dlog(ctx,
"picture will move %s one line\n", "picture will move %s one line\n",
s->dst_tff ? "up" : "down"); s->dst_tff ? "up" : "down");
h = frame->video->h; h = frame->video->h;
for (plane = 0; plane < 4 && frame->data[plane]; plane++) { for (plane = 0; plane < 4 && frame->data[plane]; plane++) {
line_step = frame->linesize[plane]; line_step = frame->linesize[plane];
line_size = s->line_size[plane]; line_size = s->line_size[plane];
data = frame->data[plane]; data = frame->data[plane];
if (s->dst_tff) { if (s->dst_tff) {
/** Move every line up one line, working from /** Move every line up one line, working from
* the top to the bottom of the frame. * the top to the bottom of the frame.
* The original top line is lost. * The original top line is lost.
* The new last line is created as a copy of the * The new last line is created as a copy of the
* penultimate line from that field. */ * penultimate line from that field. */
for (line = 0; line < h; line++) { for (line = 0; line < h; line++) {
if (1 + line < frame->video->h) { if (1 + line < frame->video->h) {
memcpy(data, data + line_step, line_size); memcpy(data, data + line_step, line_size);
} else { } else {
memcpy(data, data - line_step - line_step, line_size); memcpy(data, data - line_step - line_step, line_size);
}
data += line_step;
} }
} else { data += line_step;
/** Move every line down one line, working from }
* the bottom to the top of the frame. } else {
* The original bottom line is lost. /** Move every line down one line, working from
* The new first line is created as a copy of the * the bottom to the top of the frame.
* second line from that field. */ * The original bottom line is lost.
data += (h - 1) * line_step; * The new first line is created as a copy of the
for (line = h - 1; line >= 0 ; line--) { * second line from that field. */
if (line > 0) { data += (h - 1) * line_step;
memcpy(data, data - line_step, line_size); for (line = h - 1; line >= 0 ; line--) {
} else { if (line > 0) {
memcpy(data, data + line_step + line_step, line_size); memcpy(data, data - line_step, line_size);
} } else {
data -= line_step; memcpy(data, data + line_step + line_step, line_size);
} }
data -= line_step;
} }
} }
frame->video->top_field_first = s->dst_tff; }
frame->video->top_field_first = s->dst_tff;
return ff_filter_frame(outlink, frame); return ff_filter_frame(outlink, frame);
} }

Loading…
Cancel
Save