mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
lavfi/field, il, noise: use av_pix_fmt_count_planes()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
8d4e969afe
commit
2516b393d4
@ -55,12 +55,8 @@ static int config_props_output(AVFilterLink *outlink)
|
|||||||
AVFilterContext *ctx = outlink->src;
|
AVFilterContext *ctx = outlink->src;
|
||||||
FieldContext *field = ctx->priv;
|
FieldContext *field = ctx->priv;
|
||||||
AVFilterLink *inlink = ctx->inputs[0];
|
AVFilterLink *inlink = ctx->inputs[0];
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < desc->nb_components; i++)
|
field->nb_planes = av_pix_fmt_count_planes(outlink->format);
|
||||||
field->nb_planes = FFMAX(field->nb_planes, desc->comp[i].plane);
|
|
||||||
field->nb_planes++;
|
|
||||||
|
|
||||||
outlink->w = inlink->w;
|
outlink->w = inlink->w;
|
||||||
outlink->h = (inlink->h + (field->type == FIELD_TYPE_TOP)) / 2;
|
outlink->h = (inlink->h + (field->type == FIELD_TYPE_TOP)) / 2;
|
||||||
|
@ -100,11 +100,9 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
{
|
{
|
||||||
IlContext *il = inlink->dst->priv;
|
IlContext *il = inlink->dst->priv;
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
||||||
int i, ret;
|
int ret;
|
||||||
|
|
||||||
for (i = 0; i < desc->nb_components; i++)
|
il->nb_planes = av_pix_fmt_count_planes(inlink->format);
|
||||||
il->nb_planes = FFMAX(il->nb_planes, desc->comp[i].plane);
|
|
||||||
il->nb_planes++;
|
|
||||||
|
|
||||||
il->has_alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
|
il->has_alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
|
||||||
if ((ret = av_image_fill_linesizes(il->linesize, inlink->format, inlink->w)) < 0)
|
if ((ret = av_image_fill_linesizes(il->linesize, inlink->format, inlink->w)) < 0)
|
||||||
|
@ -184,11 +184,9 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
{
|
{
|
||||||
NoiseContext *n = inlink->dst->priv;
|
NoiseContext *n = inlink->dst->priv;
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
||||||
int i, ret;
|
int ret;
|
||||||
|
|
||||||
for (i = 0; i < desc->nb_components; i++)
|
n->nb_planes = av_pix_fmt_count_planes(inlink->format);
|
||||||
n->nb_planes = FFMAX(n->nb_planes, desc->comp[i].plane);
|
|
||||||
n->nb_planes++;
|
|
||||||
|
|
||||||
if ((ret = av_image_fill_linesizes(n->linesize, inlink->format, inlink->w)) < 0)
|
if ((ret = av_image_fill_linesizes(n->linesize, inlink->format, inlink->w)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user