avcodec/x86: use function pointers for {put,add}_pixels_clamped

Same behavior as in simple_idct.
This way the best optimized versions available will be used instead.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
pull/86/head
James Almer 10 years ago
parent 857fc0a71f
commit ad26e83f9c
  1. 2
      libavcodec/x86/cavsdsp.c
  2. 9
      libavcodec/x86/xvididct_mmx.c
  3. 6
      libavcodec/x86/xvididct_sse2.c

@ -198,7 +198,7 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
);
}
ff_add_pixels_clamped_mmx(b2, dst, stride);
ff_add_pixels_clamped(b2, dst, stride);
}
#endif /* HAVE_MMX_INLINE */

@ -46,6 +46,7 @@
#include "libavutil/mem.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/idctdsp.h"
#include "idctdsp.h"
#include "xvididct.h"
@ -497,13 +498,13 @@ void ff_xvid_idct_mmx(short *block)
void ff_xvid_idct_mmx_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_xvid_idct_mmx(block);
ff_put_pixels_clamped_mmx(block, dest, line_size);
ff_put_pixels_clamped(block, dest, line_size);
}
void ff_xvid_idct_mmx_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_xvid_idct_mmx(block);
ff_add_pixels_clamped_mmx(block, dest, line_size);
ff_add_pixels_clamped(block, dest, line_size);
}
#endif /* HAVE_MMX_INLINE */
@ -536,13 +537,13 @@ void ff_xvid_idct_mmxext(short *block)
void ff_xvid_idct_mmxext_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_xvid_idct_mmxext(block);
ff_put_pixels_clamped_mmx(block, dest, line_size);
ff_put_pixels_clamped(block, dest, line_size);
}
void ff_xvid_idct_mmxext_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_xvid_idct_mmxext(block);
ff_add_pixels_clamped_mmx(block, dest, line_size);
ff_add_pixels_clamped(block, dest, line_size);
}
#endif /* HAVE_MMXEXT_INLINE */

@ -41,6 +41,8 @@
#include "libavutil/mem.h"
#include "libavutil/x86/asm.h"
#include "libavcodec/idctdsp.h"
#include "idctdsp.h"
#include "xvididct.h"
@ -392,13 +394,13 @@ av_extern_inline void ff_xvid_idct_sse2(short *block)
void ff_xvid_idct_sse2_put(uint8_t *dest, int line_size, short *block)
{
ff_xvid_idct_sse2(block);
ff_put_pixels_clamped_mmx(block, dest, line_size);
ff_put_pixels_clamped(block, dest, line_size);
}
void ff_xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block)
{
ff_xvid_idct_sse2(block);
ff_add_pixels_clamped_mmx(block, dest, line_size);
ff_add_pixels_clamped(block, dest, line_size);
}
#endif /* HAVE_SSE2_INLINE */

Loading…
Cancel
Save