diff options
Diffstat (limited to 'libmpcodecs/ve_x264.c')
-rw-r--r-- | libmpcodecs/ve_x264.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c index 04d0bd342a..56bb5868df 100644 --- a/libmpcodecs/ve_x264.c +++ b/libmpcodecs/ve_x264.c @@ -158,7 +158,7 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, mod->mux->bih->biHeight = height; mod->mux->bih->biSizeImage = width * height * 3; mod->mux->aspect = (float)d_width/d_height; - + // make sure param is initialized x264enc_set_param(NULL, ""); param.i_width = width; @@ -181,7 +181,7 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, mp_msg(MSGT_MENCODER, MSGL_ERR, "Wrong colorspace.\n"); return 0; } - + mod->x264 = x264_encoder_open(¶m); if(!mod->x264) { mp_msg(MSGT_MENCODER, MSGL_ERR, "x264_encoder_open failed.\n"); @@ -206,12 +206,12 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, memcpy(mod->mux->bih + 1, extradata, extradata_size); mod->mux->bih->biSize= sizeof(BITMAPINFOHEADER) + extradata_size; } - + if (param.i_bframe > 1 && param.b_bframe_pyramid) mod->mux->decoder_delay = 2; else mod->mux->decoder_delay = param.i_bframe ? 1 : 0; - + return 1; } @@ -251,7 +251,7 @@ static int put_image(struct vf_instance_s *vf, mp_image_t *mpi, double pts) { h264_module_t *mod=(h264_module_t*)vf->priv; int i; - + memset(&mod->pic, 0, sizeof(x264_picture_t)); mod->pic.img.i_csp=param.i_csp; mod->pic.img.i_plane=3; @@ -278,7 +278,7 @@ static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in) mp_msg(MSGT_MENCODER, MSGL_ERR, "x264_encoder_encode failed\n"); return -1; } - + for(i=0; i < i_nal; i++) { int i_data = mod->mux->buffer_size - i_size; i_size += x264_nal_encode(mod->mux->buffer + i_size, &i_data, 1, &nal[i]); |