x86: Replace checks for CPU extensions and flags by convenience macros
This separates code relying on inline from that relying on external assembly and fixes instances where the coalesced check was incorrect.
This commit is contained in:
parent
6a0200f24d
commit
e0c6cce447
21 changed files with 133 additions and 156 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/x86/asm.h"
|
||||
#include "libavutil/x86/cpu.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "libavcodec/rv34dsp.h"
|
||||
|
||||
|
@ -32,16 +33,14 @@ void ff_rv34_idct_add_mmx2(uint8_t *dst, ptrdiff_t stride, DCTELEM *block);
|
|||
|
||||
av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp)
|
||||
{
|
||||
#if HAVE_YASM
|
||||
int mm_flags = av_get_cpu_flags();
|
||||
|
||||
if (mm_flags & AV_CPU_FLAG_MMX)
|
||||
if (EXTERNAL_MMX(mm_flags))
|
||||
c->rv34_idct_dc_add = ff_rv34_idct_dc_add_mmx;
|
||||
if (mm_flags & AV_CPU_FLAG_MMXEXT) {
|
||||
if (EXTERNAL_MMXEXT(mm_flags)) {
|
||||
c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmx2;
|
||||
c->rv34_idct_add = ff_rv34_idct_add_mmx2;
|
||||
}
|
||||
if (mm_flags & AV_CPU_FLAG_SSE4)
|
||||
if (EXTERNAL_SSE4(mm_flags))
|
||||
c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
|
||||
#endif /* HAVE_YASM */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue