1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009 |
- diff -rNua libyuv-o/include/libyuv/convert_argb.h libyuv/include/libyuv/convert_argb.h
- --- libyuv-o/include/libyuv/convert_argb.h 2020-10-23 15:16:00.638324198 +0800
- +++ libyuv/include/libyuv/convert_argb.h 2020-10-23 15:16:11.390462130 +0800
- @@ -51,6 +51,9 @@
- I420AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n)
- // Alias.
- +#define RAWCopy RGB24Copy
- +#define RAWToRAW RGB24Copy
- +#define RGB24ToRAW RAWToRGB24
- #define ARGBToARGB ARGBCopy
- // Copy ARGB to ARGB.
- @@ -62,6 +65,16 @@
- int width,
- int height);
- +// Copy RGB24 to RGB24
- +#define RGB24ToRGB24 RGB24Copy
- +LIBYUV_API
- +int RGB24Copy(const uint8_t* src_rgb24,
- + int src_stride_rgb24,
- + uint8_t* dst_rgb24,
- + int dst_stride_rgb24,
- + int width,
- + int height);
- +
- // Convert I420 to ARGB.
- LIBYUV_API
- int I420ToARGB(const uint8_t* src_y,
- diff -rNua libyuv-o/include/libyuv/convert.h libyuv/include/libyuv/convert.h
- --- libyuv-o/include/libyuv/convert.h 2020-10-23 15:16:00.638324198 +0800
- +++ libyuv/include/libyuv/convert.h 2020-10-23 15:16:11.390462130 +0800
- @@ -122,6 +122,22 @@
- int width,
- int height);
- +// Copy NV12 to NV12.
- +#define NV21Copy NV12Copy
- +#define NV12ToNV12 NV12Copy
- +#define NV21ToNV21 NV12Copy
- +LIBYUV_API
- +int NV12Copy(const uint8_t* src_y,
- + int src_stride_y,
- + const uint8_t* src_uv,
- + int src_stride_uv,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_uv,
- + int dst_stride_uv,
- + int width,
- + int height);
- +
- // Copy I010 to I010
- #define I010ToI010 I010Copy
- #define H010ToH010 I010Copy
- @@ -346,6 +362,28 @@
- int width,
- int height);
- +// RGB little endian (bgr in memory) to NV12.
- +LIBYUV_API
- +int RGB24ToNV12(const uint8_t* src_rgb24,
- + int src_stride_rgb24,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_uv,
- + int dst_stride_uv,
- + int width,
- + int height);
- +
- +// RGB little endian (bgr in memory) to NV21.
- +LIBYUV_API
- +int RGB24ToNV21(const uint8_t* src_rgb24,
- + int src_stride_rgb24,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_vu,
- + int dst_stride_vu,
- + int width,
- + int height);
- +
- // RGB little endian (bgr in memory) to J420.
- LIBYUV_API
- int RGB24ToJ420(const uint8_t* src_rgb24,
- @@ -372,6 +410,28 @@
- int width,
- int height);
- +// RGB big endian (rgb in memory) to NV12.
- +LIBYUV_API
- +int RAWToNV12(const uint8_t* src_raw,
- + int src_stride_raw,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_uv,
- + int dst_stride_uv,
- + int width,
- + int height);
- +
- +// RGB big endian (rgb in memory) to NV21.
- +LIBYUV_API
- +int RAWToNV21(const uint8_t* src_raw,
- + int src_stride_raw,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_vu,
- + int dst_stride_vu,
- + int width,
- + int height);
- +
- // RGB16 (RGBP fourcc) little endian to I420.
- LIBYUV_API
- int RGB565ToI420(const uint8_t* src_rgb565,
- diff -rNua libyuv-o/source/convert_argb.cc libyuv/source/convert_argb.cc
- --- libyuv-o/source/convert_argb.cc 2020-10-23 15:16:00.642324251 +0800
- +++ libyuv/source/convert_argb.cc 2020-10-23 15:16:11.390462130 +0800
- @@ -47,6 +47,29 @@
- return 0;
- }
- +// Copy RGB24 with optional flipping
- +LIBYUV_API
- +int RGB24Copy(const uint8_t* src_rgb24,
- + int src_stride_rgb24,
- + uint8_t* dst_rgb24,
- + int dst_stride_rgb24,
- + int width,
- + int height) {
- + if (!src_rgb24 || !dst_rgb24 || width <= 0 || height == 0) {
- + return -1;
- + }
- + // Negative height means invert the image.
- + if (height < 0) {
- + height = -height;
- + src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
- + src_stride_rgb24 = -src_stride_rgb24;
- + }
- +
- + CopyPlane(src_rgb24, src_stride_rgb24, dst_rgb24, dst_stride_rgb24,
- + width * 3, height);
- + return 0;
- +}
- +
- // Convert I420 to ARGB with matrix.
- LIBYUV_API
- int I420ToARGBMatrix(const uint8_t* src_y,
- diff -rNua libyuv-o/source/convert.cc libyuv/source/convert.cc
- --- libyuv-o/source/convert.cc 2020-10-23 15:16:00.642324251 +0800
- +++ libyuv/source/convert.cc 2020-10-23 15:16:11.390462130 +0800
- @@ -106,6 +106,41 @@
- return 0;
- }
- +// Copy NV12 with optional flipping.
- +// TODO(fbarchard): Use Scale plane which supports mirroring, but ensure
- +// is does row coalescing.
- +LIBYUV_API
- +int NV12Copy(const uint8_t* src_y,
- + int src_stride_y,
- + const uint8_t* src_uv,
- + int src_stride_uv,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_uv,
- + int dst_stride_uv,
- + int width,
- + int height) {
- + int halfheight = (height + 1) >> 1;
- + if (!src_uv || !dst_uv || width <= 0 || height == 0) {
- + return -1;
- + }
- + // Negative height means invert the image.
- + if (height < 0) {
- + height = -height;
- + src_y = src_y + (height - 1) * src_stride_y;
- + src_uv = src_uv + (height - 1) * src_stride_uv;
- + src_stride_y = -src_stride_y;
- + src_stride_uv = -src_stride_uv;
- + }
- +
- + if (dst_y) {
- + CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
- + }
- + // Copy UV planes.
- + CopyPlane(src_uv, src_stride_uv, dst_uv, dst_stride_uv, width, halfheight);
- + return 0;
- +}
- +
- // Copy I010 with optional flipping.
- LIBYUV_API
- int I010Copy(const uint16_t* src_y,
- @@ -1477,6 +1512,408 @@
- return 0;
- }
- +// Convert RGB24 to NV12.
- +LIBYUV_API
- +int RGB24ToNV12(const uint8_t* src_rgb24,
- + int src_stride_rgb24,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_uv,
- + int dst_stride_uv,
- + int width,
- + int height) {
- + int y;
- + int halfwidth = (width + 1) >> 1;
- +#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + void (*RGB24ToUVRow)(const uint8_t* src_rgb24, int src_stride_rgb24,
- + uint8_t* dst_u, uint8_t* dst_v, int width) =
- + RGB24ToUVRow_C;
- + void (*RGB24ToYRow)(const uint8_t* src_rgb24, uint8_t* dst_y, int width) =
- + RGB24ToYRow_C;
- +#else
- + void (*RGB24ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
- + RGB24ToARGBRow_C;
- + void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
- + uint8_t* dst_u, uint8_t* dst_v, int width) =
- + ARGBToUVRow_C;
- + void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
- + ARGBToYRow_C;
- +#endif
- + void (*MergeUVRow_)(const uint8_t* src_u, const uint8_t* src_v,
- + uint8_t* dst_uv, int width) = MergeUVRow_C;
- + if (!src_rgb24 || !dst_y || !dst_uv || width <= 0 || height == 0) {
- + return -1;
- + }
- + // Negative height means invert the image.
- + if (height < 0) {
- + height = -height;
- + src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
- + src_stride_rgb24 = -src_stride_rgb24;
- + }
- +
- +// Neon version does direct RGB24 to YUV.
- +#if defined(HAS_RGB24TOYROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + RGB24ToUVRow = RGB24ToUVRow_Any_NEON;
- + RGB24ToYRow = RGB24ToYRow_Any_NEON;
- + if (IS_ALIGNED(width, 8)) {
- + RGB24ToYRow = RGB24ToYRow_NEON;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToUVRow = RGB24ToUVRow_NEON;
- + }
- + }
- + }
- +// MMI and MSA version does direct RGB24 to YUV.
- +#elif (defined(HAS_RGB24TOYROW_MMI) || defined(HAS_RGB24TOYROW_MSA))
- +#if defined(HAS_RGB24TOYROW_MMI) && defined(HAS_RGB24TOUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + RGB24ToUVRow = RGB24ToUVRow_Any_MMI;
- + RGB24ToYRow = RGB24ToYRow_Any_MMI;
- + if (IS_ALIGNED(width, 8)) {
- + RGB24ToYRow = RGB24ToYRow_MMI;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToUVRow = RGB24ToUVRow_MMI;
- + }
- + }
- + }
- +#endif
- +#if defined(HAS_RGB24TOYROW_MSA) && defined(HAS_RGB24TOUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + RGB24ToUVRow = RGB24ToUVRow_Any_MSA;
- + RGB24ToYRow = RGB24ToYRow_Any_MSA;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToYRow = RGB24ToYRow_MSA;
- + RGB24ToUVRow = RGB24ToUVRow_MSA;
- + }
- + }
- +#endif
- +// Other platforms do intermediate conversion from RGB24 to ARGB.
- +#else
- +#if defined(HAS_RGB24TOARGBROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + RGB24ToARGBRow = RGB24ToARGBRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToARGBRow = RGB24ToARGBRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_SSSE3) && defined(HAS_ARGBTOUVROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
- + ARGBToYRow = ARGBToYRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + ARGBToUVRow = ARGBToUVRow_SSSE3;
- + ARGBToYRow = ARGBToYRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_AVX2) && defined(HAS_ARGBTOUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + ARGBToUVRow = ARGBToUVRow_Any_AVX2;
- + ARGBToYRow = ARGBToYRow_Any_AVX2;
- + if (IS_ALIGNED(width, 32)) {
- + ARGBToUVRow = ARGBToUVRow_AVX2;
- + ARGBToYRow = ARGBToYRow_AVX2;
- + }
- + }
- +#endif
- +#endif
- +#if defined(HAS_MERGEUVROW_SSE2)
- + if (TestCpuFlag(kCpuHasSSE2)) {
- + MergeUVRow_ = MergeUVRow_Any_SSE2;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_SSE2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + MergeUVRow_ = MergeUVRow_Any_AVX2;
- + if (IS_ALIGNED(halfwidth, 32)) {
- + MergeUVRow_ = MergeUVRow_AVX2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + MergeUVRow_ = MergeUVRow_Any_NEON;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_NEON;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + MergeUVRow_ = MergeUVRow_Any_MMI;
- + if (IS_ALIGNED(halfwidth, 8)) {
- + MergeUVRow_ = MergeUVRow_MMI;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + MergeUVRow_ = MergeUVRow_Any_MSA;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_MSA;
- + }
- + }
- +#endif
- +
- + {
- + // Allocate a rows of uv.
- + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2);
- + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31);
- +
- +#if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + // Allocate 2 rows of ARGB.
- + const int kRowSize = (width * 4 + 31) & ~31;
- + align_buffer_64(row, kRowSize * 2);
- +#endif
- +
- + for (y = 0; y < height - 1; y += 2) {
- +#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + RGB24ToUVRow(src_rgb24, src_stride_rgb24, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + RGB24ToYRow(src_rgb24, dst_y, width);
- + RGB24ToYRow(src_rgb24 + src_stride_rgb24, dst_y + dst_stride_y, width);
- +#else
- + RGB24ToARGBRow(src_rgb24, row, width);
- + RGB24ToARGBRow(src_rgb24 + src_stride_rgb24, row + kRowSize, width);
- + ARGBToUVRow(row, kRowSize, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- + ARGBToYRow(row + kRowSize, dst_y + dst_stride_y, width);
- +#endif
- + src_rgb24 += src_stride_rgb24 * 2;
- + dst_y += dst_stride_y * 2;
- + dst_uv += dst_stride_uv;
- + }
- + if (height & 1) {
- +#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + RGB24ToUVRow(src_rgb24, 0, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + RGB24ToYRow(src_rgb24, dst_y, width);
- +#else
- + RGB24ToARGBRow(src_rgb24, row, width);
- + ARGBToUVRow(row, 0, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- +#endif
- + }
- +#if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + free_aligned_buffer_64(row);
- +#endif
- + free_aligned_buffer_64(row_u);
- + }
- + return 0;
- +}
- +
- +// Convert RGB24 to NV21.
- +LIBYUV_API
- +int RGB24ToNV21(const uint8_t* src_rgb24,
- + int src_stride_rgb24,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_vu,
- + int dst_stride_vu,
- + int width,
- + int height) {
- + int y;
- + int halfwidth = (width + 1) >> 1;
- +#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + void (*RGB24ToUVRow)(const uint8_t* src_rgb24, int src_stride_rgb24,
- + uint8_t* dst_u, uint8_t* dst_v, int width) =
- + RGB24ToUVRow_C;
- + void (*RGB24ToYRow)(const uint8_t* src_rgb24, uint8_t* dst_y, int width) =
- + RGB24ToYRow_C;
- +#else
- + void (*RGB24ToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
- + RGB24ToARGBRow_C;
- + void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
- + uint8_t* dst_u, uint8_t* dst_v, int width) =
- + ARGBToUVRow_C;
- + void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
- + ARGBToYRow_C;
- +#endif
- + void (*MergeUVRow_)(const uint8_t* src_u, const uint8_t* src_v,
- + uint8_t* dst_uv, int width) = MergeUVRow_C;
- + if (!src_rgb24 || !dst_y || !dst_vu || width <= 0 || height == 0) {
- + return -1;
- + }
- + // Negative height means invert the image.
- + if (height < 0) {
- + height = -height;
- + src_rgb24 = src_rgb24 + (height - 1) * src_stride_rgb24;
- + src_stride_rgb24 = -src_stride_rgb24;
- + }
- +
- +// Neon version does direct RGB24 to YUV.
- +#if defined(HAS_RGB24TOYROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + RGB24ToUVRow = RGB24ToUVRow_Any_NEON;
- + RGB24ToYRow = RGB24ToYRow_Any_NEON;
- + if (IS_ALIGNED(width, 8)) {
- + RGB24ToYRow = RGB24ToYRow_NEON;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToUVRow = RGB24ToUVRow_NEON;
- + }
- + }
- + }
- +// MMI and MSA version does direct RGB24 to YUV.
- +#elif (defined(HAS_RGB24TOYROW_MMI) || defined(HAS_RGB24TOYROW_MSA))
- +#if defined(HAS_RGB24TOYROW_MMI) && defined(HAS_RGB24TOUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + RGB24ToUVRow = RGB24ToUVRow_Any_MMI;
- + RGB24ToYRow = RGB24ToYRow_Any_MMI;
- + if (IS_ALIGNED(width, 8)) {
- + RGB24ToYRow = RGB24ToYRow_MMI;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToUVRow = RGB24ToUVRow_MMI;
- + }
- + }
- + }
- +#endif
- +#if defined(HAS_RGB24TOYROW_MSA) && defined(HAS_RGB24TOUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + RGB24ToUVRow = RGB24ToUVRow_Any_MSA;
- + RGB24ToYRow = RGB24ToYRow_Any_MSA;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToYRow = RGB24ToYRow_MSA;
- + RGB24ToUVRow = RGB24ToUVRow_MSA;
- + }
- + }
- +#endif
- +// Other platforms do intermediate conversion from RGB24 to ARGB.
- +#else
- +#if defined(HAS_RGB24TOARGBROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + RGB24ToARGBRow = RGB24ToARGBRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + RGB24ToARGBRow = RGB24ToARGBRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_SSSE3) && defined(HAS_ARGBTOUVROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
- + ARGBToYRow = ARGBToYRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + ARGBToUVRow = ARGBToUVRow_SSSE3;
- + ARGBToYRow = ARGBToYRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_AVX2) && defined(HAS_ARGBTOUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + ARGBToUVRow = ARGBToUVRow_Any_AVX2;
- + ARGBToYRow = ARGBToYRow_Any_AVX2;
- + if (IS_ALIGNED(width, 32)) {
- + ARGBToUVRow = ARGBToUVRow_AVX2;
- + ARGBToYRow = ARGBToYRow_AVX2;
- + }
- + }
- +#endif
- +#endif
- +#if defined(HAS_MERGEUVROW_SSE2)
- + if (TestCpuFlag(kCpuHasSSE2)) {
- + MergeUVRow_ = MergeUVRow_Any_SSE2;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_SSE2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + MergeUVRow_ = MergeUVRow_Any_AVX2;
- + if (IS_ALIGNED(halfwidth, 32)) {
- + MergeUVRow_ = MergeUVRow_AVX2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + MergeUVRow_ = MergeUVRow_Any_NEON;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_NEON;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + MergeUVRow_ = MergeUVRow_Any_MMI;
- + if (IS_ALIGNED(halfwidth, 8)) {
- + MergeUVRow_ = MergeUVRow_MMI;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + MergeUVRow_ = MergeUVRow_Any_MSA;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_MSA;
- + }
- + }
- +#endif
- +
- + {
- + // Allocate a rows of uv.
- + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2);
- + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31);
- +
- +#if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + // Allocate 2 rows of ARGB.
- + const int kRowSize = (width * 4 + 31) & ~31;
- + align_buffer_64(row, kRowSize * 2);
- +#endif
- +
- + for (y = 0; y < height - 1; y += 2) {
- +#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + RGB24ToUVRow(src_rgb24, src_stride_rgb24, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + RGB24ToYRow(src_rgb24, dst_y, width);
- + RGB24ToYRow(src_rgb24 + src_stride_rgb24, dst_y + dst_stride_y, width);
- +#else
- + RGB24ToARGBRow(src_rgb24, row, width);
- + RGB24ToARGBRow(src_rgb24 + src_stride_rgb24, row + kRowSize, width);
- + ARGBToUVRow(row, kRowSize, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- + ARGBToYRow(row + kRowSize, dst_y + dst_stride_y, width);
- +#endif
- + src_rgb24 += src_stride_rgb24 * 2;
- + dst_y += dst_stride_y * 2;
- + dst_vu += dst_stride_vu;
- + }
- + if (height & 1) {
- +#if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + RGB24ToUVRow(src_rgb24, 0, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + RGB24ToYRow(src_rgb24, dst_y, width);
- +#else
- + RGB24ToARGBRow(src_rgb24, row, width);
- + ARGBToUVRow(row, 0, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- +#endif
- + }
- +#if !(defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \
- + defined(HAS_RGB24TOYROW_MMI))
- + free_aligned_buffer_64(row);
- +#endif
- + free_aligned_buffer_64(row_u);
- + }
- + return 0;
- +}
- +
- // TODO(fbarchard): Use Matrix version to implement I420 and J420.
- // Convert RGB24 to J420.
- LIBYUV_API
- @@ -1779,6 +2216,406 @@
- }
- return 0;
- }
- +
- +// Convert RAW to NV12.
- +LIBYUV_API
- +int RAWToNV12(const uint8_t* src_raw,
- + int src_stride_raw,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_uv,
- + int dst_stride_uv,
- + int width,
- + int height) {
- + int y;
- + int halfwidth = (width + 1) >> 1;
- +#if (defined(HAS_RAWTOYROW_NEON) && defined(HAS_RAWTOUVROW_NEON)) || \
- + defined(HAS_RAWTOYROW_MSA) || defined(HAS_RAWTOYROW_MMI)
- + void (*RAWToUVRow)(const uint8_t* src_raw, int src_stride_raw, uint8_t* dst_u,
- + uint8_t* dst_v, int width) = RAWToUVRow_C;
- + void (*RAWToYRow)(const uint8_t* src_raw, uint8_t* dst_y, int width) =
- + RAWToYRow_C;
- +#else
- + void (*RAWToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
- + RAWToARGBRow_C;
- + void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
- + uint8_t* dst_u, uint8_t* dst_v, int width) =
- + ARGBToUVRow_C;
- + void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
- + ARGBToYRow_C;
- +#endif
- + void (*MergeUVRow_)(const uint8_t* src_u, const uint8_t* src_v,
- + uint8_t* dst_uv, int width) = MergeUVRow_C;
- + if (!src_raw || !dst_y || !dst_uv || width <= 0 || height == 0) {
- + return -1;
- + }
- + // Negative height means invert the image.
- + if (height < 0) {
- + height = -height;
- + src_raw = src_raw + (height - 1) * src_stride_raw;
- + src_stride_raw = -src_stride_raw;
- + }
- +
- +// Neon version does direct RAW to YUV.
- +#if defined(HAS_RAWTOYROW_NEON) && defined(HAS_RAWTOUVROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + RAWToUVRow = RAWToUVRow_Any_NEON;
- + RAWToYRow = RAWToYRow_Any_NEON;
- + if (IS_ALIGNED(width, 8)) {
- + RAWToYRow = RAWToYRow_NEON;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToUVRow = RAWToUVRow_NEON;
- + }
- + }
- + }
- +// MMI and MSA version does direct RAW to YUV.
- +#elif (defined(HAS_RAWTOYROW_MMI) || defined(HAS_RAWTOYROW_MSA))
- +#if defined(HAS_RAWTOYROW_MMI) && defined(HAS_RAWTOUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + RAWToUVRow = RAWToUVRow_Any_MMI;
- + RAWToYRow = RAWToYRow_Any_MMI;
- + if (IS_ALIGNED(width, 8)) {
- + RAWToYRow = RAWToYRow_MMI;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToUVRow = RAWToUVRow_MMI;
- + }
- + }
- + }
- +#endif
- +#if defined(HAS_RAWTOYROW_MSA) && defined(HAS_RAWTOUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + RAWToUVRow = RAWToUVRow_Any_MSA;
- + RAWToYRow = RAWToYRow_Any_MSA;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToYRow = RAWToYRow_MSA;
- + RAWToUVRow = RAWToUVRow_MSA;
- + }
- + }
- +#endif
- +// Other platforms do intermediate conversion from RAW to ARGB.
- +#else
- +#if defined(HAS_RAWTOARGBROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + RAWToARGBRow = RAWToARGBRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToARGBRow = RAWToARGBRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_SSSE3) && defined(HAS_ARGBTOUVROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
- + ARGBToYRow = ARGBToYRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + ARGBToUVRow = ARGBToUVRow_SSSE3;
- + ARGBToYRow = ARGBToYRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_AVX2) && defined(HAS_ARGBTOUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + ARGBToUVRow = ARGBToUVRow_Any_AVX2;
- + ARGBToYRow = ARGBToYRow_Any_AVX2;
- + if (IS_ALIGNED(width, 32)) {
- + ARGBToUVRow = ARGBToUVRow_AVX2;
- + ARGBToYRow = ARGBToYRow_AVX2;
- + }
- + }
- +#endif
- +#endif
- +#if defined(HAS_MERGEUVROW_SSE2)
- + if (TestCpuFlag(kCpuHasSSE2)) {
- + MergeUVRow_ = MergeUVRow_Any_SSE2;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_SSE2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + MergeUVRow_ = MergeUVRow_Any_AVX2;
- + if (IS_ALIGNED(halfwidth, 32)) {
- + MergeUVRow_ = MergeUVRow_AVX2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + MergeUVRow_ = MergeUVRow_Any_NEON;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_NEON;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + MergeUVRow_ = MergeUVRow_Any_MMI;
- + if (IS_ALIGNED(halfwidth, 8)) {
- + MergeUVRow_ = MergeUVRow_MMI;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + MergeUVRow_ = MergeUVRow_Any_MSA;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_MSA;
- + }
- + }
- +#endif
- +
- + {
- + // Allocate a rows of uv.
- + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2);
- + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31);
- +
- +#if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + // Allocate 2 rows of ARGB.
- + const int kRowSize = (width * 4 + 31) & ~31;
- + align_buffer_64(row, kRowSize * 2);
- +#endif
- +
- + for (y = 0; y < height - 1; y += 2) {
- +#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + RAWToUVRow(src_raw, src_stride_raw, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + RAWToYRow(src_raw, dst_y, width);
- + RAWToYRow(src_raw + src_stride_raw, dst_y + dst_stride_y, width);
- +#else
- + RAWToARGBRow(src_raw, row, width);
- + RAWToARGBRow(src_raw + src_stride_raw, row + kRowSize, width);
- + ARGBToUVRow(row, kRowSize, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- + ARGBToYRow(row + kRowSize, dst_y + dst_stride_y, width);
- +#endif
- + src_raw += src_stride_raw * 2;
- + dst_y += dst_stride_y * 2;
- + dst_uv += dst_stride_uv;
- + }
- + if (height & 1) {
- +#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + RAWToUVRow(src_raw, 0, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + RAWToYRow(src_raw, dst_y, width);
- +#else
- + RAWToARGBRow(src_raw, row, width);
- + ARGBToUVRow(row, 0, row_u, row_v, width);
- + MergeUVRow_(row_u, row_v, dst_uv, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- +#endif
- + }
- +#if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + free_aligned_buffer_64(row);
- +#endif
- + free_aligned_buffer_64(row_u);
- + }
- + return 0;
- +}
- +
- +// Convert RAW to NV21.
- +LIBYUV_API
- +int RAWToNV21(const uint8_t* src_raw,
- + int src_stride_raw,
- + uint8_t* dst_y,
- + int dst_stride_y,
- + uint8_t* dst_vu,
- + int dst_stride_vu,
- + int width,
- + int height) {
- + int y;
- + int halfwidth = (width + 1) >> 1;
- +#if (defined(HAS_RAWTOYROW_NEON) && defined(HAS_RAWTOUVROW_NEON)) || \
- + defined(HAS_RAWTOYROW_MSA) || defined(HAS_RAWTOYROW_MMI)
- + void (*RAWToUVRow)(const uint8_t* src_raw, int src_stride_raw, uint8_t* dst_u,
- + uint8_t* dst_v, int width) = RAWToUVRow_C;
- + void (*RAWToYRow)(const uint8_t* src_raw, uint8_t* dst_y, int width) =
- + RAWToYRow_C;
- +#else
- + void (*RAWToARGBRow)(const uint8_t* src_rgb, uint8_t* dst_argb, int width) =
- + RAWToARGBRow_C;
- + void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb,
- + uint8_t* dst_u, uint8_t* dst_v, int width) =
- + ARGBToUVRow_C;
- + void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) =
- + ARGBToYRow_C;
- +#endif
- + void (*MergeUVRow_)(const uint8_t* src_u, const uint8_t* src_v,
- + uint8_t* dst_uv, int width) = MergeUVRow_C;
- + if (!src_raw || !dst_y || !dst_vu || width <= 0 || height == 0) {
- + return -1;
- + }
- + // Negative height means invert the image.
- + if (height < 0) {
- + height = -height;
- + src_raw = src_raw + (height - 1) * src_stride_raw;
- + src_stride_raw = -src_stride_raw;
- + }
- +
- +// Neon version does direct RAW to YUV.
- +#if defined(HAS_RAWTOYROW_NEON) && defined(HAS_RAWTOUVROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + RAWToUVRow = RAWToUVRow_Any_NEON;
- + RAWToYRow = RAWToYRow_Any_NEON;
- + if (IS_ALIGNED(width, 8)) {
- + RAWToYRow = RAWToYRow_NEON;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToUVRow = RAWToUVRow_NEON;
- + }
- + }
- + }
- +// MMI and MSA version does direct RAW to YUV.
- +#elif (defined(HAS_RAWTOYROW_MMI) || defined(HAS_RAWTOYROW_MSA))
- +#if defined(HAS_RAWTOYROW_MMI) && defined(HAS_RAWTOUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + RAWToUVRow = RAWToUVRow_Any_MMI;
- + RAWToYRow = RAWToYRow_Any_MMI;
- + if (IS_ALIGNED(width, 8)) {
- + RAWToYRow = RAWToYRow_MMI;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToUVRow = RAWToUVRow_MMI;
- + }
- + }
- + }
- +#endif
- +#if defined(HAS_RAWTOYROW_MSA) && defined(HAS_RAWTOUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + RAWToUVRow = RAWToUVRow_Any_MSA;
- + RAWToYRow = RAWToYRow_Any_MSA;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToYRow = RAWToYRow_MSA;
- + RAWToUVRow = RAWToUVRow_MSA;
- + }
- + }
- +#endif
- +// Other platforms do intermediate conversion from RAW to ARGB.
- +#else
- +#if defined(HAS_RAWTOARGBROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + RAWToARGBRow = RAWToARGBRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + RAWToARGBRow = RAWToARGBRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_SSSE3) && defined(HAS_ARGBTOUVROW_SSSE3)
- + if (TestCpuFlag(kCpuHasSSSE3)) {
- + ARGBToUVRow = ARGBToUVRow_Any_SSSE3;
- + ARGBToYRow = ARGBToYRow_Any_SSSE3;
- + if (IS_ALIGNED(width, 16)) {
- + ARGBToUVRow = ARGBToUVRow_SSSE3;
- + ARGBToYRow = ARGBToYRow_SSSE3;
- + }
- + }
- +#endif
- +#if defined(HAS_ARGBTOYROW_AVX2) && defined(HAS_ARGBTOUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + ARGBToUVRow = ARGBToUVRow_Any_AVX2;
- + ARGBToYRow = ARGBToYRow_Any_AVX2;
- + if (IS_ALIGNED(width, 32)) {
- + ARGBToUVRow = ARGBToUVRow_AVX2;
- + ARGBToYRow = ARGBToYRow_AVX2;
- + }
- + }
- +#endif
- +#endif
- +#if defined(HAS_MERGEUVROW_SSE2)
- + if (TestCpuFlag(kCpuHasSSE2)) {
- + MergeUVRow_ = MergeUVRow_Any_SSE2;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_SSE2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_AVX2)
- + if (TestCpuFlag(kCpuHasAVX2)) {
- + MergeUVRow_ = MergeUVRow_Any_AVX2;
- + if (IS_ALIGNED(halfwidth, 32)) {
- + MergeUVRow_ = MergeUVRow_AVX2;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_NEON)
- + if (TestCpuFlag(kCpuHasNEON)) {
- + MergeUVRow_ = MergeUVRow_Any_NEON;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_NEON;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MMI)
- + if (TestCpuFlag(kCpuHasMMI)) {
- + MergeUVRow_ = MergeUVRow_Any_MMI;
- + if (IS_ALIGNED(halfwidth, 8)) {
- + MergeUVRow_ = MergeUVRow_MMI;
- + }
- + }
- +#endif
- +#if defined(HAS_MERGEUVROW_MSA)
- + if (TestCpuFlag(kCpuHasMSA)) {
- + MergeUVRow_ = MergeUVRow_Any_MSA;
- + if (IS_ALIGNED(halfwidth, 16)) {
- + MergeUVRow_ = MergeUVRow_MSA;
- + }
- + }
- +#endif
- +
- + {
- + // Allocate a rows of uv.
- + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2);
- + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31);
- +
- +#if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + // Allocate 2 rows of ARGB.
- + const int kRowSize = (width * 4 + 31) & ~31;
- + align_buffer_64(row, kRowSize * 2);
- +#endif
- +
- + for (y = 0; y < height - 1; y += 2) {
- +#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + RAWToUVRow(src_raw, src_stride_raw, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + RAWToYRow(src_raw, dst_y, width);
- + RAWToYRow(src_raw + src_stride_raw, dst_y + dst_stride_y, width);
- +#else
- + RAWToARGBRow(src_raw, row, width);
- + RAWToARGBRow(src_raw + src_stride_raw, row + kRowSize, width);
- + ARGBToUVRow(row, kRowSize, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- + ARGBToYRow(row + kRowSize, dst_y + dst_stride_y, width);
- +#endif
- + src_raw += src_stride_raw * 2;
- + dst_y += dst_stride_y * 2;
- + dst_vu += dst_stride_vu;
- + }
- + if (height & 1) {
- +#if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + RAWToUVRow(src_raw, 0, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + RAWToYRow(src_raw, dst_y, width);
- +#else
- + RAWToARGBRow(src_raw, row, width);
- + ARGBToUVRow(row, 0, row_u, row_v, width);
- + MergeUVRow_(row_v, row_u, dst_vu, halfwidth);
- + ARGBToYRow(row, dst_y, width);
- +#endif
- + }
- +#if !(defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \
- + defined(HAS_RAWTOYROW_MMI))
- + free_aligned_buffer_64(row);
- +#endif
- + free_aligned_buffer_64(row_u);
- + }
- + return 0;
- +}
- // Convert RGB565 to I420.
- LIBYUV_API
|