Issue #2101 - Part 2: Use stdint.h types instead of uint8 and friends

Required for upcoming libyuv update
This commit is contained in:
u3shit 2023-02-24 21:28:16 +01:00 committed by roytam1
commit 42f3296899
19 changed files with 431 additions and 451 deletions

View file

@ -14,11 +14,11 @@ extern "C" {
// We don't need CPUID guards here, since x86-64 implies SSE2.
// AMD64 ABI uses register paremters.
void FastConvertYUVToRGB32Row(const uint8* y_buf, // rdi
const uint8* u_buf, // rsi
const uint8* v_buf, // rdx
uint8* rgb_buf, // rcx
int width) { // r8
void FastConvertYUVToRGB32Row(const uint8_t* y_buf, // rdi
const uint8_t* u_buf, // rsi
const uint8_t* v_buf, // rdx
uint8_t* rgb_buf, // rcx
int width) { // r8
asm(
"jmp 1f\n"
"0:"
@ -72,12 +72,12 @@ void FastConvertYUVToRGB32Row(const uint8* y_buf, // rdi
);
}
void ScaleYUVToRGB32Row(const uint8* y_buf, // rdi
const uint8* u_buf, // rsi
const uint8* v_buf, // rdx
uint8* rgb_buf, // rcx
int width, // r8
int source_dx) { // r9
void ScaleYUVToRGB32Row(const uint8_t* y_buf, // rdi
const uint8_t* u_buf, // rsi
const uint8_t* v_buf, // rdx
uint8_t* rgb_buf, // rcx
int width, // r8
int source_dx) { // r9
asm(
"xor %%r11,%%r11\n"
"sub $0x2,%4\n"
@ -141,10 +141,10 @@ void ScaleYUVToRGB32Row(const uint8* y_buf, // rdi
);
}
void LinearScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void LinearScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx) {
asm(
@ -262,10 +262,10 @@ void LinearScaleYUVToRGB32Row(const uint8* y_buf,
// PIC version is slower because less registers are available, so
// non-PIC is used on platforms where it is possible.
void FastConvertYUVToRGB32Row_SSE(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void FastConvertYUVToRGB32Row_SSE(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width);
asm(
".text\n"
@ -324,10 +324,10 @@ void FastConvertYUVToRGB32Row_SSE(const uint8* y_buf,
#endif
);
void FastConvertYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void FastConvertYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width)
{
if (mozilla::supports_sse()) {
@ -339,10 +339,10 @@ void FastConvertYUVToRGB32Row(const uint8* y_buf,
}
void ScaleYUVToRGB32Row_SSE(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void ScaleYUVToRGB32Row_SSE(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx);
asm(
@ -417,10 +417,10 @@ void ScaleYUVToRGB32Row_SSE(const uint8* y_buf,
#endif
);
void ScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void ScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx)
{
@ -434,10 +434,10 @@ void ScaleYUVToRGB32Row(const uint8* y_buf,
width, source_dx);
}
void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void LinearScaleYUVToRGB32Row_SSE(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx);
asm(
@ -549,10 +549,10 @@ void LinearScaleYUVToRGB32Row_SSE(const uint8* y_buf,
#endif
);
void LinearScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void LinearScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx)
{
@ -568,12 +568,12 @@ void LinearScaleYUVToRGB32Row(const uint8* y_buf,
#elif defined(MOZILLA_MAY_SUPPORT_SSE) && defined(ARCH_CPU_X86_32) && defined(__PIC__)
void PICConvertYUVToRGB32Row_SSE(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void PICConvertYUVToRGB32Row_SSE(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
const int16 *kCoefficientsRgbY);
const int16_t *kCoefficientsRgbY);
asm(
".text\n"
@ -635,10 +635,10 @@ void PICConvertYUVToRGB32Row_SSE(const uint8* y_buf,
#endif
);
void FastConvertYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void FastConvertYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width)
{
if (mozilla::supports_sse()) {
@ -650,13 +650,13 @@ void FastConvertYUVToRGB32Row(const uint8* y_buf,
FastConvertYUVToRGB32Row_C(y_buf, u_buf, v_buf, rgb_buf, width, 1);
}
void PICScaleYUVToRGB32Row_SSE(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void PICScaleYUVToRGB32Row_SSE(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx,
const int16 *kCoefficientsRgbY);
const int16_t *kCoefficientsRgbY);
asm(
".text\n"
@ -732,10 +732,10 @@ void PICScaleYUVToRGB32Row_SSE(const uint8* y_buf,
#endif
);
void ScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void ScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx)
{
@ -748,13 +748,13 @@ void ScaleYUVToRGB32Row(const uint8* y_buf,
ScaleYUVToRGB32Row_C(y_buf, u_buf, v_buf, rgb_buf, width, source_dx);
}
void PICLinearScaleYUVToRGB32Row_SSE(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void PICLinearScaleYUVToRGB32Row_SSE(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx,
const int16 *kCoefficientsRgbY);
const int16_t *kCoefficientsRgbY);
asm(
".text\n"
@ -871,10 +871,10 @@ void PICLinearScaleYUVToRGB32Row_SSE(const uint8* y_buf,
);
void LinearScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void LinearScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx)
{
@ -887,27 +887,27 @@ void LinearScaleYUVToRGB32Row(const uint8* y_buf,
LinearScaleYUVToRGB32Row_C(y_buf, u_buf, v_buf, rgb_buf, width, source_dx);
}
#else
void FastConvertYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void FastConvertYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width) {
FastConvertYUVToRGB32Row_C(y_buf, u_buf, v_buf, rgb_buf, width, 1);
}
void ScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void ScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx) {
ScaleYUVToRGB32Row_C(y_buf, u_buf, v_buf, rgb_buf, width, source_dx);
}
void LinearScaleYUVToRGB32Row(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
void LinearScaleYUVToRGB32Row(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* rgb_buf,
int width,
int source_dx) {
LinearScaleYUVToRGB32Row_C(y_buf, u_buf, v_buf, rgb_buf, width, source_dx);