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  

frames.h File Reference

#include "ansi.h"
#include "mtypes.h"
#include "mheaders.h"
#include "frame.h"

Go to the source code of this file.


Data Structures

struct  dct_data_tye_struct
struct  FrameTableStruct

Defines

#define I_FRAME   1
#define P_FRAME   2
#define B_FRAME   3
#define LUM_BLOCK   0
#define CHROM_BLOCK   1
#define CR_BLOCK   2
#define CB_BLOCK   3
#define MOTION_FORWARD   0
#define MOTION_BACKWARD   1
#define MOTION_INTERPOLATE   2
#define USE_HALF   0
#define USE_FULL   1
#define FORW_F_CODE   fCode
#define BACK_F_CODE   fCode
#define FORW_F   (1 << (FORW_F_CODE - 1))
#define BACK_F   (1 << (BACK_F_CODE - 1))
#define RANGE_NEG   (-(1 << (3 + FORW_F_CODE)))
#define RANGE_POS   ((1 << (3 + FORW_F_CODE))-1)
#define MODULUS   (1 << (4 + FORW_F_CODE))
#define ORIGINAL_FRAME   0
#define DECODED_FRAME   1
#define FRAME_TYPE(num)   framePattern[num % framePatternLen]
#define int_ceil_div(a, b, c)   ((b*(c = a/b) < a) ? (c+1) : c)
#define int_floor_div(a, b, c)   ((b*(c = a/b) > a) ? (c-1) : c)
#define GEN_I_BLOCK(frameType, frame, bb, mbAI, qscale)
#define BLOCK_TO_FRAME_COORD(bx1, bx2, x1, x2)
#define MOTION_TO_FRAME_COORD(bx1, bx2, mx1, mx2, x1, x2)
#define COORD_IN_FRAME(fy, fx, type)
#define ENCODE_MOTION_VECTOR(x, y, xq, yq, xr, yr, f)
#define DoQuant(bit, src, dest)

Typedefs

typedef FrameTableStruct FrameTable
typedef dct_data_tye_struct dct_data_type

Functions

void EncodeYDC _ANSI_ARGS_ ((int32 dc_term, int32 *pred_term, BitBucket *bb))
void ComputeBMotionLumBlock _ANSI_ARGS_ ((MpegFrame *prev, MpegFrame *next, int by, int bx, int mode, int fmy, int fmx, int bmy, int bmx, LumBlock motionBlock))
int BMotionSearch _ANSI_ARGS_ ((LumBlock currentBlock, MpegFrame *prev, MpegFrame *next, int by, int bx, int *fmy, int *fmx, int *bmy, int *bmx, int oldMode))
void ComputeDiffDCTs _ANSI_ARGS_ ((MpegFrame *current, MpegFrame *prev, int by, int bx, int my, int mx, int *pattern))
int ComputeDiffDCTBlock _ANSI_ARGS_ ((Block current, Block dest, Block motionBlock))
void ComputeMotionBlock _ANSI_ARGS_ ((uint8 **prev, int by, int bx, int my, int mx, Block motionBlock))
void ComputeMotionLumBlock _ANSI_ARGS_ ((MpegFrame *prevFrame, int by, int bx, int my, int mx, LumBlock motionBlock))
int32 ComputeBlockMAD _ANSI_ARGS_ ((Block current, Block prev))
void GenIFrame _ANSI_ARGS_ ((BitBucket *bb, MpegFrame *mf))
void GenPFrame _ANSI_ARGS_ ((BitBucket *bb, MpegFrame *current, MpegFrame *prev))
void GenBFrame _ANSI_ARGS_ ((BitBucket *bb, MpegFrame *curr, MpegFrame *prev, MpegFrame *next))
void AllocDctBlocks _ANSI_ARGS_ ((void))
float ShowIFrameSummary _ANSI_ARGS_ ((int inputFrameBits, int32 totalBits, FILE *fpointer))
int32 LumBlockMAD _ANSI_ARGS_ ((LumBlock currentBlock, LumBlock motionBlock, int32 bestSoFar))
int32 LumMotionError _ANSI_ARGS_ ((LumBlock currentBlock, MpegFrame *prev, int by, int bx, int my, int mx, int32 bestSoFar))
int32 LumAddMotionError _ANSI_ARGS_ ((LumBlock currentBlock, LumBlock blockSoFar, MpegFrame *prev, int by, int bx, int my, int mx, int32 bestSoFar))
int32 LumMotionErrorA _ANSI_ARGS_ ((LumBlock current, MpegFrame *prevFrame, int by, int bx, int my, int mx, int32 bestSoFar))
int32 LumMotionErrorSubSampled _ANSI_ARGS_ ((LumBlock currentBlock, MpegFrame *prevFrame, int by, int bx, int my, int mx, int startY, int startX))
void BlockComputeSNR _ANSI_ARGS_ ((MpegFrame *current, float *snr, float *psnr))

Variables

