Mercurial > mplayer.hg
annotate libswscale/yuv2rgb_bfin.c @ 28494:01b2dcc76143
Remove unnecessary _UWIN #define.
author | diego |
---|---|
date | Wed, 11 Feb 2009 00:38:42 +0000 |
parents | a39a6d332011 |
children | f0687e100b07 |
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 * |
27158 | 4 * Blackfin video color space converter operations |
5 * convert I420 YV12 to RGB in various formats | |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
6 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
7 * This file is part of FFmpeg. |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
8 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
9 * FFmpeg is free software; you can redistribute it and/or |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
10 * 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
|
11 * License as published by the Free Software Foundation; either |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
12 * 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
|
13 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
14 * 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
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
17 * Lesser General Public License for more details. |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
18 * |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
19 * 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
|
20 * 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
|
21 * 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
|
22 */ |
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 #include <stdio.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
25 #include <stdlib.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
26 #include <string.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
27 #include <inttypes.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
28 #include <assert.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
29 #include "config.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
30 #include <unistd.h> |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
31 #include "rgb2rgb.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
32 #include "swscale.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
33 #include "swscale_internal.h" |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
34 |
25978
a8ff60976ccb
FLAT objects cannot have multiple sections, so using the L1 attributes breaks
diego
parents:
25750
diff
changeset
|
35 #ifdef __FDPIC__ |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
36 #define L1CODE __attribute__ ((l1_text)) |
25978
a8ff60976ccb
FLAT objects cannot have multiple sections, so using the L1 attributes breaks
diego
parents:
25750
diff
changeset
|
37 #else |
a8ff60976ccb
FLAT objects cannot have multiple sections, so using the L1 attributes breaks
diego
parents:
25750
diff
changeset
|
38 #define L1CODE |
a8ff60976ccb
FLAT objects cannot have multiple sections, so using the L1 attributes breaks
diego
parents:
25750
diff
changeset
|
39 #endif |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
40 |
28048 | 41 void ff_bfin_yuv2rgb555_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
42 int w, uint32_t *coeffs) L1CODE; | |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
43 |
28048 | 44 void ff_bfin_yuv2rgb565_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
45 int w, uint32_t *coeffs) L1CODE; | |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
46 |
28048 | 47 void ff_bfin_yuv2rgb24_line (uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
48 int w, uint32_t *coeffs) L1CODE; | |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
49 |
28160 | 50 typedef void (* ltransform)(uint8_t *Y, uint8_t *U, uint8_t *V, uint8_t *out, |
51 int w, uint32_t *coeffs); | |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
52 |
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 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
|
55 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
56 int oy; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
57 oy = c->yOffset&0xffff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
58 oy = oy >> 3; // keep everything U8.0 for offset calculation |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
59 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
60 c->oc = 128*0x01010101U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
61 c->oy = oy*0x01010101U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
62 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
63 /* copy 64bit vector coeffs down to 32bit vector coeffs */ |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
64 c->cy = c->yCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
65 c->zero = 0; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
66 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
67 if (rgb) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
68 c->crv = c->vrCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
69 c->cbu = c->ubCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
70 c->cgu = c->ugCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
71 c->cgv = c->vgCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
72 } else { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
73 c->crv = c->ubCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
74 c->cbu = c->vrCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
75 c->cgu = c->vgCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
76 c->cgv = c->ugCoeff; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
77 } |
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 if (masks == 555) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
81 c->rmask = 0x001f * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
82 c->gmask = 0x03e0 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
83 c->bmask = 0x7c00 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
84 } else if (masks == 565) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
85 c->rmask = 0x001f * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
86 c->gmask = 0x07e0 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
87 c->bmask = 0xf800 * 0x00010001U; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
88 } |
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 static int core_yuv420_rgb (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
92 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
93 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
94 uint8_t **oplanes, int *outstrides, |
28160 | 95 ltransform lcscf, int rgb, int masks) |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
96 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
97 uint8_t *py,*pu,*pv,*op; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
98 int w = instrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
99 int h2 = srcSliceH>>1; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
100 int i; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
101 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
102 bfin_prepare_coefficients (c, rgb, masks); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
103 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
104 py = in[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
105 pu = in[1+(1^rgb)]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
106 pv = in[1+(0^rgb)]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
107 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
108 op = oplanes[0] + srcSliceY*outstrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
109 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
110 for (i=0;i<h2;i++) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
111 |
25750 | 112 lcscf (py, pu, pv, op, w, &c->oy); |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
113 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
114 py += instrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
115 op += outstrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
116 |
25750 | 117 lcscf (py, pu, pv, op, w, &c->oy); |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
118 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
119 py += instrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
120 pu += instrides[1]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
121 pv += instrides[2]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
122 op += outstrides[0]; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
123 } |
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 return srcSliceH; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
126 } |
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 static int bfin_yuv420_rgb555 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
130 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
131 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
132 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
133 { |
25750 | 134 return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides, |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
135 ff_bfin_yuv2rgb555_line, 1, 555); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
136 } |
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 static int bfin_yuv420_bgr555 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
139 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
140 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
141 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
142 { |
25750 | 143 return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides, |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
144 ff_bfin_yuv2rgb555_line, 0, 555); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
145 } |
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 static int bfin_yuv420_rgb24 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
148 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
149 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
150 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
151 { |
25750 | 152 return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides, |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
153 ff_bfin_yuv2rgb24_line, 1, 888); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
154 } |
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 static int bfin_yuv420_bgr24 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
157 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
158 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
159 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
160 { |
25750 | 161 return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides, |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
162 ff_bfin_yuv2rgb24_line, 0, 888); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
163 } |
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 static int bfin_yuv420_rgb565 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
166 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
167 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
168 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
169 { |
25750 | 170 return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides, |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
171 ff_bfin_yuv2rgb565_line, 1, 565); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
172 } |
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 static int bfin_yuv420_bgr565 (SwsContext *c, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
175 uint8_t **in, int *instrides, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
176 int srcSliceY, int srcSliceH, |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
177 uint8_t **oplanes, int *outstrides) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
178 { |
25750 | 179 return core_yuv420_rgb (c, in, instrides, srcSliceY, srcSliceH, oplanes, outstrides, |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
180 ff_bfin_yuv2rgb565_line, 0, 565); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
181 } |
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 SwsFunc ff_bfin_yuv2rgb_get_func_ptr (SwsContext *c) |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
185 { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
186 SwsFunc f; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
187 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
188 switch(c->dstFormat) { |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
189 case PIX_FMT_RGB555: f = bfin_yuv420_rgb555; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
190 case PIX_FMT_BGR555: f = bfin_yuv420_bgr555; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
191 case PIX_FMT_RGB565: f = bfin_yuv420_rgb565; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
192 case PIX_FMT_BGR565: f = bfin_yuv420_bgr565; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
193 case PIX_FMT_RGB24: f = bfin_yuv420_rgb24; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
194 case PIX_FMT_BGR24: f = bfin_yuv420_bgr24; break; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
195 default: |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
196 return 0; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
197 } |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
198 |
27158 | 199 av_log(c, AV_LOG_INFO, "BlackFin accelerated color space converter %s\n", |
23289
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
200 sws_format_name (c->dstFormat)); |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
201 |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
202 return f; |
786823779b67
Blackfin optimized YUV420 to RGB CSC Color Space Converters.
gpoirier
parents:
diff
changeset
|
203 } |