Mercurial > libavcodec.hg
comparison libx264.c @ 11689:2312dfbe9251 libavcodec
Add intra refresh and crf-max support to the libavcodec libx264 wrapper.
Minor version bump.
author | darkshikari |
---|---|
date | Thu, 06 May 2010 22:38:18 +0000 |
parents | 52bc4e605761 |
children | 40911dc14bdc |
comparison
equal
deleted
inserted
replaced
11688:6f5bee041560 | 11689:2312dfbe9251 |
---|---|
154 | 154 |
155 x4->params.pf_log = X264_log; | 155 x4->params.pf_log = X264_log; |
156 x4->params.p_log_private = avctx; | 156 x4->params.p_log_private = avctx; |
157 | 157 |
158 x4->params.i_keyint_max = avctx->gop_size; | 158 x4->params.i_keyint_max = avctx->gop_size; |
159 x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH; | |
159 x4->params.rc.i_bitrate = avctx->bit_rate / 1000; | 160 x4->params.rc.i_bitrate = avctx->bit_rate / 1000; |
160 x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000; | 161 x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000; |
161 x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; | 162 x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; |
162 x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1; | 163 x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1; |
163 if (avctx->flags & CODEC_FLAG_PASS2) { | 164 if (avctx->flags & CODEC_FLAG_PASS2) { |
164 x4->params.rc.b_stat_read = 1; | 165 x4->params.rc.b_stat_read = 1; |
165 } else { | 166 } else { |
166 if (avctx->crf) { | 167 if (avctx->crf) { |
167 x4->params.rc.i_rc_method = X264_RC_CRF; | 168 x4->params.rc.i_rc_method = X264_RC_CRF; |
168 x4->params.rc.f_rf_constant = avctx->crf; | 169 x4->params.rc.f_rf_constant = avctx->crf; |
170 x4->params.rc.f_rf_constant_max = avctx->crf_max; | |
169 } else if (avctx->cqp > -1) { | 171 } else if (avctx->cqp > -1) { |
170 x4->params.rc.i_rc_method = X264_RC_CQP; | 172 x4->params.rc.i_rc_method = X264_RC_CQP; |
171 x4->params.rc.i_qp_constant = avctx->cqp; | 173 x4->params.rc.i_qp_constant = avctx->cqp; |
172 } | 174 } |
173 } | 175 } |