1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

Merge commit '2c10e2a2f62477efaef5b641974594f7df4ca339'

* commit '2c10e2a2f62477efaef5b641974594f7df4ca339':
  build: Make the H.264 parser select h264qpel
  x86: h264qpel: add cpu flag checks for init function

Conflicts:
	libavcodec/x86/h264_qpel.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2013-01-25 14:14:21 +01:00
2 changed files with 75 additions and 78 deletions

2
configure vendored
View File

@@ -1824,7 +1824,7 @@ wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel" wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
# parsers # parsers
h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo" h264_parser_select="error_resilience golomb h264dsp h264pred h264qpel mpegvideo"
mpeg4video_parser_select="error_resilience mpegvideo" mpeg4video_parser_select="error_resilience mpegvideo"
mpegvideo_parser_select="error_resilience mpegvideo" mpegvideo_parser_select="error_resilience mpegvideo"
vc1_parser_select="error_resilience mpegvideo" vc1_parser_select="error_resilience mpegvideo"

View File

@@ -21,6 +21,7 @@
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/x86/asm.h" #include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/dsputil.h" #include "libavcodec/dsputil.h"
#include "libavcodec/h264qpel.h" #include "libavcodec/h264qpel.h"
#include "libavcodec/mpegvideo.h" #include "libavcodec/mpegvideo.h"
@@ -530,12 +531,11 @@ QPEL16(mmxext)
void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth) void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth)
{ {
#if HAVE_YASM
int high_bit_depth = bit_depth > 8; int high_bit_depth = bit_depth > 8;
int mm_flags = av_get_cpu_flags(); int mm_flags = av_get_cpu_flags();
#if HAVE_MMXEXT_EXTERNAL if (EXTERNAL_MMXEXT(mm_flags)) {
if (!(mm_flags & AV_CPU_FLAG_MMXEXT))
return;
if (!high_bit_depth) { if (!high_bit_depth) {
SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmxext, ); SET_QPEL_FUNCS(put_h264_qpel, 0, 16, mmxext, );
SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmxext, ); SET_QPEL_FUNCS(put_h264_qpel, 1, 8, mmxext, );
@@ -553,11 +553,9 @@ void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth)
SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 10_mmxext, ff_); SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 10_mmxext, ff_);
SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 10_mmxext, ff_); SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 10_mmxext, ff_);
} }
#endif }
#if HAVE_SSE2_EXTERNAL if (EXTERNAL_SSE2(mm_flags)) {
if (!(mm_flags & AV_CPU_FLAG_SSE2))
return;
if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW) && !high_bit_depth) { if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW) && !high_bit_depth) {
// these functions are slower than mmx on AMD, but faster on Intel // these functions are slower than mmx on AMD, but faster on Intel
H264_QPEL_FUNCS(0, 0, sse2); H264_QPEL_FUNCS(0, 0, sse2);
@@ -587,11 +585,9 @@ void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth)
H264_QPEL_FUNCS_10(2, 0, sse2_cache64); H264_QPEL_FUNCS_10(2, 0, sse2_cache64);
H264_QPEL_FUNCS_10(3, 0, sse2_cache64); H264_QPEL_FUNCS_10(3, 0, sse2_cache64);
} }
#endif }
#if HAVE_SSSE3_EXTERNAL if (EXTERNAL_SSSE3(mm_flags)) {
if (!(mm_flags & AV_CPU_FLAG_SSSE3))
return;
if (!high_bit_depth) { if (!high_bit_depth) {
H264_QPEL_FUNCS(1, 0, ssse3); H264_QPEL_FUNCS(1, 0, ssse3);
H264_QPEL_FUNCS(1, 1, ssse3); H264_QPEL_FUNCS(1, 1, ssse3);
@@ -612,13 +608,14 @@ void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth)
H264_QPEL_FUNCS_10(2, 0, ssse3_cache64); H264_QPEL_FUNCS_10(2, 0, ssse3_cache64);
H264_QPEL_FUNCS_10(3, 0, ssse3_cache64); H264_QPEL_FUNCS_10(3, 0, ssse3_cache64);
} }
#endif }
#if HAVE_AVX_EXTERNAL if (EXTERNAL_AVX(mm_flags)) {
if (bit_depth == 10) { if (bit_depth == 10) {
H264_QPEL_FUNCS_10(1, 0, sse2); H264_QPEL_FUNCS_10(1, 0, sse2);
H264_QPEL_FUNCS_10(2, 0, sse2); H264_QPEL_FUNCS_10(2, 0, sse2);
H264_QPEL_FUNCS_10(3, 0, sse2); H264_QPEL_FUNCS_10(3, 0, sse2);
} }
}
#endif #endif
} }