mom_access.c
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:6k
源码类别:
VC书籍
开发平台:
Visual C++
- #include "mom_access.h"
- Char *
- GetImageData(Image *image)
- {
- switch(GetImageType(image))
- {
- case SHORT_TYPE:
- return((Char *)image->data->s);
- break;
- case FLOAT_TYPE:
- return((Char *)image->data->f);
- break;
- case UCHAR_TYPE:
- return((Char *)image->data->u);
- break;
- default:
- printf("Image type >>%d<< not supportedn",image->type);
- return(NULL);
- }
- }
- UInt
- GetImageSize(Image *image)
- {
- return(image->x * image->y);
- }
- UInt
- GetImageSizeX(Image *image)
- {
- return(image->x);
- }
- UInt
- GetImageSizeY(Image *image)
- {
- return(image->y);
- }
- Int
- GetImageVersion(Image *image)
- {
- return(image->version);
- }
- ImageType
- GetImageType(Image *image)
- {
- return(image->type);
- }
- Int GetVopNot8Bit(Vop *vop)
- {
- return (vop->bits_per_pixel != 8);
- }
- Int GetVopQuantPrecision(Vop *vop)
- {
- return (vop->quant_precision);
- }
- Int GetVopBitsPerPixel(Vop *vop)
- {
- return (vop->bits_per_pixel);
- }
- Int GetVopMidGrey(Vop *vop)
- {
- return (1 << (vop->bits_per_pixel - 1));
- }
- Int GetVopBrightWhite(Vop *vop)
- {
- return ((1 << vop->bits_per_pixel) - 1);
- }
- Int GetVopTimeIncrementResolution(Vop *vop)
- {
- return (vop->time_increment_resolution);
- }
- Int
- GetVopModTimeBase(Vop *vop)
- {
- return(vop->mod_time_base);
- }
- Int
- GetVopTimeInc(Vop *vop)
- {
- return((int)vop->time_inc);
- }
- Int
- GetVopPredictionType(Vop *vop)
- {
- return(vop->prediction_type);
- }
- Int GetVopIntraDCVlcThr(Vop *vop)
- {
- return (vop->intra_dc_vlc_thr);
- }
- Int
- GetVopRoundingType(Vop *vop)
- {
- return(vop->rounding_type);
- }
- Int
- GetVopWidth(Vop *vop)
- {
- return(vop->width);
- }
- Int
- GetVopHeight(Vop *vop)
- {
- return(vop->height);
- }
- Int
- GetVopHorSpatRef(Vop *vop)
- {
- return(vop->hor_spat_ref);
- }
- Int
- GetVopVerSpatRef(Vop *vop)
- {
- return(vop->ver_spat_ref);
- }
- Int
- GetVopQuantizer(Vop *vop)
- {
- return(vop->quantizer);
- }
- Int
- GetVopIntraQuantizer(Vop *vop)
- {
- return(vop->intra_quantizer);
- }
- Int
- GetVopIntraACDCPredDisable(Vop *vop)
- {
- return(vop->intra_acdc_pred_disable);
- }
- Int
- GetVopFCodeFor(Vop *vop)
- {
- return(vop->fcode_for);
- }
- Int
- GetVopSearchRangeFor(Vop *vop)
- {
- return(vop->sr_for);
- }
- Image *
- GetVopY(Vop *vop)
- {
- return(vop->y_chan);
- }
- Image *
- GetVopU(Vop *vop)
- {
- return(vop->u_chan);
- }
- Image *
- GetVopV(Vop *vop)
- {
- return(vop->v_chan);
- }
- Void PutVopQuantPrecision(Int quant_precision,Vop *vop)
- {
- vop->quant_precision = quant_precision;
- }
- Void PutVopBitsPerPixel(Int bits_per_pixel,Vop *vop)
- {
- vop->bits_per_pixel = bits_per_pixel;
- }
- Void PutVopTimeIncrementResolution(Int time_incre_res, Vop *vop)
- {
- vop->time_increment_resolution=time_incre_res;
- }
- Void
- PutVopModTimeBase(Int mod_time_base, Vop *vop)
- {
- vop->mod_time_base = mod_time_base;
- }
- Void
- PutVopTimeInc(Int time_inc, Vop *vop)
- {
- vop->time_inc = (float)time_inc;
- }
- Void
- PutVopPredictionType(Int prediction_type, Vop *vop)
- {
- vop->prediction_type = prediction_type;
- }
- Void PutVopIntraDCVlcThr(Int intra_dc_vlc_thr,Vop *vop)
- {
- vop->intra_dc_vlc_thr=intra_dc_vlc_thr;
- }
- Void
- PutVopRoundingType(Int rounding_type, Vop *vop)
- {
- vop->rounding_type = rounding_type;
- }
- Void
- PutVopWidth(Int width, Vop *vop)
- {
- vop->width = width;
- }
- Void
- PutVopHeight(Int height, Vop *vop)
- {
- vop->height = height;
- }
- Void
- PutVopHorSpatRef(Int hor_spat_ref, Vop *vop)
- {
- vop->hor_spat_ref = hor_spat_ref;
- }
- Void
- PutVopVerSpatRef(Int ver_spat_ref, Vop *vop)
- {
- vop->ver_spat_ref = ver_spat_ref;
- }
- Void
- PutVopQuantizer(Int quantizer, Vop *vop)
- {
- vop->quantizer = quantizer;
- }
- Void
- PutVopIntraACDCPredDisable(Int intra_acdc_pred_disable, Vop *vop)
- {
- vop->intra_acdc_pred_disable = intra_acdc_pred_disable;
- }
- Void
- PutVopFCodeFor(Int fcode_for, Vop *vop)
- {
- vop->fcode_for = fcode_for;
- }
- Void
- PutVopSearchRangeFor(Int sr_for, Vop *vop)
- {
- vop->sr_for = sr_for;
- }
- Void
- PutVopY(Image *y_chan, Vop *vop)
- {
- FreeImage(vop->y_chan);
- vop->y_chan = y_chan;
- }
- Void
- PutVopU(Image *u_chan, Vop *vop)
- {
- FreeImage(vop->u_chan);
- vop->u_chan = u_chan;
- }
- Void
- PutVopV(Image *v_chan, Vop *vop)
- {
- FreeImage(vop->v_chan);
- vop->v_chan = v_chan;
- }
- Void
- PutVopIntraQuantizer(Int Q,Vop *vop)
- {
- vop->intra_quantizer = Q;
- }
- Void
- PutVolConfigFrameRate(Float fr, VolConfig *cfg)
- {
- cfg->frame_rate = fr;
- }
- Void
- PutVolConfigM(Int M, VolConfig *cfg)
- {
- cfg->M = M;
- }
- Void
- PutVolConfigStartFrame(Int frame, VolConfig *cfg)
- {
- cfg->start_frame = frame;
- }
- Void
- PutVolConfigEndFrame(Int frame, VolConfig *cfg)
- {
- cfg->end_frame = frame;
- }
- Void
- PutVolConfigBitrate(Int bit_rate,VolConfig *cfg)
- {
- cfg->bit_rate = bit_rate;
- }
- Void
- PutVolConfigIntraPeriod(Int ir,VolConfig *cfg)
- {
- cfg->intra_period = ir;
- }
- Void
- PutVolConfigQuantizer(Int Q,VolConfig *cfg)
- {
- cfg->quantizer = Q;
- }
- Void
- PutVolConfigIntraQuantizer(Int Q,VolConfig *cfg)
- {
- cfg->intra_quantizer = Q;
- }
- Void
- PutVolConfigFrameSkip(Int frame_skip,VolConfig *cfg)
- {
- cfg->frame_skip = frame_skip;
- }
- Void
- PutVolConfigModTimeBase(Int time,VolConfig *cfg)
- {
- cfg->modulo_time_base[0] = cfg->modulo_time_base[1];
- cfg->modulo_time_base[1] = time;
- }
- Float
- GetVolConfigFrameRate(VolConfig *cfg)
- {
- return(cfg->frame_rate);
- }
- Int
- GetVolConfigM(VolConfig *cfg)
- {
- return(cfg->M);
- }
- Int
- GetVolConfigStartFrame(VolConfig *cfg)
- {
- return(cfg->start_frame);
- }
- Int
- GetVolConfigEndFrame(VolConfig *cfg)
- {
- return(cfg->end_frame);
- }
- Int
- GetVolConfigBitrate(VolConfig *cfg)
- {
- return(cfg->bit_rate);
- }
- Int
- GetVolConfigIntraPeriod(VolConfig *cfg)
- {
- return(cfg->intra_period);
- }
- Int
- GetVolConfigQuantizer(VolConfig *cfg)
- {
- return(cfg->quantizer);
- }
- Int
- GetVolConfigIntraQuantizer(VolConfig *cfg)
- {
- return(cfg->intra_quantizer);
- }
- Int
- GetVolConfigFrameSkip(VolConfig *cfg)
- {
- return(cfg->frame_skip);
- }
- Int
- GetVolConfigModTimeBase(VolConfig *cfg,Int i)
- {
- return(cfg->modulo_time_base[i]);
- }