blob: cdaca47b6564c9b6189f7abca1478d98d208ad86 [file] [log] [blame]
Jamie Gennis8ba32fa2010-12-20 11:27:26 -08001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "SurfaceTexture"
Jamie Gennise70d8b42011-01-09 13:24:09 -080018//#define LOG_NDEBUG 0
Jamie Gennis8ba32fa2010-12-20 11:27:26 -080019
20#define GL_GLEXT_PROTOTYPES
21#define EGL_EGLEXT_PROTOTYPES
22
23#include <EGL/egl.h>
24#include <EGL/eglext.h>
25#include <GLES2/gl2.h>
26#include <GLES2/gl2ext.h>
27
28#include <gui/SurfaceTexture.h>
29
30#include <surfaceflinger/ISurfaceComposer.h>
31#include <surfaceflinger/SurfaceComposerClient.h>
Jamie Gennis9a78c902011-01-12 18:30:40 -080032#include <surfaceflinger/IGraphicBufferAlloc.h>
Jamie Gennis8ba32fa2010-12-20 11:27:26 -080033
34#include <utils/Log.h>
35
36namespace android {
37
Jamie Gennisf238e282011-01-09 16:33:17 -080038// Transform matrices
39static float mtxIdentity[16] = {
40 1, 0, 0, 0,
41 0, 1, 0, 0,
42 0, 0, 1, 0,
43 0, 0, 0, 1,
44};
45static float mtxFlipH[16] = {
46 -1, 0, 0, 0,
47 0, 1, 0, 0,
48 0, 0, 1, 0,
49 1, 0, 0, 1,
50};
51static float mtxFlipV[16] = {
52 1, 0, 0, 0,
53 0, -1, 0, 0,
54 0, 0, 1, 0,
55 0, 1, 0, 1,
56};
57static float mtxRot90[16] = {
58 0, 1, 0, 0,
59 -1, 0, 0, 0,
60 0, 0, 1, 0,
61 1, 0, 0, 1,
62};
63static float mtxRot180[16] = {
64 -1, 0, 0, 0,
65 0, -1, 0, 0,
66 0, 0, 1, 0,
67 1, 1, 0, 1,
68};
69static float mtxRot270[16] = {
70 0, -1, 0, 0,
71 1, 0, 0, 0,
72 0, 0, 1, 0,
73 0, 1, 0, 1,
74};
75
76static void mtxMul(float out[16], const float a[16], const float b[16]);
77
Jamie Gennis8ba32fa2010-12-20 11:27:26 -080078SurfaceTexture::SurfaceTexture(GLuint tex) :
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -080079 mBufferCount(MIN_BUFFER_SLOTS),
80 mCurrentTexture(INVALID_BUFFER_SLOT),
81 mCurrentTransform(0),
82 mCurrentTimestamp(0),
83 mLastQueued(INVALID_BUFFER_SLOT),
84 mLastQueuedTransform(0),
85 mLastQueuedTimestamp(0),
86 mNextTransform(0),
87 mTexName(tex) {
Jamie Gennise70d8b42011-01-09 13:24:09 -080088 LOGV("SurfaceTexture::SurfaceTexture");
Jamie Gennis3461e0f2011-01-07 16:05:47 -080089 for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
90 mSlots[i].mEglImage = EGL_NO_IMAGE_KHR;
91 mSlots[i].mEglDisplay = EGL_NO_DISPLAY;
92 mSlots[i].mOwnedByClient = false;
93 }
Jamie Gennis9a78c902011-01-12 18:30:40 -080094 sp<ISurfaceComposer> composer(ComposerService::getComposerService());
95 mGraphicBufferAlloc = composer->createGraphicBufferAlloc();
Jamie Gennis8ba32fa2010-12-20 11:27:26 -080096}
97
98SurfaceTexture::~SurfaceTexture() {
Jamie Gennise70d8b42011-01-09 13:24:09 -080099 LOGV("SurfaceTexture::~SurfaceTexture");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800100 freeAllBuffers();
101}
102
103status_t SurfaceTexture::setBufferCount(int bufferCount) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800104 LOGV("SurfaceTexture::setBufferCount");
Jamie Gennis9d4d6c12011-02-27 14:10:20 -0800105
106 if (bufferCount < MIN_BUFFER_SLOTS) {
107 return BAD_VALUE;
108 }
109
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800110 Mutex::Autolock lock(mMutex);
111 freeAllBuffers();
112 mBufferCount = bufferCount;
Jamie Gennis67eedd72011-01-09 13:25:39 -0800113 mCurrentTexture = INVALID_BUFFER_SLOT;
114 mLastQueued = INVALID_BUFFER_SLOT;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800115 return OK;
116}
117
118sp<GraphicBuffer> SurfaceTexture::requestBuffer(int buf,
119 uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800120 LOGV("SurfaceTexture::requestBuffer");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800121 Mutex::Autolock lock(mMutex);
122 if (buf < 0 || mBufferCount <= buf) {
123 LOGE("requestBuffer: slot index out of range [0, %d]: %d",
124 mBufferCount, buf);
125 return 0;
126 }
127 usage |= GraphicBuffer::USAGE_HW_TEXTURE;
Jamie Gennis9a78c902011-01-12 18:30:40 -0800128 sp<GraphicBuffer> graphicBuffer(
129 mGraphicBufferAlloc->createGraphicBuffer(w, h, format, usage));
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800130 if (graphicBuffer == 0) {
131 LOGE("requestBuffer: SurfaceComposer::createGraphicBuffer failed");
132 } else {
133 mSlots[buf].mGraphicBuffer = graphicBuffer;
134 if (mSlots[buf].mEglImage != EGL_NO_IMAGE_KHR) {
135 eglDestroyImageKHR(mSlots[buf].mEglDisplay, mSlots[buf].mEglImage);
136 mSlots[buf].mEglImage = EGL_NO_IMAGE_KHR;
137 mSlots[buf].mEglDisplay = EGL_NO_DISPLAY;
138 }
Jamie Gennis9a78c902011-01-12 18:30:40 -0800139 mAllocdBuffers.add(graphicBuffer);
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800140 }
141 return graphicBuffer;
142}
143
144status_t SurfaceTexture::dequeueBuffer(int *buf) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800145 LOGV("SurfaceTexture::dequeueBuffer");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800146 Mutex::Autolock lock(mMutex);
147 int found = INVALID_BUFFER_SLOT;
148 for (int i = 0; i < mBufferCount; i++) {
Jamie Gennis235c4242011-01-11 15:00:09 -0800149 if (!mSlots[i].mOwnedByClient && i != mCurrentTexture && i != mLastQueued) {
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800150 mSlots[i].mOwnedByClient = true;
151 found = i;
152 break;
153 }
154 }
155 if (found == INVALID_BUFFER_SLOT) {
156 return -EBUSY;
157 }
158 *buf = found;
159 return OK;
160}
161
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -0800162status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800163 LOGV("SurfaceTexture::queueBuffer");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800164 Mutex::Autolock lock(mMutex);
165 if (buf < 0 || mBufferCount <= buf) {
166 LOGE("queueBuffer: slot index out of range [0, %d]: %d",
167 mBufferCount, buf);
168 return -EINVAL;
169 } else if (!mSlots[buf].mOwnedByClient) {
170 LOGE("queueBuffer: slot %d is not owned by the client", buf);
171 return -EINVAL;
172 } else if (mSlots[buf].mGraphicBuffer == 0) {
173 LOGE("queueBuffer: slot %d was enqueued without requesting a buffer",
174 buf);
175 return -EINVAL;
176 }
177 mSlots[buf].mOwnedByClient = false;
178 mLastQueued = buf;
Jamie Gennisf238e282011-01-09 16:33:17 -0800179 mLastQueuedCrop = mNextCrop;
180 mLastQueuedTransform = mNextTransform;
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -0800181 mLastQueuedTimestamp = timestamp;
Jamie Gennisc4d4aea2011-01-13 14:43:36 -0800182 if (mFrameAvailableListener != 0) {
183 mFrameAvailableListener->onFrameAvailable();
184 }
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800185 return OK;
186}
187
188void SurfaceTexture::cancelBuffer(int buf) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800189 LOGV("SurfaceTexture::cancelBuffer");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800190 Mutex::Autolock lock(mMutex);
191 if (buf < 0 || mBufferCount <= buf) {
192 LOGE("cancelBuffer: slot index out of range [0, %d]: %d", mBufferCount,
193 buf);
194 return;
195 } else if (!mSlots[buf].mOwnedByClient) {
196 LOGE("cancelBuffer: slot %d is not owned by the client", buf);
197 return;
198 }
199 mSlots[buf].mOwnedByClient = false;
200}
201
Jamie Gennisf238e282011-01-09 16:33:17 -0800202status_t SurfaceTexture::setCrop(const Rect& crop) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800203 LOGV("SurfaceTexture::setCrop");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800204 Mutex::Autolock lock(mMutex);
Jamie Gennisf238e282011-01-09 16:33:17 -0800205 mNextCrop = crop;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800206 return OK;
207}
208
209status_t SurfaceTexture::setTransform(uint32_t transform) {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800210 LOGV("SurfaceTexture::setTransform");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800211 Mutex::Autolock lock(mMutex);
Jamie Gennisf238e282011-01-09 16:33:17 -0800212 mNextTransform = transform;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800213 return OK;
214}
215
216status_t SurfaceTexture::updateTexImage() {
Jamie Gennise70d8b42011-01-09 13:24:09 -0800217 LOGV("SurfaceTexture::updateTexImage");
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800218 Mutex::Autolock lock(mMutex);
219
220 // We always bind the texture even if we don't update its contents.
221 glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTexName);
222
223 // Initially both mCurrentTexture and mLastQueued are INVALID_BUFFER_SLOT,
224 // so this check will fail until a buffer gets queued.
225 if (mCurrentTexture != mLastQueued) {
Jamie Gennisf238e282011-01-09 16:33:17 -0800226 // Update the GL texture object.
Jamie Gennis9a78c902011-01-12 18:30:40 -0800227 EGLImageKHR image = mSlots[mLastQueued].mEglImage;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800228 if (image == EGL_NO_IMAGE_KHR) {
229 EGLDisplay dpy = eglGetCurrentDisplay();
Jamie Gennis9a78c902011-01-12 18:30:40 -0800230 sp<GraphicBuffer> graphicBuffer = mSlots[mLastQueued].mGraphicBuffer;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800231 image = createImage(dpy, graphicBuffer);
Jamie Gennis9a78c902011-01-12 18:30:40 -0800232 mSlots[mLastQueued].mEglImage = image;
233 mSlots[mLastQueued].mEglDisplay = dpy;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800234 }
Jamie Gennis0eb88512011-01-26 11:52:02 -0800235
236 GLint error;
237 while ((error = glGetError()) != GL_NO_ERROR) {
238 LOGE("GL error cleared before updating SurfaceTexture: %#04x", error);
239 }
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800240 glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)image);
Jamie Gennis0eb88512011-01-26 11:52:02 -0800241 bool failed = false;
242 while ((error = glGetError()) != GL_NO_ERROR) {
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800243 LOGE("error binding external texture image %p (slot %d): %#04x",
Jamie Gennis9a78c902011-01-12 18:30:40 -0800244 image, mLastQueued, error);
Jamie Gennis0eb88512011-01-26 11:52:02 -0800245 failed = true;
246 }
247 if (failed) {
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800248 return -EINVAL;
249 }
Jamie Gennis9a78c902011-01-12 18:30:40 -0800250
251 // Update the SurfaceTexture state.
252 mCurrentTexture = mLastQueued;
253 mCurrentTextureBuf = mSlots[mCurrentTexture].mGraphicBuffer;
254 mCurrentCrop = mLastQueuedCrop;
255 mCurrentTransform = mLastQueuedTransform;
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -0800256 mCurrentTimestamp = mLastQueuedTimestamp;
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800257 }
258 return OK;
259}
260
Jamie Gennisf238e282011-01-09 16:33:17 -0800261void SurfaceTexture::getTransformMatrix(float mtx[16]) {
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -0800262 LOGV("SurfaceTexture::getTransformMatrix");
Jamie Gennisf238e282011-01-09 16:33:17 -0800263 Mutex::Autolock lock(mMutex);
264
Jamie Gennisa214c642011-01-14 13:53:31 -0800265 float xform[16];
266 for (int i = 0; i < 16; i++) {
267 xform[i] = mtxIdentity[i];
268 }
269 if (mCurrentTransform & NATIVE_WINDOW_TRANSFORM_FLIP_H) {
270 float result[16];
271 mtxMul(result, xform, mtxFlipH);
272 for (int i = 0; i < 16; i++) {
273 xform[i] = result[i];
274 }
275 }
276 if (mCurrentTransform & NATIVE_WINDOW_TRANSFORM_FLIP_V) {
277 float result[16];
278 mtxMul(result, xform, mtxFlipV);
279 for (int i = 0; i < 16; i++) {
280 xform[i] = result[i];
281 }
282 }
283 if (mCurrentTransform & NATIVE_WINDOW_TRANSFORM_ROT_90) {
284 float result[16];
285 mtxMul(result, xform, mtxRot90);
286 for (int i = 0; i < 16; i++) {
287 xform[i] = result[i];
288 }
Jamie Gennisf238e282011-01-09 16:33:17 -0800289 }
290
291 sp<GraphicBuffer>& buf(mSlots[mCurrentTexture].mGraphicBuffer);
Jamie Gennisa214c642011-01-14 13:53:31 -0800292 float tx, ty, sx, sy;
293 if (!mCurrentCrop.isEmpty()) {
Jamie Gennisd99c0882011-03-10 16:24:46 -0800294 // In order to prevent bilinear sampling at the of the crop rectangle we
295 // may need to shrink it by 2 texels in each direction. Normally this
296 // would just need to take 1/2 a texel off each end, but because the
297 // chroma channels will likely be subsampled we need to chop off a whole
298 // texel. This will cause artifacts if someone does nearest sampling
299 // with 1:1 pixel:texel ratio, but it's impossible to simultaneously
300 // accomodate the bilinear and nearest sampling uses.
301 //
302 // If nearest sampling turns out to be a desirable usage of these
303 // textures then we could add the ability to switch a SurfaceTexture to
304 // nearest-mode. Preferably, however, the image producers (video
305 // decoder, camera, etc.) would simply not use a crop rectangle (or at
306 // least not tell the framework about it) so that the GPU can do the
307 // correct edge behavior.
308 int xshrink = 0, yshrink = 0;
309 if (mCurrentCrop.left > 0) {
310 tx = float(mCurrentCrop.left + 1) / float(buf->getWidth());
311 xshrink++;
312 } else {
313 tx = 0.0f;
314 }
315 if (mCurrentCrop.right < buf->getWidth()) {
316 xshrink++;
317 }
318 if (mCurrentCrop.bottom < buf->getHeight()) {
319 ty = (float(buf->getHeight() - mCurrentCrop.bottom) + 1.0f) /
320 float(buf->getHeight());
321 yshrink++;
322 } else {
323 ty = 0.0f;
324 }
325 if (mCurrentCrop.top > 0) {
326 yshrink++;
327 }
328 sx = float(mCurrentCrop.width() - xshrink) / float(buf->getWidth());
329 sy = float(mCurrentCrop.height() - yshrink) / float(buf->getHeight());
Jamie Gennisa214c642011-01-14 13:53:31 -0800330 } else {
331 tx = 0.0f;
332 ty = 0.0f;
333 sx = 1.0f;
334 sy = 1.0f;
335 }
Jamie Gennisf238e282011-01-09 16:33:17 -0800336 float crop[16] = {
Jamie Gennisa214c642011-01-14 13:53:31 -0800337 sx, 0, 0, 0,
338 0, sy, 0, 0,
Jamie Gennisf238e282011-01-09 16:33:17 -0800339 0, 0, 1, 0,
Jamie Gennisd99c0882011-03-10 16:24:46 -0800340 tx, ty, 0, 1,
Jamie Gennisf238e282011-01-09 16:33:17 -0800341 };
342
Jamie Gennisa214c642011-01-14 13:53:31 -0800343 float mtxBeforeFlipV[16];
344 mtxMul(mtxBeforeFlipV, crop, xform);
345
346 // SurfaceFlinger expects the top of its window textures to be at a Y
347 // coordinate of 0, so SurfaceTexture must behave the same way. We don't
348 // want to expose this to applications, however, so we must add an
349 // additional vertical flip to the transform after all the other transforms.
350 mtxMul(mtx, mtxFlipV, mtxBeforeFlipV);
Jamie Gennisf238e282011-01-09 16:33:17 -0800351}
352
Eino-Ville Talvala1d01a122011-02-18 11:02:42 -0800353nsecs_t SurfaceTexture::getTimestamp() {
354 LOGV("SurfaceTexture::getTimestamp");
355 Mutex::Autolock lock(mMutex);
356 return mCurrentTimestamp;
357}
358
Jamie Gennisc4d4aea2011-01-13 14:43:36 -0800359void SurfaceTexture::setFrameAvailableListener(
360 const sp<FrameAvailableListener>& l) {
361 LOGV("SurfaceTexture::setFrameAvailableListener");
362 Mutex::Autolock lock(mMutex);
363 mFrameAvailableListener = l;
364}
365
Jamie Gennis1b20cde2011-02-02 15:31:47 -0800366sp<IBinder> SurfaceTexture::getAllocator() {
367 LOGV("SurfaceTexture::getAllocator");
368 return mGraphicBufferAlloc->asBinder();
369}
370
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800371void SurfaceTexture::freeAllBuffers() {
372 for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
373 mSlots[i].mGraphicBuffer = 0;
374 mSlots[i].mOwnedByClient = false;
375 if (mSlots[i].mEglImage != EGL_NO_IMAGE_KHR) {
376 eglDestroyImageKHR(mSlots[i].mEglDisplay, mSlots[i].mEglImage);
377 mSlots[i].mEglImage = EGL_NO_IMAGE_KHR;
378 mSlots[i].mEglDisplay = EGL_NO_DISPLAY;
379 }
380 }
Jamie Gennis9a78c902011-01-12 18:30:40 -0800381
382 int exceptBuf = -1;
383 for (size_t i = 0; i < mAllocdBuffers.size(); i++) {
384 if (mAllocdBuffers[i] == mCurrentTextureBuf) {
385 exceptBuf = i;
386 break;
387 }
388 }
389 mAllocdBuffers.clear();
390 if (exceptBuf >= 0) {
391 mAllocdBuffers.add(mCurrentTextureBuf);
392 }
393 mGraphicBufferAlloc->freeAllGraphicBuffersExcept(exceptBuf);
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800394}
395
396EGLImageKHR SurfaceTexture::createImage(EGLDisplay dpy,
397 const sp<GraphicBuffer>& graphicBuffer) {
398 EGLClientBuffer cbuf = (EGLClientBuffer)graphicBuffer->getNativeBuffer();
399 EGLint attrs[] = {
400 EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
401 EGL_NONE,
402 };
403 EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT,
404 EGL_NATIVE_BUFFER_ANDROID, cbuf, attrs);
405 EGLint error = eglGetError();
406 if (error != EGL_SUCCESS) {
407 LOGE("error creating EGLImage: %#x", error);
408 } else if (image == EGL_NO_IMAGE_KHR) {
409 LOGE("no error reported, but no image was returned by "
410 "eglCreateImageKHR");
411 }
412 return image;
413}
414
Jamie Gennisf238e282011-01-09 16:33:17 -0800415static void mtxMul(float out[16], const float a[16], const float b[16]) {
416 out[0] = a[0]*b[0] + a[4]*b[1] + a[8]*b[2] + a[12]*b[3];
417 out[1] = a[1]*b[0] + a[5]*b[1] + a[9]*b[2] + a[13]*b[3];
418 out[2] = a[2]*b[0] + a[6]*b[1] + a[10]*b[2] + a[14]*b[3];
419 out[3] = a[3]*b[0] + a[7]*b[1] + a[11]*b[2] + a[15]*b[3];
420
421 out[4] = a[0]*b[4] + a[4]*b[5] + a[8]*b[6] + a[12]*b[7];
422 out[5] = a[1]*b[4] + a[5]*b[5] + a[9]*b[6] + a[13]*b[7];
423 out[6] = a[2]*b[4] + a[6]*b[5] + a[10]*b[6] + a[14]*b[7];
424 out[7] = a[3]*b[4] + a[7]*b[5] + a[11]*b[6] + a[15]*b[7];
425
426 out[8] = a[0]*b[8] + a[4]*b[9] + a[8]*b[10] + a[12]*b[11];
427 out[9] = a[1]*b[8] + a[5]*b[9] + a[9]*b[10] + a[13]*b[11];
428 out[10] = a[2]*b[8] + a[6]*b[9] + a[10]*b[10] + a[14]*b[11];
429 out[11] = a[3]*b[8] + a[7]*b[9] + a[11]*b[10] + a[15]*b[11];
430
431 out[12] = a[0]*b[12] + a[4]*b[13] + a[8]*b[14] + a[12]*b[15];
432 out[13] = a[1]*b[12] + a[5]*b[13] + a[9]*b[14] + a[13]*b[15];
433 out[14] = a[2]*b[12] + a[6]*b[13] + a[10]*b[14] + a[14]*b[15];
434 out[15] = a[3]*b[12] + a[7]*b[13] + a[11]*b[14] + a[15]*b[15];
435}
436
Jamie Gennis8ba32fa2010-12-20 11:27:26 -0800437}; // namespace android