annotate libswscale/swscale_bfin.c @ 23805:3c6db57870ea

UltraSPARC VIS yuv2rgb patch by Denes Balatoni: [dbalatoni interware hu] original thread: [FFmpeg-devel] [PATCH] UltraSPARC VIS yuv2rgb third try date: 07/17/2007 08:35 PM
author benoit
date Thu, 19 Jul 2007 07:24:43 +0000
parents a01f8876ea2c
children 5b10bd9793b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23584
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
1 /*
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
2 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
3 *
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
4 * Blackfin Software Video SCALER Operations
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
5 *
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
6 * This file is part of FFmpeg.
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
7 *
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
10 * License as published by the Free Software Foundation; either
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
12 *
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
16 * Lesser General Public License for more details.
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
17 *
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
21 */
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
22
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
23 #include <stdio.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
24 #include <stdlib.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
25 #include <string.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
26 #include <inttypes.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
27 #include <assert.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
28 #include "config.h"
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
29 #ifdef HAVE_MALLOC_H
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
30 #include <malloc.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
31 #endif
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
32 #include <unistd.h>
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
33 #include "rgb2rgb.h"
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
34 #include "swscale.h"
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
35 #include "swscale_internal.h"
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
36
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
37
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
38 extern int ff_bfin_uyvytoyv12 (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
39 long width, long height,
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
40 long lumStride, long chromStride, long srcStride) __attribute__ ((l1_text));
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
41
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
42 static int uyvytoyv12_unscaled (SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
43 int srcSliceH, uint8_t* dst[], int dstStride[])
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
44 {
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
45 uint8_t *dsty = dst[0] + dstStride[0]*srcSliceY;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
46 uint8_t *dstu = dst[1] + dstStride[1]*srcSliceY/2;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
47 uint8_t *dstv = dst[2] + dstStride[2]*srcSliceY/2;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
48 uint8_t *ip = src[0] + srcStride[0]*srcSliceY;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
49 int w = dstStride[0];
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
50
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
51 ff_bfin_uyvytoyv12 (ip, dsty, dstu, dstv, w, srcSliceH, dstStride[0], dstStride[1], srcStride[0]);
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
52
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
53 return srcSliceH;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
54 }
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
55
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
56
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
57 void ff_bfin_get_unscaled_swscale (SwsContext *c)
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
58 {
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
59 SwsFunc swScale = c->swScale;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
60 if (c->flags & SWS_CPU_CAPS_BFIN)
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
61 if (c->dstFormat == PIX_FMT_YUV420P)
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
62 if (c->srcFormat == PIX_FMT_UYVY422) {
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
63 av_log (NULL, AV_LOG_VERBOSE, "selecting Blackfin optimized uyvytoyv12_unscaled\n");
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
64 c->swScale = uyvytoyv12_unscaled;
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
65 }
a01f8876ea2c adding Blackfin swscale_bfin infrastructure, and the first swscale routine uyvy to yv12 video resampler
mhoffman
parents:
diff changeset
66 }