History

Merge commit '4efab89332ea39a77145e8b15562b981d9dbde68'

* commit '4efab89332ea39a77145e8b15562b981d9dbde68': x86: Use *_FAST/*_SLOW CPU feature detection macros where appropriate

James Almer committed 9 years ago

Commit ac774cf2 parents a956164 4efab894 files · +17 −13Browse files

Unified · Split

4 files
  1. libavcodec/x86/ac3dsp_init.c +8 −5
  2. libavcodec/x86/h264_qpel.c +6 −5
  3. libavcodec/x86/lpc.c +1 −1
  4. libavcodec/x86/vp8dsp_init.c +2 −2
libavcodec/x86/ac3dsp_init.c+8−5
@@ -228,16 +228,19 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) · 227 unmodified lines
228228 c->float_to_fixed24 = ff_float_to_fixed24_sse2;
229229 c->compute_mantissa_size = ff_ac3_compute_mantissa_size_sse2;
230230 c->extract_exponents = ff_ac3_extract_exponents_sse2;
231− if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
232− c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
233− c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
234− }
235231 if (bit_exact) {
236232 c->apply_window_int16 = ff_apply_window_int16_sse2;
237− } else if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
233+ }
234+ }
235+
236+ if (EXTERNAL_SSE2_FAST(cpu_flags)) {
237+ c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
238+ c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
239+ if (!bit_exact) {
238240 c->apply_window_int16 = ff_apply_window_int16_round_sse2;
239241 }
240242 }
243+
241244 if (EXTERNAL_SSSE3(cpu_flags)) {
242245 c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_ssse3;
243246 if (cpu_flags & AV_CPU_FLAG_ATOM) {
libavcodec/x86/h264_qpel.c+6−5
@@ -562,11 +562,6 @@ av_cold void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth) · 561 unmodified lines
562562 }
563563
564564 if (EXTERNAL_SSE2(cpu_flags)) {
565− if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW) && !high_bit_depth) {
566− // these functions are slower than mmx on AMD, but faster on Intel
567− H264_QPEL_FUNCS(0, 0, sse2);
568− }
569−
570565 if (!high_bit_depth) {
571566 H264_QPEL_FUNCS(0, 1, sse2);
572567 H264_QPEL_FUNCS(0, 2, sse2);
@@ -593,6 +588,12 @@ av_cold void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth) · 20 unmodified lines
593588 }
594589 }
595590
591+ if (EXTERNAL_SSE2_FAST(cpu_flags)) {
592+ if (!high_bit_depth) {
593+ H264_QPEL_FUNCS(0, 0, sse2);
594+ }
595+ }
596+
596597 if (EXTERNAL_SSSE3(cpu_flags)) {
597598 if (!high_bit_depth) {
598599 H264_QPEL_FUNCS(1, 0, ssse3);
libavcodec/x86/lpc.c+1−1
@@ -154,7 +154,7 @@ av_cold void ff_lpc_init_x86(LPCContext *c) · 153 unmodified lines
154154 #if HAVE_SSE2_INLINE
155155 int cpu_flags = av_get_cpu_flags();
156156
157− if (HAVE_SSE2_INLINE && cpu_flags & (AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW)) {
157+ if (INLINE_SSE2(cpu_flags) || INLINE_SSE2_SLOW(cpu_flags)) {
158158 c->lpc_apply_welch_window = lpc_apply_welch_window_sse2;
159159 c->lpc_compute_autocorr = lpc_compute_autocorr_sse2;
160160 }
libavcodec/x86/vp8dsp_init.c+2−2
@@ -346,7 +346,7 @@ av_cold void ff_vp78dsp_init_x86(VP8DSPContext *c) · 345 unmodified lines
346346 c->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_sse;
347347 }
348348
349− if (HAVE_SSE2_EXTERNAL && cpu_flags & (AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW)) {
349+ if (EXTERNAL_SSE2(cpu_flags) || EXTERNAL_SSE2_SLOW(cpu_flags)) {
350350 VP8_LUMA_MC_FUNC(0, 16, sse2);
351351 VP8_MC_FUNC(1, 8, sse2);
352352 VP8_BILINEAR_MC_FUNC(0, 16, sse2);
@@ -416,7 +416,7 @@ av_cold void ff_vp8dsp_init_x86(VP8DSPContext *c) · 63 unmodified lines
416416 c->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_sse;
417417 }
418418
419− if (HAVE_SSE2_EXTERNAL && cpu_flags & (AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW)) {
419+ if (EXTERNAL_SSE2(cpu_flags) || EXTERNAL_SSE2_SLOW(cpu_flags)) {
420420 c->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_sse2;
421421
422422 c->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16y_inner_sse2;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t