diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2006-10-01 08:18:21 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2006-10-01 08:18:21 +0000 |
commit | 7026d151d1bf717c57775a769e7de7babdc6544d (patch) | |
tree | dd6d2c48a3179604a6fba3f61966ea386645d8ae /converter/ppm/ppmtompeg/headers/frames.h | |
parent | 90c4dc405ef50935603aaef73c27bf83fc2bb3cb (diff) | |
download | netpbm-mirror-7026d151d1bf717c57775a769e7de7babdc6544d.tar.gz netpbm-mirror-7026d151d1bf717c57775a769e7de7babdc6544d.tar.xz netpbm-mirror-7026d151d1bf717c57775a769e7de7babdc6544d.zip |
cleanup, accomodate Irix compiler literal prototype comparison
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@75 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm/ppmtompeg/headers/frames.h')
-rw-r--r-- | converter/ppm/ppmtompeg/headers/frames.h | 168 |
1 files changed, 12 insertions, 156 deletions
diff --git a/converter/ppm/ppmtompeg/headers/frames.h b/converter/ppm/ppmtompeg/headers/frames.h index 3fefaea7..8661645b 100644 --- a/converter/ppm/ppmtompeg/headers/frames.h +++ b/converter/ppm/ppmtompeg/headers/frames.h @@ -15,6 +15,7 @@ #include "ansi.h" #include "mtypes.h" #include "mheaders.h" +#include "iframe.h" #include "frame.h" @@ -85,11 +86,13 @@ typedef struct dct_data_tye_struct { int fmotionX, fmotionY, bmotionX, bmotionY; } dct_data_type; -void EncodeYDC _ANSI_ARGS_((int32 dc_term, int32 *pred_term, BitBucket *bb)); -void -EncodeCDC(int32 const dc_term, - int32 * const pred_term, - BitBucket * const bb); + +/*==================* + * GLOBAL VARIABLES * + *==================*/ + +extern Block **dct, **dctr, **dctb; +extern dct_data_type **dct_data; /*========* @@ -100,63 +103,6 @@ EncodeCDC(int32 const dc_term, #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) -/* assumes many things: - * block indices are (y,x) - * variables y_dc_pred, cr_dc_pred, and cb_dc_pred - * flat block fb exists - */ -#define GEN_I_BLOCK(frameType, frame, bb, mbAI, qscale) { \ - boolean overflow, overflowChange=FALSE; \ - int overflowValue = 0; \ - do { \ - overflow = Mpost_QuantZigBlock(dct[y][x], fb[0], \ - qscale, TRUE)==MPOST_OVERFLOW; \ - overflow |= Mpost_QuantZigBlock(dct[y][x+1], fb[1], \ - qscale, TRUE)==MPOST_OVERFLOW; \ - overflow |= Mpost_QuantZigBlock(dct[y+1][x], fb[2], \ - qscale, TRUE)==MPOST_OVERFLOW; \ - overflow |= Mpost_QuantZigBlock(dct[y+1][x+1], fb[3], \ - qscale, TRUE)==MPOST_OVERFLOW; \ - overflow |= Mpost_QuantZigBlock(dctb[y >> 1][x >> 1], \ - fb[4], qscale, TRUE)==MPOST_OVERFLOW; \ - overflow |= Mpost_QuantZigBlock(dctr[y >> 1][x >> 1], \ - fb[5], qscale, TRUE)==MPOST_OVERFLOW; \ - if ((overflow) && (qscale!=31)) { \ - overflowChange = TRUE; overflowValue++; \ - qscale++; \ - } else overflow = FALSE; \ - } while (overflow); \ - Mhead_GenMBHeader(bb, \ - frameType /* pict_code_type */, mbAI /* addr_incr */, \ - qscale /* q_scale */, \ - 0 /* forw_f_code */, 0 /* back_f_code */, \ - 0 /* horiz_forw_r */, 0 /* vert_forw_r */, \ - 0 /* horiz_back_r */, 0 /* vert_back_r */, \ - 0 /* motion_forw */, 0 /* m_horiz_forw */, \ - 0 /* m_vert_forw */, 0 /* motion_back */, \ - 0 /* m_horiz_back */, 0 /* m_vert_back */, \ - 0 /* mb_pattern */, TRUE /* mb_intra */); \ - \ - /* Y blocks */ \ - EncodeYDC(fb[0][0], &y_dc_pred, bb); \ - Mpost_RLEHuffIBlock(fb[0], bb); \ - EncodeYDC(fb[1][0], &y_dc_pred, bb); \ - Mpost_RLEHuffIBlock(fb[1], bb); \ - EncodeYDC(fb[2][0], &y_dc_pred, bb); \ - Mpost_RLEHuffIBlock(fb[2], bb); \ - EncodeYDC(fb[3][0], &y_dc_pred, bb); \ - Mpost_RLEHuffIBlock(fb[3], bb); \ - \ - /* CB block */ \ - EncodeCDC(fb[4][0], &cb_dc_pred, bb); \ - Mpost_RLEHuffIBlock(fb[4], bb); \ - \ - /* CR block */ \ - EncodeCDC(fb[5][0], &cr_dc_pred, bb); \ - Mpost_RLEHuffIBlock(fb[5], bb); \ - if (overflowChange) qscale -= overflowValue; \ - } - #define BLOCK_TO_FRAME_COORD(bx1, bx2, x1, x2) { \ x1 = (bx1)*DCTSIZE; \ x2 = (bx2)*DCTSIZE; \ @@ -253,6 +199,9 @@ encodeMotionVector(int const x, *===============================*/ void +AllocDctBlocks(void); + +void ComputeBMotionLumBlock(MpegFrame * const prev, MpegFrame * const next, int const by, @@ -270,8 +219,6 @@ BMotionSearch(const LumBlock * const currentBlockP, motion * const motionP, int const oldMode); -void GenIFrame (BitBucket * const bb, - MpegFrame * const mf); void GenPFrame (BitBucket * const bb, MpegFrame * const current, MpegFrame * const prev); @@ -279,11 +226,6 @@ void GenBFrame (BitBucket * const bb, MpegFrame * const curr, MpegFrame * const prev, MpegFrame * const next); -void AllocDctBlocks _ANSI_ARGS_((void )); - - -float -IFrameTotalTime(void); float PFrameTotalTime(void); @@ -292,11 +234,6 @@ float BFrameTotalTime(void); void -ShowIFrameSummary(unsigned int const inputFrameBits, - unsigned int const totalBits, - FILE * const fpointer); - -void ShowPFrameSummary(unsigned int const inputFrameBits, unsigned int const totalBits, FILE * const fpointer); @@ -306,87 +243,6 @@ ShowBFrameSummary(unsigned int const inputFrameBits, unsigned int const totalBits, FILE * const fpointer); -/* DIFFERENCE FUNCTIONS */ - -int32 -LumBlockMAD(const LumBlock * const currentBlockP, - const LumBlock * const motionBlockP, - int32 const bestSoFar); - -int32 -LumBlockMSE(const LumBlock * const currentBlockP, - const LumBlock * const motionBlockP, - int32 const bestSoFar); - -int32 -LumMotionError(const LumBlock * const currentBlockP, - MpegFrame * const prev, - int const by, - int const bx, - vector const m, - int32 const bestSoFar); - -int32 -LumAddMotionError(const LumBlock * const currentBlockP, - const LumBlock * const blockSoFarP, - MpegFrame * const prev, - int const by, - int const bx, - vector const m, - int32 const bestSoFar); - -int32 -LumMotionErrorA(const LumBlock * const currentBlockP, - MpegFrame * const prevFrame, - int const by, - int const bx, - vector const m, - int32 const bestSoFar); - -int32 -LumMotionErrorB(const LumBlock * const currentP, - MpegFrame * const prevFrame, - int const by, - int const bx, - vector const m, - int32 const bestSoFar); - -int32 -LumMotionErrorC(const LumBlock * const currentP, - MpegFrame * const prevFrame, - int const by, - int const bx, - vector const m, - int32 const bestSoFar); - -int32 -LumMotionErrorD(const LumBlock * const currentP, - MpegFrame * const prevFrame, - int const by, - int const bx, - vector const m, - int32 const bestSoFar); - -int32 -LumMotionErrorSubSampled(const LumBlock * const currentBlockP, - MpegFrame * const prevFrame, - int const by, - int const bx, - vector const m, - int const startY, - int const startX); - -void -BlockComputeSNR(MpegFrame * const current, - float * const snr, - float * const psnr); - -int32 -time_elapsed(void); - -void -AllocDctBlocks(void); - /*==================* * GLOBAL VARIABLES * *==================*/ @@ -412,7 +268,7 @@ extern int fCodeI,fCodeP,fCodeB; extern boolean forceEncodeLast; extern int TIME_RATE; -#endif /* FRAMES_INCLUDED */ +#endif /* |