Revision a6ddf8bf libavfilter/vf_crop.c
libavfilter/vf_crop.c | ||
---|---|---|
24 | 24 |
*/ |
25 | 25 |
|
26 | 26 |
#include "avfilter.h" |
27 |
#include "libavutil/pixdesc.h"
|
|
27 |
#include "libavcore/imgutils.h"
|
|
28 | 28 |
|
29 | 29 |
typedef struct { |
30 | 30 |
int x; ///< x offset of the non-cropped area with respect to the input area |
... | ... | |
83 | 83 |
AVFilterContext *ctx = link->dst; |
84 | 84 |
CropContext *crop = ctx->priv; |
85 | 85 |
const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[link->format]; |
86 |
int i; |
|
87 |
|
|
88 |
memset(crop->max_step, 0, sizeof(crop->max_step)); |
|
89 |
for (i = 0; i < 4; i++) { |
|
90 |
const AVComponentDescriptor *comp = &(pix_desc->comp[i]); |
|
91 |
if ((comp->step_minus1+1) > crop->max_step[comp->plane]) |
|
92 |
crop->max_step[comp->plane] = comp->step_minus1+1; |
|
93 |
} |
|
94 | 86 |
|
87 |
av_fill_image_max_pixstep(crop->max_step, NULL, pix_desc); |
|
95 | 88 |
crop->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w; |
96 | 89 |
crop->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; |
97 | 90 |
|
Also available in: Unified diff