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

Side by Side Diff: source/convert.cc

Issue 1398633002: change all pix parameters to width for consistency (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 5 years, 2 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 | « libyuv.gypi ('k') | source/convert_from.cc » ('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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 static int X420ToI420(const uint8* src_y, 238 static int X420ToI420(const uint8* src_y,
239 int src_stride_y0, int src_stride_y1, 239 int src_stride_y0, int src_stride_y1,
240 const uint8* src_uv, int src_stride_uv, 240 const uint8* src_uv, int src_stride_uv,
241 uint8* dst_y, int dst_stride_y, 241 uint8* dst_y, int dst_stride_y,
242 uint8* dst_u, int dst_stride_u, 242 uint8* dst_u, int dst_stride_u,
243 uint8* dst_v, int dst_stride_v, 243 uint8* dst_v, int dst_stride_v,
244 int width, int height) { 244 int width, int height) {
245 int y; 245 int y;
246 int halfwidth = (width + 1) >> 1; 246 int halfwidth = (width + 1) >> 1;
247 int halfheight = (height + 1) >> 1; 247 int halfheight = (height + 1) >> 1;
248 void (*SplitUVRow)(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix) = 248 void (*SplitUVRow)(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width) =
249 SplitUVRow_C; 249 SplitUVRow_C;
250 if (!src_y || !src_uv || 250 if (!src_y || !src_uv ||
251 !dst_y || !dst_u || !dst_v || 251 !dst_y || !dst_u || !dst_v ||
252 width <= 0 || height == 0) { 252 width <= 0 || height == 0) {
253 return -1; 253 return -1;
254 } 254 }
255 // Negative height means invert the image. 255 // Negative height means invert the image.
256 if (height < 0) { 256 if (height < 0) {
257 height = -height; 257 height = -height;
258 halfheight = (height + 1) >> 1; 258 halfheight = (height + 1) >> 1;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 // Convert YUY2 to I420. 384 // Convert YUY2 to I420.
385 LIBYUV_API 385 LIBYUV_API
386 int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2, 386 int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2,
387 uint8* dst_y, int dst_stride_y, 387 uint8* dst_y, int dst_stride_y,
388 uint8* dst_u, int dst_stride_u, 388 uint8* dst_u, int dst_stride_u,
389 uint8* dst_v, int dst_stride_v, 389 uint8* dst_v, int dst_stride_v,
390 int width, int height) { 390 int width, int height) {
391 int y; 391 int y;
392 void (*YUY2ToUVRow)(const uint8* src_yuy2, int src_stride_yuy2, 392 void (*YUY2ToUVRow)(const uint8* src_yuy2, int src_stride_yuy2,
393 uint8* dst_u, uint8* dst_v, int pix) = YUY2ToUVRow_C; 393 uint8* dst_u, uint8* dst_v, int width) = YUY2ToUVRow_C;
394 void (*YUY2ToYRow)(const uint8* src_yuy2, 394 void (*YUY2ToYRow)(const uint8* src_yuy2,
395 uint8* dst_y, int pix) = YUY2ToYRow_C; 395 uint8* dst_y, int width) = YUY2ToYRow_C;
396 // Negative height means invert the image. 396 // Negative height means invert the image.
397 if (height < 0) { 397 if (height < 0) {
398 height = -height; 398 height = -height;
399 src_yuy2 = src_yuy2 + (height - 1) * src_stride_yuy2; 399 src_yuy2 = src_yuy2 + (height - 1) * src_stride_yuy2;
400 src_stride_yuy2 = -src_stride_yuy2; 400 src_stride_yuy2 = -src_stride_yuy2;
401 } 401 }
402 #if defined(HAS_YUY2TOYROW_SSE2) 402 #if defined(HAS_YUY2TOYROW_SSE2)
403 if (TestCpuFlag(kCpuHasSSE2)) { 403 if (TestCpuFlag(kCpuHasSSE2)) {
404 YUY2ToUVRow = YUY2ToUVRow_Any_SSE2; 404 YUY2ToUVRow = YUY2ToUVRow_Any_SSE2;
405 YUY2ToYRow = YUY2ToYRow_Any_SSE2; 405 YUY2ToYRow = YUY2ToYRow_Any_SSE2;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 // Convert UYVY to I420. 449 // Convert UYVY to I420.
450 LIBYUV_API 450 LIBYUV_API
451 int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy, 451 int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy,
452 uint8* dst_y, int dst_stride_y, 452 uint8* dst_y, int dst_stride_y,
453 uint8* dst_u, int dst_stride_u, 453 uint8* dst_u, int dst_stride_u,
454 uint8* dst_v, int dst_stride_v, 454 uint8* dst_v, int dst_stride_v,
455 int width, int height) { 455 int width, int height) {
456 int y; 456 int y;
457 void (*UYVYToUVRow)(const uint8* src_uyvy, int src_stride_uyvy, 457 void (*UYVYToUVRow)(const uint8* src_uyvy, int src_stride_uyvy,
458 uint8* dst_u, uint8* dst_v, int pix) = UYVYToUVRow_C; 458 uint8* dst_u, uint8* dst_v, int width) = UYVYToUVRow_C;
459 void (*UYVYToYRow)(const uint8* src_uyvy, 459 void (*UYVYToYRow)(const uint8* src_uyvy,
460 uint8* dst_y, int pix) = UYVYToYRow_C; 460 uint8* dst_y, int width) = UYVYToYRow_C;
461 // Negative height means invert the image. 461 // Negative height means invert the image.
462 if (height < 0) { 462 if (height < 0) {
463 height = -height; 463 height = -height;
464 src_uyvy = src_uyvy + (height - 1) * src_stride_uyvy; 464 src_uyvy = src_uyvy + (height - 1) * src_stride_uyvy;
465 src_stride_uyvy = -src_stride_uyvy; 465 src_stride_uyvy = -src_stride_uyvy;
466 } 466 }
467 #if defined(HAS_UYVYTOYROW_SSE2) 467 #if defined(HAS_UYVYTOYROW_SSE2)
468 if (TestCpuFlag(kCpuHasSSE2)) { 468 if (TestCpuFlag(kCpuHasSSE2)) {
469 UYVYToUVRow = UYVYToUVRow_Any_SSE2; 469 UYVYToUVRow = UYVYToUVRow_Any_SSE2;
470 UYVYToYRow = UYVYToYRow_Any_SSE2; 470 UYVYToYRow = UYVYToYRow_Any_SSE2;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // Convert ARGB to I420. 514 // Convert ARGB to I420.
515 LIBYUV_API 515 LIBYUV_API
516 int ARGBToI420(const uint8* src_argb, int src_stride_argb, 516 int ARGBToI420(const uint8* src_argb, int src_stride_argb,
517 uint8* dst_y, int dst_stride_y, 517 uint8* dst_y, int dst_stride_y,
518 uint8* dst_u, int dst_stride_u, 518 uint8* dst_u, int dst_stride_u,
519 uint8* dst_v, int dst_stride_v, 519 uint8* dst_v, int dst_stride_v,
520 int width, int height) { 520 int width, int height) {
521 int y; 521 int y;
522 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, 522 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb,
523 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; 523 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C;
524 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = 524 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int width) =
525 ARGBToYRow_C; 525 ARGBToYRow_C;
526 if (!src_argb || 526 if (!src_argb ||
527 !dst_y || !dst_u || !dst_v || 527 !dst_y || !dst_u || !dst_v ||
528 width <= 0 || height == 0) { 528 width <= 0 || height == 0) {
529 return -1; 529 return -1;
530 } 530 }
531 // Negative height means invert the image. 531 // Negative height means invert the image.
532 if (height < 0) { 532 if (height < 0) {
533 height = -height; 533 height = -height;
534 src_argb = src_argb + (height - 1) * src_stride_argb; 534 src_argb = src_argb + (height - 1) * src_stride_argb;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 // Convert BGRA to I420. 590 // Convert BGRA to I420.
591 LIBYUV_API 591 LIBYUV_API
592 int BGRAToI420(const uint8* src_bgra, int src_stride_bgra, 592 int BGRAToI420(const uint8* src_bgra, int src_stride_bgra,
593 uint8* dst_y, int dst_stride_y, 593 uint8* dst_y, int dst_stride_y,
594 uint8* dst_u, int dst_stride_u, 594 uint8* dst_u, int dst_stride_u,
595 uint8* dst_v, int dst_stride_v, 595 uint8* dst_v, int dst_stride_v,
596 int width, int height) { 596 int width, int height) {
597 int y; 597 int y;
598 void (*BGRAToUVRow)(const uint8* src_bgra0, int src_stride_bgra, 598 void (*BGRAToUVRow)(const uint8* src_bgra0, int src_stride_bgra,
599 uint8* dst_u, uint8* dst_v, int width) = BGRAToUVRow_C; 599 uint8* dst_u, uint8* dst_v, int width) = BGRAToUVRow_C;
600 void (*BGRAToYRow)(const uint8* src_bgra, uint8* dst_y, int pix) = 600 void (*BGRAToYRow)(const uint8* src_bgra, uint8* dst_y, int width) =
601 BGRAToYRow_C; 601 BGRAToYRow_C;
602 if (!src_bgra || 602 if (!src_bgra ||
603 !dst_y || !dst_u || !dst_v || 603 !dst_y || !dst_u || !dst_v ||
604 width <= 0 || height == 0) { 604 width <= 0 || height == 0) {
605 return -1; 605 return -1;
606 } 606 }
607 // Negative height means invert the image. 607 // Negative height means invert the image.
608 if (height < 0) { 608 if (height < 0) {
609 height = -height; 609 height = -height;
610 src_bgra = src_bgra + (height - 1) * src_stride_bgra; 610 src_bgra = src_bgra + (height - 1) * src_stride_bgra;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 // Convert ABGR to I420. 656 // Convert ABGR to I420.
657 LIBYUV_API 657 LIBYUV_API
658 int ABGRToI420(const uint8* src_abgr, int src_stride_abgr, 658 int ABGRToI420(const uint8* src_abgr, int src_stride_abgr,
659 uint8* dst_y, int dst_stride_y, 659 uint8* dst_y, int dst_stride_y,
660 uint8* dst_u, int dst_stride_u, 660 uint8* dst_u, int dst_stride_u,
661 uint8* dst_v, int dst_stride_v, 661 uint8* dst_v, int dst_stride_v,
662 int width, int height) { 662 int width, int height) {
663 int y; 663 int y;
664 void (*ABGRToUVRow)(const uint8* src_abgr0, int src_stride_abgr, 664 void (*ABGRToUVRow)(const uint8* src_abgr0, int src_stride_abgr,
665 uint8* dst_u, uint8* dst_v, int width) = ABGRToUVRow_C; 665 uint8* dst_u, uint8* dst_v, int width) = ABGRToUVRow_C;
666 void (*ABGRToYRow)(const uint8* src_abgr, uint8* dst_y, int pix) = 666 void (*ABGRToYRow)(const uint8* src_abgr, uint8* dst_y, int width) =
667 ABGRToYRow_C; 667 ABGRToYRow_C;
668 if (!src_abgr || 668 if (!src_abgr ||
669 !dst_y || !dst_u || !dst_v || 669 !dst_y || !dst_u || !dst_v ||
670 width <= 0 || height == 0) { 670 width <= 0 || height == 0) {
671 return -1; 671 return -1;
672 } 672 }
673 // Negative height means invert the image. 673 // Negative height means invert the image.
674 if (height < 0) { 674 if (height < 0) {
675 height = -height; 675 height = -height;
676 src_abgr = src_abgr + (height - 1) * src_stride_abgr; 676 src_abgr = src_abgr + (height - 1) * src_stride_abgr;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 // Convert RGBA to I420. 722 // Convert RGBA to I420.
723 LIBYUV_API 723 LIBYUV_API
724 int RGBAToI420(const uint8* src_rgba, int src_stride_rgba, 724 int RGBAToI420(const uint8* src_rgba, int src_stride_rgba,
725 uint8* dst_y, int dst_stride_y, 725 uint8* dst_y, int dst_stride_y,
726 uint8* dst_u, int dst_stride_u, 726 uint8* dst_u, int dst_stride_u,
727 uint8* dst_v, int dst_stride_v, 727 uint8* dst_v, int dst_stride_v,
728 int width, int height) { 728 int width, int height) {
729 int y; 729 int y;
730 void (*RGBAToUVRow)(const uint8* src_rgba0, int src_stride_rgba, 730 void (*RGBAToUVRow)(const uint8* src_rgba0, int src_stride_rgba,
731 uint8* dst_u, uint8* dst_v, int width) = RGBAToUVRow_C; 731 uint8* dst_u, uint8* dst_v, int width) = RGBAToUVRow_C;
732 void (*RGBAToYRow)(const uint8* src_rgba, uint8* dst_y, int pix) = 732 void (*RGBAToYRow)(const uint8* src_rgba, uint8* dst_y, int width) =
733 RGBAToYRow_C; 733 RGBAToYRow_C;
734 if (!src_rgba || 734 if (!src_rgba ||
735 !dst_y || !dst_u || !dst_v || 735 !dst_y || !dst_u || !dst_v ||
736 width <= 0 || height == 0) { 736 width <= 0 || height == 0) {
737 return -1; 737 return -1;
738 } 738 }
739 // Negative height means invert the image. 739 // Negative height means invert the image.
740 if (height < 0) { 740 if (height < 0) {
741 height = -height; 741 height = -height;
742 src_rgba = src_rgba + (height - 1) * src_stride_rgba; 742 src_rgba = src_rgba + (height - 1) * src_stride_rgba;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 LIBYUV_API 789 LIBYUV_API
790 int RGB24ToI420(const uint8* src_rgb24, int src_stride_rgb24, 790 int RGB24ToI420(const uint8* src_rgb24, int src_stride_rgb24,
791 uint8* dst_y, int dst_stride_y, 791 uint8* dst_y, int dst_stride_y,
792 uint8* dst_u, int dst_stride_u, 792 uint8* dst_u, int dst_stride_u,
793 uint8* dst_v, int dst_stride_v, 793 uint8* dst_v, int dst_stride_v,
794 int width, int height) { 794 int width, int height) {
795 int y; 795 int y;
796 #if defined(HAS_RGB24TOYROW_NEON) 796 #if defined(HAS_RGB24TOYROW_NEON)
797 void (*RGB24ToUVRow)(const uint8* src_rgb24, int src_stride_rgb24, 797 void (*RGB24ToUVRow)(const uint8* src_rgb24, int src_stride_rgb24,
798 uint8* dst_u, uint8* dst_v, int width) = RGB24ToUVRow_C; 798 uint8* dst_u, uint8* dst_v, int width) = RGB24ToUVRow_C;
799 void (*RGB24ToYRow)(const uint8* src_rgb24, uint8* dst_y, int pix) = 799 void (*RGB24ToYRow)(const uint8* src_rgb24, uint8* dst_y, int width) =
800 RGB24ToYRow_C; 800 RGB24ToYRow_C;
801 #else 801 #else
802 void (*RGB24ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) = 802 void (*RGB24ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) =
803 RGB24ToARGBRow_C; 803 RGB24ToARGBRow_C;
804 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, 804 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb,
805 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; 805 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C;
806 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = 806 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int width) =
807 ARGBToYRow_C; 807 ARGBToYRow_C;
808 #endif 808 #endif
809 if (!src_rgb24 || !dst_y || !dst_u || !dst_v || 809 if (!src_rgb24 || !dst_y || !dst_u || !dst_v ||
810 width <= 0 || height == 0) { 810 width <= 0 || height == 0) {
811 return -1; 811 return -1;
812 } 812 }
813 // Negative height means invert the image. 813 // Negative height means invert the image.
814 if (height < 0) { 814 if (height < 0) {
815 height = -height; 815 height = -height;
816 src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24; 816 src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 LIBYUV_API 903 LIBYUV_API
904 int RAWToI420(const uint8* src_raw, int src_stride_raw, 904 int RAWToI420(const uint8* src_raw, int src_stride_raw,
905 uint8* dst_y, int dst_stride_y, 905 uint8* dst_y, int dst_stride_y,
906 uint8* dst_u, int dst_stride_u, 906 uint8* dst_u, int dst_stride_u,
907 uint8* dst_v, int dst_stride_v, 907 uint8* dst_v, int dst_stride_v,
908 int width, int height) { 908 int width, int height) {
909 int y; 909 int y;
910 #if defined(HAS_RAWTOYROW_NEON) 910 #if defined(HAS_RAWTOYROW_NEON)
911 void (*RAWToUVRow)(const uint8* src_raw, int src_stride_raw, 911 void (*RAWToUVRow)(const uint8* src_raw, int src_stride_raw,
912 uint8* dst_u, uint8* dst_v, int width) = RAWToUVRow_C; 912 uint8* dst_u, uint8* dst_v, int width) = RAWToUVRow_C;
913 void (*RAWToYRow)(const uint8* src_raw, uint8* dst_y, int pix) = 913 void (*RAWToYRow)(const uint8* src_raw, uint8* dst_y, int width) =
914 RAWToYRow_C; 914 RAWToYRow_C;
915 #else 915 #else
916 void (*RAWToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) = 916 void (*RAWToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) =
917 RAWToARGBRow_C; 917 RAWToARGBRow_C;
918 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, 918 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb,
919 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; 919 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C;
920 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = 920 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int width) =
921 ARGBToYRow_C; 921 ARGBToYRow_C;
922 #endif 922 #endif
923 if (!src_raw || !dst_y || !dst_u || !dst_v || 923 if (!src_raw || !dst_y || !dst_u || !dst_v ||
924 width <= 0 || height == 0) { 924 width <= 0 || height == 0) {
925 return -1; 925 return -1;
926 } 926 }
927 // Negative height means invert the image. 927 // Negative height means invert the image.
928 if (height < 0) { 928 if (height < 0) {
929 height = -height; 929 height = -height;
930 src_raw = src_raw + (height - 1) * src_stride_raw; 930 src_raw = src_raw + (height - 1) * src_stride_raw;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 LIBYUV_API 1017 LIBYUV_API
1018 int RGB565ToI420(const uint8* src_rgb565, int src_stride_rgb565, 1018 int RGB565ToI420(const uint8* src_rgb565, int src_stride_rgb565,
1019 uint8* dst_y, int dst_stride_y, 1019 uint8* dst_y, int dst_stride_y,
1020 uint8* dst_u, int dst_stride_u, 1020 uint8* dst_u, int dst_stride_u,
1021 uint8* dst_v, int dst_stride_v, 1021 uint8* dst_v, int dst_stride_v,
1022 int width, int height) { 1022 int width, int height) {
1023 int y; 1023 int y;
1024 #if defined(HAS_RGB565TOYROW_NEON) 1024 #if defined(HAS_RGB565TOYROW_NEON)
1025 void (*RGB565ToUVRow)(const uint8* src_rgb565, int src_stride_rgb565, 1025 void (*RGB565ToUVRow)(const uint8* src_rgb565, int src_stride_rgb565,
1026 uint8* dst_u, uint8* dst_v, int width) = RGB565ToUVRow_C; 1026 uint8* dst_u, uint8* dst_v, int width) = RGB565ToUVRow_C;
1027 void (*RGB565ToYRow)(const uint8* src_rgb565, uint8* dst_y, int pix) = 1027 void (*RGB565ToYRow)(const uint8* src_rgb565, uint8* dst_y, int width) =
1028 RGB565ToYRow_C; 1028 RGB565ToYRow_C;
1029 #else 1029 #else
1030 void (*RGB565ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) = 1030 void (*RGB565ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) =
1031 RGB565ToARGBRow_C; 1031 RGB565ToARGBRow_C;
1032 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, 1032 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb,
1033 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; 1033 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C;
1034 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = 1034 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int width) =
1035 ARGBToYRow_C; 1035 ARGBToYRow_C;
1036 #endif 1036 #endif
1037 if (!src_rgb565 || !dst_y || !dst_u || !dst_v || 1037 if (!src_rgb565 || !dst_y || !dst_u || !dst_v ||
1038 width <= 0 || height == 0) { 1038 width <= 0 || height == 0) {
1039 return -1; 1039 return -1;
1040 } 1040 }
1041 // Negative height means invert the image. 1041 // Negative height means invert the image.
1042 if (height < 0) { 1042 if (height < 0) {
1043 height = -height; 1043 height = -height;
1044 src_rgb565 = src_rgb565 + (height - 1) * src_stride_rgb565; 1044 src_rgb565 = src_rgb565 + (height - 1) * src_stride_rgb565;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 LIBYUV_API 1139 LIBYUV_API
1140 int ARGB1555ToI420(const uint8* src_argb1555, int src_stride_argb1555, 1140 int ARGB1555ToI420(const uint8* src_argb1555, int src_stride_argb1555,
1141 uint8* dst_y, int dst_stride_y, 1141 uint8* dst_y, int dst_stride_y,
1142 uint8* dst_u, int dst_stride_u, 1142 uint8* dst_u, int dst_stride_u,
1143 uint8* dst_v, int dst_stride_v, 1143 uint8* dst_v, int dst_stride_v,
1144 int width, int height) { 1144 int width, int height) {
1145 int y; 1145 int y;
1146 #if defined(HAS_ARGB1555TOYROW_NEON) 1146 #if defined(HAS_ARGB1555TOYROW_NEON)
1147 void (*ARGB1555ToUVRow)(const uint8* src_argb1555, int src_stride_argb1555, 1147 void (*ARGB1555ToUVRow)(const uint8* src_argb1555, int src_stride_argb1555,
1148 uint8* dst_u, uint8* dst_v, int width) = ARGB1555ToUVRow_C; 1148 uint8* dst_u, uint8* dst_v, int width) = ARGB1555ToUVRow_C;
1149 void (*ARGB1555ToYRow)(const uint8* src_argb1555, uint8* dst_y, int pix) = 1149 void (*ARGB1555ToYRow)(const uint8* src_argb1555, uint8* dst_y, int width) =
1150 ARGB1555ToYRow_C; 1150 ARGB1555ToYRow_C;
1151 #else 1151 #else
1152 void (*ARGB1555ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) = 1152 void (*ARGB1555ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) =
1153 ARGB1555ToARGBRow_C; 1153 ARGB1555ToARGBRow_C;
1154 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, 1154 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb,
1155 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; 1155 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C;
1156 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = 1156 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int width) =
1157 ARGBToYRow_C; 1157 ARGBToYRow_C;
1158 #endif 1158 #endif
1159 if (!src_argb1555 || !dst_y || !dst_u || !dst_v || 1159 if (!src_argb1555 || !dst_y || !dst_u || !dst_v ||
1160 width <= 0 || height == 0) { 1160 width <= 0 || height == 0) {
1161 return -1; 1161 return -1;
1162 } 1162 }
1163 // Negative height means invert the image. 1163 // Negative height means invert the image.
1164 if (height < 0) { 1164 if (height < 0) {
1165 height = -height; 1165 height = -height;
1166 src_argb1555 = src_argb1555 + (height - 1) * src_stride_argb1555; 1166 src_argb1555 = src_argb1555 + (height - 1) * src_stride_argb1555;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 LIBYUV_API 1263 LIBYUV_API
1264 int ARGB4444ToI420(const uint8* src_argb4444, int src_stride_argb4444, 1264 int ARGB4444ToI420(const uint8* src_argb4444, int src_stride_argb4444,
1265 uint8* dst_y, int dst_stride_y, 1265 uint8* dst_y, int dst_stride_y,
1266 uint8* dst_u, int dst_stride_u, 1266 uint8* dst_u, int dst_stride_u,
1267 uint8* dst_v, int dst_stride_v, 1267 uint8* dst_v, int dst_stride_v,
1268 int width, int height) { 1268 int width, int height) {
1269 int y; 1269 int y;
1270 #if defined(HAS_ARGB4444TOYROW_NEON) 1270 #if defined(HAS_ARGB4444TOYROW_NEON)
1271 void (*ARGB4444ToUVRow)(const uint8* src_argb4444, int src_stride_argb4444, 1271 void (*ARGB4444ToUVRow)(const uint8* src_argb4444, int src_stride_argb4444,
1272 uint8* dst_u, uint8* dst_v, int width) = ARGB4444ToUVRow_C; 1272 uint8* dst_u, uint8* dst_v, int width) = ARGB4444ToUVRow_C;
1273 void (*ARGB4444ToYRow)(const uint8* src_argb4444, uint8* dst_y, int pix) = 1273 void (*ARGB4444ToYRow)(const uint8* src_argb4444, uint8* dst_y, int width) =
1274 ARGB4444ToYRow_C; 1274 ARGB4444ToYRow_C;
1275 #else 1275 #else
1276 void (*ARGB4444ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int pix) = 1276 void (*ARGB4444ToARGBRow)(const uint8* src_rgb, uint8* dst_argb, int width) =
1277 ARGB4444ToARGBRow_C; 1277 ARGB4444ToARGBRow_C;
1278 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, 1278 void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb,
1279 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; 1279 uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C;
1280 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = 1280 void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int width) =
1281 ARGBToYRow_C; 1281 ARGBToYRow_C;
1282 #endif 1282 #endif
1283 if (!src_argb4444 || !dst_y || !dst_u || !dst_v || 1283 if (!src_argb4444 || !dst_y || !dst_u || !dst_v ||
1284 width <= 0 || height == 0) { 1284 width <= 0 || height == 0) {
1285 return -1; 1285 return -1;
1286 } 1286 }
1287 // Negative height means invert the image. 1287 // Negative height means invert the image.
1288 if (height < 0) { 1288 if (height < 0) {
1289 height = -height; 1289 height = -height;
1290 src_argb4444 = src_argb4444 + (height - 1) * src_stride_argb4444; 1290 src_argb4444 = src_argb4444 + (height - 1) * src_stride_argb4444;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 free_aligned_buffer_64(row); 1380 free_aligned_buffer_64(row);
1381 } 1381 }
1382 #endif 1382 #endif
1383 return 0; 1383 return 0;
1384 } 1384 }
1385 1385
1386 #ifdef __cplusplus 1386 #ifdef __cplusplus
1387 } // extern "C" 1387 } // extern "C"
1388 } // namespace libyuv 1388 } // namespace libyuv
1389 #endif 1389 #endif
OLDNEW
« no previous file with comments | « libyuv.gypi ('k') | source/convert_from.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698