[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: De-interlacing




Hello Pedro!

On Tue, 13 Feb 2001, Pedro J.Garcia - wrote:

> Dear folks,
> 
> I am using a PC-COMP and a B&W CCIR video signal along with the icpci 0.5.1 driver and the cmp patch. The signal is actually made up of two different images: the even field comes from one camera and the odd one from another one. As the two fields of my signal are from different images, I would like to get them de-interlaced in memory to process them separately without time-consuming additional memory transfers.
> 
> I would like to know how to do it. I can guess some things but I am not able to put them together. For example, two questions that I can't make out:
> 
> 1) What is the difference between MMAP and BMA modes?

When working in MMAP mode, you access the on-board memory of the ic-pci
DIRECTLY (by dereferencing a pointer to it). This is VERY slow and not
useful. The BMA mode in differece accesses the main memory and is much
faster.
 
> 2) Do I have to give up using BMA mode to avoid de-interlacing by hand?

No! If working with interlaced images, the odd and even frames are stored
separately into the on-board memory (one after the other). This is what
you need. But what happens - when using the bma mode it REORDERS
during transfer both frames to a even/odd/even/odd... line manner, taking
one line from the first and one line from the second memory area. The only
think you have to do is to avoid this.
Please edit icpciAux.c (icp_bma_init lines 1552 to 1570:

  /* set source values */ 
  if (cr_get_smstat (board) == CR_ILACE)
    {
      /* interlaced */
      if (cr_set_bmilace (board, CR_ENABLE) < 0)
	{
	  icp_error (board, "cr_set_bmilace");
	  return -EIO;
	}
    }
  else
    {
      /* not interlaced */
      if (cr_set_bmilace (board, CR_DISABLE) < 0)
	{
	  icp_error (board, "cr_set_bmilace");
	  return -EIO;
	}
    }

and make sure, that the 'else' branch is ALWAYS executed. Further edit
into the same file (next function icp_bma_copy lines 1623 to 1636):

  if (cr_get_smstat (board) == CR_ILACE)
    switch (cr_get_fstrt (board))
      {
      case CR_FIELD_EVEN:
	cr_set_bmsf (board, src_off);
	cr_set_bmss (board, src_off + size / 2);
	break;
      case CR_FIELD_ODD:
	cr_set_bmsf (board, src_off + size / 2);
	cr_set_bmss (board, src_off);
	break;
      }
  else
    cr_set_bmsf (board, src_off);

Again, ONLY the 'else' branch matches for your requirements.


					matthias

> Thanks a lot to everyone,
> Pedro
> 
> ***********************************************************************
>  Pedro José García Pardo
> 
>  DISAM - Computer Vision Group
>  UNIVERSIDAD POLITÉCNICA DE MADRID
>       __
>    __/_/\_  
>   /______/\        Escuela Técnica Superior de Ingenieros Industriales
>   \____  \ \       C/ José Gutiérrez Abascal, 2
>   / / /\  \ \      28006 Madrid  SPAIN
>  /_/ /__\__\ \
>  \ \/______/ /     Phone: +34 91 336 30 61
>   \________\/      Fax:   +34 91 336 30 10
> 
>  http://www.disam.upm.es/~pjgarcia
>  mailto:pjgarcia@etsii.upm.es
> ************************************************************************
> 
-------------------------------------------------------------------------------
GOM mbH                                                 Tel.: ++49 531/3804-330
Gesellschaft fuer optische Messtechnik                  Fax.: ++49 531/3804-333
Rebenring 33                                            Mail: M.Stein@gom.com
38106 Braunschweig GERMANY                              http://www.gom.com
-------------------------------------------------------------------------------