Ok, it was so easy I did it myself.  Here are patches for the CVS
yuvmedianfilter.c and yuvmedianfilter.1 to mention the -I interlace
flag and to handle -t 0 and/or -T 0 with -I.

Dan 

--- yuvmedianfilter.c.orig      2003-02-24 23:09:49.000000000 -0500
+++ yuvmedianfilter.c   2003-03-04 00:10:14.000000000 -0500
@@ -48,12 +48,13 @@
 static void Usage(char *name )
 {
        fprintf(stderr,
-               "Usage: %s: [-h] [-r num] [-R num] [-t num] [-T num] [-v num]\n"
+               "Usage: %s: [-h] [-r num] [-R num] [-t num] [-T num] [-I] [-v num]\n"
                 "-h   - Print out this help\n"
                "-r   - Radius for luma median (default: 2 pixels)\n"
                "-R   - Radius for chroma median (default: 2 pixels)\n"
                "-t   - Trigger luma threshold (default: 2 [0=disable])\n"
                "-T   - Trigger chroma threshold (default: 2 [0=disable])\n"
+               "-I   - Interlaced input (default: non-interlaced)\n"
                "-v   - Verbosity [0..2]\n", name);
 }
                        
@@ -168,13 +169,27 @@
 filter(int width, int height, uint8_t *input[], uint8_t * const output[])
 {
        if( interlace )
-       {
+       {         
+           if(threshold_luma == 0)
+           {
+             memcpy(output[0], input[0], width * height);
+           }
+           else
+           {
                filter_buffer(width, height/2, width*2, 
                                          radius_luma, threshold_luma, 
                                          input[0], output[0]);
                filter_buffer(width, height/2, width*2, 
                                          radius_luma, threshold_luma, 
                                          input[0]+width, output[0]+width);
+           }
+           if(threshold_chroma == 0)
+           {
+             memcpy(output[1], input[1], width/2 * height/2);
+             memcpy(output[2], input[2], width/2 * height/2);
+           }
+           else
+           {
                filter_buffer(width/2, height/4, width, 
                                          radius_chroma, threshold_chroma, 
                                          input[1], output[1]);
@@ -187,18 +202,34 @@
                filter_buffer(width/2, height/4, width, radius_chroma, 
                                          threshold_chroma, 
                                          input[2]+width/2, output[2]+width/2);
+           }
        }
        else
        {
+           if(threshold_luma == 0)
+           {
+             memcpy(output[0], input[0], width * height);
+           }
+           else
+           {
                filter_buffer(width, height, width, 
                                                  radius_luma, threshold_luma, 
                                                  input[0], output[0]);
+           }
+           if(threshold_chroma == 0)
+           {
+             memcpy(output[1], input[1], width/2 * height/2);
+             memcpy(output[2], input[2], width/2 * height/2);
+           }
+           else
+           {
                filter_buffer(width/2, height/2, width/2, 
                                          radius_chroma, threshold_chroma, 
                                          input[1], output[1]);
                filter_buffer(width/2, height/2, width/2, 
                                          radius_chroma, threshold_chroma, 
                                          input[2], output[2]);
+           }
        }
 }
 
@@ -224,12 +255,6 @@
        min_count = (radius_count * radius_count + 2)/3;
        
 
-       if      (threshold == 0)
-               {
-               memcpy(output, input, width * height);
-               return;
-               }
-
        for(y=0; y < radius; y++)
                memcpy(&output[y * row_stride], &input[y * row_stride], width);
 

--- yuvmedianfilter.1.orig      2003-02-24 23:09:44.000000000 -0500
+++ yuvmedianfilter.1   2003-03-04 00:17:48.000000000 -0500
@@ -13,6 +13,7 @@
 .IR num ]
 .RB [ \-T
 .IR num ]
+.RB [ \-I ]
 .RB [ \-v
 .IR num ]
 .RB [ \-h ]
@@ -44,6 +45,9 @@
 .BI \-T " num"
 Trigger threshold for chroma (default: 2 [0=disable])
 .TP 5
+.BI \-I " num"
+Interlaced input (default: non-interlaced)
+.TP 5
 .BI \-v " num"
 Verbosity level (0, 1 or 2)
 .TP 5


-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Mjpeg-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to