mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 06:29:31 +00:00
gst/deinterlace2/tvtime/vfir.c: Make it possible to use the vfir method on X86 CPUs without MMXEXT too but use the MM...
Original commit message from CVS: * gst/deinterlace2/tvtime/vfir.c: (deinterlace_line_mmxext), (deinterlace_line_c), (deinterlace_scanline_vfir): Make it possible to use the vfir method on X86 CPUs without MMXEXT too but use the MMXEXT optimized code whenever possible.
This commit is contained in:
parent
0c293c5824
commit
25442736e5
2 changed files with 33 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-06-20 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/deinterlace2/tvtime/vfir.c: (deinterlace_line_mmxext),
|
||||||
|
(deinterlace_line_c), (deinterlace_scanline_vfir):
|
||||||
|
Make it possible to use the vfir method on X86 CPUs without MMXEXT too
|
||||||
|
but use the MMXEXT optimized code whenever possible.
|
||||||
|
|
||||||
2008-06-20 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-06-20 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
* gst/deinterlace2/gstdeinterlace2.c:
|
* gst/deinterlace2/gstdeinterlace2.c:
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mmx.h"
|
|
||||||
#include "speedy.h"
|
#include "speedy.h"
|
||||||
#include "gstdeinterlace2.h"
|
#include "gstdeinterlace2.h"
|
||||||
|
|
||||||
|
@ -50,12 +49,13 @@
|
||||||
* filter taps here are: [-1 4 2 4 -1].
|
* filter taps here are: [-1 4 2 4 -1].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CPU_I386
|
||||||
|
#include "mmx.h"
|
||||||
static void
|
static void
|
||||||
deinterlace_line (uint8_t * dst, uint8_t * lum_m4,
|
deinterlace_line_mmxext (uint8_t * dst, uint8_t * lum_m4,
|
||||||
uint8_t * lum_m3, uint8_t * lum_m2,
|
uint8_t * lum_m3, uint8_t * lum_m2,
|
||||||
uint8_t * lum_m1, uint8_t * lum, int size)
|
uint8_t * lum_m1, uint8_t * lum, int size)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CPU_I386
|
|
||||||
mmx_t rounder;
|
mmx_t rounder;
|
||||||
|
|
||||||
rounder.uw[0] = 4;
|
rounder.uw[0] = 4;
|
||||||
|
@ -94,10 +94,17 @@ deinterlace_line (uint8_t * dst, uint8_t * lum_m4,
|
||||||
dst += 4;
|
dst += 4;
|
||||||
}
|
}
|
||||||
emms ();
|
emms ();
|
||||||
#else
|
}
|
||||||
/**
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
* C implementation.
|
* C implementation.
|
||||||
*/
|
*/
|
||||||
|
static void
|
||||||
|
deinterlace_line_c (uint8_t * dst, uint8_t * lum_m4,
|
||||||
|
uint8_t * lum_m3, uint8_t * lum_m2,
|
||||||
|
uint8_t * lum_m1, uint8_t * lum, int size)
|
||||||
|
{
|
||||||
int sum;
|
int sum;
|
||||||
|
|
||||||
for (; size > 0; size--) {
|
for (; size > 0; size--) {
|
||||||
|
@ -114,10 +121,8 @@ deinterlace_line (uint8_t * dst, uint8_t * lum_m4,
|
||||||
lum++;
|
lum++;
|
||||||
dst++;
|
dst++;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The commented-out method below that uses the bottom_field member is more
|
* The commented-out method below that uses the bottom_field member is more
|
||||||
* like the filter as specified in the MPEG2 spec, but it doesn't seem to
|
* like the filter as specified in the MPEG2 spec, but it doesn't seem to
|
||||||
|
@ -128,8 +133,18 @@ static void
|
||||||
deinterlace_scanline_vfir (GstDeinterlace2 * object,
|
deinterlace_scanline_vfir (GstDeinterlace2 * object,
|
||||||
deinterlace_scanline_data_t * data, uint8_t * output)
|
deinterlace_scanline_data_t * data, uint8_t * output)
|
||||||
{
|
{
|
||||||
deinterlace_line (output, data->tt1, data->t0, data->m1, data->b0, data->bb1,
|
#ifdef HAVE_CPU_I386
|
||||||
object->frame_width * 2);
|
if (object->cpu_feature_flags & OIL_IMPL_FLAG_MMXEXT) {
|
||||||
|
deinterlace_line_mmxext (output, data->tt1, data->t0, data->m1, data->b0,
|
||||||
|
data->bb1, object->frame_width * 2);
|
||||||
|
} else {
|
||||||
|
deinterlace_line_c (output, data->tt1, data->t0, data->m1, data->b0,
|
||||||
|
data->bb1, object->frame_width * 2);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
deinterlace_line_c (output, data->tt1, data->t0, data->m1, data->b0,
|
||||||
|
data->bb1, object->frame_width * 2);
|
||||||
|
#endif
|
||||||
// blit_packed422_scanline( output, data->m1, width );
|
// blit_packed422_scanline( output, data->m1, width );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,11 +168,7 @@ static deinterlace_method_t vfirmethod = {
|
||||||
"Blur: Vertical",
|
"Blur: Vertical",
|
||||||
"BlurVertical",
|
"BlurVertical",
|
||||||
2,
|
2,
|
||||||
#ifdef HAVE_CPU_I386
|
|
||||||
OIL_IMPL_FLAG_MMXEXT,
|
|
||||||
#else
|
|
||||||
0,
|
0,
|
||||||
#endif
|
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Reference in a new issue