uint8_t *pred, uint8_t *dest,
int pitch, int stride, int eob) {
int i;
- int16_t output[16];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 16);
for (i = 0; i < 16; i++)
input[i] *= dq[i];
const int16_t *dq,
uint8_t *pred, uint8_t *dest,
int pitch, int stride, int eob) {
- int16_t output[64];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 64);
if (eob == 0) {
// All 0 DCT coefficients
void vp9_dequant_idct_add_c(int16_t *input, const int16_t *dq, uint8_t *pred,
uint8_t *dest, int pitch, int stride, int eob) {
int i;
- int16_t output[16];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 16);
if (eob > 1) {
for (i = 0; i < 16; i++)
void vp9_dequant_dc_idct_add_c(int16_t *input, const int16_t *dq, uint8_t *pred,
uint8_t *dest, int pitch, int stride, int dc) {
int i;
- int16_t output[16];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 16);
input[0] = dc;
uint8_t *pred, uint8_t *dest,
int pitch, int stride, int eob) {
int i;
- int16_t output[16];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 16);
if (eob > 1) {
for (i = 0; i < 16; i++)
uint8_t *dest,
int pitch, int stride, int dc) {
int i;
- int16_t output[16];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 16);
input[0] = dc;
void vp9_dequant_idct_add_8x8_c(int16_t *input, const int16_t *dq,
uint8_t *pred, uint8_t *dest, int pitch,
int stride, int eob) {
- int16_t output[64];
-
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 64);
// If dc is 1, then input[0] is the reconstructed value, do not need
// dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1.
const int16_t *dq, uint8_t *pred,
uint8_t *dest, int pitch, int stride,
int eob) {
- int16_t output[256];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 256);
if (eob == 0) {
// All 0 DCT coefficients
void vp9_dequant_idct_add_16x16_c(int16_t *input, const int16_t *dq,
uint8_t *pred, uint8_t *dest, int pitch,
int stride, int eob) {
- int16_t output[256];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 256);
/* The calculation can be simplified if there are not many non-zero dct
* coefficients. Use eobs to separate different cases. */
void vp9_dequant_idct_add_32x32_c(int16_t *input, const int16_t *dq,
uint8_t *pred, uint8_t *dest, int pitch,
int stride, int eob) {
- int16_t output[1024];
+ DECLARE_ALIGNED_ARRAY(16, int16_t, output, 1024);
if (eob) {
input[0] = input[0] * dq[0] / 2;
const __m128i zero = _mm_setzero_si128();
// Diff data
- const __m128i d0 = _mm_loadu_si128((const __m128i *)(diff + 0 * width));
- const __m128i d1 = _mm_loadu_si128((const __m128i *)(diff + 1 * width));
- const __m128i d2 = _mm_loadu_si128((const __m128i *)(diff + 2 * width));
- const __m128i d3 = _mm_loadu_si128((const __m128i *)(diff + 3 * width));
- const __m128i d4 = _mm_loadu_si128((const __m128i *)(diff + 4 * width));
- const __m128i d5 = _mm_loadu_si128((const __m128i *)(diff + 5 * width));
- const __m128i d6 = _mm_loadu_si128((const __m128i *)(diff + 6 * width));
- const __m128i d7 = _mm_loadu_si128((const __m128i *)(diff + 7 * width));
+ const __m128i d0 = _mm_load_si128((const __m128i *)(diff + 0 * width));
+ const __m128i d1 = _mm_load_si128((const __m128i *)(diff + 1 * width));
+ const __m128i d2 = _mm_load_si128((const __m128i *)(diff + 2 * width));
+ const __m128i d3 = _mm_load_si128((const __m128i *)(diff + 3 * width));
+ const __m128i d4 = _mm_load_si128((const __m128i *)(diff + 4 * width));
+ const __m128i d5 = _mm_load_si128((const __m128i *)(diff + 5 * width));
+ const __m128i d6 = _mm_load_si128((const __m128i *)(diff + 6 * width));
+ const __m128i d7 = _mm_load_si128((const __m128i *)(diff + 7 * width));
// Prediction data.
__m128i p0 = _mm_loadl_epi64((const __m128i *)(pred + 0 * pitch));
__m128i p0, p1, p2, p3, p4, p5, p6, p7;
do {
- d0 = _mm_loadu_si128((const __m128i *)(diff + 0 * width));
- d1 = _mm_loadu_si128((const __m128i *)(diff + 0 * width + 8));
- d2 = _mm_loadu_si128((const __m128i *)(diff + 1 * width));
- d3 = _mm_loadu_si128((const __m128i *)(diff + 1 * width + 8));
- d4 = _mm_loadu_si128((const __m128i *)(diff + 2 * width));
- d5 = _mm_loadu_si128((const __m128i *)(diff + 2 * width + 8));
- d6 = _mm_loadu_si128((const __m128i *)(diff + 3 * width));
- d7 = _mm_loadu_si128((const __m128i *)(diff + 3 * width + 8));
+ d0 = _mm_load_si128((const __m128i *)(diff + 0 * width));
+ d1 = _mm_load_si128((const __m128i *)(diff + 0 * width + 8));
+ d2 = _mm_load_si128((const __m128i *)(diff + 1 * width));
+ d3 = _mm_load_si128((const __m128i *)(diff + 1 * width + 8));
+ d4 = _mm_load_si128((const __m128i *)(diff + 2 * width));
+ d5 = _mm_load_si128((const __m128i *)(diff + 2 * width + 8));
+ d6 = _mm_load_si128((const __m128i *)(diff + 3 * width));
+ d7 = _mm_load_si128((const __m128i *)(diff + 3 * width + 8));
// Prediction data.
p1 = _mm_load_si128((const __m128i *)(pred + 0 * pitch));
__m128i p0, p1, p2, p3, p4, p5, p6, p7;
do {
- d0 = _mm_loadu_si128((const __m128i *)(diff + 0 * width));
- d1 = _mm_loadu_si128((const __m128i *)(diff + 0 * width + 8));
- d2 = _mm_loadu_si128((const __m128i *)(diff + 0 * width + 16));
- d3 = _mm_loadu_si128((const __m128i *)(diff + 0 * width + 24));
- d4 = _mm_loadu_si128((const __m128i *)(diff + 1 * width));
- d5 = _mm_loadu_si128((const __m128i *)(diff + 1 * width + 8));
- d6 = _mm_loadu_si128((const __m128i *)(diff + 1 * width + 16));
- d7 = _mm_loadu_si128((const __m128i *)(diff + 1 * width + 24));
+ d0 = _mm_load_si128((const __m128i *)(diff + 0 * width));
+ d1 = _mm_load_si128((const __m128i *)(diff + 0 * width + 8));
+ d2 = _mm_load_si128((const __m128i *)(diff + 0 * width + 16));
+ d3 = _mm_load_si128((const __m128i *)(diff + 0 * width + 24));
+ d4 = _mm_load_si128((const __m128i *)(diff + 1 * width));
+ d5 = _mm_load_si128((const __m128i *)(diff + 1 * width + 8));
+ d6 = _mm_load_si128((const __m128i *)(diff + 1 * width + 16));
+ d7 = _mm_load_si128((const __m128i *)(diff + 1 * width + 24));
// Prediction data.
p1 = _mm_load_si128((const __m128i *)(pred + 0 * pitch));