Something useable :)

1) Added optimized versions of four field deinterlacing, including SSSE3 ones.
2) Removed the "Very Soft" and "Very Hard" options.
3) Deinterlacing happens before any rotation to the image.
This commit is contained in:
Kfir Itzhak
2012-07-15 17:30:37 +03:00
parent a6c7acd02a
commit 0fe55a18bf
4 changed files with 1352 additions and 268 deletions

View File

File diff suppressed because it is too large Load Diff

View File

@@ -47,9 +47,9 @@ extern "C"
typedef void (*blend_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long, double);
typedef void (*delta_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long);
typedef void (*convert_fptr_t)(const uint8_t*, uint8_t*, unsigned long);
typedef void (*deinterlace_4field_fptr_t)(uint8_t*, uint8_t*, unsigned int, unsigned int, unsigned int);
typedef void* (*imgbufcpy_fptr_t)(void*, const void*, size_t);
extern imgbufcpy_fptr_t fptr_imgbufcpy;
/* Should be called from Image class functions */
@@ -242,6 +242,7 @@ public:
void Rotate( int angle );
void Flip( bool leftright );
void Scale( unsigned int factor );
void Deinterlace_Discard();
void Deinterlace_Linear();
void Deinterlace_Blend();
@@ -292,4 +293,16 @@ void zm_convert_rgb555_rgba(const uint8_t* col1, uint8_t* result, unsigned long
void zm_convert_rgb565_rgb(const uint8_t* col1, uint8_t* result, unsigned long count);
void zm_convert_rgb565_rgba(const uint8_t* col1, uint8_t* result, unsigned long count);
/* Deinterlace_4Field functions */
void std_deinterlace_4field_gray8(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void std_deinterlace_4field_rgb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void std_deinterlace_4field_bgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void std_deinterlace_4field_rgba(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void std_deinterlace_4field_bgra(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void std_deinterlace_4field_argb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void std_deinterlace_4field_abgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void ssse3_deinterlace_4field_gray8(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void ssse3_deinterlace_4field_rgba(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void ssse3_deinterlace_4field_bgra(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void ssse3_deinterlace_4field_argb(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);
void ssse3_deinterlace_4field_abgr(uint8_t* col1, uint8_t* col2, unsigned int threshold, unsigned int width, unsigned int height);

View File

@@ -2631,6 +2631,21 @@ int Monitor::Capture()
if ( captureResult == 1 )
{
/* Deinterlacing */
if ( (deinterlacing & 0xff) == 1 ) {
capture_image->Deinterlace_Discard();
} else if ( (deinterlacing & 0xff) == 2 ) {
capture_image->Deinterlace_Linear();
} else if ( (deinterlacing & 0xff) == 3 ) {
capture_image->Deinterlace_Blend();
} else if ( (deinterlacing & 0xff) == 4 ) {
capture_image->Deinterlace_4Field( next_buffer.image, (deinterlacing>>8)&0xff );
} else if ( (deinterlacing & 0xff) == 5 ) {
capture_image->Deinterlace_Blend_CustomRatio( (deinterlacing>>8)&0xff );
}
if ( orientation != ROTATE_0 )
{
switch ( orientation )
@@ -2655,19 +2670,6 @@ int Monitor::Capture()
}
}
}
/* Deinterlacing */
if ( (deinterlacing & 0xff) == 1 ) {
capture_image->Deinterlace_Discard();
} else if ( (deinterlacing & 0xff) == 2 ) {
capture_image->Deinterlace_Linear();
} else if ( (deinterlacing & 0xff) == 3 ) {
capture_image->Deinterlace_Blend();
} else if ( (deinterlacing & 0xff) == 4 ) {
capture_image->Deinterlace_4Field( next_buffer.image, (deinterlacing>>8)&0xff );
} else if ( (deinterlacing & 0xff) == 5 ) {
capture_image->Deinterlace_Blend_CustomRatio( (deinterlacing>>8)&0xff );
}
}
if ( true ) {

View File

@@ -364,11 +364,9 @@ $orientations = array(
$deinterlaceopts = array(
"Disabled" => 0x00000000,
"Four field motion adaptive - Very Soft" => 0x00003204, /* 50 change */
"Four field motion adaptive - Soft" => 0x00002804, /* 40 change */
"Four field motion adaptive - Medium" => 0x00001E04, /* 30 change */
"Four field motion adaptive - Hard" => 0x00001404, /* 20 change */
"Four field motion adaptive - Very Hard" => 0x00000A04, /* 10 change */
"Four field motion adaptive - Soft" => 0x00001E04, /* 30 change */
"Four field motion adaptive - Medium" => 0x00001404, /* 20 change */
"Four field motion adaptive - Hard" => 0x00000A04, /* 10 change */
"Discard" => 0x00000001,
"Linear" => 0x00000002,
"Blend" => 0x00000003,
@@ -377,11 +375,9 @@ $deinterlaceopts = array(
$deinterlaceopts_v4l2 = array(
"Disabled" => 0x00000000,
"Four field motion adaptive - Very Soft" => 0x00003204, /* 50 change */
"Four field motion adaptive - Soft" => 0x00002804, /* 40 change */
"Four field motion adaptive - Medium" => 0x00001E04, /* 30 change */
"Four field motion adaptive - Hard" => 0x00001404, /* 20 change */
"Four field motion adaptive - Very Hard" => 0x00000A04, /* 10 change */
"Four field motion adaptive - Soft" => 0x00001E04, /* 30 change */
"Four field motion adaptive - Medium" => 0x00001404, /* 20 change */
"Four field motion adaptive - Hard" => 0x00000A04, /* 10 change */
"Discard" => 0x00000001,
"Linear" => 0x00000002,
"Blend" => 0x00000003,