diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2019-09-26 23:36:54 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-27 10:58:30 +0200 |
commit | b9d479bac45bb4ce42b3f685bce5cad8d89f8f71 (patch) | |
tree | dae6bd16561cce533c5d8484f6b6a157a335ea25 /libavfilter/vf_scale.c | |
parent | 87ddf9f1ef17726fd4235f2e7aed8334d0ff231b (diff) | |
download | ffmpeg-b9d479bac45bb4ce42b3f685bce5cad8d89f8f71.tar.gz |
avfilter/vf_scale: cosmetics
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r-- | libavfilter/vf_scale.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index cb42794086..41ddec7661 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -396,16 +396,16 @@ static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, s int in_stride[4],out_stride[4]; int i; - for(i=0; i<4; i++){ + for (i=0; i<4; i++) { int vsub= ((i+1)&2) ? scale->vsub : 0; in_stride[i] = cur_pic->linesize[i] * mul; out_stride[i] = out_buf->linesize[i] * mul; in[i] = cur_pic->data[i] + ((y>>vsub)+field) * cur_pic->linesize[i]; out[i] = out_buf->data[i] + field * out_buf->linesize[i]; } - if(scale->input_is_pal) + if (scale->input_is_pal) in[1] = cur_pic->data[1]; - if(scale->output_is_pal) + if (scale->output_is_pal) out[1] = out_buf->data[1]; return sws_scale(sws, in, in_stride, y/mul, h, @@ -425,7 +425,7 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) if (in->colorspace == AVCOL_SPC_YCGCO) av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n"); - if( in->width != link->w + if ( in->width != link->w || in->height != link->h || in->format != link->format || in->sample_aspect_ratio.den != link->sample_aspect_ratio.den || in->sample_aspect_ratio.num != link->sample_aspect_ratio.num) { @@ -445,7 +445,6 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) link->dst->inputs[0]->sample_aspect_ratio.den = in->sample_aspect_ratio.den; link->dst->inputs[0]->sample_aspect_ratio.num = in->sample_aspect_ratio.num; - if ((ret = config_props(outlink)) < 0) return ret; } @@ -469,7 +468,7 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) out->width = outlink->w; out->height = outlink->h; - if(scale->output_is_pal) + if (scale->output_is_pal) avpriv_set_systematic_pal2((uint32_t*)out->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format); in_range = in->color_range; @@ -520,10 +519,10 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h, INT_MAX); - if(scale->interlaced>0 || (scale->interlaced<0 && in->interlaced_frame)){ + if (scale->interlaced>0 || (scale->interlaced<0 && in->interlaced_frame)) { scale_slice(link, out, in, scale->isws[0], 0, (link->h+1)/2, 2, 0); scale_slice(link, out, in, scale->isws[1], 0, link->h /2, 2, 1); - }else if (scale->nb_slices) { + } else if (scale->nb_slices) { int i, slice_h, slice_start, slice_end = 0; const int nb_slices = FFMIN(scale->nb_slices, link->h); for (i = 0; i < nb_slices; i++) { @@ -532,7 +531,7 @@ static int scale_frame(AVFilterLink *link, AVFrame *in, AVFrame **frame_out) slice_h = slice_end - slice_start; scale_slice(link, out, in, scale->sws, slice_start, slice_h, 1, 0); } - }else{ + } else { scale_slice(link, out, in, scale->sws, 0, link->h, 1, 0); } |