[x264-devel] x264 version 104 crash
191919
191919 at gmail.com
Thu Jul 15 07:53:31 CEST 2010
I noticed x264.h was versioned up to 104, but some APIs, like
x264_picture_alloc, are not used anymore.
And sadly, my code is not working anymore. Basically, I copied the code from
x264.c, but x264.c changed a lot, I need modify many lines to follow up.
=== Initialization ===
x264_param_t params;
x264_param_default(¶ms);
params.i_width = frame_param->width;
params.i_height = frame_param->height;
params.i_fps_num = (int) time_base;
params.i_fps_den = 1;
params.i_timebase_num = params.i_fps_den;
params.i_timebase_den = params.i_fps_num;
params.b_annexb = 0;
params.b_dts_compress = 1;
params.b_repeat_headers = 0;
params.i_frame_reference = 1;
params.i_keyint_max = 30;
params.rc.i_bitrate = g_video_bitrate;
params.rc.i_vbv_max_bitrate = 40;
params.rc.f_rate_tolerance = 2.0f;
params.rc.i_lookahead = 0;
params.rc.i_rc_method = X264_RC_ABR;
params.rc.f_rf_constant = 2.0f;
params.rc.f_rf_constant_max = 37.0f;
params.rc.i_qp_min = 2;
params.rc.i_qp_max = 37;
params.rc.b_stat_write = 0;
params.i_bframe = 0;
params.b_cabac = 1;
params.analyse.inter = 0;
params.b_deblocking_filter = 1;
params.analyse.i_trellis = 2;
params.analyse.i_me_method = X264_ME_UMH;
params.analyse.inter |= X264_ANALYSE_I4x4 | X264_ANALYSE_I8x8 |
X264_ANALYSE_PSUB16x16 | X264_ANALYSE_PSUB8x8 | X264_ANALYSE_BSUB16x16;
params.analyse.b_chroma_me = 1;
params.analyse.b_transform_8x8 = 1;
params.analyse.i_direct_mv_pred = 3;
params.analyse.b_weighted_bipred = 1;
params.analyse.i_weighted_pred = 2;
params.i_threads = 1;
codec->x264 = x264_encoder_open(¶ms);
x264_encoder_parameters(codec->x264, ¶ms);
codec->pic = (x264_picture_t*) calloc(1, sizeof(x264_picture_t));
x264_picture_init(codec->pic);
x264_picture_alloc(codec->pic, params.i_csp, params.i_width,
params.i_height);
=== Encoding, the input buffer is in YV12 ===
codec->pic->img.plane[0] = codec->yuv_buffer;
codec->pic->img.plane[1] = codec->pic->img.plane[0] +
frame_param->height * frame_param->width;
codec->pic->img.plane[2] = codec->pic->img.plane[0] +
frame_param->height * frame_param->width + frame_param->height *
frame_param->width / 4;
codec->pic->b_keyframe = 0;
codec->pic->i_dts = 0;
codec->pic->i_pts = 0;
x264_picture_t pic_out;
x264_nal_t *nal;
int i_nal;
codec->pic->i_type = X264_TYPE_AUTO;
codec->pic->i_qpplus1 = 0;
codec->pic->i_pts = codec->frame_index;
int i_frame_size = x264_encoder_encode(codec->x264, &nal, &i_nal,
codec->pic, &pic_out);
My program then crashed after the last statement. It works well until x264
version 102.
Regards,
191919
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20100715/a6cd3da4/attachment.htm>
More information about the x264-devel
mailing list