~ubuntu-branches/ubuntu/trusty/libav/trusty-proposed

« back to all changes in this revision

Viewing changes to libswscale/swscale-test.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-10-23 18:49:26 UTC
  • mto: (1.1.18 experimental)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121023184926-cw5imrodltw6h5o4
Tags: upstream-9~beta2
ImportĀ upstreamĀ versionĀ 9~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
                  int srcW, int srcH, int dstW, int dstH, int flags,
82
82
                  struct Results *r)
83
83
{
 
84
    const AVPixFmtDescriptor *desc_yuva420p = av_pix_fmt_desc_get(AV_PIX_FMT_YUVA420P);
 
85
    const AVPixFmtDescriptor *desc_src      = av_pix_fmt_desc_get(srcFormat);
 
86
    const AVPixFmtDescriptor *desc_dst      = av_pix_fmt_desc_get(dstFormat);
84
87
    static enum AVPixelFormat cur_srcFormat;
85
88
    static int cur_srcW, cur_srcH;
86
89
    static uint8_t *src[4];
115
118
                                    srcFormat, SWS_BILINEAR, NULL, NULL, NULL);
116
119
        if (!srcContext) {
117
120
            fprintf(stderr, "Failed to get %s ---> %s\n",
118
 
                    av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name,
119
 
                    av_pix_fmt_descriptors[srcFormat].name);
 
121
                    desc_yuva420p->name,
 
122
                    desc_src->name);
120
123
            res = -1;
121
124
            goto end;
122
125
        }
150
153
                                flags, NULL, NULL, NULL);
151
154
    if (!dstContext) {
152
155
        fprintf(stderr, "Failed to get %s ---> %s\n",
153
 
                av_pix_fmt_descriptors[srcFormat].name,
154
 
                av_pix_fmt_descriptors[dstFormat].name);
 
156
                desc_src->name, desc_dst->name);
155
157
        res = -1;
156
158
        goto end;
157
159
    }
158
160
 
159
161
    printf(" %s %dx%d -> %s %3dx%3d flags=%2d",
160
 
           av_pix_fmt_descriptors[srcFormat].name, srcW, srcH,
161
 
           av_pix_fmt_descriptors[dstFormat].name, dstW, dstH,
 
162
           desc_src->name, srcW, srcH,
 
163
           desc_dst->name, dstW, dstH,
162
164
           flags);
163
165
    fflush(stdout);
164
166
 
188
190
                                    NULL, NULL, NULL);
189
191
        if (!outContext) {
190
192
            fprintf(stderr, "Failed to get %s ---> %s\n",
191
 
                    av_pix_fmt_descriptors[dstFormat].name,
192
 
                    av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name);
 
193
                    desc_dst->name,
 
194
                    desc_yuva420p->name);
193
195
            res = -1;
194
196
            goto end;
195
197
        }
242
244
    const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 };
243
245
    const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 };
244
246
    enum AVPixelFormat srcFormat, dstFormat;
 
247
    const AVPixFmtDescriptor *desc_src, *desc_dst;
245
248
 
246
249
    for (srcFormat = srcFormat_in != AV_PIX_FMT_NONE ? srcFormat_in : 0;
247
250
         srcFormat < AV_PIX_FMT_NB; srcFormat++) {
249
252
            !sws_isSupportedOutput(srcFormat))
250
253
            continue;
251
254
 
 
255
        desc_src = av_pix_fmt_desc_get(srcFormat);
 
256
 
252
257
        for (dstFormat = dstFormat_in != AV_PIX_FMT_NONE ? dstFormat_in : 0;
253
258
             dstFormat < AV_PIX_FMT_NB; dstFormat++) {
254
259
            int i, j, k;
258
263
                !sws_isSupportedOutput(dstFormat))
259
264
                continue;
260
265
 
261
 
            printf("%s -> %s\n",
262
 
                   av_pix_fmt_descriptors[srcFormat].name,
263
 
                   av_pix_fmt_descriptors[dstFormat].name);
 
266
            desc_dst = av_pix_fmt_desc_get(dstFormat);
 
267
 
 
268
            printf("%s -> %s\n", desc_src->name, desc_dst->name);
264
269
            fflush(stdout);
265
270
 
266
271
            for (k = 0; flags[k] && !res; k++)