您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vf_get_image函数代码示例

51自学网 2021-06-03 09:38:05
  C++
这篇教程C++ vf_get_image函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中vf_get_image函数的典型用法代码示例。如果您正苦于以下问题:C++ vf_get_image函数的具体用法?C++ vf_get_image怎么用?C++ vf_get_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了vf_get_image函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: put_image

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){    mp_image_t *dmpi;    // hope we'll get DR buffer:    dmpi=vf_get_image(vf->next,vf->priv->fmt,	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,	mpi->w, mpi->h);    if(mpi->stride[0]!=dmpi->stride[0] || mpi->stride[0]!=mpi->w*(mpi->bpp/8)){	int y;	unsigned char* src=mpi->planes[0];	unsigned char* dst=dmpi->planes[0];	int srcsize=mpi->w*mpi->bpp/8;	for(y=0;y<mpi->h;y++){	    if(mpi->bpp==32)		rgb32tobgr32(src,dst,srcsize);	    else		rgb24tobgr24(src,dst,srcsize);	    src+=mpi->stride[0];	    dst+=dmpi->stride[0];	}    } else {	if(mpi->bpp==32)	    rgb32tobgr32(mpi->planes[0],dmpi->planes[0],mpi->w*mpi->h*4);	else	    rgb24tobgr24(mpi->planes[0],dmpi->planes[0],mpi->w*mpi->h*3);    }    return vf_next_put_image(vf,dmpi, pts);}
开发者ID:batman52,项目名称:dingux-code,代码行数:30,


示例2: put_image

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){    mp_image_t* dmpi;    int out_size;    AVFrame *pic= vf->priv->pic;    pic->data[0]=mpi->planes[0];    pic->data[1]=mpi->planes[1];    pic->data[2]=mpi->planes[2];    pic->linesize[0]=mpi->stride[0];    pic->linesize[1]=mpi->stride[1];    pic->linesize[2]=mpi->stride[2];    out_size = avcodec_encode_video(&lavc_venc_context,	vf->priv->outbuf, vf->priv->outbuf_size, pic);    if(out_size<=0) return 1;    dmpi=vf_get_image(vf->next,IMGFMT_MPEGPES,	MP_IMGTYPE_EXPORT, 0,	mpi->w, mpi->h);    vf->priv->pes.data=vf->priv->outbuf;    vf->priv->pes.size=out_size;    vf->priv->pes.id=0x1E0;    vf->priv->pes.timestamp=-1; // dunno    dmpi->planes[0]=(unsigned char*)&vf->priv->pes;    return vf_next_put_image(vf,dmpi, MP_NOPTS_VALUE);}
开发者ID:Newbleeto,项目名称:mplayer-tegra,代码行数:30,


示例3: put_image

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){    AVFilterBufferRef *buf;    mp_image_t *cmpi = NULL;    if (!(mpi->flags & MP_IMGFLAG_DIRECT)) {        cmpi = vf_get_image(vf, mpi->imgfmt, MP_IMGTYPE_TEMP,                            MP_IMGFLAG_PREFER_ALIGNED_STRIDE,                            mpi->w, mpi->h);        copy_mpi(cmpi, mpi);        buf = cmpi->priv;    } else {        buf = mpi->priv;    }    buf->video->key_frame = mpi->pict_type == 1;    buf->video->pict_type = mpi->pict_type; /* seems to be the same code */    buf->video->interlaced = !!(mpi->fields & MP_IMGFIELD_INTERLACED);    buf->video->top_field_first = !!(mpi->fields & MP_IMGFIELD_TOP_FIRST);    vf->priv->in_buf = buf;    if (pts != MP_NOPTS_VALUE)        buf->pts = pts * AV_TIME_BASE;    while (avfilter_poll_frame(vf->priv->out->inputs[0])) {        if (avfilter_request_frame(vf->priv->out->inputs[0]))            break;    }    return 1;}
开发者ID:0p1pp1,项目名称:mplayer,代码行数:27,


