Skip to content

Instantly share code, notes, and snippets.

View luctrudeau's full-sized avatar

Luc Trudeau luctrudeau

View GitHub Profile
int16_t vaddv_s16_c(int16x4_t a) {
int16_t b = 0;
for (int i = 0; i < 4; i++) {
b += a[i];
}
return b;
}
@luctrudeau
luctrudeau / vpadd.c
Last active February 28, 2018 03:52
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;
}
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;
}
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;
}
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;
}
// 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;
}
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;
}
@luctrudeau
luctrudeau / vadd_s16.c
Last active February 28, 2018 03:51
vadd
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;
}
@luctrudeau
luctrudeau / build.sh
Last active February 6, 2018 00:05
Rav1e build script
#!/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")
@luctrudeau
luctrudeau / install_notes.md
Last active January 25, 2018 14:40
Arch Linux Installation Notes

Pre-Install

Connect to internet

wifi-setup

Setup wifi using wifi-mency

Update system clock