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

Unified · Split

libavfilter/vf_scale.c+5−6
@@ -622,9 +622,8 @@ static int request_frame_ref(AVFilterLink *outlink) · 621 unmodified lines
622622 return ff_request_frame(outlink->src->inputs[1]);
623623 }
624624
625−static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field)
625+static int scale_slice(ScaleContext *scale, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field)
626626 {
627− ScaleContext *scale = link->dst->priv;
628627 const uint8_t *in[4];
629628 uint8_t *out[4];
630629 int in_stride[4],out_stride[4];
@@ -792,8 +791,8 @@ scale: · 161 unmodified lines
792791 INT_MAX);
793792
794793 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);
796− scale_slice(link, out, in, scale->isws[1], 0, link->h /2, 2, 1);
794+ scale_slice(scale, out, in, scale->isws[0], 0, (link->h+1)/2, 2, 0);
795+ scale_slice(scale, out, in, scale->isws[1], 0, link->h /2, 2, 1);
797796 } else if (scale->nb_slices) {
798797 int i, slice_h, slice_start, slice_end = 0;
799798 const int nb_slices = FFMIN(scale->nb_slices, link->h);
@@ -801,10 +800,10 @@ scale: · 1 unmodified line
801800 slice_start = slice_end;
802801 slice_end = (link->h * (i+1)) / nb_slices;
803802 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);
805804 }
806805 } 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);
808807 }
809808
810809 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