Doxygen Source Code Documentation
frame.h
Go to the documentation of this file.00001 /*===========================================================================* 00002 * frame.h * 00003 * * 00004 * basic frames procedures * 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 #ifndef FRAME_INCLUDED 00031 #define FRAME_INCLUDED 00032 00033 /*==============* 00034 * HEADER FILES * 00035 *==============*/ 00036 00037 #include "general.h" 00038 #include "ansi.h" 00039 #include "mtypes.h" 00040 00041 00042 /*===========* 00043 * CONSTANTS * 00044 *===========*/ 00045 #define TYPE_IFRAME 2 00046 #define TYPE_PFRAME 3 00047 #define TYPE_BFRAME 4 00048 00049 00050 /*=======================* 00051 * STRUCTURE DEFINITIONS * 00052 *=======================*/ 00053 00054 typedef struct mpegFrame { 00055 int type; 00056 char inputFileName[256]; 00057 int id; /* the frame number -- starts at 0 */ 00058 boolean inUse; /* TRUE iff this frame is currently being used */ 00059 /* FALSE means any data here can be thrashed */ 00060 00061 uint8 **ppm_data; 00062 xel **rgb_data; /* pnm format -- see pbmplus docs */ 00063 xelval rgb_maxval; /* largest value of any pixel index */ 00064 int rgb_format; /* more info from pnm */ 00065 00066 /* 00067 * now, the YCrCb data. All pixel information is stored in unsigned 00068 * 8-bit pieces. We separate y, cr, and cb because cr and cb are 00069 * subsampled by a factor of 2. 00070 */ 00071 uint8 **orig_y, **orig_cr, **orig_cb; 00072 00073 /* now, the decoded data -- relevant only if 00074 * referenceFrame == DECODED_FRAME 00075 * 00076 */ 00077 uint8 **decoded_y, **decoded_cr, **decoded_cb; 00078 00079 /* reference data */ 00080 uint8 **ref_y, **ref_cr, **ref_cb; 00081 00082 /* 00083 * these are the Blocks which will ultimately compose MacroBlocks. 00084 * A Block is in a format that mp_fwddct() can crunch. 00085 */ 00086 Block **y_blocks, **cr_blocks, **cb_blocks; 00087 00088 /* 00089 * this is the half-pixel luminance data (for reference frames) 00090 */ 00091 uint8 **halfX, **halfY, **halfBoth; 00092 00093 boolean halfComputed; /* TRUE iff half-pixels already computed */ 00094 00095 struct mpegFrame *next; /* points to the next B-frame to be encoded, if 00096 * stdin is used as the input. 00097 */ 00098 } MpegFrame; 00099 00100 00101 extern MpegFrame *Frame_New _ANSI_ARGS_((int id, int type)); 00102 extern void Frame_Init _ANSI_ARGS_((void)); 00103 extern void Frame_Free _ANSI_ARGS_((MpegFrame *frame)); 00104 extern void Frame_Exit _ANSI_ARGS_((void)); 00105 extern void Frame_AllocPPM _ANSI_ARGS_((MpegFrame * frame)); 00106 extern void Frame_AllocYCC _ANSI_ARGS_((MpegFrame * mf)); 00107 extern void Frame_AllocDecoded _ANSI_ARGS_((MpegFrame *frame, 00108 boolean makeReference)); 00109 extern void Frame_AllocHalf _ANSI_ARGS_((MpegFrame *frame)); 00110 extern void Frame_AllocBlocks _ANSI_ARGS_((MpegFrame *mf)); 00111 extern void Frame_Resize _ANSI_ARGS_((MpegFrame *omf, MpegFrame *mf, 00112 int insize_x, int insize_y, 00113 int outsize_x, int outsize_y)); 00114 00115 00116 #endif /* FRAME_INCLUDED */