@ -521,11 +521,9 @@ do { \
} while ( 0 )
static av_cold void dsputil_init_mmx ( DSPContext * c , AVCodecContext * avctx ,
int cpu_flags )
int cpu_flags , unsigned high_bit_depth )
{
# if HAVE_MMX_INLINE
const int high_bit_depth = avctx - > bits_per_raw_sample > 8 ;
c - > put_pixels_clamped = ff_put_pixels_clamped_mmx ;
c - > put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx ;
c - > add_pixels_clamped = ff_add_pixels_clamped_mmx ;
@ -549,11 +547,9 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_mmxext ( DSPContext * c , AVCodecContext * avctx ,
int cpu_flags )
int cpu_flags , unsigned high_bit_depth )
{
# if HAVE_MMXEXT_INLINE
const int high_bit_depth = avctx - > bits_per_raw_sample > 8 ;
if ( ! high_bit_depth & & avctx - > idct_algo = = FF_IDCT_XVIDMMX & & avctx - > lowres = = 0 ) {
c - > idct_put = ff_idct_xvid_mmxext_put ;
c - > idct_add = ff_idct_xvid_mmxext_add ;
@ -580,11 +576,9 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_sse ( DSPContext * c , AVCodecContext * avctx ,
int cpu_flags )
int cpu_flags , unsigned high_bit_depth )
{
# if HAVE_SSE_INLINE
const int high_bit_depth = avctx - > bits_per_raw_sample > 8 ;
c - > vector_clipf = ff_vector_clipf_sse ;
/* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
@ -605,11 +599,9 @@ static av_cold void dsputil_init_sse(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_sse2 ( DSPContext * c , AVCodecContext * avctx ,
int cpu_flags )
int cpu_flags , unsigned high_bit_depth )
{
# if HAVE_SSE2_INLINE
const int high_bit_depth = avctx - > bits_per_raw_sample > 8 ;
if ( ! high_bit_depth & & avctx - > idct_algo = = FF_IDCT_XVIDMMX & & avctx - > lowres = = 0 ) {
c - > idct_put = ff_idct_xvid_sse2_put ;
c - > idct_add = ff_idct_xvid_sse2_add ;
@ -631,7 +623,7 @@ static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_ssse3 ( DSPContext * c , AVCodecContext * avctx ,
int cpu_flags )
int cpu_flags , unsigned high_bit_depth )
{
# if HAVE_SSSE3_EXTERNAL
c - > add_hfyu_left_prediction = ff_add_hfyu_left_prediction_ssse3 ;
@ -645,14 +637,15 @@ static av_cold void dsputil_init_ssse3(DSPContext *c, AVCodecContext *avctx,
}
static av_cold void dsputil_init_sse4 ( DSPContext * c , AVCodecContext * avctx ,
int cpu_flags )
int cpu_flags , unsigned high_bit_depth )
{
# if HAVE_SSE4_EXTERNAL
c - > vector_clip_int32 = ff_vector_clip_int32_sse4 ;
# endif /* HAVE_SSE4_EXTERNAL */
}
av_cold void ff_dsputil_init_x86 ( DSPContext * c , AVCodecContext * avctx )
av_cold void ff_dsputil_init_x86 ( DSPContext * c , AVCodecContext * avctx ,
unsigned high_bit_depth )
{
int cpu_flags = av_get_cpu_flags ( ) ;
@ -665,7 +658,7 @@ av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
# if HAVE_INLINE_ASM
const int idct_algo = avctx - > idct_algo ;
if ( avctx - > lowres = = 0 & & avctx - > bits_per_raw_sample < = 8 ) {
if ( avctx - > lowres = = 0 & & ! high_bit_depth ) {
if ( idct_algo = = FF_IDCT_AUTO | | idct_algo = = FF_IDCT_SIMPLEMMX ) {
c - > idct_put = ff_simple_idct_put_mmx ;
c - > idct_add = ff_simple_idct_add_mmx ;
@ -679,24 +672,24 @@ av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
}
# endif /* HAVE_INLINE_ASM */
dsputil_init_mmx ( c , avctx , cpu_flags ) ;
dsputil_init_mmx ( c , avctx , cpu_flags , high_bit_depth ) ;
}
if ( X86_MMXEXT ( cpu_flags ) )
dsputil_init_mmxext ( c , avctx , cpu_flags ) ;
dsputil_init_mmxext ( c , avctx , cpu_flags , high_bit_depth ) ;
if ( X86_SSE ( cpu_flags ) )
dsputil_init_sse ( c , avctx , cpu_flags ) ;
dsputil_init_sse ( c , avctx , cpu_flags , high_bit_depth ) ;
if ( X86_SSE2 ( cpu_flags ) )
dsputil_init_sse2 ( c , avctx , cpu_flags ) ;
dsputil_init_sse2 ( c , avctx , cpu_flags , high_bit_depth ) ;
if ( EXTERNAL_SSSE3 ( cpu_flags ) )
dsputil_init_ssse3 ( c , avctx , cpu_flags ) ;
dsputil_init_ssse3 ( c , avctx , cpu_flags , high_bit_depth ) ;
if ( EXTERNAL_SSE4 ( cpu_flags ) )
dsputil_init_sse4 ( c , avctx , cpu_flags ) ;
dsputil_init_sse4 ( c , avctx , cpu_flags , high_bit_depth ) ;
if ( CONFIG_ENCODERS )
ff_dsputilenc_init_mmx ( c , avctx ) ;
ff_dsputilenc_init_mmx ( c , avctx , high_bit_depth ) ;
}