swscale_bfin.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
3  *
4  * Blackfin software video scaler operations
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
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  *
13  * FFmpeg is distributed in the hope that it will be useful,
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
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include <stdint.h>
24 
25 #include "config.h"
27 
28 #if defined (__FDPIC__) && CONFIG_SRAM
29 #define L1CODE __attribute__((l1_text))
30 #else
31 #define L1CODE
32 #endif
33 
34 int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
35  uint8_t *vdst, int width, int height,
36  int lumStride, int chromStride, int srcStride) L1CODE;
37 
38 int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
39  uint8_t *vdst, int width, int height,
40  int lumStride, int chromStride, int srcStride) L1CODE;
41 
42 static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[],
43  int srcStride[], int srcSliceY, int srcSliceH,
44  uint8_t *dst[], int dstStride[])
45 {
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;
49  const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
50  int w = dstStride[0];
51 
52  ff_bfin_uyvytoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
53  dstStride[0], dstStride[1], srcStride[0]);
54 
55  return srcSliceH;
56 }
57 
58 static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[],
59  int srcStride[], int srcSliceY, int srcSliceH,
60  uint8_t *dst[], int dstStride[])
61 {
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;
65  const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
66  int w = dstStride[0];
67 
68  ff_bfin_yuyvtoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
69  dstStride[0], dstStride[1], srcStride[0]);
70 
71  return srcSliceH;
72 }
73 
75 {
78  "selecting Blackfin optimized uyvytoyv12_unscaled\n");
80  }
83  "selecting Blackfin optimized yuyvtoyv12_unscaled\n");
85  }
86 }
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:85
SwsFunc swScale
Note that src, dst, srcStride, dstStride will be copied in the sws_scale() wrapper so they can be fre...
output residual component w
void ff_bfin_get_unscaled_swscale(SwsContext *c)
Definition: swscale_bfin.c:74
uint8_t
enum AVPixelFormat dstFormat
Destination pixel format.
#define L1CODE
Definition: swscale_bfin.c:31
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
#define AV_LOG_VERBOSE
Definition: log.h:157
static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
Definition: swscale_bfin.c:42
int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride) L1CODE
NULL
Definition: eval.c:55
static int width
Definition: tests/utils.c:158
AVS_Value src
Definition: avisynth_c.h:523
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:69
BYTE int const BYTE int int int height
Definition: avisynth_c.h:713
int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride) L1CODE
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:68
static double c[64]
enum AVPixelFormat srcFormat
Source pixel format.
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
Definition: swscale_bfin.c:58