Mercurial > mplayer.hg
annotate libswscale/yuv2rgb_bfin.c @ 24173:49aa1cef1867
Fix warning:
In file included from layer3.c:1171,
from sr1.c:391:
decod386.c:106: warning: redundant redeclaration of 'synth_1to1_MMX'
mpg123.h:120: warning: previous declaration of 'synth_1to1_MMX' was here
author | diego |
---|---|
date | Sat, 25 Aug 2007 17:05:02 +0000 |
parents | e88ed9dc0737 |
children | 06bf0eb70a55 |
rev | line source |
---|---|
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
1 /* |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
2 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
3 * April 20, 2007 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
4 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
5 * Blackfin Video Color Space Converters Operations |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
6 * convert I420 YV12 to RGB in various formats, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
7 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
8 * This file is part of FFmpeg. |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
9 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
10 * FFmpeg is free software; you can redistribute it and/or |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
11 * modify it under the terms of the GNU Lesser General Public |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
12 * License as published by the Free Software Foundation; either |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
13 * version 2.1 of the License, or (at your option) any later version. |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
14 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
15 * FFmpeg is distributed in the hope that it will be useful, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
18 * Lesser General Public License for more details. |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
19 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
20 * You should have received a copy of the GNU Lesser General Public |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
21 * License along with FFmpeg; if not, write to the Free Software |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
23 */ |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
24 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
25 #include <stdio.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
26 #include <stdlib.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
27 #include <string.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
28 #include <inttypes.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
29 #include <assert.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
30 #include "config.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
31 #ifdef HAVE_MALLOC_H |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
32 #include <malloc.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
33 #endif |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
34 #include <unistd.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
35 #include "rgb2rgb.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
36 #include "swscale.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
37 #include "swscale_internal.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
38 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
39 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
40 #define L1CODE __attribute__ ((l1_text)) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
41 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
42 extern void ff_bfin_yuv2rgb555_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
43 int w, uint32_t *coeffs) L1CODE; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
44 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
45 extern void ff_bfin_yuv2rgb565_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
46 int w, uint32_t *coeffs) L1CODE; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
47 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
48 extern void ff_bfin_yuv2rgb24_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
49 int w, uint32_t *coeffs) L1CODE; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
50 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
51 typedef void (* ltransform_t)(uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
52 int w, uint32_t *coeffs); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
53 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
54 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
55 static void bfin_prepare_coefficients (SwsContext *c, int rgb, int masks) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
56 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
57 int oy; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
58 oy = c->yOffset&0xffff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
59 oy = oy >> 3; // keep everything U8.0 for offset calculation |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
60 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
61 c->oc = 128*0x01010101U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
62 c->oy = oy*0x01010101U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
63 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
64 /* copy 64bit vector coeffs down to 32bit vector coeffs */ |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
65 c->cy = c->yCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
66 c->zero = 0; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
67 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
68 if (rgb) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
69 c->crv = c->vrCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
70 c->cbu = c->ubCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
71 c->cgu = c->ugCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
72 c->cgv = c->vgCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
73 } else { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
74 c->crv = c->ubCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
75 c->cbu = c->vrCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
76 c->cgu = c->vgCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
77 c->cgv = c->ugCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
78 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
79 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
80 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
81 if (masks == 555) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
82 c->rmask = 0x001f * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
83 c->gmask = 0x03e0 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
84 c->bmask = 0x7c00 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
85 } else if (masks == 565) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
86 c->rmask = 0x001f * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
87 c->gmask = 0x07e0 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
88 c->bmask = 0xf800 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
89 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
90 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
91 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
92 static int core_yuv420_rgb (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
93 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
94 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
95 uint8_t **oplanes, int *outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
96 ltransform_t lcscf, int rgb, int masks) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
97 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
98 uint8_t *py,*pu,*pv,*op; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
99 int w = instrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
100 int h2 = srcSliceH>>1; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
101 int i; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
102 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
103 bfin_prepare_coefficients (c, rgb, masks); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
104 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
105 py = in[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
106 pu = in[1+(1^rgb)]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
107 pv = in[1+(0^rgb)]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
108 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
109 op = oplanes[0] + srcSliceY*outstrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
110 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
111 for (i=0;i<h2;i++) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
112 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
113 lcscf (py,pu,pv,op,w,&c->oy); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
114 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
115 py += instrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
116 op += outstrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
117 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
118 lcscf (py,pu,pv,op,w,&c->oy); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
119 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
120 py += instrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
121 pu += instrides[1]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
122 pv += instrides[2]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
123 op += outstrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
124 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
125 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
126 return srcSliceH; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
127 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
128 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
129 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
130 static int bfin_yuv420_rgb555 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
131 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
132 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
133 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
134 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
135 return core_yuv420_rgb (c,in,instrides,srcSliceY,srcSliceH,oplanes,outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
136 ff_bfin_yuv2rgb555_line, 1, 555); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
137 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
138 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
139 static int bfin_yuv420_bgr555 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
140 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
141 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
142 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
143 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
144 return core_yuv420_rgb (c,in,instrides,srcSliceY,srcSliceH,oplanes,outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
145 ff_bfin_yuv2rgb555_line, 0, 555); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
146 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
147 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
148 static int bfin_yuv420_rgb24 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
149 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
150 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
151 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
152 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
153 return core_yuv420_rgb (c,in,instrides,srcSliceY,srcSliceH,oplanes,outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
154 ff_bfin_yuv2rgb24_line, 1, 888); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
155 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
156 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
157 static int bfin_yuv420_bgr24 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
158 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
159 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
160 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
161 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
162 return core_yuv420_rgb (c,in,instrides,srcSliceY,srcSliceH,oplanes,outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
163 ff_bfin_yuv2rgb24_line, 0, 888); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
164 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
165 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
166 static int bfin_yuv420_rgb565 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
167 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
168 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
169 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
170 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
171 return core_yuv420_rgb (c,in,instrides,srcSliceY,srcSliceH,oplanes,outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
172 ff_bfin_yuv2rgb565_line, 1, 565); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
173 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
174 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
175 static int bfin_yuv420_bgr565 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
176 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
177 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
178 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
179 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
180 return core_yuv420_rgb (c,in,instrides,srcSliceY,srcSliceH,oplanes,outstrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
181 ff_bfin_yuv2rgb565_line, 0, 565); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
182 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
183 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
184 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
185 SwsFunc ff_bfin_yuv2rgb_get_func_ptr (SwsContext *c) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
186 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
187 SwsFunc f; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
188 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
189 switch(c->dstFormat) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
190 case PIX_FMT_RGB555: f = bfin_yuv420_rgb555; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
191 case PIX_FMT_BGR555: f = bfin_yuv420_bgr555; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
192 case PIX_FMT_RGB565: f = bfin_yuv420_rgb565; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
193 case PIX_FMT_BGR565: f = bfin_yuv420_bgr565; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
194 case PIX_FMT_RGB24: f = bfin_yuv420_rgb24; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
195 case PIX_FMT_BGR24: f = bfin_yuv420_bgr24; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
196 default: |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
197 return 0; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
198 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
199 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
200 av_log(c, AV_LOG_INFO, "BlackFin Accelerated Color Space Converter %s\n", |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
201 sws_format_name (c->dstFormat)); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
202 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
203 return f; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
204 } |