Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: include/libyuv/row.h

Issue 2291533004: YuvConstants declare alignment for externs as well as declarations (Closed)
Patch Set: use SIMD_ALIGNED for all aligned vars Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « README.chromium ('k') | include/libyuv/version.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 #if defined(__mips_dsp) && (__mips_dsp_rev >= 2) 366 #if defined(__mips_dsp) && (__mips_dsp_rev >= 2)
367 #define HAS_I422TOARGBROW_DSPR2 367 #define HAS_I422TOARGBROW_DSPR2
368 #define HAS_INTERPOLATEROW_DSPR2 368 #define HAS_INTERPOLATEROW_DSPR2
369 #define HAS_MIRRORROW_DSPR2 369 #define HAS_MIRRORROW_DSPR2
370 #define HAS_MIRRORUVROW_DSPR2 370 #define HAS_MIRRORUVROW_DSPR2
371 #define HAS_SPLITUVROW_DSPR2 371 #define HAS_SPLITUVROW_DSPR2
372 #endif 372 #endif
373 #endif 373 #endif
374 374
375 #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) 375 #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__)
376 #if defined(VISUALC_HAS_AVX2)
377 #define SIMD_ALIGNED(var) __declspec(align(32)) var
378 #else
376 #define SIMD_ALIGNED(var) __declspec(align(16)) var 379 #define SIMD_ALIGNED(var) __declspec(align(16)) var
377 #define SIMD_ALIGNED32(var) __declspec(align(32)) var 380 #endif
378 typedef __declspec(align(16)) int16 vec16[8]; 381 typedef __declspec(align(16)) int16 vec16[8];
379 typedef __declspec(align(16)) int32 vec32[4]; 382 typedef __declspec(align(16)) int32 vec32[4];
380 typedef __declspec(align(16)) int8 vec8[16]; 383 typedef __declspec(align(16)) int8 vec8[16];
381 typedef __declspec(align(16)) uint16 uvec16[8]; 384 typedef __declspec(align(16)) uint16 uvec16[8];
382 typedef __declspec(align(16)) uint32 uvec32[4]; 385 typedef __declspec(align(16)) uint32 uvec32[4];
383 typedef __declspec(align(16)) uint8 uvec8[16]; 386 typedef __declspec(align(16)) uint8 uvec8[16];
384 typedef __declspec(align(32)) int16 lvec16[16]; 387 typedef __declspec(align(32)) int16 lvec16[16];
385 typedef __declspec(align(32)) int32 lvec32[8]; 388 typedef __declspec(align(32)) int32 lvec32[8];
386 typedef __declspec(align(32)) int8 lvec8[32]; 389 typedef __declspec(align(32)) int8 lvec8[32];
387 typedef __declspec(align(32)) uint16 ulvec16[16]; 390 typedef __declspec(align(32)) uint16 ulvec16[16];
388 typedef __declspec(align(32)) uint32 ulvec32[8]; 391 typedef __declspec(align(32)) uint32 ulvec32[8];
389 typedef __declspec(align(32)) uint8 ulvec8[32]; 392 typedef __declspec(align(32)) uint8 ulvec8[32];
390 #elif !defined(__pnacl__) && (defined(__GNUC__) || defined(__clang__)) 393 #elif !defined(__pnacl__) && (defined(__GNUC__) || defined(__clang__))
391 // Caveat GCC 4.2 to 4.7 have a known issue using vectors with const. 394 // Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
395 #if defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)
396 #define SIMD_ALIGNED(var) var __attribute__((aligned(32)))
397 #else
392 #define SIMD_ALIGNED(var) var __attribute__((aligned(16))) 398 #define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
393 #define SIMD_ALIGNED32(var) var __attribute__((aligned(32))) 399 #endif
394 typedef int16 __attribute__((vector_size(16))) vec16; 400 typedef int16 __attribute__((vector_size(16))) vec16;
395 typedef int32 __attribute__((vector_size(16))) vec32; 401 typedef int32 __attribute__((vector_size(16))) vec32;
396 typedef int8 __attribute__((vector_size(16))) vec8; 402 typedef int8 __attribute__((vector_size(16))) vec8;
397 typedef uint16 __attribute__((vector_size(16))) uvec16; 403 typedef uint16 __attribute__((vector_size(16))) uvec16;
398 typedef uint32 __attribute__((vector_size(16))) uvec32; 404 typedef uint32 __attribute__((vector_size(16))) uvec32;
399 typedef uint8 __attribute__((vector_size(16))) uvec8; 405 typedef uint8 __attribute__((vector_size(16))) uvec8;
400 typedef int16 __attribute__((vector_size(32))) lvec16; 406 typedef int16 __attribute__((vector_size(32))) lvec16;
401 typedef int32 __attribute__((vector_size(32))) lvec32; 407 typedef int32 __attribute__((vector_size(32))) lvec32;
402 typedef int8 __attribute__((vector_size(32))) lvec8; 408 typedef int8 __attribute__((vector_size(32))) lvec8;
403 typedef uint16 __attribute__((vector_size(32))) ulvec16; 409 typedef uint16 __attribute__((vector_size(32))) ulvec16;
404 typedef uint32 __attribute__((vector_size(32))) ulvec32; 410 typedef uint32 __attribute__((vector_size(32))) ulvec32;
405 typedef uint8 __attribute__((vector_size(32))) ulvec8; 411 typedef uint8 __attribute__((vector_size(32))) ulvec8;
406 #else 412 #else
407 #define SIMD_ALIGNED(var) var 413 #define SIMD_ALIGNED(var) var
408 #define SIMD_ALIGNED32(var) var
409 typedef int16 vec16[8]; 414 typedef int16 vec16[8];
410 typedef int32 vec32[4]; 415 typedef int32 vec32[4];
411 typedef int8 vec8[16]; 416 typedef int8 vec8[16];
412 typedef uint16 uvec16[8]; 417 typedef uint16 uvec16[8];
413 typedef uint32 uvec32[4]; 418 typedef uint32 uvec32[4];
414 typedef uint8 uvec8[16]; 419 typedef uint8 uvec8[16];
415 typedef int16 lvec16[16]; 420 typedef int16 lvec16[16];
416 typedef int32 lvec32[8]; 421 typedef int32 lvec32[8];
417 typedef int8 lvec8[32]; 422 typedef int8 lvec8[32];
418 typedef uint16 ulvec16[16]; 423 typedef uint16 ulvec16[16];
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 #define KUVTOB 0 459 #define KUVTOB 0
455 #define KUVTOG 32 460 #define KUVTOG 32
456 #define KUVTOR 64 461 #define KUVTOR 64
457 #define KUVBIASB 96 462 #define KUVBIASB 96
458 #define KUVBIASG 128 463 #define KUVBIASG 128
459 #define KUVBIASR 160 464 #define KUVBIASR 160
460 #define KYTORGB 192 465 #define KYTORGB 192
461 #endif 466 #endif
462 467
463 // Conversion matrix for YUV to RGB 468 // Conversion matrix for YUV to RGB
464 extern const struct YuvConstants kYuvI601Constants; // BT.601 469 extern const struct YuvConstants SIMD_ALIGNED(kYuvI601Constants); // BT.601
465 extern const struct YuvConstants kYuvJPEGConstants; // JPeg color space 470 extern const struct YuvConstants SIMD_ALIGNED(kYuvJPEGConstants); // JPeg
466 extern const struct YuvConstants kYuvH709Constants; // BT.709 471 extern const struct YuvConstants SIMD_ALIGNED(kYuvH709Constants); // BT.709
467 472
468 // Conversion matrix for YVU to BGR 473 // Conversion matrix for YVU to BGR
469 extern const struct YuvConstants kYvuI601Constants; // BT.601 474 extern const struct YuvConstants SIMD_ALIGNED(kYvuI601Constants); // BT.601
470 extern const struct YuvConstants kYvuJPEGConstants; // JPeg color space 475 extern const struct YuvConstants SIMD_ALIGNED(kYvuJPEGConstants); // JPeg
471 extern const struct YuvConstants kYvuH709Constants; // BT.709 476 extern const struct YuvConstants SIMD_ALIGNED(kYvuH709Constants); // BT.709
472 477
473 #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) 478 #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
474 #define OMITFP 479 #define OMITFP
475 #else 480 #else
476 #define OMITFP __attribute__((optimize("omit-frame-pointer"))) 481 #define OMITFP __attribute__((optimize("omit-frame-pointer")))
477 #endif 482 #endif
478 483
479 // NaCL macros for GCC x86 and x64. 484 // NaCL macros for GCC x86 and x64.
480 #if defined(__native_client__) 485 #if defined(__native_client__)
481 #define LABELALIGN ".p2align 5\n" 486 #define LABELALIGN ".p2align 5\n"
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, 1935 void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb,
1931 int width, 1936 int width,
1932 const uint8* luma, uint32 lumacoeff); 1937 const uint8* luma, uint32 lumacoeff);
1933 1938
1934 #ifdef __cplusplus 1939 #ifdef __cplusplus
1935 } // extern "C" 1940 } // extern "C"
1936 } // namespace libyuv 1941 } // namespace libyuv
1937 #endif 1942 #endif
1938 1943
1939 #endif // INCLUDE_LIBYUV_ROW_H_ NOLINT 1944 #endif // INCLUDE_LIBYUV_ROW_H_ NOLINT
OLDNEW
« no previous file with comments | « README.chromium ('k') | include/libyuv/version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698