2010-08-30 19:34:13 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2010 Jason Garrett-Glaser
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2010-09-08 18:07:14 +03:00
|
|
|
#include "libavutil/cpu.h"
|
2010-08-30 19:34:13 +03:00
|
|
|
#include "libavcodec/h264pred.h"
|
|
|
|
|
2011-06-06 02:20:05 +03:00
|
|
|
#define PRED4x4(TYPE, DEPTH, OPT) \
|
|
|
|
void ff_pred4x4_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, const uint8_t *topright, int stride);
|
|
|
|
|
|
|
|
PRED4x4(dc, 10, mmxext)
|
|
|
|
PRED4x4(down_left, 10, sse2)
|
|
|
|
PRED4x4(down_left, 10, avx)
|
|
|
|
PRED4x4(down_right, 10, sse2)
|
|
|
|
PRED4x4(down_right, 10, ssse3)
|
|
|
|
PRED4x4(down_right, 10, avx)
|
|
|
|
PRED4x4(vertical_left, 10, sse2)
|
|
|
|
PRED4x4(vertical_left, 10, avx)
|
|
|
|
PRED4x4(vertical_right, 10, sse2)
|
|
|
|
PRED4x4(vertical_right, 10, ssse3)
|
|
|
|
PRED4x4(vertical_right, 10, avx)
|
|
|
|
PRED4x4(horizontal_up, 10, mmxext)
|
|
|
|
PRED4x4(horizontal_down, 10, sse2)
|
|
|
|
PRED4x4(horizontal_down, 10, ssse3)
|
|
|
|
PRED4x4(horizontal_down, 10, avx)
|
|
|
|
|
|
|
|
#define PRED8x8(TYPE, DEPTH, OPT) \
|
|
|
|
void ff_pred8x8_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
|
|
|
|
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8(dc, 10, mmxext)
|
|
|
|
PRED8x8(dc, 10, sse2)
|
|
|
|
PRED8x8(top_dc, 10, sse2)
|
2011-07-12 00:26:43 +03:00
|
|
|
PRED8x8(plane, 10, sse2)
|
2011-06-06 02:20:05 +03:00
|
|
|
PRED8x8(vertical, 10, sse2)
|
|
|
|
PRED8x8(horizontal, 10, sse2)
|
|
|
|
|
2011-07-03 21:56:09 +03:00
|
|
|
#define PRED8x8L(TYPE, DEPTH, OPT)\
|
|
|
|
void ff_pred8x8l_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
|
|
|
|
PRED8x8L(dc, 10, sse2)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(dc, 10, avx)
|
2011-07-12 00:26:43 +03:00
|
|
|
PRED8x8L(128_dc, 10, mmxext)
|
|
|
|
PRED8x8L(128_dc, 10, sse2)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(top_dc, 10, sse2)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(top_dc, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(vertical, 10, sse2)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(vertical, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(horizontal, 10, sse2)
|
|
|
|
PRED8x8L(horizontal, 10, ssse3)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(horizontal, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(down_left, 10, sse2)
|
|
|
|
PRED8x8L(down_left, 10, ssse3)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(down_left, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(down_right, 10, sse2)
|
|
|
|
PRED8x8L(down_right, 10, ssse3)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(down_right, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(vertical_right, 10, sse2)
|
|
|
|
PRED8x8L(vertical_right, 10, ssse3)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(vertical_right, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED8x8L(horizontal_up, 10, sse2)
|
|
|
|
PRED8x8L(horizontal_up, 10, ssse3)
|
2011-07-22 04:15:58 +03:00
|
|
|
PRED8x8L(horizontal_up, 10, avx)
|
2011-07-03 21:56:09 +03:00
|
|
|
|
|
|
|
#define PRED16x16(TYPE, DEPTH, OPT)\
|
|
|
|
void ff_pred16x16_ ## TYPE ## _ ## DEPTH ## _ ## OPT (uint8_t *src, int stride);
|
|
|
|
|
2011-07-12 00:26:43 +03:00
|
|
|
PRED16x16(dc, 10, mmxext)
|
|
|
|
PRED16x16(dc, 10, sse2)
|
|
|
|
PRED16x16(top_dc, 10, mmxext)
|
|
|
|
PRED16x16(top_dc, 10, sse2)
|
|
|
|
PRED16x16(128_dc, 10, mmxext)
|
|
|
|
PRED16x16(128_dc, 10, sse2)
|
|
|
|
PRED16x16(left_dc, 10, mmxext)
|
|
|
|
PRED16x16(left_dc, 10, sse2)
|
2011-07-03 21:56:09 +03:00
|
|
|
PRED16x16(vertical, 10, mmxext)
|
|
|
|
PRED16x16(vertical, 10, sse2)
|
|
|
|
PRED16x16(horizontal, 10, mmxext)
|
|
|
|
PRED16x16(horizontal, 10, sse2)
|
|
|
|
|
2010-08-30 19:34:13 +03:00
|
|
|
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);
|
2012-07-04 02:07:42 +03:00
|
|
|
void ff_pred16x16_horizontal_mmx2 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred16x16_horizontal_ssse3 (uint8_t *src, int stride);
|
2012-07-04 02:07:42 +03:00
|
|
|
void ff_pred16x16_dc_mmx2 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred16x16_dc_sse2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_dc_ssse3 (uint8_t *src, int stride);
|
2010-10-06 01:06:18 +03:00
|
|
|
void ff_pred16x16_plane_h264_mmx (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_h264_mmx2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_h264_sse2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_h264_ssse3 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_rv40_mmx (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_rv40_mmx2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_rv40_sse2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_rv40_ssse3 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_svq3_mmx (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_svq3_mmx2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_svq3_sse2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred16x16_plane_svq3_ssse3 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred16x16_tm_vp8_mmx (uint8_t *src, int stride);
|
2012-07-04 02:07:42 +03:00
|
|
|
void ff_pred16x16_tm_vp8_mmx2 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred16x16_tm_vp8_sse2 (uint8_t *src, int stride);
|
2010-12-29 19:42:34 +02:00
|
|
|
void ff_pred8x8_top_dc_mmxext (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred8x8_dc_rv40_mmxext (uint8_t *src, int stride);
|
2010-12-29 20:00:26 +02:00
|
|
|
void ff_pred8x8_dc_mmxext (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred8x8_vertical_mmx (uint8_t *src, int stride);
|
|
|
|
void ff_pred8x8_horizontal_mmx (uint8_t *src, int stride);
|
2012-07-04 02:07:42 +03:00
|
|
|
void ff_pred8x8_horizontal_mmx2 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred8x8_horizontal_ssse3 (uint8_t *src, int stride);
|
2010-10-06 01:06:18 +03:00
|
|
|
void ff_pred8x8_plane_mmx (uint8_t *src, int stride);
|
|
|
|
void ff_pred8x8_plane_mmx2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred8x8_plane_sse2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred8x8_plane_ssse3 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred8x8_tm_vp8_mmx (uint8_t *src, int stride);
|
2012-07-04 02:07:42 +03:00
|
|
|
void ff_pred8x8_tm_vp8_mmx2 (uint8_t *src, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred8x8_tm_vp8_sse2 (uint8_t *src, int stride);
|
|
|
|
void ff_pred8x8_tm_vp8_ssse3 (uint8_t *src, int stride);
|
2010-12-29 20:11:27 +02:00
|
|
|
void ff_pred8x8l_top_dc_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_top_dc_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 20:33:10 +02:00
|
|
|
void ff_pred8x8l_dc_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_dc_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 20:40:53 +02:00
|
|
|
void ff_pred8x8l_horizontal_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_horizontal_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 20:46:40 +02:00
|
|
|
void ff_pred8x8l_vertical_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_vertical_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-30 01:48:44 +02:00
|
|
|
void ff_pred8x8l_down_left_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 21:02:50 +02:00
|
|
|
void ff_pred8x8l_down_left_sse2 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_down_left_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 21:12:02 +02:00
|
|
|
void ff_pred8x8l_down_right_mmxext (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 21:19:49 +02:00
|
|
|
void ff_pred8x8l_down_right_sse2 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_down_right_ssse3 (uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 21:46:09 +02:00
|
|
|
void ff_pred8x8l_vertical_right_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 21:54:05 +02:00
|
|
|
void ff_pred8x8l_vertical_right_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_vertical_right_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 22:06:22 +02:00
|
|
|
void ff_pred8x8l_vertical_left_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_vertical_left_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 22:35:31 +02:00
|
|
|
void ff_pred8x8l_horizontal_up_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_horizontal_up_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 22:38:06 +02:00
|
|
|
void ff_pred8x8l_horizontal_down_mmxext(uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-12-29 22:42:15 +02:00
|
|
|
void ff_pred8x8l_horizontal_down_sse2(uint8_t *src, int has_topleft, int has_topright, int stride);
|
|
|
|
void ff_pred8x8l_horizontal_down_ssse3(uint8_t *src, int has_topleft, int has_topright, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred4x4_dc_mmxext (uint8_t *src, const uint8_t *topright, int stride);
|
2010-12-25 00:43:07 +02:00
|
|
|
void ff_pred4x4_down_left_mmxext (uint8_t *src, const uint8_t *topright, int stride);
|
2010-12-29 23:55:51 +02:00
|
|
|
void ff_pred4x4_down_right_mmxext (uint8_t *src, const uint8_t *topright, int stride);
|
2010-12-29 23:35:34 +02:00
|
|
|
void ff_pred4x4_vertical_left_mmxext(uint8_t *src, const uint8_t *topright, int stride);
|
2010-12-29 23:52:41 +02:00
|
|
|
void ff_pred4x4_vertical_right_mmxext(uint8_t *src, const uint8_t *topright, int stride);
|
2010-12-29 23:42:33 +02:00
|
|
|
void ff_pred4x4_horizontal_up_mmxext(uint8_t *src, const uint8_t *topright, int stride);
|
2010-12-29 23:49:57 +02:00
|
|
|
void ff_pred4x4_horizontal_down_mmxext(uint8_t *src, const uint8_t *topright, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred4x4_tm_vp8_mmx (uint8_t *src, const uint8_t *topright, int stride);
|
2012-07-04 02:07:42 +03:00
|
|
|
void ff_pred4x4_tm_vp8_mmx2 (uint8_t *src, const uint8_t *topright, int stride);
|
2010-08-30 19:34:13 +03:00
|
|
|
void ff_pred4x4_tm_vp8_ssse3 (uint8_t *src, const uint8_t *topright, int stride);
|
|
|
|
void ff_pred4x4_vertical_vp8_mmxext(uint8_t *src, const uint8_t *topright, int stride);
|
|
|
|
|
2011-08-15 01:39:55 +03:00
|
|
|
void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc)
|
2010-08-30 19:34:13 +03:00
|
|
|
{
|
2011-10-20 16:43:16 +03:00
|
|
|
#if HAVE_YASM
|
2010-09-08 18:07:14 +03:00
|
|
|
int mm_flags = av_get_cpu_flags();
|
2010-08-30 19:34:13 +03:00
|
|
|
|
2011-06-07 17:31:51 +03:00
|
|
|
if (bit_depth == 8) {
|
|
|
|
if (mm_flags & AV_CPU_FLAG_MMX) {
|
|
|
|
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_mmx;
|
|
|
|
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx;
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1) {
|
|
|
|
h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_mmx;
|
|
|
|
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx;
|
|
|
|
}
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_VP8) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_mmx;
|
|
|
|
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_mmx;
|
|
|
|
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx;
|
2010-10-06 01:06:18 +03:00
|
|
|
} else {
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
|
|
|
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_mmx;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_SVQ3) {
|
2012-02-11 18:04:43 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_CMOV)
|
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_mmx;
|
2012-08-05 12:11:04 +03:00
|
|
|
} else if (codec_id == AV_CODEC_ID_RV40) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_mmx;
|
|
|
|
} else {
|
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_mmx;
|
|
|
|
}
|
2010-10-06 01:06:18 +03:00
|
|
|
}
|
2010-08-30 19:34:13 +03:00
|
|
|
}
|
|
|
|
|
2012-07-08 19:42:12 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_MMXEXT) {
|
2012-07-04 02:07:42 +03:00
|
|
|
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmx2;
|
|
|
|
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmx2;
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
2012-07-04 02:07:42 +03:00
|
|
|
h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmx2;
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_mmxext;
|
|
|
|
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_mmxext;
|
|
|
|
h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_mmxext;
|
|
|
|
h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_mmxext;
|
|
|
|
h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_mmxext;
|
|
|
|
h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_mmxext;
|
|
|
|
h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_mmxext;
|
|
|
|
h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_mmxext;
|
|
|
|
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_mmxext;
|
|
|
|
h->pred4x4 [DIAG_DOWN_RIGHT_PRED ] = ff_pred4x4_down_right_mmxext;
|
|
|
|
h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_mmxext;
|
|
|
|
h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_mmxext;
|
|
|
|
h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_VP8 || codec_id == AV_CODEC_ID_H264) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred4x4 [DIAG_DOWN_LEFT_PRED] = ff_pred4x4_down_left_mmxext;
|
|
|
|
}
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred4x4 [VERT_LEFT_PRED ] = ff_pred4x4_vertical_left_mmxext;
|
|
|
|
}
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id != AV_CODEC_ID_RV40) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred4x4 [HOR_UP_PRED ] = ff_pred4x4_horizontal_up_mmxext;
|
|
|
|
}
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1) {
|
|
|
|
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext;
|
|
|
|
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_mmxext;
|
|
|
|
}
|
2011-06-07 17:31:51 +03:00
|
|
|
}
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_VP8) {
|
2012-07-04 02:07:42 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_mmx2;
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
|
2012-07-04 02:07:42 +03:00
|
|
|
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_mmx2;
|
|
|
|
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_mmx2;
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred4x4 [VERT_PRED ] = ff_pred4x4_vertical_vp8_mmxext;
|
2010-10-06 01:06:18 +03:00
|
|
|
} else {
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
|
|
|
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_mmx2;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_SVQ3) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_mmx2;
|
2012-08-05 12:11:04 +03:00
|
|
|
} else if (codec_id == AV_CODEC_ID_RV40) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_rv40_mmx2;
|
|
|
|
} else {
|
|
|
|
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_h264_mmx2;
|
|
|
|
}
|
2010-10-06 01:06:18 +03:00
|
|
|
}
|
2010-08-30 19:34:13 +03:00
|
|
|
}
|
|
|
|
|
2011-06-07 17:31:51 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_SSE) {
|
|
|
|
h->pred16x16[VERT_PRED8x8] = ff_pred16x16_vertical_sse;
|
|
|
|
}
|
2010-08-30 19:34:13 +03:00
|
|
|
|
2011-06-07 17:31:51 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_SSE2) {
|
|
|
|
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
|
|
|
|
h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_sse2;
|
|
|
|
h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_sse2;
|
|
|
|
h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_sse2;
|
|
|
|
h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_sse2;
|
|
|
|
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_sse2;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_VP8) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_tm_vp8_sse2;
|
|
|
|
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_sse2;
|
2010-10-06 01:06:18 +03:00
|
|
|
} else {
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
|
|
|
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_sse2;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_SVQ3) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_sse2;
|
2012-08-05 12:11:04 +03:00
|
|
|
} else if (codec_id == AV_CODEC_ID_RV40) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_sse2;
|
|
|
|
} else {
|
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_sse2;
|
|
|
|
}
|
2010-10-06 01:06:18 +03:00
|
|
|
}
|
2010-08-30 19:34:13 +03:00
|
|
|
}
|
|
|
|
|
2011-06-07 17:31:51 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_SSSE3) {
|
|
|
|
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
|
|
|
|
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
|
|
|
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_ssse3;
|
|
|
|
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_ssse3;
|
|
|
|
h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_ssse3;
|
|
|
|
h->pred8x8l [VERT_PRED ] = ff_pred8x8l_vertical_ssse3;
|
|
|
|
h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_ssse3;
|
|
|
|
h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = ff_pred8x8l_down_right_ssse3;
|
|
|
|
h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_ssse3;
|
|
|
|
h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_ssse3;
|
|
|
|
h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_ssse3;
|
|
|
|
h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_ssse3;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_VP8) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred8x8 [PLANE_PRED8x8 ] = ff_pred8x8_tm_vp8_ssse3;
|
|
|
|
h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3;
|
2010-10-06 01:06:18 +03:00
|
|
|
} else {
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
|
|
|
h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_plane_ssse3;
|
2012-08-05 12:11:04 +03:00
|
|
|
if (codec_id == AV_CODEC_ID_SVQ3) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_svq3_ssse3;
|
2012-08-05 12:11:04 +03:00
|
|
|
} else if (codec_id == AV_CODEC_ID_RV40) {
|
2011-06-07 17:31:51 +03:00
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_rv40_ssse3;
|
|
|
|
} else {
|
|
|
|
h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_plane_h264_ssse3;
|
|
|
|
}
|
2010-10-06 01:06:18 +03:00
|
|
|
}
|
2010-08-30 19:34:13 +03:00
|
|
|
}
|
2011-06-06 02:20:05 +03:00
|
|
|
} else if (bit_depth == 10) {
|
2012-07-08 19:42:12 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_MMXEXT) {
|
2011-06-06 02:20:05 +03:00
|
|
|
h->pred4x4[DC_PRED ] = ff_pred4x4_dc_10_mmxext;
|
|
|
|
h->pred4x4[HOR_UP_PRED ] = ff_pred4x4_horizontal_up_10_mmxext;
|
2011-07-03 21:56:09 +03:00
|
|
|
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1)
|
|
|
|
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_10_mmxext;
|
2011-07-03 21:56:09 +03:00
|
|
|
|
2011-07-12 00:26:43 +03:00
|
|
|
h->pred8x8l[DC_128_PRED ] = ff_pred8x8l_128_dc_10_mmxext;
|
|
|
|
|
|
|
|
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_10_mmxext;
|
|
|
|
h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_10_mmxext;
|
|
|
|
h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_10_mmxext;
|
|
|
|
h->pred16x16[LEFT_DC_PRED8x8 ] = ff_pred16x16_left_dc_10_mmxext;
|
2011-07-03 21:56:09 +03:00
|
|
|
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_10_mmxext;
|
|
|
|
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_10_mmxext;
|
2011-06-06 02:20:05 +03:00
|
|
|
}
|
|
|
|
if (mm_flags & AV_CPU_FLAG_SSE2) {
|
|
|
|
h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_sse2;
|
|
|
|
h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_sse2;
|
|
|
|
h->pred4x4[VERT_LEFT_PRED ] = ff_pred4x4_vertical_left_10_sse2;
|
|
|
|
h->pred4x4[VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_10_sse2;
|
|
|
|
h->pred4x4[HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_10_sse2;
|
|
|
|
|
2011-08-15 01:39:55 +03:00
|
|
|
if (chroma_format_idc == 1) {
|
|
|
|
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_10_sse2;
|
|
|
|
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_10_sse2;
|
|
|
|
h->pred8x8[PLANE_PRED8x8 ] = ff_pred8x8_plane_10_sse2;
|
|
|
|
h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vertical_10_sse2;
|
|
|
|
h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_horizontal_10_sse2;
|
|
|
|
}
|
2011-07-03 21:56:09 +03:00
|
|
|
|
|
|
|
h->pred8x8l[VERT_PRED ] = ff_pred8x8l_vertical_10_sse2;
|
|
|
|
h->pred8x8l[HOR_PRED ] = ff_pred8x8l_horizontal_10_sse2;
|
|
|
|
h->pred8x8l[DC_PRED ] = ff_pred8x8l_dc_10_sse2;
|
2011-07-12 00:26:43 +03:00
|
|
|
h->pred8x8l[DC_128_PRED ] = ff_pred8x8l_128_dc_10_sse2;
|
2011-07-03 21:56:09 +03:00
|
|
|
h->pred8x8l[TOP_DC_PRED ] = ff_pred8x8l_top_dc_10_sse2;
|
|
|
|
h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_sse2;
|
|
|
|
h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_sse2;
|
|
|
|
h->pred8x8l[VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_10_sse2;
|
|
|
|
h->pred8x8l[HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_10_sse2;
|
|
|
|
|
2011-07-12 00:26:43 +03:00
|
|
|
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_10_sse2;
|
|
|
|
h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_10_sse2;
|
|
|
|
h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_10_sse2;
|
|
|
|
h->pred16x16[LEFT_DC_PRED8x8 ] = ff_pred16x16_left_dc_10_sse2;
|
2011-07-03 21:56:09 +03:00
|
|
|
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_10_sse2;
|
|
|
|
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_10_sse2;
|
2011-06-06 02:20:05 +03:00
|
|
|
}
|
|
|
|
if (mm_flags & AV_CPU_FLAG_SSSE3) {
|
|
|
|
h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_ssse3;
|
|
|
|
h->pred4x4[VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_10_ssse3;
|
|
|
|
h->pred4x4[HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_10_ssse3;
|
2011-07-03 21:56:09 +03:00
|
|
|
|
|
|
|
h->pred8x8l[HOR_PRED ] = ff_pred8x8l_horizontal_10_ssse3;
|
|
|
|
h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_ssse3;
|
2011-07-22 04:15:58 +03:00
|
|
|
h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_ssse3;
|
|
|
|
h->pred8x8l[VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_10_ssse3;
|
|
|
|
h->pred8x8l[HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_10_ssse3;
|
2011-06-06 02:20:05 +03:00
|
|
|
}
|
|
|
|
#if HAVE_AVX
|
2011-06-07 17:31:51 +03:00
|
|
|
if (mm_flags & AV_CPU_FLAG_AVX) {
|
2011-06-06 02:20:05 +03:00
|
|
|
h->pred4x4[DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_10_avx;
|
|
|
|
h->pred4x4[DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_10_avx;
|
2011-07-22 04:15:58 +03:00
|
|
|
h->pred4x4[VERT_LEFT_PRED ] = ff_pred4x4_vertical_left_10_avx;
|
2011-06-06 02:20:05 +03:00
|
|
|
h->pred4x4[VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_10_avx;
|
|
|
|
h->pred4x4[HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_10_avx;
|
2011-07-22 04:15:58 +03:00
|
|
|
|
|
|
|
h->pred8x8l[VERT_PRED ] = ff_pred8x8l_vertical_10_avx;
|
|
|
|
h->pred8x8l[HOR_PRED ] = ff_pred8x8l_horizontal_10_avx;
|
|
|
|
h->pred8x8l[DC_PRED ] = ff_pred8x8l_dc_10_avx;
|
|
|
|
h->pred8x8l[TOP_DC_PRED ] = ff_pred8x8l_top_dc_10_avx;
|
|
|
|
h->pred8x8l[DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_10_avx;
|
|
|
|
h->pred8x8l[DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_10_avx;
|
|
|
|
h->pred8x8l[VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_10_avx;
|
|
|
|
h->pred8x8l[HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_10_avx;
|
2011-06-06 02:20:05 +03:00
|
|
|
}
|
|
|
|
#endif /* HAVE_AVX */
|
|
|
|
}
|
2011-06-07 17:31:51 +03:00
|
|
|
#endif /* HAVE_YASM */
|
2010-08-30 19:34:13 +03:00
|
|
|
}
|