int pixelFullSearch
int searchRangeP
int searchRangeB
int qscaleI
int gopSize
int slicesPerFrame
int blocksPerSlice
int referenceFrame
int specificsOn
int quietTime
boolean realQuiet
boolean frameSummary
boolean printSNR
boolean printMSE
boolean decodeRefFrames
int fCodeI
int fCodeP
int fCodeB
boolean forceEncodeLast
int TIME_RATE

Define Documentation

#define B_FRAME   3
 

Definition at line 112 of file frames.h.

#define BACK_F   (1 << (BACK_F_CODE - 1))
 

Definition at line 131 of file frames.h.

#define BACK_F_CODE   fCode
 

Definition at line 129 of file frames.h.

#define BLOCK_TO_FRAME_COORD bx1,
bx2,
x1,
x2   
 

Value:

{    \
        x1 = (bx1)*DCTSIZE;                         \
        x2 = (bx2)*DCTSIZE;                         \
    }

Definition at line 244 of file frames.h.

#define CB_BLOCK   3
 

Definition at line 117 of file frames.h.

#define CHROM_BLOCK   1
 

Definition at line 115 of file frames.h.

#define COORD_IN_FRAME fy,
fx,
type   
 

Value:

((type == LUM_BLOCK) ?                                          \
     ((fy >= 0) && (fx >= 0) && (fy < Fsize_y) && (fx < Fsize_x)) :     \
     ((fy >= 0) && (fx >= 0) && (fy < (Fsize_y>>1)) && (fx < (Fsize_x>>1))))

Definition at line 254 of file frames.h.

#define CR_BLOCK   2
 

Definition at line 116 of file frames.h.

#define DECODED_FRAME   1
 

Definition at line 137 of file frames.h.

#define DoQuant bit,
src,
dest   
 

Value:

if (pattern & bit) {                                                  \
    switch (Mpost_QuantZigBlock(src, dest, QScale, FALSE)) {            \
    case MPOST_NON_ZERO:                                                \
      break;                                                            \
    case MPOST_ZERO:                                                    \
      pattern ^= bit;                                                   \
      break;                                                            \
    case MPOST_OVERFLOW:                                                \
      if (QScale != 31) {                                               \
        QScale++;                                                       \
        overflowChange = TRUE;                                          \
        overflowValue++;                                                \
        goto calc_blocks;                                               \
      }                                                                 \
      break;                                                            \
    }                                                                   \
  }

Definition at line 288 of file frames.h.

#define ENCODE_MOTION_VECTOR x,
y,
xq,
yq,
xr,
yr,
 
 

Value:

{                       \
        int     tempC;                                                  \
                                                                        \
        if ( x < RANGE_NEG )        tempX = x + MODULUS;                \
        else if ( x > RANGE_POS ) tempX = x - MODULUS;                  \
        else                                tempX = x;                  \
                                                                        \
        if ( y < RANGE_NEG )        tempY = y + MODULUS;                \
        else if ( y > RANGE_POS ) tempY = y - MODULUS;                  \
        else                                tempY = y;                  \
                                                                        \
        if ( tempX >= 0 ) {                                             \
            xq = int_ceil_div(tempX, f, tempC);                         \
            xr = f - 1 + tempX - xq*f;                                  \
        } else {                                                        \
            xq = int_floor_div(tempX, f, tempC);                        \
            xr = f - 1 - tempX + xq*f;                                  \
        }                                                               \
                                                                        \
        if ( tempY >= 0 ) {                                             \
            yq = int_ceil_div(tempY, f, tempC);                         \
            yr = f - 1 + tempY - yq*f;                                  \
        } else {                                                        \
            yq = int_floor_div(tempY, f, tempC);                        \
            yr = f - 1 - tempY + yq*f;                                  \
        }                                                               \
    }

Definition at line 259 of file frames.h.

#define FORW_F   (1 << (FORW_F_CODE - 1))
 

Definition at line 130 of file frames.h.

#define FORW_F_CODE   fCode
 

Definition at line 128 of file frames.h.

#define FRAME_TYPE num       framePattern[num % framePatternLen]
 

Definition at line 181 of file frames.h.

#define GEN_I_BLOCK frameType,
frame,
bb,
mbAI,
qscale   
 

Definition at line 192 of file frames.h.

#define I_FRAME   1
 

Definition at line 110 of file frames.h.

#define int_ceil_div a,
b,
c       ((b*(c = a/b) < a) ? (c+1) : c)
 

Definition at line 184 of file frames.h.

#define int_floor_div a,
b,
c       ((b*(c = a/b) > a) ? (c-1) : c)
 

Definition at line 185 of file frames.h.

#define LUM_BLOCK   0
 

Definition at line 114 of file frames.h.

#define MODULUS   (1 << (4 + FORW_F_CODE))
 

Definition at line 134 of file frames.h.

#define MOTION_BACKWARD   1
 

Definition at line 120 of file frames.h.

#define MOTION_FORWARD   0
 

Definition at line 119 of file frames.h.

#define MOTION_INTERPOLATE   2
 

Definition at line 121 of file frames.h.

#define MOTION_TO_FRAME_COORD bx1,
bx2,
mx1,
mx2,
x1,
x2   
 

Value:

{ \
        x1 = (bx1)*DCTSIZE+(mx1);                           \
        x2 = (bx2)*DCTSIZE+(mx2);                           \
    }