示例4: put_image

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){    int i,j;    uint8_t *y_in, *cb_in, *cr_in;    uint8_t *y_out, *cb_out, *cr_out;    vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,	mpi->width, mpi->height);        y_in = mpi->planes[0];    cb_in = mpi->planes[1];    cr_in = mpi->planes[2];    y_out = vf->dmpi->planes[0];    cb_out = vf->dmpi->planes[1];    cr_out = vf->dmpi->planes[2];        for (i = 0; i < mpi->height; i++)	for (j = 0; j < mpi->width; j++)	    y_out[i*vf->dmpi->stride[0]+j] = clamp_y(y_in[i*mpi->stride[0]+j]);    for (i = 0; i < mpi->chroma_height; i++)	for (j = 0; j < mpi->chroma_width; j++)	{	    cb_out[i*vf->dmpi->stride[1]+j] = clamp_c(cb_in[i*mpi->stride[1]+j]);	    cr_out[i*vf->dmpi->stride[2]+j] = clamp_c(cr_in[i*mpi->stride[2]+j]);	}        return vf_next_put_image(vf,vf->dmpi, pts);}
开发者ID:batman52,项目名称:dingux-code,代码行数:30,


示例5: put_image

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){    mp_image_t *dmpi = (mp_image_t *)mpi->priv;    if(!(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK))){        dmpi=vf_get_image(vf->next,mpi->imgfmt,                                    MP_IMGTYPE_EXPORT, 0,                                    mpi->width, mpi->height);        vf_clone_mpi_attributes(dmpi, mpi);        dmpi->planes[0]=mpi->planes[0];        dmpi->planes[1]=mpi->planes[1];        dmpi->planes[2]=mpi->planes[2];        dmpi->stride[0]=mpi->stride[0];        dmpi->stride[1]=mpi->stride[1];        dmpi->stride[2]=mpi->stride[2];        dmpi->width=mpi->width;        dmpi->height=mpi->height;    }    if(vf->priv->shot) {        if (vf->priv->shot==1)            vf->priv->shot=0;        gen_fname(vf->priv);        if (vf->priv->fname[0]) {            if (!vf->priv->store_slices)              scale_image(vf->priv, dmpi);            write_png(vf->priv);        }        vf->priv->store_slices = 0;    }    return vf_next_put_image(vf, dmpi, pts);}
开发者ID:C3MA,项目名称:fc_mplayer,代码行数:33,


示例6: put_image

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){    mp_image_t *dmpi;    int frame= vf->priv->frame_num;    // hope we'll get DR buffer:    dmpi=vf_get_image(vf->next,IMGFMT_YV12,        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,        WIDTH, HEIGHT);    // clean    memset(dmpi->planes[0], 0, dmpi->stride[0]*dmpi->h);    memset(dmpi->planes[1], 128, dmpi->stride[1]*dmpi->h>>dmpi->chroma_y_shift);    memset(dmpi->planes[2], 128, dmpi->stride[2]*dmpi->h>>dmpi->chroma_y_shift);    if(frame%30)    {        switch(frame/30)        {        case 0:   dc1Test(dmpi->planes[0], dmpi->stride[0], 256, 256, frame%30); break;        case 1:   dc1Test(dmpi->planes[1], dmpi->stride[1], 256, 256, frame%30); break;        case 2: freq1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;        case 3: freq1Test(dmpi->planes[1], dmpi->stride[1], frame%30); break;        case 4:  amp1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;        case 5:  amp1Test(dmpi->planes[1], dmpi->stride[1], frame%30); break;        case 6:  cbp1Test(dmpi->planes   , dmpi->stride   , frame%30); break;        case 7:   mv1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;        case 8: ring1Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;        case 9: ring2Test(dmpi->planes[0], dmpi->stride[0], frame%30); break;        }    }    frame++;    vf->priv->frame_num= frame;    return vf_next_put_image(vf,dmpi, pts);}
开发者ID:0p1pp1,项目名称:mplayer,代码行数:35,


示例7: put_image

static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){	int cw= mpi->w >> mpi->chroma_x_shift;	int ch= mpi->h >> mpi->chroma_y_shift;	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,		MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_READABLE,		mpi->w,mpi->h);	assert(mpi->flags&MP_IMGFLAG_PLANAR);	hBlur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h,		dmpi->stride[0], mpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);	hBlur(dmpi->planes[1], mpi->planes[1], cw,ch,		dmpi->stride[1], mpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);	hBlur(dmpi->planes[2], mpi->planes[2], cw,ch,		dmpi->stride[2], mpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);	vBlur(dmpi->planes[0], dmpi->planes[0], mpi->w,mpi->h,		dmpi->stride[0], dmpi->stride[0], vf->priv->lumaParam.radius, vf->priv->lumaParam.power);	vBlur(dmpi->planes[1], dmpi->planes[1], cw,ch,		dmpi->stride[1], dmpi->stride[1], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);	vBlur(dmpi->planes[2], dmpi->planes[2], cw,ch,		dmpi->stride[2], dmpi->stride[2], vf->priv->chromaParam.radius, vf->priv->chromaParam.power);	return vf_next_put_image(vf,dmpi, pts);}
开发者ID:hanyong,项目名称:mplayer-kovensky,代码行数:26,


示例8: put_image

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){    mp_image_t *dmpi;    if(!(mpi->flags&MP_IMGFLAG_DIRECT)){        // no DR, so get a new image! hope we'll get DR buffer:        dmpi=vf_get_image(vf->next,mpi->imgfmt,            MP_IMGTYPE_TEMP,            MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,            mpi->width,mpi->height);        vf_clone_mpi_attributes(dmpi, mpi);    }else{        dmpi=vf->dmpi;    }    vf->priv->mpeg2= mpi->qscale_type;    if(vf->priv->log2_count || !(mpi->flags&MP_IMGFLAG_DIRECT)){        if(mpi->qscale || vf->priv->qp){            filter(vf->priv, dmpi->planes, mpi->planes, dmpi->stride, mpi->stride, mpi->w, mpi->h, mpi->qscale, mpi->qstride);        }else{            memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, dmpi->stride[0], mpi->stride[0]);            memcpy_pic(dmpi->planes[1], mpi->planes[1], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[1], mpi->stride[1]);            memcpy_pic(dmpi->planes[2], mpi->planes[2], mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift, dmpi->stride[2], mpi->stride[2]);        }    }#ifdef HAVE_MMX    if(gCpuCaps.hasMMX) asm volatile ("emms/n/t");#endif#ifdef HAVE_MMX2    if(gCpuCaps.hasMMX2) asm volatile ("sfence/n/t");#endif    return vf_next_put_image(vf,dmpi, pts);}
开发者ID:batman52,项目名称:dingux-code,代码行数:34,


示例9: put_image

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){    mp_image_t *dmpi;    int y,w,h;    // hope we'll get DR buffer:    dmpi=vf_get_image(vf->next,IMGFMT_YV12,	MP_IMGTYPE_TEMP, 0/*MP_IMGFLAG_ACCEPT_STRIDE*/,	mpi->w, mpi->h);    for(y=0;y<mpi->h;y++)	memcpy(dmpi->planes[0]+dmpi->stride[0]*y,	       mpi->planes[0]+mpi->stride[0]*y,	       mpi->w);    w=mpi->w/4; h=mpi->h/2;    for(y=0;y<h;y++){	unsigned char* s=mpi->planes[1]+mpi->stride[1]*(y>>1);	unsigned char* d=dmpi->planes[1]+dmpi->stride[1]*y;	int x;	for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];    }    for(y=0;y<h;y++){	unsigned char* s=mpi->planes[2]+mpi->stride[2]*(y>>1);	unsigned char* d=dmpi->planes[2]+dmpi->stride[2]*y;	int x;	for(x=0;x<w;x++) d[2*x]=d[2*x+1]=s[x];    }    vf_clone_mpi_attributes(dmpi, mpi);        return vf_next_put_image(vf,dmpi, pts);}
开发者ID:BOTCrusher,项目名称:sagetv,代码行数:32,


示例10: put_image

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){	int cw= mpi->w >> mpi->chroma_x_shift;	int ch= mpi->h >> mpi->chroma_y_shift;        int W = mpi->w, H = mpi->h;	mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,		MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE |		MP_IMGFLAG_PRESERVE | MP_IMGFLAG_READABLE,                mpi->w,mpi->h);	if(!dmpi) return 0;        if (!vf->priv->pmpi) vf->priv->pmpi=mpi;        deNoise(mpi->planes[0], vf->priv->pmpi->planes[0], dmpi->planes[0],		vf->priv->Line, W, H,                mpi->stride[0], vf->priv->pmpi->stride[0], dmpi->stride[0],                vf->priv->Coefs[0] + 256,                vf->priv->Coefs[0] + 256,                vf->priv->Coefs[1] + 256);        deNoise(mpi->planes[1], vf->priv->pmpi->planes[1], dmpi->planes[1],		vf->priv->Line, cw, ch,                mpi->stride[1], vf->priv->pmpi->stride[1], dmpi->stride[1],                vf->priv->Coefs[2] + 256,                vf->priv->Coefs[2] + 256,                vf->priv->Coefs[3] + 256);        deNoise(mpi->planes[2], vf->priv->pmpi->planes[2], dmpi->planes[2],		vf->priv->Line, cw, ch,                mpi->stride[2], vf->priv->pmpi->stride[2], dmpi->stride[2],                vf->priv->Coefs[2] + 256,                vf->priv->Coefs[2] + 256,                vf->priv->Coefs[3] + 256);	vf->priv->pmpi=dmpi; // save reference image	return vf_next_put_image(vf,dmpi, pts);}
开发者ID:OpenSageTV,项目名称:mplayer-sage9orig,代码行数:35,


示例11: put_image

static intput_image (struct vf_instance *vf, mp_image_t *mpi, double pts){  struct vf_priv_s *priv = vf->priv;  mp_image_t* dmpi;  AVPicture pic;  AVPicture lavc_picture;  lavc_picture.data[0]     = mpi->planes[0];  lavc_picture.data[1]     = mpi->planes[1];  lavc_picture.data[2]     = mpi->planes[2];  lavc_picture.linesize[0] = mpi->stride[0];  lavc_picture.linesize[1] = mpi->stride[1];  lavc_picture.linesize[2] = mpi->stride[2];  dmpi = vf_get_image(vf->next, mpi->imgfmt,		      MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,		      priv->width, priv->height);  pic.data[0]     = dmpi->planes[0];  pic.data[1]     = dmpi->planes[1];  pic.data[2]     = dmpi->planes[2];  pic.linesize[0] = dmpi->stride[0];  pic.linesize[1] = dmpi->stride[1];  pic.linesize[2] = dmpi->stride[2];  if (avpicture_deinterlace(&pic, &lavc_picture,			    priv->pix_fmt, priv->width, priv->height) < 0)    {      /* This should not happen -- see config() */      return 0;    }  return vf_next_put_image(vf, dmpi, pts);}
开发者ID:dr4g0nsr,项目名称:mplayer-skyviia-8860,代码行数:35,


示例12: get_image

static void get_image(struct vf_instance* vf, mp_image_t *mpi){//    if(mpi->type==MP_IMGTYPE_IPB) return; // not yet working#ifdef OSD_SUPPORT    if(vf->priv->osd_enabled && (mpi->flags&MP_IMGFLAG_PRESERVE)){	// check if we have to render osd!	osd_update(vf->priv->osd, vf->priv->exp_w, vf->priv->exp_h);	if(vo_osd_check_range_update(vf->priv->exp_x,vf->priv->exp_y,	    vf->priv->exp_x+mpi->w,vf->priv->exp_y+mpi->h)) return;    }#endif    if(vf->priv->exp_w==mpi->width ||       (mpi->flags&(MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_ACCEPT_WIDTH)) ){	// try full DR !	mpi->priv=vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,	    mpi->type, mpi->flags,            FFMAX(vf->priv->exp_w, mpi->width +vf->priv->exp_x),            FFMAX(vf->priv->exp_h, mpi->height+vf->priv->exp_y));	if((vf->dmpi->flags & MP_IMGFLAG_DRAW_CALLBACK) &&	  !(vf->dmpi->flags & MP_IMGFLAG_DIRECT)){	    mp_tmsg(MSGT_VFILTER, MSGL_INFO, "Full DR not possible, trying SLICES instead!/n");	    return;	}	// set up mpi as a cropped-down image of dmpi:	if(mpi->flags&MP_IMGFLAG_PLANAR){	    mpi->planes[0]=vf->dmpi->planes[0]+		vf->priv->exp_y*vf->dmpi->stride[0]+vf->priv->exp_x;	    mpi->planes[1]=vf->dmpi->planes[1]+		(vf->priv->exp_y>>mpi->chroma_y_shift)*vf->dmpi->stride[1]+(vf->priv->exp_x>>mpi->chroma_x_shift);	    mpi->planes[2]=vf->dmpi->planes[2]+		(vf->priv->exp_y>>mpi->chroma_y_shift)*vf->dmpi->stride[2]+(vf->priv->exp_x>>mpi->chroma_x_shift);	    mpi->stride[1]=vf->dmpi->stride[1];	    mpi->stride[2]=vf->dmpi->stride[2];	} else {
开发者ID:hanyong,项目名称:mplayer-kovensky,代码行数:33,


示例13: put_image

/* Filter handler */static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){    mp_image_t        *dmpi;    struct vf_priv_s  *priv;    int               skip;    priv = vf->priv;    /* Print the 'I' if is a intra frame. The /n advance the current line so you got the     * current file time (in second) and the frame number on the console ;-)     */    if (priv->dump_iframe) {        if (mpi->pict_type == 1) {            mp_msg(MSGT_VFILTER, MSGL_INFO, "I!/n");        }    }    /* decide if frame must be shown */    if (priv->dump_iframe == 2) {        /* Only key frame */        skip = mpi->pict_type == 1 ? 0 : 1;    }    else {        /* Only 1 every frame_step */        skip = 0;        if ((priv->frame_step != 0) && ((priv->frame_cur % priv->frame_step) != 0)) {            skip = 1;        }    }    /* Increment current frame */    ++priv->frame_cur;    if (skip == 0) {	/* Get image, export type (we don't modify tghe image) */	dmpi=vf_get_image(vf->next, mpi->imgfmt,                      MP_IMGTYPE_EXPORT, 0,	              mpi->w, mpi->h);        /* Copy only the pointer ( MP_IMGTYPE_EXPORT ! ) */        dmpi->planes[0] = mpi->planes[0];        dmpi->planes[1] = mpi->planes[1];        dmpi->planes[2] = mpi->planes[2];        dmpi->stride[0] = mpi->stride[0];        dmpi->stride[1] = mpi->stride[1];        dmpi->stride[2] = mpi->stride[2];        dmpi->width     = mpi->width;        dmpi->height    = mpi->height;        /* Chain to next filter / output ... */        return vf_next_put_image(vf, dmpi, pts);    }    /* Skip the frame */    return 0;}
开发者ID:IngenicSemiconductor,项目名称:hardware-ingenic-xb4780,代码行数:57,


示例14: vf_get_image

// mp_imgtype: buffering type, see mp_image.h// mp_imgflag: buffer requirements (read/write, preserve, stride limits), see mp_image.h// returns NULL or allocated mp_image_t*// Note: buffer allocation may be moved to mpcodecs_config_vo() later...mp_image_t *mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,                               int w, int h){    mp_image_t *mpi =        vf_get_image(sh->vfilter, sh->codec->outfmt[sh->outfmtidx], mp_imgtype,                     mp_imgflag, w, h);    if (mpi)        mpi->x = mpi->y = 0;    return mpi;}
开发者ID:sherpya,项目名称:MPlayer,代码行数:14,


示例15: start_slice

static void start_slice(struct vf_instance_s* vf, mp_image_t *mpi){    vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,	mpi->type, mpi->flags, mpi->width, mpi->height);    if (vf->priv->shot) {	vf->priv->store_slices = 1;	if (!vf->priv->buffer)	    vf->priv->buffer = (uint8_t*)memalign(16, vf->priv->stride*vf->priv->dh);    }    }
开发者ID:OpenSageTV,项目名称:mplayer-sage9orig,代码行数:10,


示例16: get_image

static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){  mp_image_t *dmpi;  if(mpi->type == MP_IMGTYPE_TEMP && (!(mpi->flags&MP_IMGFLAG_PRESERVE)) ) {    dmpi = vf_get_image(vf->next,mpi->imgfmt,mpi->type, mpi->flags, mpi->w, mpi->h);    memcpy(mpi->planes,dmpi->planes,MP_MAX_PLANES*sizeof(unsigned char*));    memcpy(mpi->stride,dmpi->stride,MP_MAX_PLANES*sizeof(unsigned int));    mpi->flags|=MP_IMGFLAG_DIRECT;    mpi->priv=(void*)dmpi;    return;  }}
开发者ID:batman52,项目名称:dingux-code,代码行数:12,


示例17: get_image

static void get_image(struct vf_instance *vf, mp_image_t *mpi){    mp_image_t *dmpi= vf_get_image(vf->next, mpi->imgfmt,        mpi->type, mpi->flags, mpi->w, mpi->h);    mpi->planes[0]=dmpi->planes[0];    mpi->planes[1]=dmpi->planes[2];    mpi->planes[2]=dmpi->planes[1];    mpi->stride[0]=dmpi->stride[0];    mpi->stride[1]=dmpi->stride[2];    mpi->stride[2]=dmpi->stride[1];    mpi->width=dmpi->width;    mpi->flags|=MP_IMGFLAG_DIRECT;    mpi->priv=(void*)dmpi;}
开发者ID:0p1pp1,项目名称:mplayer,代码行数:15,


示例18: put_image

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) {    mp_image_t *dmpi;    int x,y, plane;    if(!(mpi->flags&MP_IMGFLAG_DIRECT)) {        // no DR, so get a new image! hope we'll get DR buffer:        vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP,                              MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE,                              mpi->w,mpi->h);    }    dmpi= vf->dmpi;    vf->priv->mpi= mpi;    vf_clone_mpi_attributes(dmpi, mpi);    for(plane=0; plane<3; plane++) {        int w= mpi->w >> (plane ? mpi->chroma_x_shift : 0);        int h= mpi->h >> (plane ? mpi->chroma_y_shift : 0);        uint8_t *dst  = dmpi->planes[plane];        int dst_stride= dmpi->stride[plane];        double const_values[]= {            M_PI,            M_E,            0,            0,            w,            h,            vf->priv->framenum,            w/(double)mpi->w,            h/(double)mpi->h,            0        };        if (!vf->priv->e[plane]) continue;        for(y=0; y<h; y++) {            const_values[3]=y;            for(x=0; x<w; x++) {                const_values[2]=x;                dst[x + y * dst_stride] = av_expr_eval(vf->priv->e[plane],                                                       const_values, vf);            }        }    }    vf->priv->framenum++;    return vf_next_put_image(vf,dmpi, pts);}
开发者ID:WilliamRen,项目名称:mplayer-android,代码行数:48,


示例19: put_image

static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){	mp_image_t *dmpi;	// hope we'll get DR buffer:	dmpi=vf_get_image(vf->next, IMGFMT_YV12,			  MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE |			  (vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0,			  mpi->w * vf->priv->scalew,			  mpi->h / vf->priv->scaleh - vf->priv->skipline);	toright(dmpi->planes, mpi->planes, dmpi->stride,		mpi->stride, mpi->w, mpi->h, vf->priv);	return vf_next_put_image(vf,dmpi, pts);}
开发者ID:hanyong,项目名称:mplayer-kovensky,代码行数:16,


示例20: get_image

static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){    if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change    // ok, we can do pp in-place (or pp disabled):    vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,        mpi->type, mpi->flags | MP_IMGFLAG_READABLE, mpi->width, mpi->height);    mpi->planes[0]=vf->dmpi->planes[0];    mpi->stride[0]=vf->dmpi->stride[0];    mpi->width=vf->dmpi->width;    if(mpi->flags&MP_IMGFLAG_PLANAR){        mpi->planes[1]=vf->dmpi->planes[1];        mpi->planes[2]=vf->dmpi->planes[2];	mpi->stride[1]=vf->dmpi->stride[1];	mpi->stride[2]=vf->dmpi->stride[2];    }    mpi->flags|=MP_IMGFLAG_DIRECT;}
开发者ID:batman52,项目名称:dingux-code,代码行数:16,


示例21: put_image

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){    mp_image_t *dmpi;        // hope we'll get DR buffer:    dmpi=vf_get_image(vf->next,vf->priv->fmt,	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,	mpi->w, mpi->h);    if (!mpi->planes[1])    {	if(!vf->priv->pal_msg){	    mp_msg(MSGT_VFILTER,MSGL_V,"[%s] no palette given, assuming builtin grayscale one/n",vf->info->name);	    vf->priv->pal_msg=1;	}	mpi->planes[1] = (unsigned char*)gray_pal;    }    if(mpi->w==mpi->stride[0] && dmpi->w*(dmpi->bpp>>3)==dmpi->stride[0]){	// no stride conversion needed	switch(IMGFMT_RGB_DEPTH(dmpi->imgfmt)){	case 15:	    if (IMGFMT_IS_BGR(dmpi->imgfmt))		palette8tobgr15(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    else		palette8torgb15(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    break;	case 16:	    if (IMGFMT_IS_BGR(dmpi->imgfmt))		palette8tobgr16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    else		palette8torgb16(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    break;	case 24:	    if (IMGFMT_IS_BGR(dmpi->imgfmt))		palette8tobgr24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    else		palette8torgb24(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    break;	case 32:	    if (IMGFMT_IS_BGR(dmpi->imgfmt))		palette8tobgr32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    else		palette8torgb32(mpi->planes[0],dmpi->planes[0],mpi->h*mpi->w,mpi->planes[1]);	    break;	}    } else {
开发者ID:batman52,项目名称:dingux-code,代码行数:46,


示例22: get_image

static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){    if(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE){	// try full DR !	vf->dmpi=vf_get_image(vf->next,mpi->imgfmt,	    mpi->type, mpi->flags, mpi->width, mpi->height);	// set up mpi as a upside-down image of dmpi:	mpi->planes[0]=vf->dmpi->planes[0]+		    vf->dmpi->stride[0]*(vf->dmpi->height-1);	mpi->stride[0]=-vf->dmpi->stride[0];	if(mpi->flags&MP_IMGFLAG_PLANAR){	    mpi->planes[1]=vf->dmpi->planes[1]+		    vf->dmpi->stride[1]*((vf->dmpi->height>>mpi->chroma_y_shift)-1);	    mpi->stride[1]=-vf->dmpi->stride[1];	    mpi->planes[2]=vf->dmpi->planes[2]+		    vf->dmpi->stride[2]*((vf->dmpi->height>>mpi->chroma_y_shift)-1);	    mpi->stride[2]=-vf->dmpi->stride[2];	}
开发者ID:BOTCrusher,项目名称:sagetv,代码行数:17,


示例23: put_image

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){    int cw= mpi->w >> mpi->chroma_x_shift;    int ch= mpi->h >> mpi->chroma_y_shift;    int threshold = vf->priv->luma.threshold || vf->priv->chroma.threshold;    mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,        MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|        (threshold ? MP_IMGFLAG_READABLE : 0),        mpi->w,mpi->h);    assert(mpi->flags&MP_IMGFLAG_PLANAR);    blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);    blur(dmpi->planes[1], mpi->planes[1], cw    , ch   , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);    blur(dmpi->planes[2], mpi->planes[2], cw    , ch   , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);    return vf_next_put_image(vf,dmpi, pts);}
开发者ID:Gamer125,项目名称:wiibrowser,代码行数:18,


示例24: put_image

/*** * /param vf pointer to vf_instance * /param mpi pointer to mp_image_t structure * /param pts */static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){	struct vf_priv_s *priv = vf->priv;	int size = 0;	int i;	mp_image_t* dmpi;	for (i = 0; i < priv->fields; i++)		size += jpeg_enc_frame(priv->j,				mpi->planes[0] + i*priv->y_stride,				mpi->planes[1] + i*priv->c_stride,				mpi->planes[2] + i*priv->c_stride,				priv->buf + size);	dmpi = vf_get_image(vf->next, IMGFMT_ZRMJPEGNI,			MP_IMGTYPE_EXPORT, 0, mpi->w, mpi->h);	dmpi->planes[0] = (uint8_t*)priv->buf;	dmpi->planes[1] = (uint8_t*)size;	return vf_next_put_image(vf,dmpi, pts);}
开发者ID:jlelli,项目名称:mplayer-dl,代码行数:23,



注:本文中的vf_get_image函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ vfork函数代码示例
C++ vexRT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。