This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Stop on first error | |
set -e | |
# !!!!! ENTER YOUR FAVORITE Y4M HERE !!!!! | |
SEQ=~/Videos/firefox-quantum_robot-suit-2_wallpaper-4K.y4m | |
if [ ! -f $SEQ ]; then | |
(>&2 echo "ERROR: Failed to find $SEQ") | |
(>&2 echo "Please recheck the variables") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int16x4_t vadd_s16(int16x4_t a, int16x4_t b) { | |
int16x4_t c; | |
for (int i = 0; i < 4; i++) { | |
c[i] = a[i] + b[i]; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int32x4_t vaddl_s16(int16x4_t a, int16x4_t b) { | |
int32x4_t c; | |
for (int i = 0; i < 4; i++) { | |
c[i] = a[i] + b[i]; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vector long add | |
int32x4_t vaddl_s16_c(int16x4_t a, int16x4_t b) { | |
int32x4_t c; | |
for (int i = 0; i < 4; i++) { | |
c[i] = a[i] + b[i]; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int32x4_t vaddw_s16_c(int32x4_t a, int16x4_t b) { | |
int32x4_t c; | |
for (int i = 0; i < 4; i++) { | |
c[i] = a[i] + b[i]; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int16x4_t vrhadd_s16_c(int16x4_t a, int16x4_t b) { | |
int16x4_t c; | |
for (int i = 0; i < 4; i++) { | |
c[i] = (a[i] + b[i] + 1) >> 1; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int16x4_t vqadd_s16_c(int16x4_t a, int16x4_t b) { | |
int16x4_t c; | |
for (int i = 0; i < 4; i++) { | |
int32_t tmp = a[i] + b[i]; | |
tmp = (tmp > INT16_MAX) ? INT16_MAX : tmp; | |
tmp = (tmp < INT16_MIN) ? INT16_MIN : tmp; | |
c[i] = (int16_t)tmp; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int16x4_t vpadd_s16_c(int16x4_t a, int16x4_t b) { | |
int16x4_t c; | |
for (int i = 0; i < 2; i++) { | |
c[i] = a[i * 2] + a[i * 2 + 1]; | |
} | |
for (int i = 0; i < 2; i++) { | |
c[i + 2] = b[i * 2] + b[i * 2 + 1]; | |
} | |
return c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int16_t vaddv_s16_c(int16x4_t a) { | |
int16_t b = 0; | |
for (int i = 0; i < 4; i++) { | |
b += a[i]; | |
} | |
return b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint16_t hicolor_avg(uint16_t a, uint16_t b) { | |
const uint16_t s = a ^ b; | |
return ((s & 0xF7DEU) >> 1) + (a & b) + (s & 0x0821U); | |
} |