History

lavfi/vf_scale: pass only the private context to scale_slice()

Not the input link. The function does nothing with the link except extract the private context from it.

Anton Khirnov committed 5 years ago

Commit 6d51d651 parent f32f5641 file · +5 −6Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_scale.c+5−6
@@ -622,9 +622,8 @@ static int request_frame_ref(AVFilterLink *outlink) · 621 unmodified lines
622 return ff_request_frame(outlink->src->inputs[1]);622 return ff_request_frame(outlink->src->inputs[1]);
623}623}
624 624
625static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field)625static int scale_slice(ScaleContext *scale, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field)
626{626{
627 ScaleContext *scale = link->dst->priv;
628 const uint8_t *in[4];627 const uint8_t *in[4];
629 uint8_t *out[4];628 uint8_t *out[4];
630 int in_stride[4],out_stride[4];629 int in_stride[4],out_stride[4];
@@ -792,8 +791,8 @@ scale: · 161 unmodified lines
792 INT_MAX);791 INT_MAX);
793 792
794 if (scale->interlaced>0 || (scale->interlaced<0 && in->interlaced_frame)) {793 if (scale->interlaced>0 || (scale->interlaced<0 && in->interlaced_frame)) {
795 scale_slice(link, out, in, scale->isws[0], 0, (link->h+1)/2, 2, 0);794 scale_slice(scale, out, in, scale->isws[0], 0, (link->h+1)/2, 2, 0);
796 scale_slice(link, out, in, scale->isws[1], 0, link->h /2, 2, 1);795 scale_slice(scale, out, in, scale->isws[1], 0, link->h /2, 2, 1);
797 } else if (scale->nb_slices) {796 } else if (scale->nb_slices) {
798 int i, slice_h, slice_start, slice_end = 0;797 int i, slice_h, slice_start, slice_end = 0;
799 const int nb_slices = FFMIN(scale->nb_slices, link->h);798 const int nb_slices = FFMIN(scale->nb_slices, link->h);
@@ -801,10 +800,10 @@ scale: · 1 unmodified line
801 slice_start = slice_end;800 slice_start = slice_end;
802 slice_end = (link->h * (i+1)) / nb_slices;801 slice_end = (link->h * (i+1)) / nb_slices;
803 slice_h = slice_end - slice_start;802 slice_h = slice_end - slice_start;
804 scale_slice(link, out, in, scale->sws, slice_start, slice_h, 1, 0);803 scale_slice(scale, out, in, scale->sws, slice_start, slice_h, 1, 0);
805 }804 }
806 } else {805 } else {
807 scale_slice(link, out, in, scale->sws, 0, link->h, 1, 0);806 scale_slice(scale, out, in, scale->sws, 0, link->h, 1, 0);
808 }807 }
809 808
810 av_frame_free(&in);809 av_frame_free(&in);

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