* @param color_equal Sensitivity for detecting similar colors
* @param color_diff Sensitivity for detecting different colors
* @param threshold Sensitivity for flagging planes as combed
* @param color_equal Sensitivity for detecting similar colors
* @param color_diff Sensitivity for detecting different colors
* @param threshold Sensitivity for flagging planes as combed
+ * @param prog_equal Sensitivity for detecting similar colors on progressive frames
+ * @param prog_diff Sensitivity for detecting different colors on progressive frames
+ * @param prog_threshold Sensitivity for flagging progressive frames as combed
*/
*/
-int hb_detect_comb( hb_buffer_t * buf, int width, int height, int color_equal, int color_diff, int threshold )
+int hb_detect_comb( hb_buffer_t * buf, int width, int height, int color_equal, int color_diff, int threshold, int prog_equal, int prog_diff, int prog_threshold )
{
{
- int j, k, n, off, block, cc_1, cc_2, cc[3], flag[3];
+ int j, k, n, off, cc_1, cc_2, cc[3], flag[3] ;
uint16_t s1, s2, s3, s4;
cc_1 = 0; cc_2 = 0;
int offset = 0;
uint16_t s1, s2, s3, s4;
cc_1 = 0; cc_2 = 0;
int offset = 0;
+
+ if ( buf->flags & 16 )
+ {
+ /* Frame is progressive, be more discerning. */
+ color_diff = prog_diff;
+ color_equal = prog_equal;
+ threshold = prog_threshold;
+ }
+ /* One pas for Y, one pass for Cb, one pass for Cr */
for( k = 0; k < 3; k++ )
{
for( k = 0; k < 3; k++ )
{
- /* One pas for Y, one pass for Cb, one pass for Cr */
-
if( k == 1 )
{
/* Y has already been checked, now offset by Y's dimensions
if( k == 1 )
{
/* Y has already been checked, now offset by Y's dimensions
@@ -466,9+476,6 @@ int hb_detect_comb( hb_buffer_t * buf, int width, int height, int color_equal, i
offset = width * height;
width >>= 1;
height >>= 1;
offset = width * height;
width >>= 1;
height >>= 1;
- threshold >>= 1;
- color_equal >>= 1;
- color_diff >>= 1;
}
else if ( k == 2 )
{
}
else if ( k == 2 )
{
@@ -477,10+484,7 @@ int hb_detect_comb( hb_buffer_t * buf, int width, int height, int color_equal, i
offset *= 5/4;
}
offset *= 5/4;
}
- /* Look at one horizontal line at a time */
- block = width;
-
- for( j = 0; j < block; ++j )
+ for( j = 0; j < width; ++j )
{
off = 0;
{
off = 0;
@@ -488,9+492,9 @@ int hb_detect_comb( hb_buffer_t * buf, int width, int height, int color_equal, i
{
/* Look at groups of 4 sequential horizontal lines */