comparison libx264.c @ 10936:b2ea6b0d17bf libavcodec

Update libx264.c to use new libx264 features With b_keyframe instead of IDR for detecting keyframes, ffmpeg should now support periodic encoding with periodic intra refresh (although there is no interface option for it yet). Set the new timebase values for full VFR input support. Bump configure to check for API version 83.
author darkshikari
date Tue, 19 Jan 2010 04:00:08 +0000
parents 80161fd66fd1
children 9beb570426f4
comparison
equal deleted inserted replaced
10935:fb2dcafa2db3 10936:b2ea6b0d17bf
107 107
108 bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0); 108 bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0);
109 if (bufsize < 0) 109 if (bufsize < 0)
110 return -1; 110 return -1;
111 111
112 /* FIXME: dts */ 112 /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */
113 x4->out_pic.pts = pic_out.i_pts; 113 x4->out_pic.pts = pic_out.i_pts;
114 114
115 switch (pic_out.i_type) { 115 switch (pic_out.i_type) {
116 case X264_TYPE_IDR: 116 case X264_TYPE_IDR:
117 case X264_TYPE_I: 117 case X264_TYPE_I:
124 case X264_TYPE_BREF: 124 case X264_TYPE_BREF:
125 x4->out_pic.pict_type = FF_B_TYPE; 125 x4->out_pic.pict_type = FF_B_TYPE;
126 break; 126 break;
127 } 127 }
128 128
129 x4->out_pic.key_frame = pic_out.i_type == X264_TYPE_IDR; 129 x4->out_pic.key_frame = pic_out.b_keyframe;
130 x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; 130 x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA;
131 131
132 return bufsize; 132 return bufsize;
133 } 133 }
134 134
206 206
207 x4->params.i_width = avctx->width; 207 x4->params.i_width = avctx->width;
208 x4->params.i_height = avctx->height; 208 x4->params.i_height = avctx->height;
209 x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num; 209 x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num;
210 x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den; 210 x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
211 x4->params.i_fps_num = avctx->time_base.den; 211 x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
212 x4->params.i_fps_den = avctx->time_base.num; 212 x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
213 213
214 x4->params.analyse.inter = 0; 214 x4->params.analyse.inter = 0;
215 if (avctx->partitions) { 215 if (avctx->partitions) {
216 if (avctx->partitions & X264_PART_I4X4) 216 if (avctx->partitions & X264_PART_I4X4)
217 x4->params.analyse.inter |= X264_ANALYSE_I4x4; 217 x4->params.analyse.inter |= X264_ANALYSE_I4x4;