~ubuntu-branches/debian/experimental/ffmpeg/experimental

« back to all changes in this revision

Viewing changes to libavfilter/vf_il.c

  • Committer: Package Import Robot
  • Author(s): Andreas Cadhalpun, Andreas Cadhalpun, Carl Eugen Hoyos
  • Date: 2015-07-09 23:42:42 UTC
  • mfrom: (0.1.17) (3.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20150709234242-mf3vk9qgvcv9zh3s
Tags: 7:2.7.1-2
[ Andreas Cadhalpun ]
* Build libavcodec-extra flavor.
* Add encdec-extra autopkgtest for the libavcodec-extra flavor.
* Add lib*-dev and libav-tools-links packages.
* Drop README.Debian.
* Remove bogus apng-ffm autopkg test.
* Explicitly build-depend on liblzma-dev used by the tiff decoder.
* Use the pkg-multimedia repository for the Vcs links.
* Use the plain lib*-dev packages for the test dependencies.
* Disable libssh on sparc due to #790067.
* Remove temporary gdb dependency on sparc64.
* Enable openal on sparc64.

[ Carl Eugen Hoyos ]
* Disable x265 on alpha due to #789807.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
typedef struct {
40
40
    const AVClass *class;
41
 
    enum FilterMode luma_mode, chroma_mode, alpha_mode;
 
41
    int luma_mode, chroma_mode, alpha_mode; ///<FilterMode
42
42
    int luma_swap, chroma_swap, alpha_swap;
43
43
    int nb_planes;
44
44
    int linesize[4], chroma_height;
92
92
            ff_add_format(&formats, fmt);
93
93
    }
94
94
 
95
 
    ff_set_common_formats(ctx, formats);
96
 
    return 0;
 
95
    return ff_set_common_formats(ctx, formats);
97
96
}
98
97
 
99
98
static int config_input(AVFilterLink *inlink)
100
99
{
101
 
    IlContext *il = inlink->dst->priv;
 
100
    IlContext *s = inlink->dst->priv;
102
101
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
103
102
    int ret;
104
103
 
105
 
    il->nb_planes = av_pix_fmt_count_planes(inlink->format);
 
104
    s->nb_planes = av_pix_fmt_count_planes(inlink->format);
106
105
 
107
 
    il->has_alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
108
 
    if ((ret = av_image_fill_linesizes(il->linesize, inlink->format, inlink->w)) < 0)
 
106
    s->has_alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
 
107
    if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
109
108
        return ret;
110
109
 
111
 
    il->chroma_height = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
 
110
    s->chroma_height = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
112
111
 
113
112
    return 0;
114
113
}
146
145
 
147
146
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
148
147
{
149
 
    IlContext *il = inlink->dst->priv;
 
148
    IlContext *s = inlink->dst->priv;
150
149
    AVFilterLink *outlink = inlink->dst->outputs[0];
151
150
    AVFrame *out;
152
151
    int comp;
159
158
    av_frame_copy_props(out, inpicref);
160
159
 
161
160
    interleave(out->data[0], inpicref->data[0],
162
 
               il->linesize[0], inlink->h,
 
161
               s->linesize[0], inlink->h,
163
162
               out->linesize[0], inpicref->linesize[0],
164
 
               il->luma_mode, il->luma_swap);
 
163
               s->luma_mode, s->luma_swap);
165
164
 
166
 
    for (comp = 1; comp < (il->nb_planes - il->has_alpha); comp++) {
 
165
    for (comp = 1; comp < (s->nb_planes - s->has_alpha); comp++) {
167
166
        interleave(out->data[comp], inpicref->data[comp],
168
 
                   il->linesize[comp], il->chroma_height,
 
167
                   s->linesize[comp], s->chroma_height,
169
168
                   out->linesize[comp], inpicref->linesize[comp],
170
 
                   il->chroma_mode, il->chroma_swap);
 
169
                   s->chroma_mode, s->chroma_swap);
171
170
    }
172
171
 
173
 
    if (il->has_alpha) {
174
 
        comp = il->nb_planes - 1;
 
172
    if (s->has_alpha) {
 
173
        comp = s->nb_planes - 1;
175
174
        interleave(out->data[comp], inpicref->data[comp],
176
 
                   il->linesize[comp], inlink->h,
 
175
                   s->linesize[comp], inlink->h,
177
176
                   out->linesize[comp], inpicref->linesize[comp],
178
 
                   il->alpha_mode, il->alpha_swap);
 
177
                   s->alpha_mode, s->alpha_swap);
179
178
    }
180
179
 
181
180
    av_frame_free(&inpicref);