swscale: consistent names for arch-specific acceleration functions
[libav.git] / libswscale / bfin / swscale_bfin.c
CommitLineData
c185b405
MH
1/*
2 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
3 *
8a322796 4 * Blackfin software video scaler operations
c185b405 5 *
2912e87a 6 * This file is part of Libav.
c185b405 7 *
2912e87a 8 * Libav is free software; you can redistribute it and/or
c185b405
MH
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
2912e87a 13 * Libav is distributed in the hope that it will be useful,
c185b405
MH
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
2912e87a 19 * License along with Libav; if not, write to the Free Software
c185b405
MH
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
6bac8971 23#include <stdint.h>
148bc235 24
6bac8971 25#include "config.h"
d5e9bc06 26#include "libswscale/swscale_internal.h"
c185b405 27
e62bd367 28#if defined (__FDPIC__) && CONFIG_SRAM
148bc235 29#define L1CODE __attribute__((l1_text))
d2a4ecaf
MF
30#else
31#define L1CODE
32#endif
c185b405 33
148bc235
DB
34int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
35 uint8_t *vdst, int width, int height,
b8e89339 36 int lumStride, int chromStride, int srcStride) L1CODE;
c185b405 37
148bc235
DB
38int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
39 uint8_t *vdst, int width, int height,
b8e89339 40 int lumStride, int chromStride, int srcStride) L1CODE;
7889f528 41
4996e8f5
MR
42static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[],
43 int srcStride[], int srcSliceY, int srcSliceH,
44 uint8_t *dst[], int dstStride[])
c185b405 45{
148bc235
DB
46 uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
47 uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
48 uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
4996e8f5 49 const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
148bc235 50 int w = dstStride[0];
c185b405 51
7f5ee4ea
DB
52 ff_bfin_uyvytoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
53 dstStride[0], dstStride[1], srcStride[0]);
c185b405
MH
54
55 return srcSliceH;
56}
57
4996e8f5
MR
58static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[],
59 int srcStride[], int srcSliceY, int srcSliceH,
60 uint8_t *dst[], int dstStride[])
7889f528 61{
148bc235
DB
62 uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
63 uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
64 uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
4996e8f5 65 const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
148bc235 66 int w = dstStride[0];
7889f528 67
7f5ee4ea
DB
68 ff_bfin_yuyvtoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
69 dstStride[0], dstStride[1], srcStride[0]);
7889f528
MH
70
71 return srcSliceH;
72}
73
3aa682f2 74void ff_get_unscaled_swscale_bfin(SwsContext *c)
c185b405 75{
716d413c 76 if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) {
148bc235
DB
77 av_log(NULL, AV_LOG_VERBOSE,
78 "selecting Blackfin optimized uyvytoyv12_unscaled\n");
e66149e7
RB
79 c->swScale = uyvytoyv12_unscaled;
80 }
716d413c 81 if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) {
148bc235
DB
82 av_log(NULL, AV_LOG_VERBOSE,
83 "selecting Blackfin optimized yuyvtoyv12_unscaled\n");
e66149e7
RB
84 c->swScale = yuyvtoyv12_unscaled;
85 }
c185b405 86}