Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

search.h

Go to the documentation of this file.
00001 /*===========================================================================*
00002  * search.h                                                                  *
00003  *                                                                           *
00004  *      stuff dealing with the motion search                                 *
00005  *                                                                           *
00006  *===========================================================================*/
00007 
00008 /*
00009  * Copyright (c) 1995 The Regents of the University of California.
00010  * All rights reserved.
00011  *
00012  * Permission to use, copy, modify, and distribute this software and its
00013  * documentation for any purpose, without fee, and without written agreement is
00014  * hereby granted, provided that the above copyright notice and the following
00015  * two paragraphs appear in all copies of this software.
00016  *
00017  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
00018  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
00019  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
00020  * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00021  *
00022  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
00023  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
00024  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
00025  * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
00026  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
00027  */
00028 
00029 /*  
00030  *  $Header: /misc/elrond0/share/cvs/AFNI/src/mpeg_encodedir/headers/search.h,v 1.4 2004/04/02 15:12:42 rwcox Exp $
00031  *  $Log: search.h,v $
00032  *  Revision 1.4  2004/04/02 15:12:42  rwcox
00033  *  Cput
00034  *
00035  *  Revision 1.3  2003/12/23 13:50:09  rwcox
00036  *  Cput
00037  *
00038  *  Revision 1.2  2003/12/03 14:46:15  rwcox
00039  *  Cput
00040  *
00041  *  Revision 1.1  2001/12/17 18:25:45  rwcox
00042  *  Cadd
00043  *
00044  *  Revision 1.6  1995/08/15 23:43:36  smoot
00045  *  *** empty log message ***
00046  *
00047  *  Revision 1.5  1995/01/19 23:55:20  eyhung
00048  *  Changed copyrights
00049  *
00050  * Revision 1.4  1994/12/07  00:42:01  smoot
00051  * Added seperate P and B search ranges
00052  *
00053  * Revision 1.3  1994/11/12  02:12:58  keving
00054  * nothing
00055  *
00056  * Revision 1.2  1993/07/22  22:24:23  keving
00057  * nothing
00058  *
00059  * Revision 1.1  1993/07/09  00:17:23  keving
00060  * nothing
00061  *
00062  */
00063 
00064 
00065 /*==============*
00066  * HEADER FILES *
00067  *==============*/
00068 
00069 #include "ansi.h"
00070 
00071 
00072 /*===========*
00073  * CONSTANTS *
00074  *===========*/
00075 
00076 #define PSEARCH_SUBSAMPLE   0
00077 #define PSEARCH_EXHAUSTIVE  1
00078 #define PSEARCH_LOGARITHMIC 2
00079 #define PSEARCH_TWOLEVEL    3
00080 
00081 #define BSEARCH_EXHAUSTIVE  0
00082 #define BSEARCH_CROSS2      1
00083 #define BSEARCH_SIMPLE      2
00084 
00085 
00086 /*========*
00087  * MACROS *
00088  *========*/
00089 
00090 #define COMPUTE_MOTION_BOUNDARY(by,bx,stepSize,leftMY,leftMX,rightMY,rightMX)\
00091     leftMY = -2*DCTSIZE*by;     /* these are valid motion vectors */         \
00092     leftMX = -2*DCTSIZE*bx;                                                  \
00093                                 /* these are invalid motion vectors */       \
00094     rightMY = 2*(Fsize_y - (by+2)*DCTSIZE + 1) - 1;                          \
00095     rightMX = 2*(Fsize_x - (bx+2)*DCTSIZE + 1) - 1;                          \
00096                                                                              \
00097     if ( stepSize == 2 ) {                                                   \
00098         rightMY++;                                                           \
00099         rightMX++;                                                           \
00100     }
00101     
00102 #define VALID_MOTION(y,x)       \
00103     (((y) >= leftMY) && ((y) < rightMY) &&   \
00104      ((x) >= leftMX) && ((x) < rightMX) )
00105 
00106 
00107 /*===============================*
00108  * EXTERNAL PROCEDURE prototypes *
00109  *===============================*/
00110 
00111 void    SetPSearchAlg _ANSI_ARGS_((char *alg));
00112 void    SetBSearchAlg _ANSI_ARGS_((char *alg));
00113 char    *BSearchName _ANSI_ARGS_((void));
00114 char    *PSearchName _ANSI_ARGS_((void));
00115 int32   PLogarithmicSearch _ANSI_ARGS_((LumBlock currentBlock,
00116                                         MpegFrame *prev,
00117                                         int by, int bx,
00118                                         int *motionY, int *motionX, int searchRange));
00119 int32   PSubSampleSearch _ANSI_ARGS_((LumBlock currentBlock,
00120                                               MpegFrame *prev, int by, int bx,
00121                                               int *motionY, int *motionX, int searchRange));
00122 int32   PLocalSearch _ANSI_ARGS_((LumBlock currentBlock,
00123                                           MpegFrame *prev, int by, int bx,
00124                                           int *motionY, int *motionX,
00125                                           int32 bestSoFar, int searchRange));
00126 int32   PTwoLevelSearch _ANSI_ARGS_((LumBlock currentBlock,
00127                                      MpegFrame *prev, int by, int bx,
00128                                      int *motionY, int *motionX,
00129                                      int32 bestSoFar, int searchRange));
00130 boolean PMotionSearch _ANSI_ARGS_((LumBlock currentBlock,
00131                                    MpegFrame *prev,
00132                                    int by, int bx,
00133                                    int *motionY, int *motionX));
00134 
00135 
00136 /*==================*
00137  * GLOBAL VARIABLES *
00138  *==================*/
00139 
00140 extern int psearchAlg;
00141 
 

Powered by Plone

This site conforms to the following standards: