Diego Biurrun <di...@biurrun.de> writes:

> ---
>  libavcodec/x86/h264_intrapred_init.c |    6 +++---
>  libavcodec/x86/h264dsp_mmx.c         |    2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/x86/h264_intrapred_init.c 
> b/libavcodec/x86/h264_intrapred_init.c
> index 558bb86..69de86e 100644
> --- a/libavcodec/x86/h264_intrapred_init.c
> +++ b/libavcodec/x86/h264_intrapred_init.c
> @@ -188,9 +188,9 @@ void ff_h264_pred_init_x86(H264PredContext *h, int 
> codec_id, const int bit_depth
>              } else {
>                  if (chroma_format_idc == 1)
>                      h->pred8x8  [PLANE_PRED8x8] = ff_pred8x8_plane_mmx;
> -                if (codec_id == CODEC_ID_SVQ3) {
> -                    if (HAVE_CMOV)
> -                        h->pred16x16[PLANE_PRED8x8] = 
> ff_pred16x16_plane_svq3_mmx;
> +                if (codec_id == CODEC_ID_SVQ3 &&
> +                    HAVE_CMOV && mm_flags & AV_CPU_FLAG_CMOV) {
> +                    h->pred16x16[PLANE_PRED8x8] = 
> ff_pred16x16_plane_svq3_mmx;
>                  } else if (codec_id == CODEC_ID_RV40) {
>                      h->pred16x16[PLANE_PRED8x8] = 
> ff_pred16x16_plane_rv40_mmx;
>                  } else {
> diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c
> index 64b7d9c..07135d0 100644
> --- a/libavcodec/x86/h264dsp_mmx.c
> +++ b/libavcodec/x86/h264dsp_mmx.c
> @@ -362,7 +362,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int 
> bit_depth, const int chrom
>          if (chroma_format_idc == 1)
>              c->h264_idct_add8       = ff_h264_idct_add8_8_mmx;
>          c->h264_idct_add16intra     = ff_h264_idct_add16intra_8_mmx;
> -        if (HAVE_CMOV)
> +        if (HAVE_CMOV && mm_flags & AV_CPU_FLAG_CMOV)
>              c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_mmx;
>
>          if (mm_flags & AV_CPU_FLAG_MMX2) {
> -- 

In addition to what Hendrik Leppkes said, this is, if not wrong,
inconsistent with how optimised functions are usually handled.
The usual way on x86 is to build everything and use only runtime
detection to determine which function pointers to assign.  In other
words, I think you should drop the first patch and modify this to use
only the flag check.

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to