return p - buf;
}
-extern int
+static int
X264_frame(AVCodecContext *ctx, uint8_t *buf, int bufsize, void *data)
{
X264Context *x4 = ctx->priv_data;
x4->pic.img.i_plane = 3;
if (frame) {
- for(i = 0; i < 3; i++){
- x4->pic.img.plane[i] = frame->data[i];
- x4->pic.img.i_stride[i] = frame->linesize[i];
- }
+ for(i = 0; i < 3; i++){
+ x4->pic.img.plane[i] = frame->data[i];
+ x4->pic.img.i_stride[i] = frame->linesize[i];
+ }
- x4->pic.i_pts = frame->pts;
- x4->pic.i_type = X264_TYPE_AUTO;
+ x4->pic.i_pts = frame->pts;
+ x4->pic.i_type = X264_TYPE_AUTO;
}
if(x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL,
return 0;
}
-extern int
+static int
X264_init(AVCodecContext *avctx)
{
X264Context *x4 = avctx->priv_data;
x4->params.analyse.i_me_range = avctx->me_range;
x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
+ x4->params.analyse.b_bidir_me = (avctx->bidir_refine > 0);
x4->params.analyse.b_bframe_rdo = (avctx->flags2 & CODEC_FLAG2_BRDO);
x4->params.analyse.b_mixed_references =
(avctx->flags2 & CODEC_FLAG2_MIXED_REFS);