annotate libswscale/sparc/yuv2rgb_vis.c @ 32507:97738e6f82dc

Use IMGFMT to compare instead of PIX_FMT to avoid issues with the "JPEG" formats like PIX_FMT_YUVJ422P.
author reimar
date Sat, 06 Nov 2010 21:49:49 +0000
parents c080f1f5c07e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
1 /*
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
2 * VIS optimized software YUV to RGB converter
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
3 * Copyright (c) 2007 Denes Balatoni <dbalatoni@programozo.hu>
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
4 *
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
5 * This file is part of FFmpeg.
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
6 *
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
11 *
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
15 * Lesser General Public License for more details.
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
16 *
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
20 */
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
21
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
22 #include <inttypes.h>
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
23 #include <stdlib.h>
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
24
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
25 #include "libswscale/swscale.h"
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
26 #include "libswscale/swscale_internal.h"
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
27
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
28 #define YUV2RGB_INIT \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
29 "wr %%g0, 0x10, %%gsr \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
30 "ldd [%5], %%f32 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
31 "ldd [%5+8], %%f34 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
32 "ldd [%5+16], %%f36 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
33 "ldd [%5+24], %%f38 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
34 "ldd [%5+32], %%f40 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
35 "ldd [%5+40], %%f42 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
36 "ldd [%5+48], %%f44 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
37 "ldd [%5+56], %%f46 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
38 "ldd [%5+64], %%f48 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
39 "ldd [%5+72], %%f50 \n\t"
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
40
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
41 #define YUV2RGB_KERNEL \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
42 /* ^^^^ f0=Y f3=u f5=v */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
43 "fmul8x16 %%f3, %%f48, %%f6 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
44 "fmul8x16 %%f19, %%f48, %%f22 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
45 "fmul8x16 %%f5, %%f44, %%f8 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
46 "fmul8x16 %%f21, %%f44, %%f24 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
47 "fmul8x16 %%f0, %%f42, %%f0 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
48 "fmul8x16 %%f16, %%f42, %%f16 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
49 "fmul8x16 %%f3, %%f50, %%f2 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
50 "fmul8x16 %%f19, %%f50, %%f18 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
51 "fmul8x16 %%f5, %%f46, %%f4 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
52 "fmul8x16 %%f21, %%f46, %%f20 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
53 \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
54 "fpsub16 %%f6, %%f34, %%f6 \n\t" /* 1 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
55 "fpsub16 %%f22, %%f34, %%f22 \n\t" /* 1 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
56 "fpsub16 %%f8, %%f38, %%f8 \n\t" /* 3 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
57 "fpsub16 %%f24, %%f38, %%f24 \n\t" /* 3 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
58 "fpsub16 %%f0, %%f32, %%f0 \n\t" /* 0 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
59 "fpsub16 %%f16, %%f32, %%f16 \n\t" /* 0 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
60 "fpsub16 %%f2, %%f36, %%f2 \n\t" /* 2 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
61 "fpsub16 %%f18, %%f36, %%f18 \n\t" /* 2 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
62 "fpsub16 %%f4, %%f40, %%f4 \n\t" /* 4 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
63 "fpsub16 %%f20, %%f40, %%f20 \n\t" /* 4 */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
64 \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
65 "fpadd16 %%f0, %%f8, %%f8 \n\t" /* Gt */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
66 "fpadd16 %%f16, %%f24, %%f24 \n\t" /* Gt */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
67 "fpadd16 %%f0, %%f4, %%f4 \n\t" /* R */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
68 "fpadd16 %%f16, %%f20, %%f20 \n\t" /* R */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
69 "fpadd16 %%f0, %%f6, %%f6 \n\t" /* B */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
70 "fpadd16 %%f16, %%f22, %%f22 \n\t" /* B */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
71 "fpadd16 %%f8, %%f2, %%f2 \n\t" /* G */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
72 "fpadd16 %%f24, %%f18, %%f18 \n\t" /* G */ \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
73 \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
74 "fpack16 %%f4, %%f4 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
75 "fpack16 %%f20, %%f20 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
76 "fpack16 %%f6, %%f6 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
77 "fpack16 %%f22, %%f22 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
78 "fpack16 %%f2, %%f2 \n\t" \
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
79 "fpack16 %%f18, %%f18 \n\t"
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
80
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
81
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
82
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
83 // FIXME: must be changed to set alpha to 255 instead of 0
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
84 static int vis_420P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
29481
c080f1f5c07e Cosmetics:
ramiro
parents: 29480
diff changeset
85 int srcSliceH, uint8_t* dst[], int dstStride[])
c080f1f5c07e Cosmetics:
ramiro
parents: 29480
diff changeset
86 {
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
87 int y, out1, out2, out3, out4, out5, out6;
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
88
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
89 for(y=0;y < srcSliceH;++y) {
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
90 __asm__ volatile (
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
91 YUV2RGB_INIT
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
92 "wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
93 "1: \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
94 "ldda [%1] %%asi, %%f2 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
95 "ldda [%1+2] %%asi, %%f18 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
96 "ldda [%2] %%asi, %%f4 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
97 "ldda [%2+2] %%asi, %%f20 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
98 "ld [%0], %%f0 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
99 "ld [%0+4], %%f16 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
100 "fpmerge %%f3, %%f3, %%f2 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
101 "fpmerge %%f19, %%f19, %%f18 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
102 "fpmerge %%f5, %%f5, %%f4 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
103 "fpmerge %%f21, %%f21, %%f20 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
104 YUV2RGB_KERNEL
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
105 "fzero %%f0 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
106 "fpmerge %%f4, %%f6, %%f8 \n\t" // r,b,t1
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
107 "fpmerge %%f20, %%f22, %%f24 \n\t" // r,b,t1
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
108 "fpmerge %%f0, %%f2, %%f10 \n\t" // 0,g,t2
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
109 "fpmerge %%f0, %%f18, %%f26 \n\t" // 0,g,t2
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
110 "fpmerge %%f10, %%f8, %%f4 \n\t" // t2,t1,msb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
111 "fpmerge %%f26, %%f24, %%f20 \n\t" // t2,t1,msb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
112 "fpmerge %%f11, %%f9, %%f6 \n\t" // t2,t1,lsb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
113 "fpmerge %%f27, %%f25, %%f22 \n\t" // t2,t1,lsb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
114 "std %%f4, [%3] \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
115 "std %%f20, [%3+16] \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
116 "std %%f6, [%3+8] \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
117 "std %%f22, [%3+24] \n\t"
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
118
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
119 "add %0, 8, %0 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
120 "add %1, 4, %1 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
121 "add %2, 4, %2 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
122 "subcc %4, 8, %4 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
123 "bne 1b \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
124 "add %3, 32, %3 \n\t" //delay slot
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
125 : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
126 : "0" (src[0]+(y+srcSliceY)*srcStride[0]), "1" (src[1]+((y+srcSliceY)>>1)*srcStride[1]),
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
127 "2" (src[2]+((y+srcSliceY)>>1)*srcStride[2]), "3" (dst[0]+(y+srcSliceY)*dstStride[0]),
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
128 "4" (c->dstW),
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
129 "5" (c->sparc_coeffs)
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
130 );
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
131 }
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
132
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
133 return srcSliceH;
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
134 }
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
135
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
136 // FIXME: must be changed to set alpha to 255 instead of 0
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
137 static int vis_422P_ARGB32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
29481
c080f1f5c07e Cosmetics:
ramiro
parents: 29480
diff changeset
138 int srcSliceH, uint8_t* dst[], int dstStride[])
c080f1f5c07e Cosmetics:
ramiro
parents: 29480
diff changeset
139 {
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
140 int y, out1, out2, out3, out4, out5, out6;
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
141
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
142 for(y=0;y < srcSliceH;++y) {
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
143 __asm__ volatile (
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
144 YUV2RGB_INIT
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
145 "wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
146 "1: \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
147 "ldda [%1] %%asi, %%f2 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
148 "ldda [%1+2] %%asi, %%f18 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
149 "ldda [%2] %%asi, %%f4 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
150 "ldda [%2+2] %%asi, %%f20 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
151 "ld [%0], %%f0 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
152 "ld [%0+4], %%f16 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
153 "fpmerge %%f3, %%f3, %%f2 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
154 "fpmerge %%f19, %%f19, %%f18 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
155 "fpmerge %%f5, %%f5, %%f4 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
156 "fpmerge %%f21, %%f21, %%f20 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
157 YUV2RGB_KERNEL
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
158 "fzero %%f0 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
159 "fpmerge %%f4, %%f6, %%f8 \n\t" // r,b,t1
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
160 "fpmerge %%f20, %%f22, %%f24 \n\t" // r,b,t1
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
161 "fpmerge %%f0, %%f2, %%f10 \n\t" // 0,g,t2
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
162 "fpmerge %%f0, %%f18, %%f26 \n\t" // 0,g,t2
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
163 "fpmerge %%f10, %%f8, %%f4 \n\t" // t2,t1,msb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
164 "fpmerge %%f26, %%f24, %%f20 \n\t" // t2,t1,msb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
165 "fpmerge %%f11, %%f9, %%f6 \n\t" // t2,t1,lsb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
166 "fpmerge %%f27, %%f25, %%f22 \n\t" // t2,t1,lsb
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
167 "std %%f4, [%3] \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
168 "std %%f20, [%3+16] \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
169 "std %%f6, [%3+8] \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
170 "std %%f22, [%3+24] \n\t"
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
171
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
172 "add %0, 8, %0 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
173 "add %1, 4, %1 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
174 "add %2, 4, %2 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
175 "subcc %4, 8, %4 \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
176 "bne 1b \n\t"
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
177 "add %3, 32, %3 \n\t" //delay slot
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
178 : "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
179 : "0" (src[0]+(y+srcSliceY)*srcStride[0]), "1" (src[1]+(y+srcSliceY)*srcStride[1]),
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
180 "2" (src[2]+(y+srcSliceY)*srcStride[2]), "3" (dst[0]+(y+srcSliceY)*dstStride[0]),
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
181 "4" (c->dstW),
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
182 "5" (c->sparc_coeffs)
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
183 );
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
184 }
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
185
29480
a4d8dee13834 Indent libswscale:
ramiro
parents: 29028
diff changeset
186 return srcSliceH;
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
187 }
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
188
29481
c080f1f5c07e Cosmetics:
ramiro
parents: 29480
diff changeset
189 SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
c080f1f5c07e Cosmetics:
ramiro
parents: 29480
diff changeset
190 {
29028
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
191 c->sparc_coeffs[5]=c->yCoeff;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
192 c->sparc_coeffs[6]=c->vgCoeff;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
193 c->sparc_coeffs[7]=c->vrCoeff;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
194 c->sparc_coeffs[8]=c->ubCoeff;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
195 c->sparc_coeffs[9]=c->ugCoeff;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
196
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
197 c->sparc_coeffs[0]=(((int16_t)c->yOffset*(int16_t)c->yCoeff >>11) & 0xffff) * 0x0001000100010001ULL;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
198 c->sparc_coeffs[1]=(((int16_t)c->uOffset*(int16_t)c->ubCoeff>>11) & 0xffff) * 0x0001000100010001ULL;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
199 c->sparc_coeffs[2]=(((int16_t)c->uOffset*(int16_t)c->ugCoeff>>11) & 0xffff) * 0x0001000100010001ULL;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
200 c->sparc_coeffs[3]=(((int16_t)c->vOffset*(int16_t)c->vgCoeff>>11) & 0xffff) * 0x0001000100010001ULL;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
201 c->sparc_coeffs[4]=(((int16_t)c->vOffset*(int16_t)c->vrCoeff>>11) & 0xffff) * 0x0001000100010001ULL;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
202
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
203 if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV422P && (c->dstW & 7)==0) {
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
204 av_log(c, AV_LOG_INFO, "SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
205 return vis_422P_ARGB32;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
206 }
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
207 else if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV420P && (c->dstW & 7)==0) {
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
208 av_log(c, AV_LOG_INFO, "SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
209 return vis_420P_ARGB32;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
210 }
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
211 return NULL;
f8db50af4035 Move yuv2rgb code to subdirs.
ramiro
parents:
diff changeset
212 }