Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-08-27 02:30:30 +0300
committerLimin Wang <lance.lmwang@gmail.com>2020-08-27 02:30:30 +0300
commit71ec3e4583def61fbb32a4815376773ef7c80dee (patch)
treea98e85b05a9184ccbda1d6438bf64874b2b277db /libavfilter/vf_bwdif.c
parentca8e5dedc7fabae3df76ea11d9952070cbb19620 (diff)
Revert "avfilter/yadif: simplify the code for better readability"
This reverts commit 2a9b934675b9e2d3850b46f8a618c19b03f02551.
Diffstat (limited to 'libavfilter/vf_bwdif.c')
-rw-r--r--libavfilter/vf_bwdif.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index 583a96570e..b6aed7a450 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -219,8 +219,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
YADIFContext *yadif = &s->yadif;
ThreadData *td = arg;
int linesize = yadif->cur->linesize[td->plane];
- int clip_max = (1 << (yadif->depth)) - 1;
- int df = (yadif->depth + 7) / 8;
+ int clip_max = (1 << (yadif->csp->comp[td->plane].depth)) - 1;
+ int df = (yadif->csp->comp[td->plane].depth + 7) / 8;
int refs = linesize / df;
int slice_start = (td->h * jobnr ) / nb_jobs;
int slice_end = (td->h * (jobnr+1)) / nb_jobs;
@@ -267,13 +267,13 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic,
ThreadData td = { .frame = dstpic, .parity = parity, .tff = tff };
int i;
- for (i = 0; i < yadif->nb_components; i++) {
+ for (i = 0; i < yadif->csp->nb_components; i++) {
int w = dstpic->width;
int h = dstpic->height;
if (i == 1 || i == 2) {
- w = AV_CEIL_RSHIFT(w, yadif->hsub);
- h = AV_CEIL_RSHIFT(h, yadif->vsub);
+ w = AV_CEIL_RSHIFT(w, yadif->csp->log2_chroma_w);
+ h = AV_CEIL_RSHIFT(h, yadif->csp->log2_chroma_h);
}
td.w = w;
@@ -348,8 +348,9 @@ static int config_props(AVFilterLink *link)
return AVERROR(EINVAL);
}
+ yadif->csp = av_pix_fmt_desc_get(link->format);
yadif->filter = filter;
- if (yadif->depth > 8) {
+ if (yadif->csp->comp[0].depth > 8) {
s->filter_intra = filter_intra_16bit;
s->filter_line = filter_line_c_16bit;
s->filter_edge = filter_edge_16bit;