2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
2013-02-08 02:00:37 +01:00
|
|
|
#include <assert.h>
|
2010-05-18 17:58:33 +02:00
|
|
|
|
2012-12-23 16:20:10 +01:00
|
|
|
#include "./vpx_config.h"
|
2013-02-08 02:00:37 +01:00
|
|
|
#include "./vp9_rtcd.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
#include "vpx_ports/mem.h"
|
2013-02-08 02:00:37 +01:00
|
|
|
|
2013-10-10 22:51:35 +02:00
|
|
|
typedef void filter8_1dfunction (
|
|
|
|
const unsigned char *src_ptr,
|
|
|
|
const unsigned int src_pitch,
|
|
|
|
unsigned char *output_ptr,
|
|
|
|
unsigned int out_pitch,
|
|
|
|
unsigned int output_height,
|
|
|
|
const short *filter
|
|
|
|
);
|
2013-02-10 00:15:14 +01:00
|
|
|
|
2014-01-13 20:58:47 +01:00
|
|
|
#if (HAVE_SSSE3)
|
2013-10-10 22:51:35 +02:00
|
|
|
filter8_1dfunction vp9_filter_block1d16_v8_avg_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_h8_avg_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_v8_avg_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_h8_avg_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_v8_avg_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_h8_avg_ssse3;
|
2014-01-13 20:58:47 +01:00
|
|
|
#if (ARCH_X86_64)
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_v8_intrin_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_h8_intrin_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_v8_intrin_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_h8_intrin_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_v8_intrin_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_h8_intrin_ssse3;
|
|
|
|
|
|
|
|
void vp9_convolve8_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
/* Ensure the filter can be compressed to int16_t. */
|
|
|
|
if (x_step_q4 == 16 && filter_x[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_h8_intrin_ssse3(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_h8_intrin_ssse3(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_h8_intrin_ssse3(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_horiz_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
2013-02-13 18:15:38 +01:00
|
|
|
|
2014-01-13 20:58:47 +01:00
|
|
|
void vp9_convolve8_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (y_step_q4 == 16 && filter_y[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_v8_intrin_ssse3(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_v8_intrin_ssse3(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_v8_intrin_ssse3(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_vert_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_v8_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_h8_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_v8_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_h8_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_v8_ssse3;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_h8_ssse3;
|
2013-07-10 20:17:19 +02:00
|
|
|
void vp9_convolve8_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
2013-02-08 02:00:37 +01:00
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
2013-05-23 21:50:41 +02:00
|
|
|
/* Ensure the filter can be compressed to int16_t. */
|
2013-02-08 02:00:37 +01:00
|
|
|
if (x_step_q4 == 16 && filter_x[3] != 128) {
|
|
|
|
while (w >= 16) {
|
2013-09-14 00:11:07 +02:00
|
|
|
vp9_filter_block1d16_h8_ssse3(src, src_stride,
|
2013-02-08 02:00:37 +01:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
2013-09-14 00:11:07 +02:00
|
|
|
vp9_filter_block1d8_h8_ssse3(src, src_stride,
|
2013-02-08 02:00:37 +01:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
2013-02-10 00:15:14 +01:00
|
|
|
while (w >= 4) {
|
2013-09-14 00:11:07 +02:00
|
|
|
vp9_filter_block1d4_h8_ssse3(src, src_stride,
|
2013-02-10 00:15:14 +01:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
2013-02-08 02:00:37 +01:00
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_horiz_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-10 20:17:19 +02:00
|
|
|
void vp9_convolve8_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
2013-02-08 02:00:37 +01:00
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (y_step_q4 == 16 && filter_y[3] != 128) {
|
|
|
|
while (w >= 16) {
|
2013-09-14 00:11:07 +02:00
|
|
|
vp9_filter_block1d16_v8_ssse3(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
2013-02-08 02:00:37 +01:00
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
2013-09-14 00:11:07 +02:00
|
|
|
vp9_filter_block1d8_v8_ssse3(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
2013-02-08 02:00:37 +01:00
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
2013-02-10 00:15:14 +01:00
|
|
|
while (w >= 4) {
|
2013-09-14 00:11:07 +02:00
|
|
|
vp9_filter_block1d4_v8_ssse3(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
2013-02-10 00:15:14 +01:00
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
2013-02-08 02:00:37 +01:00
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_vert_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
2014-01-13 20:58:47 +01:00
|
|
|
#endif
|
2013-02-08 02:00:37 +01:00
|
|
|
|
2013-07-10 20:17:19 +02:00
|
|
|
void vp9_convolve8_avg_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
2013-02-13 18:15:38 +01:00
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (x_step_q4 == 16 && filter_x[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_h8_avg_ssse3(src, src_stride,
|
2013-09-14 00:11:07 +02:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
2013-02-13 18:15:38 +01:00
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_h8_avg_ssse3(src, src_stride,
|
2013-09-14 00:11:07 +02:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
2013-02-13 18:15:38 +01:00
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_h8_avg_ssse3(src, src_stride,
|
2013-09-14 00:11:07 +02:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
2013-02-13 18:15:38 +01:00
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-10 20:17:19 +02:00
|
|
|
void vp9_convolve8_avg_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
2013-02-13 18:15:38 +01:00
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (y_step_q4 == 16 && filter_y[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_v8_avg_ssse3(src - src_stride * 3, src_stride,
|
2013-09-14 00:11:07 +02:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
2013-02-13 18:15:38 +01:00
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_v8_avg_ssse3(src - src_stride * 3, src_stride,
|
2013-09-14 00:11:07 +02:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
2013-02-13 18:15:38 +01:00
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_v8_avg_ssse3(src - src_stride * 3, src_stride,
|
2013-09-14 00:11:07 +02:00
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
2013-02-13 18:15:38 +01:00
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-10 20:17:19 +02:00
|
|
|
void vp9_convolve8_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
2013-02-08 02:00:37 +01:00
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
2013-10-15 20:50:25 +02:00
|
|
|
DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
|
2013-02-08 02:00:37 +01:00
|
|
|
|
2013-04-19 17:24:33 +02:00
|
|
|
assert(w <= 64);
|
2013-04-18 22:05:38 +02:00
|
|
|
assert(h <= 64);
|
2013-04-19 17:24:33 +02:00
|
|
|
if (x_step_q4 == 16 && y_step_q4 == 16) {
|
|
|
|
vp9_convolve8_horiz_ssse3(src - 3 * src_stride, src_stride, fdata2, 64,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h + 7);
|
|
|
|
vp9_convolve8_vert_ssse3(fdata2 + 3 * 64, 64, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4, w, h);
|
|
|
|
} else {
|
|
|
|
vp9_convolve8_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4, w, h);
|
2013-02-08 02:00:37 +01:00
|
|
|
}
|
|
|
|
}
|
2013-02-13 18:15:38 +01:00
|
|
|
|
2013-07-10 20:17:19 +02:00
|
|
|
void vp9_convolve8_avg_ssse3(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
2013-02-13 18:15:38 +01:00
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
2013-10-15 20:50:25 +02:00
|
|
|
DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
|
2013-02-13 18:15:38 +01:00
|
|
|
|
2013-04-19 17:24:33 +02:00
|
|
|
assert(w <= 64);
|
2013-04-18 22:05:38 +02:00
|
|
|
assert(h <= 64);
|
2013-04-19 17:24:33 +02:00
|
|
|
if (x_step_q4 == 16 && y_step_q4 == 16) {
|
|
|
|
vp9_convolve8_horiz_ssse3(src - 3 * src_stride, src_stride, fdata2, 64,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h + 7);
|
|
|
|
vp9_convolve8_avg_vert_ssse3(fdata2 + 3 * 64, 64, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
} else {
|
|
|
|
vp9_convolve8_avg_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4, w, h);
|
2013-02-13 18:15:38 +01:00
|
|
|
}
|
|
|
|
}
|
2013-02-08 02:00:37 +01:00
|
|
|
#endif
|
2013-10-10 22:51:35 +02:00
|
|
|
|
|
|
|
#if HAVE_SSE2
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_v8_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_h8_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_v8_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_h8_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_v8_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_h8_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_v8_avg_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d16_h8_avg_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_v8_avg_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d8_h8_avg_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_v8_avg_sse2;
|
|
|
|
filter8_1dfunction vp9_filter_block1d4_h8_avg_sse2;
|
|
|
|
|
|
|
|
void vp9_convolve8_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
/* Ensure the filter can be compressed to int16_t. */
|
|
|
|
if (x_step_q4 == 16 && filter_x[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_h8_sse2(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_h8_sse2(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_h8_sse2(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_horiz_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp9_convolve8_vert_sse2(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (y_step_q4 == 16 && filter_y[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_v8_sse2(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_v8_sse2(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_v8_sse2(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_vert_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp9_convolve8_avg_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (x_step_q4 == 16 && filter_x[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_h8_avg_sse2(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_h8_avg_sse2(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_h8_avg_sse2(src, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_x);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp9_convolve8_avg_vert_sse2(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
|
|
|
if (y_step_q4 == 16 && filter_y[3] != 128) {
|
|
|
|
while (w >= 16) {
|
|
|
|
vp9_filter_block1d16_v8_avg_sse2(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 16;
|
|
|
|
dst += 16;
|
|
|
|
w -= 16;
|
|
|
|
}
|
|
|
|
while (w >= 8) {
|
|
|
|
vp9_filter_block1d8_v8_avg_sse2(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 8;
|
|
|
|
dst += 8;
|
|
|
|
w -= 8;
|
|
|
|
}
|
|
|
|
while (w >= 4) {
|
|
|
|
vp9_filter_block1d4_v8_avg_sse2(src - src_stride * 3, src_stride,
|
|
|
|
dst, dst_stride,
|
|
|
|
h, filter_y);
|
|
|
|
src += 4;
|
|
|
|
dst += 4;
|
|
|
|
w -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (w) {
|
|
|
|
vp9_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp9_convolve8_sse2(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
2013-10-15 20:50:25 +02:00
|
|
|
DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
|
2013-10-10 22:51:35 +02:00
|
|
|
|
|
|
|
assert(w <= 64);
|
|
|
|
assert(h <= 64);
|
|
|
|
if (x_step_q4 == 16 && y_step_q4 == 16) {
|
|
|
|
vp9_convolve8_horiz_sse2(src - 3 * src_stride, src_stride, fdata2, 64,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h + 7);
|
|
|
|
vp9_convolve8_vert_sse2(fdata2 + 3 * 64, 64, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4, w, h);
|
|
|
|
} else {
|
|
|
|
vp9_convolve8_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4, w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void vp9_convolve8_avg_sse2(const uint8_t *src, ptrdiff_t src_stride,
|
|
|
|
uint8_t *dst, ptrdiff_t dst_stride,
|
|
|
|
const int16_t *filter_x, int x_step_q4,
|
|
|
|
const int16_t *filter_y, int y_step_q4,
|
|
|
|
int w, int h) {
|
2013-10-15 20:50:25 +02:00
|
|
|
DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
|
2013-10-10 22:51:35 +02:00
|
|
|
|
|
|
|
assert(w <= 64);
|
|
|
|
assert(h <= 64);
|
|
|
|
if (x_step_q4 == 16 && y_step_q4 == 16) {
|
|
|
|
vp9_convolve8_horiz_sse2(src - 3 * src_stride, src_stride, fdata2, 64,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h + 7);
|
|
|
|
vp9_convolve8_avg_vert_sse2(fdata2 + 3 * 64, 64, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4,
|
|
|
|
w, h);
|
|
|
|
} else {
|
|
|
|
vp9_convolve8_avg_c(src, src_stride, dst, dst_stride,
|
|
|
|
filter_x, x_step_q4, filter_y, y_step_q4, w, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|