Definition at line 249 of file frames.h.

#define ORIGINAL_FRAME   0
 

Definition at line 136 of file frames.h.

#define P_FRAME   2
 

Definition at line 111 of file frames.h.

#define RANGE_NEG   (-(1 << (3 + FORW_F_CODE)))
 

Definition at line 132 of file frames.h.

#define RANGE_POS   ((1 << (3 + FORW_F_CODE))-1)
 

Definition at line 133 of file frames.h.

#define USE_FULL   1
 

Definition at line 125 of file frames.h.

#define USE_HALF   0
 

Definition at line 124 of file frames.h.


Typedef Documentation

typedef struct dct_data_tye_struct dct_data_type
 

typedef struct FrameTableStruct FrameTable
 


Function Documentation

void BlockComputeSNR _ANSI_ARGS_ (MpegFrame *current, float *snr, float *psnr  
 

int32 LumMotionErrorSubSampled _ANSI_ARGS_ (LumBlock currentBlock, MpegFrame *prevFrame, int by, int bx, int my, int mx, int startY, int startX)   
 

int32 LumMotionErrorD _ANSI_ARGS_ (LumBlock current, MpegFrame *prevFrame, int by, int bx, int my, int mx, int32 bestSoFar  
 

int32 LumAddMotionError _ANSI_ARGS_ (LumBlock currentBlock, LumBlock blockSoFar, MpegFrame *prev, int by, int bx, int my, int mx, int32 bestSoFar  
 

int32 LumMotionError _ANSI_ARGS_ (LumBlock currentBlock, MpegFrame *prev, int by, int bx, int my, int mx, int32 bestSoFar  
 

int32 LumBlockMSE _ANSI_ARGS_ (LumBlock currentBlock, LumBlock motionBlock, int32 bestSoFar  
 

float ShowBFrameSummary _ANSI_ARGS_ (int inputFrameBits, int32 totalBits, FILE *fpointer  
 

void AllocDctBlocks _ANSI_ARGS_ (void)   
 

void GenBFrame _ANSI_ARGS_ (BitBucket *bb, MpegFrame *curr, MpegFrame *prev, MpegFrame *next  
 

void GenPFrame _ANSI_ARGS_ (BitBucket *bb, MpegFrame *current, MpegFrame *prev  
 

void GenIFrame _ANSI_ARGS_ (BitBucket *bb, MpegFrame *mf  
 

int32 ComputeBlockMAD _ANSI_ARGS_ (Block current, Block prev  
 

void ComputeMotionLumBlock _ANSI_ARGS_ (MpegFrame *prevFrame, int by, int bx, int my, int mx, LumBlock motionBlock  
 

void ComputeMotionBlock _ANSI_ARGS_ (uint8 **prev, int by, int bx, int my, int mx, Block motionBlock  
 

int ComputeDiffDCTBlock _ANSI_ARGS_ (Block current, Block dest, Block motionBlock  
 

void ComputeDiffDCTs _ANSI_ARGS_ (MpegFrame *current, MpegFrame *prev, int by, int bx, int my, int mx, int *pattern  
 

int BMotionSearch _ANSI_ARGS_ (LumBlock currentBlock, MpegFrame *prev, MpegFrame *next, int by, int bx, int *fmy, int *fmx, int *bmy, int *bmx, int oldMode  
 

void ComputeBMotionLumBlock _ANSI_ARGS_ (MpegFrame *prev, MpegFrame *next, int by, int bx, int mode, int fmy, int fmx, int bmy, int bmx, LumBlock motionBlock  
 

void EncodeCDC _ANSI_ARGS_ (int32 dc_term, int32 *pred_term, BitBucket *bb  
 


Variable Documentation

int blocksPerSlice
 

Definition at line 378 of file frames.h.

boolean decodeRefFrames
 

Definition at line 389 of file frames.h.

int fCodeB
 

Definition at line 390 of file frames.h.

int fCodeI
 

Definition at line 390 of file frames.h.

int fCodeP
 

Definition at line 390 of file frames.h.

boolean forceEncodeLast
 

Definition at line 391 of file frames.h.

boolean frameSummary
 

Definition at line 386 of file frames.h.

int gopSize
 

Definition at line 376 of file frames.h.

int pixelFullSearch
 

Definition at line 373 of file frames.h.

boolean printMSE
 

Definition at line 388 of file frames.h.

boolean printSNR
 

Definition at line 387 of file frames.h.

int qscaleI
 

Definition at line 375 of file frames.h.

int quietTime
 

Definition at line 381 of file frames.h.

boolean realQuiet
 

Definition at line 384 of file frames.h.

int referenceFrame
 

Definition at line 379 of file frames.h.

int searchRangeB
 

Definition at line 374 of file frames.h.

int searchRangeP
 

Definition at line 374 of file frames.h.

int slicesPerFrame
 

Definition at line 377 of file frames.h.

int specificsOn
 

Definition at line 380 of file frames.h.

int TIME_RATE
 

Definition at line 392 of file frames.h.

 

Powered by Plone

This site conforms to the following standards: