Commit 4af8cdfc authored by Jason Garrett-Glaser's avatar Jason Garrett-Glaser

16x16 and 8x8c x86 SIMD intra pred functions for VP8 and H.264

Originally committed as revision 23783 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent d6f8476b
......@@ -1299,4 +1299,5 @@ void ff_h264_pred_init(H264PredContext *h, int codec_id){
h->pred16x16_add[ HOR_PRED8x8]= pred16x16_horizontal_add_c;
if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id);
if (ARCH_X86) ff_h264_pred_init_x86(h, codec_id);
}
......@@ -87,5 +87,6 @@ typedef struct H264PredContext{
void ff_h264_pred_init(H264PredContext *h, int codec_id);
void ff_h264_pred_init_arm(H264PredContext *h, int codec_id);
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id);
#endif /* AVCODEC_H264PRED_H */
......@@ -8,6 +8,7 @@ YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \
$(YASM-OBJS-FFT-yes)
YASM-OBJS-$(CONFIG_GPL) += x86/h264_deblock_sse2.o \
x86/h264_idct_sse2.o \
x86/h264_intrapred.o \
MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o
MMX-OBJS-$(CONFIG_MP1FLOAT_DECODER) += x86/mpegaudiodec_mmx.o
......
......@@ -62,7 +62,7 @@ DECLARE_ALIGNED(8, const uint64_t, ff_pw_128) = 0x0080008000800080ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_pw_255) = 0x00ff00ff00ff00ffULL;
DECLARE_ALIGNED(8, const uint64_t, ff_pb_1 ) = 0x0101010101010101ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_pb_3 ) = 0x0303030303030303ULL;
DECLARE_ALIGNED(16, const xmm_reg, ff_pb_3 ) = {0x0303030303030303ULL, 0x0303030303030303ULL};
DECLARE_ALIGNED(8, const uint64_t, ff_pb_7 ) = 0x0707070707070707ULL;
DECLARE_ALIGNED(8, const uint64_t, ff_pb_1F ) = 0x1F1F1F1F1F1F1F1FULL;
DECLARE_ALIGNED(8, const uint64_t, ff_pb_3F ) = 0x3F3F3F3F3F3F3F3FULL;
......
......@@ -48,7 +48,7 @@ extern const uint64_t ff_pw_128;
extern const uint64_t ff_pw_255;
extern const uint64_t ff_pb_1;
extern const uint64_t ff_pb_3;
extern const xmm_reg ff_pb_3;
extern const uint64_t ff_pb_7;
extern const uint64_t ff_pb_1F;
extern const uint64_t ff_pb_3F;
......
This diff is collapsed.
......@@ -19,6 +19,7 @@
*/
#include "dsputil_mmx.h"
#include "libavcodec/h264pred.h"
DECLARE_ALIGNED(8, static const uint64_t, ff_pb_3_1 ) = 0x0103010301030103ULL;
DECLARE_ALIGNED(8, static const uint64_t, ff_pb_7_3 ) = 0x0307030703070307ULL;
......@@ -2322,3 +2323,77 @@ H264_WEIGHT( 4, 8)
H264_WEIGHT( 4, 4)
H264_WEIGHT( 4, 2)
void ff_pred16x16_vertical_mmx (uint8_t *src, int stride);
void ff_pred16x16_vertical_sse (uint8_t *src, int stride);
void ff_pred16x16_horizontal_mmx (uint8_t *src, int stride);
void ff_pred16x16_horizontal_mmxext(uint8_t *src, int stride);
void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
void ff_pred16x16_dc_mmx (uint8_t *src, int stride);
void ff_pred16x16_dc_mmxext (uint8_t *src, int stride);
void ff_pred16x16_dc_sse (uint8_t *src, int stride);
void ff_pred16x16_dc_sse2 (uint8_t *src, int stride);
void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride);
void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride);
void ff_pred16x16_tm_vp8_mmxext (uint8_t *src, int stride);
void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride);
void ff_pred8x8_dc_rv40_mmx (uint8_t *src, int stride);
void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride);
void ff_pred8x8_vertical_mmx (uint8_t *src, int stride);
void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride);
void ff_pred8x8_horizontal_mmxext (uint8_t *src, int stride);
void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride);
void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride);
void ff_pred8x8_tm_vp8_mmxext (uint8_t *src, int stride);
void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride);
void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride);
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id)
{
#if HAVE_YASM
if (mm_flags & FF_MM_MMX) {
h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_mmx;
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmx;
h->pred8x8 [VERT_PRED8x8] = ff_pred8x8_vertical_mmx;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
if (codec_id == CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmx;
h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmx;
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmx;
}
}
if (mm_flags & FF_MM_MMXEXT) {
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
if (codec_id == CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_mmxext;
}
}
if (mm_flags & FF_MM_SSE) {
h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse;
}
if (mm_flags & FF_MM_SSE2) {
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
if (codec_id == CODEC_ID_VP8) {
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
}
}
if (mm_flags & FF_MM_SSSE3) {
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
if (codec_id == CODEC_ID_VP8) {
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
}
}
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment