static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { switch (vf->priv->mode) { case 0: case 3: return ff_vf_next_config(vf,width,height*2,d_width,d_height*2,flags,outfmt); case 1: /* odd frames */ case 2: /* even frames */ case 4: /* alternate frame (height-preserving) interlacing */ return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } return 0; }
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { if (height&3) { ff_mp_msg(MSGT_VFILTER, MSGL_ERR, "height must be divisible by four\n"); return 0; } return ff_vf_next_config(vf, width, height, d_width, d_height, flags, outfmt); }
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ free(vf->priv->Line); vf->priv->Line = malloc(width); vf->priv->pmpi=NULL; // vf->default_caps &= !VFCAP_ACCEPT_STRIDE; return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); }
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ int sw, sh; //__asm__ volatile("emms\n\t"); allocStuff(&vf->priv->luma, width, height); getSubSampleFactors(&sw, &sh, outfmt); allocStuff(&vf->priv->chroma, width>>sw, height>>sh); return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); }
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ int i; AVCodec *enc= avcodec_find_encoder(AV_CODEC_ID_SNOW); for(i=0; i<3; i++){ int is_chroma= !!i; int w= ((width + 4*BLOCK-1) & (~(2*BLOCK-1)))>>is_chroma; int h= ((height + 4*BLOCK-1) & (~(2*BLOCK-1)))>>is_chroma; vf->priv->temp_stride[i]= w; vf->priv->temp[i]= malloc(vf->priv->temp_stride[i]*h*sizeof(int16_t)); vf->priv->src [i]= malloc(vf->priv->temp_stride[i]*h*sizeof(uint8_t)); } for(i=0; i< (1<<vf->priv->log2_count); i++){ AVCodecContext *avctx_enc; AVDictionary *opts = NULL; avctx_enc= vf->priv->avctx_enc[i]= avcodec_alloc_context3(NULL); avctx_enc->width = width + BLOCK; avctx_enc->height = height + BLOCK; #ifdef IDE_COMPILE avctx_enc->time_base.num = 1; // meaningless avctx_enc->time_base.den = 25; // meaningless #else avctx_enc->time_base= (AVRational){1,25}; // meaningless #endif avctx_enc->gop_size = 300; avctx_enc->max_b_frames= 0; avctx_enc->pix_fmt = AV_PIX_FMT_YUV420P; avctx_enc->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY; avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; avctx_enc->global_quality= 123; av_dict_set(&opts, "no_bitstream", "1", 0); if (avcodec_open2(avctx_enc, enc, &opts) < 0) return 0; av_dict_free(&opts); assert(avctx_enc->codec); } vf->priv->frame= av_frame_alloc(); vf->priv->frame_dec= av_frame_alloc(); vf->priv->outbuf_size= (width + BLOCK)*(height + BLOCK)*10; vf->priv->outbuf= malloc(vf->priv->outbuf_size); return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); }
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ return ff_vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); }