mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Fix tidy warning that uint32_t dither4 should not be const
- Remove const from uint32_t dither4 parameter to fix clang-tidy warning - Apply clang format - Bump version - Remove unused MMI source; superceded by MSA Bug: None Change-Id: Id49991db25bca4e99590b415312542d917471c62 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4581882 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
c0f64c14ca
commit
157b153b60
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 1870
|
Version: 1871
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -418,7 +418,6 @@ int I412ToI420(const uint16_t* src_y,
|
|||||||
int width,
|
int width,
|
||||||
int height);
|
int height);
|
||||||
|
|
||||||
|
|
||||||
#define I412ToI012 I410ToI010
|
#define I412ToI012 I410ToI010
|
||||||
#define H410ToH010 I410ToI010
|
#define H410ToH010 I410ToI010
|
||||||
#define H412ToH012 I410ToI010
|
#define H412ToH012 I410ToI010
|
||||||
|
|||||||
@ -3378,15 +3378,15 @@ void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width);
|
|||||||
|
|
||||||
void ARGBToRGB565DitherRow_C(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_C(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
void ARGBToRGB565DitherRow_SSE2(const uint8_t* src,
|
void ARGBToRGB565DitherRow_SSE2(const uint8_t* src,
|
||||||
uint8_t* dst,
|
uint8_t* dst,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
void ARGBToRGB565DitherRow_AVX2(const uint8_t* src,
|
void ARGBToRGB565DitherRow_AVX2(const uint8_t* src,
|
||||||
uint8_t* dst,
|
uint8_t* dst,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
|
|
||||||
void ARGBToRGB565Row_AVX2(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
void ARGBToRGB565Row_AVX2(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||||
@ -3414,7 +3414,7 @@ void ARGBToARGB4444Row_NEON(const uint8_t* src_argb,
|
|||||||
int width);
|
int width);
|
||||||
void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
void ARGBToRGB24Row_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
void ARGBToRGB24Row_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||||
void ARGBToRAWRow_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
void ARGBToRAWRow_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||||
@ -3427,15 +3427,15 @@ void ARGBToARGB4444Row_MSA(const uint8_t* src_argb,
|
|||||||
int width);
|
int width);
|
||||||
void ARGBToRGB565DitherRow_MSA(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_MSA(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width);
|
int width);
|
||||||
|
|
||||||
void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 1870
|
#define LIBYUV_VERSION 1871
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|||||||
@ -1,123 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by a BSD-style license
|
|
||||||
* that can be found in the LICENSE file in the root of the source
|
|
||||||
* tree. An additional intellectual property rights grant can be found
|
|
||||||
* in the file PATENTS. All contributing project authors may
|
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "libyuv/basic_types.h"
|
|
||||||
|
|
||||||
#include "libyuv/compare_row.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
namespace libyuv {
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This module is for Mips MMI.
|
|
||||||
#if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
|
|
||||||
|
|
||||||
// Hakmem method for hamming distance.
|
|
||||||
uint32_t HammingDistance_MMI(const uint8_t* src_a,
|
|
||||||
const uint8_t* src_b,
|
|
||||||
int count) {
|
|
||||||
uint32_t diff = 0u;
|
|
||||||
|
|
||||||
uint64_t temp = 0, temp1 = 0, ta = 0, tb = 0;
|
|
||||||
uint64_t c1 = 0x5555555555555555;
|
|
||||||
uint64_t c2 = 0x3333333333333333;
|
|
||||||
uint64_t c3 = 0x0f0f0f0f0f0f0f0f;
|
|
||||||
uint32_t c4 = 0x01010101;
|
|
||||||
uint64_t s1 = 1, s2 = 2, s3 = 4;
|
|
||||||
__asm__ volatile(
|
|
||||||
"1: \n\t"
|
|
||||||
"ldc1 %[ta], 0(%[src_a]) \n\t"
|
|
||||||
"ldc1 %[tb], 0(%[src_b]) \n\t"
|
|
||||||
"xor %[temp], %[ta], %[tb] \n\t"
|
|
||||||
"psrlw %[temp1], %[temp], %[s1] \n\t" // temp1=x>>1
|
|
||||||
"and %[temp1], %[temp1], %[c1] \n\t" // temp1&=c1
|
|
||||||
"psubw %[temp1], %[temp], %[temp1] \n\t" // x-temp1
|
|
||||||
"and %[temp], %[temp1], %[c2] \n\t" // t = (u&c2)
|
|
||||||
"psrlw %[temp1], %[temp1], %[s2] \n\t" // u>>2
|
|
||||||
"and %[temp1], %[temp1], %[c2] \n\t" // u>>2 & c2
|
|
||||||
"paddw %[temp1], %[temp1], %[temp] \n\t" // t1 = t1+t
|
|
||||||
"psrlw %[temp], %[temp1], %[s3] \n\t" // u>>4
|
|
||||||
"paddw %[temp1], %[temp1], %[temp] \n\t" // u+(u>>4)
|
|
||||||
"and %[temp1], %[temp1], %[c3] \n\t" //&c3
|
|
||||||
"dmfc1 $t0, %[temp1] \n\t"
|
|
||||||
"dsrl32 $t0, $t0, 0 \n\t "
|
|
||||||
"mul $t0, $t0, %[c4] \n\t"
|
|
||||||
"dsrl $t0, $t0, 24 \n\t"
|
|
||||||
"dadd %[diff], %[diff], $t0 \n\t"
|
|
||||||
"dmfc1 $t0, %[temp1] \n\t"
|
|
||||||
"mul $t0, $t0, %[c4] \n\t"
|
|
||||||
"dsrl $t0, $t0, 24 \n\t"
|
|
||||||
"dadd %[diff], %[diff], $t0 \n\t"
|
|
||||||
"daddiu %[src_a], %[src_a], 8 \n\t"
|
|
||||||
"daddiu %[src_b], %[src_b], 8 \n\t"
|
|
||||||
"addiu %[count], %[count], -8 \n\t"
|
|
||||||
"bgtz %[count], 1b \n\t"
|
|
||||||
"nop \n\t"
|
|
||||||
: [diff] "+r"(diff), [src_a] "+r"(src_a), [src_b] "+r"(src_b),
|
|
||||||
[count] "+r"(count), [ta] "+f"(ta), [tb] "+f"(tb), [temp] "+f"(temp),
|
|
||||||
[temp1] "+f"(temp1)
|
|
||||||
: [c1] "f"(c1), [c2] "f"(c2), [c3] "f"(c3), [c4] "r"(c4), [s1] "f"(s1),
|
|
||||||
[s2] "f"(s2), [s3] "f"(s3)
|
|
||||||
: "memory");
|
|
||||||
return diff;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t SumSquareError_MMI(const uint8_t* src_a,
|
|
||||||
const uint8_t* src_b,
|
|
||||||
int count) {
|
|
||||||
uint32_t sse = 0u;
|
|
||||||
uint32_t sse_hi = 0u, sse_lo = 0u;
|
|
||||||
|
|
||||||
uint64_t src1, src2;
|
|
||||||
uint64_t diff, diff_hi, diff_lo;
|
|
||||||
uint64_t sse_sum, sse_tmp;
|
|
||||||
|
|
||||||
const uint64_t mask = 0x0ULL;
|
|
||||||
|
|
||||||
__asm__ volatile(
|
|
||||||
"xor %[sse_sum], %[sse_sum], %[sse_sum] \n\t"
|
|
||||||
|
|
||||||
"1: \n\t"
|
|
||||||
"ldc1 %[src1], 0x00(%[src_a]) \n\t"
|
|
||||||
"ldc1 %[src2], 0x00(%[src_b]) \n\t"
|
|
||||||
"pasubub %[diff], %[src1], %[src2] \n\t"
|
|
||||||
"punpcklbh %[diff_lo], %[diff], %[mask] \n\t"
|
|
||||||
"punpckhbh %[diff_hi], %[diff], %[mask] \n\t"
|
|
||||||
"pmaddhw %[sse_tmp], %[diff_lo], %[diff_lo] \n\t"
|
|
||||||
"paddw %[sse_sum], %[sse_sum], %[sse_tmp] \n\t"
|
|
||||||
"pmaddhw %[sse_tmp], %[diff_hi], %[diff_hi] \n\t"
|
|
||||||
"paddw %[sse_sum], %[sse_sum], %[sse_tmp] \n\t"
|
|
||||||
|
|
||||||
"daddiu %[src_a], %[src_a], 0x08 \n\t"
|
|
||||||
"daddiu %[src_b], %[src_b], 0x08 \n\t"
|
|
||||||
"daddiu %[count], %[count], -0x08 \n\t"
|
|
||||||
"bnez %[count], 1b \n\t"
|
|
||||||
|
|
||||||
"mfc1 %[sse_lo], %[sse_sum] \n\t"
|
|
||||||
"mfhc1 %[sse_hi], %[sse_sum] \n\t"
|
|
||||||
"daddu %[sse], %[sse_hi], %[sse_lo] \n\t"
|
|
||||||
: [sse] "+&r"(sse), [diff] "=&f"(diff), [src1] "=&f"(src1),
|
|
||||||
[src2] "=&f"(src2), [diff_lo] "=&f"(diff_lo), [diff_hi] "=&f"(diff_hi),
|
|
||||||
[sse_sum] "=&f"(sse_sum), [sse_tmp] "=&f"(sse_tmp),
|
|
||||||
[sse_hi] "+&r"(sse_hi), [sse_lo] "+&r"(sse_lo)
|
|
||||||
: [src_a] "r"(src_a), [src_b] "r"(src_b), [count] "r"(count),
|
|
||||||
[mask] "f"(mask)
|
|
||||||
: "memory");
|
|
||||||
|
|
||||||
return sse;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} // extern "C"
|
|
||||||
} // namespace libyuv
|
|
||||||
#endif
|
|
||||||
@ -2010,7 +2010,8 @@ int ARGBToI420Alpha(const uint8_t* src_argb,
|
|||||||
ARGBToYRow_C;
|
ARGBToYRow_C;
|
||||||
void (*ARGBExtractAlphaRow)(const uint8_t* src_argb, uint8_t* dst_a,
|
void (*ARGBExtractAlphaRow)(const uint8_t* src_argb, uint8_t* dst_a,
|
||||||
int width) = ARGBExtractAlphaRow_C;
|
int width) = ARGBExtractAlphaRow_C;
|
||||||
if (!src_argb || !dst_y || !dst_u || !dst_v || !dst_a || width <= 0 || height == 0) {
|
if (!src_argb || !dst_y || !dst_u || !dst_v || !dst_a || width <= 0 ||
|
||||||
|
height == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Negative height means invert the image.
|
// Negative height means invert the image.
|
||||||
@ -2133,7 +2134,8 @@ int ARGBToI420Alpha(const uint8_t* src_argb,
|
|||||||
ARGBToYRow(src_argb, dst_y, width);
|
ARGBToYRow(src_argb, dst_y, width);
|
||||||
ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width);
|
ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width);
|
||||||
ARGBExtractAlphaRow(src_argb, dst_a, width);
|
ARGBExtractAlphaRow(src_argb, dst_a, width);
|
||||||
ARGBExtractAlphaRow(src_argb + src_stride_argb, dst_a + dst_stride_a, width);
|
ARGBExtractAlphaRow(src_argb + src_stride_argb, dst_a + dst_stride_a,
|
||||||
|
width);
|
||||||
src_argb += src_stride_argb * 2;
|
src_argb += src_stride_argb * 2;
|
||||||
dst_y += dst_stride_y * 2;
|
dst_y += dst_stride_y * 2;
|
||||||
dst_u += dst_stride_u;
|
dst_u += dst_stride_u;
|
||||||
|
|||||||
@ -5645,7 +5645,7 @@ int I420ToRGB565Dither(const uint8_t* src_y,
|
|||||||
const struct YuvConstants* yuvconstants, int width) =
|
const struct YuvConstants* yuvconstants, int width) =
|
||||||
I422ToARGBRow_C;
|
I422ToARGBRow_C;
|
||||||
void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb,
|
void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb,
|
||||||
const uint32_t dither4, int width) =
|
uint32_t dither4, int width) =
|
||||||
ARGBToRGB565DitherRow_C;
|
ARGBToRGB565DitherRow_C;
|
||||||
if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) {
|
if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -1741,7 +1741,7 @@ int ARGBToRGB565Dither(const uint8_t* src_argb,
|
|||||||
int height) {
|
int height) {
|
||||||
int y;
|
int y;
|
||||||
void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb,
|
void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb,
|
||||||
const uint32_t dither4, int width) =
|
uint32_t dither4, int width) =
|
||||||
ARGBToRGB565DitherRow_C;
|
ARGBToRGB565DitherRow_C;
|
||||||
if (!src_argb || !dst_rgb565 || width <= 0 || height == 0) {
|
if (!src_argb || !dst_rgb565 || width <= 0 || height == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -1,291 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 The LibYuv Project Authors. All rights reserved.
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by a BSD-style license
|
|
||||||
* that can be found in the LICENSE file in the root of the source
|
|
||||||
* tree. An additional intellectual property rights grant can be found
|
|
||||||
* in the file PATENTS. All contributing project authors may
|
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "libyuv/rotate_row.h"
|
|
||||||
#include "libyuv/row.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
namespace libyuv {
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This module is for Mips MMI.
|
|
||||||
#if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
|
|
||||||
|
|
||||||
void TransposeWx8_MMI(const uint8_t* src,
|
|
||||||
int src_stride,
|
|
||||||
uint8_t* dst,
|
|
||||||
int dst_stride,
|
|
||||||
int width) {
|
|
||||||
uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
|
|
||||||
uint64_t tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13;
|
|
||||||
uint8_t* src_tmp = nullptr;
|
|
||||||
|
|
||||||
__asm__ volatile(
|
|
||||||
"1: \n\t"
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src]) \n\t"
|
|
||||||
"dadd %[src_tmp], %[src], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (00 10 01 11 02 12 03 13) */
|
|
||||||
"punpcklbh %[tmp0], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp1 = (04 14 05 15 06 16 07 17) */
|
|
||||||
"punpckhbh %[tmp1], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src_tmp]) \n\t"
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp2 = (20 30 21 31 22 32 23 33) */
|
|
||||||
"punpcklbh %[tmp2], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp3 = (24 34 25 35 26 36 27 37) */
|
|
||||||
"punpckhbh %[tmp3], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
/* tmp4 = (00 10 20 30 01 11 21 31) */
|
|
||||||
"punpcklhw %[tmp4], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp5 = (02 12 22 32 03 13 23 33) */
|
|
||||||
"punpckhhw %[tmp5], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp6 = (04 14 24 34 05 15 25 35) */
|
|
||||||
"punpcklhw %[tmp6], %[tmp1], %[tmp3] \n\t"
|
|
||||||
/* tmp7 = (06 16 26 36 07 17 27 37) */
|
|
||||||
"punpckhhw %[tmp7], %[tmp1], %[tmp3] \n\t"
|
|
||||||
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src_tmp]) \n\t"
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (40 50 41 51 42 52 43 53) */
|
|
||||||
"punpcklbh %[tmp0], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp1 = (44 54 45 55 46 56 47 57) */
|
|
||||||
"punpckhbh %[tmp1], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src_tmp]) \n\t"
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp2 = (60 70 61 71 62 72 63 73) */
|
|
||||||
"punpcklbh %[tmp2], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp3 = (64 74 65 75 66 76 67 77) */
|
|
||||||
"punpckhbh %[tmp3], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
/* tmp8 = (40 50 60 70 41 51 61 71) */
|
|
||||||
"punpcklhw %[tmp8], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp9 = (42 52 62 72 43 53 63 73) */
|
|
||||||
"punpckhhw %[tmp9], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp10 = (44 54 64 74 45 55 65 75) */
|
|
||||||
"punpcklhw %[tmp10], %[tmp1], %[tmp3] \n\t"
|
|
||||||
/* tmp11 = (46 56 66 76 47 57 67 77) */
|
|
||||||
"punpckhhw %[tmp11], %[tmp1], %[tmp3] \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (00 10 20 30 40 50 60 70) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp4], %[tmp8] \n\t"
|
|
||||||
/* tmp1 = (01 11 21 31 41 51 61 71) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp4], %[tmp8] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst]) \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (02 12 22 32 42 52 62 72) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp5], %[tmp9] \n\t"
|
|
||||||
/* tmp1 = (03 13 23 33 43 53 63 73) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp5], %[tmp9] \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst]) \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (04 14 24 34 44 54 64 74) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp6], %[tmp10] \n\t"
|
|
||||||
/* tmp1 = (05 15 25 35 45 55 65 75) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp6], %[tmp10] \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst]) \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (06 16 26 36 46 56 66 76) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp7], %[tmp11] \n\t"
|
|
||||||
/* tmp1 = (07 17 27 37 47 57 67 77) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp7], %[tmp11] \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst]) \n\t"
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst]) \n\t"
|
|
||||||
|
|
||||||
"dadd %[dst], %[dst], %[dst_stride] \n\t"
|
|
||||||
"daddi %[src], %[src], 0x08 \n\t"
|
|
||||||
"daddi %[width], %[width], -0x08 \n\t"
|
|
||||||
"bnez %[width], 1b \n\t"
|
|
||||||
|
|
||||||
: [tmp0] "=&f"(tmp0), [tmp1] "=&f"(tmp1), [tmp2] "=&f"(tmp2),
|
|
||||||
[tmp3] "=&f"(tmp3), [tmp4] "=&f"(tmp4), [tmp5] "=&f"(tmp5),
|
|
||||||
[tmp6] "=&f"(tmp6), [tmp7] "=&f"(tmp7), [tmp8] "=&f"(tmp8),
|
|
||||||
[tmp9] "=&f"(tmp9), [tmp10] "=&f"(tmp10), [tmp11] "=&f"(tmp11),
|
|
||||||
[tmp12] "=&f"(tmp12), [tmp13] "=&f"(tmp13), [dst] "+&r"(dst),
|
|
||||||
[src_tmp] "+&r"(src_tmp)
|
|
||||||
: [src] "r"(src), [width] "r"(width), [src_stride] "r"(src_stride),
|
|
||||||
[dst_stride] "r"(dst_stride)
|
|
||||||
: "memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransposeUVWx8_MMI(const uint8_t* src,
|
|
||||||
int src_stride,
|
|
||||||
uint8_t* dst_a,
|
|
||||||
int dst_stride_a,
|
|
||||||
uint8_t* dst_b,
|
|
||||||
int dst_stride_b,
|
|
||||||
int width) {
|
|
||||||
uint64_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
|
|
||||||
uint64_t tmp7, tmp8, tmp9, tmp10, tmp11, tmp12, tmp13;
|
|
||||||
uint8_t* src_tmp = nullptr;
|
|
||||||
|
|
||||||
__asm__ volatile(
|
|
||||||
"1: \n\t"
|
|
||||||
/* tmp12 = (u00 v00 u01 v01 u02 v02 u03 v03) */
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src]) \n\t"
|
|
||||||
"dadd %[src_tmp], %[src], %[src_stride] \n\t"
|
|
||||||
/* tmp13 = (u10 v10 u11 v11 u12 v12 u13 v13) */
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (u00 u10 v00 v10 u01 u11 v01 v11) */
|
|
||||||
"punpcklbh %[tmp0], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp1 = (u02 u12 v02 v12 u03 u13 v03 v13) */
|
|
||||||
"punpckhbh %[tmp1], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
/* tmp12 = (u20 v20 u21 v21 u22 v22 u23 v23) */
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src_tmp]) \n\t"
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
/* tmp13 = (u30 v30 u31 v31 u32 v32 u33 v33) */
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp2 = (u20 u30 v20 v30 u21 u31 v21 v31) */
|
|
||||||
"punpcklbh %[tmp2], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp3 = (u22 u32 v22 v32 u23 u33 v23 v33) */
|
|
||||||
"punpckhbh %[tmp3], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
/* tmp4 = (u00 u10 u20 u30 v00 v10 v20 v30) */
|
|
||||||
"punpcklhw %[tmp4], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp5 = (u01 u11 u21 u31 v01 v11 v21 v31) */
|
|
||||||
"punpckhhw %[tmp5], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp6 = (u02 u12 u22 u32 v02 v12 v22 v32) */
|
|
||||||
"punpcklhw %[tmp6], %[tmp1], %[tmp3] \n\t"
|
|
||||||
/* tmp7 = (u03 u13 u23 u33 v03 v13 v23 v33) */
|
|
||||||
"punpckhhw %[tmp7], %[tmp1], %[tmp3] \n\t"
|
|
||||||
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
/* tmp12 = (u40 v40 u41 v41 u42 v42 u43 v43) */
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src_tmp]) \n\t"
|
|
||||||
/* tmp13 = (u50 v50 u51 v51 u52 v52 u53 v53) */
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (u40 u50 v40 v50 u41 u51 v41 v51) */
|
|
||||||
"punpcklbh %[tmp0], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp1 = (u42 u52 v42 v52 u43 u53 v43 v53) */
|
|
||||||
"punpckhbh %[tmp1], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
/* tmp12 = (u60 v60 u61 v61 u62 v62 u63 v63) */
|
|
||||||
"ldc1 %[tmp12], 0x00(%[src_tmp]) \n\t"
|
|
||||||
/* tmp13 = (u70 v70 u71 v71 u72 v72 u73 v73) */
|
|
||||||
"dadd %[src_tmp], %[src_tmp], %[src_stride] \n\t"
|
|
||||||
"ldc1 %[tmp13], 0x00(%[src_tmp]) \n\t"
|
|
||||||
|
|
||||||
/* tmp2 = (u60 u70 v60 v70 u61 u71 v61 v71) */
|
|
||||||
"punpcklbh %[tmp2], %[tmp12], %[tmp13] \n\t"
|
|
||||||
/* tmp3 = (u62 u72 v62 v72 u63 u73 v63 v73) */
|
|
||||||
"punpckhbh %[tmp3], %[tmp12], %[tmp13] \n\t"
|
|
||||||
|
|
||||||
/* tmp8 = (u40 u50 u60 u70 v40 v50 v60 v70) */
|
|
||||||
"punpcklhw %[tmp8], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp9 = (u41 u51 u61 u71 v41 v51 v61 v71) */
|
|
||||||
"punpckhhw %[tmp9], %[tmp0], %[tmp2] \n\t"
|
|
||||||
/* tmp10 = (u42 u52 u62 u72 v42 v52 v62 v72) */
|
|
||||||
"punpcklhw %[tmp10], %[tmp1], %[tmp3] \n\t"
|
|
||||||
/* tmp11 = (u43 u53 u63 u73 v43 v53 v63 v73) */
|
|
||||||
"punpckhhw %[tmp11], %[tmp1], %[tmp3] \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (u00 u10 u20 u30 u40 u50 u60 u70) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp4], %[tmp8] \n\t"
|
|
||||||
/* tmp1 = (v00 v10 v20 v30 v40 v50 v60 v70) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp4], %[tmp8] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst_a]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst_a]) \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst_b]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst_b]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (u01 u11 u21 u31 u41 u51 u61 u71) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp5], %[tmp9] \n\t"
|
|
||||||
/* tmp1 = (v01 v11 v21 v31 v41 v51 v61 v71) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp5], %[tmp9] \n\t"
|
|
||||||
"dadd %[dst_a], %[dst_a], %[dst_stride_a] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst_a]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst_a]) \n\t"
|
|
||||||
"dadd %[dst_b], %[dst_b], %[dst_stride_b] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst_b]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst_b]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (u02 u12 u22 u32 u42 u52 u62 u72) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp6], %[tmp10] \n\t"
|
|
||||||
/* tmp1 = (v02 v12 v22 v32 v42 v52 v62 v72) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp6], %[tmp10] \n\t"
|
|
||||||
"dadd %[dst_a], %[dst_a], %[dst_stride_a] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst_a]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst_a]) \n\t"
|
|
||||||
"dadd %[dst_b], %[dst_b], %[dst_stride_b] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst_b]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst_b]) \n\t"
|
|
||||||
|
|
||||||
/* tmp0 = (u03 u13 u23 u33 u43 u53 u63 u73) */
|
|
||||||
"punpcklwd %[tmp0], %[tmp7], %[tmp11] \n\t"
|
|
||||||
/* tmp1 = (v03 v13 v23 v33 v43 v53 v63 v73) */
|
|
||||||
"punpckhwd %[tmp1], %[tmp7], %[tmp11] \n\t"
|
|
||||||
"dadd %[dst_a], %[dst_a], %[dst_stride_a] \n\t"
|
|
||||||
"gssdlc1 %[tmp0], 0x07(%[dst_a]) \n\t"
|
|
||||||
"gssdrc1 %[tmp0], 0x00(%[dst_a]) \n\t"
|
|
||||||
"dadd %[dst_b], %[dst_b], %[dst_stride_b] \n\t"
|
|
||||||
"gssdlc1 %[tmp1], 0x07(%[dst_b]) \n\t"
|
|
||||||
"gssdrc1 %[tmp1], 0x00(%[dst_b]) \n\t"
|
|
||||||
|
|
||||||
"dadd %[dst_a], %[dst_a], %[dst_stride_a] \n\t"
|
|
||||||
"dadd %[dst_b], %[dst_b], %[dst_stride_b] \n\t"
|
|
||||||
"daddiu %[src], %[src], 0x08 \n\t"
|
|
||||||
"daddi %[width], %[width], -0x04 \n\t"
|
|
||||||
"bnez %[width], 1b \n\t"
|
|
||||||
|
|
||||||
: [tmp0] "=&f"(tmp0), [tmp1] "=&f"(tmp1), [tmp2] "=&f"(tmp2),
|
|
||||||
[tmp3] "=&f"(tmp3), [tmp4] "=&f"(tmp4), [tmp5] "=&f"(tmp5),
|
|
||||||
[tmp6] "=&f"(tmp6), [tmp7] "=&f"(tmp7), [tmp8] "=&f"(tmp8),
|
|
||||||
[tmp9] "=&f"(tmp9), [tmp10] "=&f"(tmp10), [tmp11] "=&f"(tmp11),
|
|
||||||
[tmp12] "=&f"(tmp12), [tmp13] "=&f"(tmp13), [dst_a] "+&r"(dst_a),
|
|
||||||
[dst_b] "+&r"(dst_b), [src_tmp] "+&r"(src_tmp)
|
|
||||||
: [src] "r"(src), [width] "r"(width), [dst_stride_a] "r"(dst_stride_a),
|
|
||||||
[dst_stride_b] "r"(dst_stride_b), [src_stride] "r"(src_stride)
|
|
||||||
: "memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} // extern "C"
|
|
||||||
} // namespace libyuv
|
|
||||||
#endif
|
|
||||||
@ -342,7 +342,7 @@ void ARGBToRGB565Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
|||||||
// or the upper byte for big endian.
|
// or the upper byte for big endian.
|
||||||
void ARGBToRGB565DitherRow_C(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_C(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x < width - 1; x += 2) {
|
for (x = 0; x < width - 1; x += 2) {
|
||||||
|
|||||||
@ -738,7 +738,7 @@ void ARGBToRGB565Row_SSE2(const uint8_t* src, uint8_t* dst, int width) {
|
|||||||
|
|
||||||
void ARGBToRGB565DitherRow_SSE2(const uint8_t* src,
|
void ARGBToRGB565DitherRow_SSE2(const uint8_t* src,
|
||||||
uint8_t* dst,
|
uint8_t* dst,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"movd %3,%%xmm6 \n"
|
"movd %3,%%xmm6 \n"
|
||||||
@ -786,7 +786,7 @@ void ARGBToRGB565DitherRow_SSE2(const uint8_t* src,
|
|||||||
#ifdef HAS_ARGBTORGB565DITHERROW_AVX2
|
#ifdef HAS_ARGBTORGB565DITHERROW_AVX2
|
||||||
void ARGBToRGB565DitherRow_AVX2(const uint8_t* src,
|
void ARGBToRGB565DitherRow_AVX2(const uint8_t* src,
|
||||||
uint8_t* dst,
|
uint8_t* dst,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vbroadcastss %3,%%xmm6 \n"
|
"vbroadcastss %3,%%xmm6 \n"
|
||||||
|
|||||||
@ -1182,7 +1182,7 @@ void ARGBAttenuateRow_LASX(const uint8_t* src_argb,
|
|||||||
|
|
||||||
void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
int x;
|
int x;
|
||||||
int len = width / 16;
|
int len = width / 16;
|
||||||
|
|||||||
@ -794,10 +794,10 @@ void ARGBToUVRow_LSX(const uint8_t* src_argb0,
|
|||||||
__m128i const_0x12 = {0x0009000900090009, 0x0009000900090009};
|
__m128i const_0x12 = {0x0009000900090009, 0x0009000900090009};
|
||||||
__m128i const_0x8080 = {0x8080808080808080, 0x8080808080808080};
|
__m128i const_0x8080 = {0x8080808080808080, 0x8080808080808080};
|
||||||
for (x = 0; x < len; x++) {
|
for (x = 0; x < len; x++) {
|
||||||
DUP4_ARG2(__lsx_vld, src_argb0, 0, src_argb0, 16, src_argb0, 32,
|
DUP4_ARG2(__lsx_vld, src_argb0, 0, src_argb0, 16, src_argb0, 32, src_argb0,
|
||||||
src_argb0, 48, src0, src1, src2, src3);
|
48, src0, src1, src2, src3);
|
||||||
DUP4_ARG2(__lsx_vld, src_argb1, 0, src_argb1, 16, src_argb1, 32,
|
DUP4_ARG2(__lsx_vld, src_argb1, 0, src_argb1, 16, src_argb1, 32, src_argb1,
|
||||||
src_argb1, 48, src4, src5, src6, src7);
|
48, src4, src5, src6, src7);
|
||||||
vec0 = __lsx_vaddwev_h_bu(src0, src4);
|
vec0 = __lsx_vaddwev_h_bu(src0, src4);
|
||||||
vec1 = __lsx_vaddwev_h_bu(src1, src5);
|
vec1 = __lsx_vaddwev_h_bu(src1, src5);
|
||||||
vec2 = __lsx_vaddwev_h_bu(src2, src6);
|
vec2 = __lsx_vaddwev_h_bu(src2, src6);
|
||||||
@ -846,8 +846,8 @@ void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
|||||||
__m128i tmp0, tmp1, tmp2, tmp3;
|
__m128i tmp0, tmp1, tmp2, tmp3;
|
||||||
__m128i shuf = {0x0908060504020100, 0x000000000E0D0C0A};
|
__m128i shuf = {0x0908060504020100, 0x000000000E0D0C0A};
|
||||||
for (x = 0; x < len; x++) {
|
for (x = 0; x < len; x++) {
|
||||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb,
|
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48,
|
||||||
48, src0, src1, src2, src3);
|
src0, src1, src2, src3);
|
||||||
tmp0 = __lsx_vshuf_b(src0, src0, shuf);
|
tmp0 = __lsx_vshuf_b(src0, src0, shuf);
|
||||||
tmp1 = __lsx_vshuf_b(src1, src1, shuf);
|
tmp1 = __lsx_vshuf_b(src1, src1, shuf);
|
||||||
tmp2 = __lsx_vshuf_b(src2, src2, shuf);
|
tmp2 = __lsx_vshuf_b(src2, src2, shuf);
|
||||||
@ -879,8 +879,8 @@ void ARGBToRAWRow_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
|||||||
__m128i tmp0, tmp1, tmp2, tmp3;
|
__m128i tmp0, tmp1, tmp2, tmp3;
|
||||||
__m128i shuf = {0x090A040506000102, 0x000000000C0D0E08};
|
__m128i shuf = {0x090A040506000102, 0x000000000C0D0E08};
|
||||||
for (x = 0; x < len; x++) {
|
for (x = 0; x < len; x++) {
|
||||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb,
|
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48,
|
||||||
48, src0, src1, src2, src3);
|
src0, src1, src2, src3);
|
||||||
tmp0 = __lsx_vshuf_b(src0, src0, shuf);
|
tmp0 = __lsx_vshuf_b(src0, src0, shuf);
|
||||||
tmp1 = __lsx_vshuf_b(src1, src1, shuf);
|
tmp1 = __lsx_vshuf_b(src1, src1, shuf);
|
||||||
tmp2 = __lsx_vshuf_b(src2, src2, shuf);
|
tmp2 = __lsx_vshuf_b(src2, src2, shuf);
|
||||||
@ -905,9 +905,7 @@ void ARGBToRAWRow_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
|||||||
__lsx_vst(tmp3, dst_rgb, 0);
|
__lsx_vst(tmp3, dst_rgb, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARGBToRGB565Row_LSX(const uint8_t* src_argb,
|
void ARGBToRGB565Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||||
uint8_t* dst_rgb,
|
|
||||||
int width) {
|
|
||||||
int x;
|
int x;
|
||||||
int len = width / 8;
|
int len = width / 8;
|
||||||
__m128i zero = __lsx_vldi(0);
|
__m128i zero = __lsx_vldi(0);
|
||||||
@ -995,8 +993,8 @@ void ARGBToUV444Row_LSX(const uint8_t* src_argb,
|
|||||||
__m128i const_18 = __lsx_vldi(18);
|
__m128i const_18 = __lsx_vldi(18);
|
||||||
__m128i const_0x8080 = {0x8080808080808080, 0x8080808080808080};
|
__m128i const_0x8080 = {0x8080808080808080, 0x8080808080808080};
|
||||||
for (x = 0; x < len; x++) {
|
for (x = 0; x < len; x++) {
|
||||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb,
|
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48,
|
||||||
48, src0, src1, src2, src3);
|
src0, src1, src2, src3);
|
||||||
tmp0 = __lsx_vpickev_h(src1, src0);
|
tmp0 = __lsx_vpickev_h(src1, src0);
|
||||||
tmp1 = __lsx_vpickod_h(src1, src0);
|
tmp1 = __lsx_vpickod_h(src1, src0);
|
||||||
tmp2 = __lsx_vpickev_h(src3, src2);
|
tmp2 = __lsx_vpickev_h(src3, src2);
|
||||||
@ -1138,7 +1136,7 @@ void ARGBAttenuateRow_LSX(const uint8_t* src_argb,
|
|||||||
|
|
||||||
void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
int x;
|
int x;
|
||||||
int len = width / 8;
|
int len = width / 8;
|
||||||
|
|||||||
7842
source/row_mmi.cc
7842
source/row_mmi.cc
File diff suppressed because it is too large
Load Diff
@ -1753,7 +1753,7 @@ void ARGBToRGB565Row_NEON(const uint8_t* src_argb,
|
|||||||
|
|
||||||
void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"vdup.32 d7, %2 \n" // dither4
|
"vdup.32 d7, %2 \n" // dither4
|
||||||
|
|||||||
@ -1979,7 +1979,7 @@ void ARGBToRGB565Row_NEON(const uint8_t* src_argb,
|
|||||||
|
|
||||||
void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb,
|
void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"dup v1.4s, %w3 \n" // dither4
|
"dup v1.4s, %w3 \n" // dither4
|
||||||
|
|||||||
@ -895,7 +895,7 @@ __declspec(naked) void ARGBToRGB565Row_SSE2(const uint8_t* src_argb,
|
|||||||
|
|
||||||
__declspec(naked) void ARGBToRGB565DitherRow_SSE2(const uint8_t* src_argb,
|
__declspec(naked) void ARGBToRGB565DitherRow_SSE2(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
__asm {
|
__asm {
|
||||||
|
|
||||||
@ -942,7 +942,7 @@ __declspec(naked) void ARGBToRGB565DitherRow_SSE2(const uint8_t* src_argb,
|
|||||||
#ifdef HAS_ARGBTORGB565DITHERROW_AVX2
|
#ifdef HAS_ARGBTORGB565DITHERROW_AVX2
|
||||||
__declspec(naked) void ARGBToRGB565DitherRow_AVX2(const uint8_t* src_argb,
|
__declspec(naked) void ARGBToRGB565DitherRow_AVX2(const uint8_t* src_argb,
|
||||||
uint8_t* dst_rgb,
|
uint8_t* dst_rgb,
|
||||||
const uint32_t dither4,
|
uint32_t dither4,
|
||||||
int width) {
|
int width) {
|
||||||
__asm {
|
__asm {
|
||||||
mov eax, [esp + 4] // src_argb
|
mov eax, [esp + 4] // src_argb
|
||||||
|
|||||||
1168
source/scale_mmi.cc
1168
source/scale_mmi.cc
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user