00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef PFSPDFE_H
00012 #define PFSPDFE_H
00013
00014 #include "yapi.h"
00015 #include "vya.h"
00016 #include "cpfspd.h"
00017
00018 #define PFSPD_BITS 8 // PFSPD uses 8 bits per pixel
00019 #define UV_OFFSET 128 // PFSPD expects U and V to range from 0..255
00020 #define Y_RGB_CVBS_MIN 0 // minimum Y value
00021 #define Y_RGB_CVBS_MAX 255 // maximum Y value
00022 #define UV_MIN -128 // minimum UV value
00023 #define UV_MAX 127 // maximum UV value
00024
00025 typedef unsigned char byte;
00026
00027 class pfspdFE : public VYAprocess
00028 {
00029 public:
00030
00031 pfspdFE(
00032 const Id& n,
00033 VYAbitPrecision Y_RGB_CVBSoutPrecision,
00034 VYAbitPrecision UVoutPrecision,
00035
00036 In<VYAfileName>& fileNameInF,
00037 In<pT_header>& seqInfoInF,
00038 Out<VYApixel>& Y_R_CVBSoutF,
00039 Out<VYApixel>& U_GoutF,
00040 Out<VYApixel>& V_BoutF,
00041 Out<VYAimageWidth>& Y_RGBimgWidthOutF,
00042 Out<VYAimageHeight>& Y_RGBimgHeightOutF,
00043 Out<VYAimageWidth>& UVimgWidthOutF,
00044 Out<VYAimageHeight>& UVimgHeightOutF,
00045 Out<VYAimageType>& Y_YUV_RGBimgTypeOutF
00046 );
00047
00048
00049
00050
00051 const char* type() const { return "pfspdFE"; }
00052
00053
00054 void main ();
00055
00056 private:
00057
00058 InPort<VYAfileName> fileNameInP;
00059 InPort<pT_header> seqInfoInP;
00060
00061
00062 OutPort<VYApixel> Y_R_CVBSoutP;
00063 OutPort<VYApixel> U_GoutP;
00064 OutPort<VYApixel> V_BoutP;
00065 OutPort<VYAimageWidth> Y_RGBimgWidthOutP;
00066 OutPort<VYAimageHeight> Y_RGBimgHeightOutP;
00067 OutPort<VYAimageWidth> UVimgWidthOutP;
00068 OutPort<VYAimageHeight> UVimgHeightOutP;
00069 OutPort<VYAimageType> Y_YUV_RGBimgTypeOutP;
00070
00071
00072 VYAbitPrecision Y_RGB_CVBSoutPrec, UVoutPrec;
00073 VYAfileName fileNameIn;
00074
00075
00076 void checkSequenceInfo(int nrInFrames, int nrOutFrames, int startFrame);
00077 void printInfo(bool interlaced, pT_color colorFormat, int nrOutFrames,
00078 int Y_RGBframeWidth, int Y_RGBframeHeight,
00079 int Y_RGB_CVBSscaleFactor, int UVscaleFactor);
00080 void createLineBuffers(pT_color colorFormat,
00081 int Y_RGBimgWidth, int UVimgWidth,
00082 VYApixel **Y_R_CVBSbuf, VYApixel **U_Gbuf, VYApixel **V_Bbuf);
00083 void createImageBuffers(pT_color colorFormat,
00084 int Y_RGBimgWidth, int Y_RGBimgHeight,
00085 int UVimgWidth, int UVimgHeight,
00086 byte **CVBSbuf, byte **Ybuf, byte **Ubuf, byte **Vbuf, byte **UVbuf,
00087 byte **Rbuf, byte **Gbuf, byte **Bbuf);
00088 void deleteLineBuffers(pT_color colorFormat,
00089 VYApixel **Y_R_CVBSbuf, VYApixel **U_Gbuf, VYApixel **V_Bbuf);
00090 void deleteImageBuffers(pT_color colorFormat,
00091 byte **CVBSbuf, byte **Ybuf, byte **Ubuf, byte **Vbuf, byte **UVbuf,
00092 byte **Rbuf, byte **Gbuf, byte **Bbuf);
00093 };
00094
00095 #endif