Mercurial > libavcodec.hg
comparison libx264.c @ 7000:af0fe48cda98 libavcodec
cleanup, remove useless parentheses
author | bcoudurier |
---|---|
date | Wed, 04 Jun 2008 00:44:43 +0000 |
parents | e1302edb0f69 |
children | 8193f8ae7ff4 |
comparison
equal
deleted
inserted
replaced
6999:3d84a99ecfa7 | 7000:af0fe48cda98 |
---|---|
142 | 142 |
143 x4->params.i_keyint_max = avctx->gop_size; | 143 x4->params.i_keyint_max = avctx->gop_size; |
144 x4->params.rc.i_bitrate = avctx->bit_rate / 1000; | 144 x4->params.rc.i_bitrate = avctx->bit_rate / 1000; |
145 x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000; | 145 x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000; |
146 x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; | 146 x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000; |
147 x4->params.rc.b_stat_write = (avctx->flags & CODEC_FLAG_PASS1); | 147 x4->params.rc.b_stat_write = avctx->flags & CODEC_FLAG_PASS1; |
148 if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1; | 148 if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1; |
149 else{ | 149 else{ |
150 if(avctx->crf){ | 150 if(avctx->crf){ |
151 x4->params.rc.i_rc_method = X264_RC_CRF; | 151 x4->params.rc.i_rc_method = X264_RC_CRF; |
152 x4->params.rc.f_rf_constant = avctx->crf; | 152 x4->params.rc.f_rf_constant = avctx->crf; |
162 | 162 |
163 x4->params.i_bframe = avctx->max_b_frames; | 163 x4->params.i_bframe = avctx->max_b_frames; |
164 x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; | 164 x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; |
165 x4->params.b_bframe_adaptive = avctx->b_frame_strategy; | 165 x4->params.b_bframe_adaptive = avctx->b_frame_strategy; |
166 x4->params.i_bframe_bias = avctx->bframebias; | 166 x4->params.i_bframe_bias = avctx->bframebias; |
167 x4->params.b_bframe_pyramid = (avctx->flags2 & CODEC_FLAG2_BPYRAMID); | 167 x4->params.b_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID; |
168 avctx->has_b_frames= (avctx->flags2 & CODEC_FLAG2_BPYRAMID) ? 2 : !!avctx->max_b_frames; | 168 avctx->has_b_frames= avctx->flags2 & CODEC_FLAG2_BPYRAMID ? 2 : !!avctx->max_b_frames; |
169 | 169 |
170 x4->params.i_keyint_min = avctx->keyint_min; | 170 x4->params.i_keyint_min = avctx->keyint_min; |
171 if(x4->params.i_keyint_min > x4->params.i_keyint_max) | 171 if(x4->params.i_keyint_min > x4->params.i_keyint_max) |
172 x4->params.i_keyint_min = x4->params.i_keyint_max; | 172 x4->params.i_keyint_min = x4->params.i_keyint_max; |
173 | 173 |
174 x4->params.i_scenecut_threshold = avctx->scenechange_threshold; | 174 x4->params.i_scenecut_threshold = avctx->scenechange_threshold; |
175 | 175 |
176 x4->params.b_deblocking_filter = (avctx->flags & CODEC_FLAG_LOOP_FILTER); | 176 x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER; |
177 x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; | 177 x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; |
178 x4->params.i_deblocking_filter_beta = avctx->deblockbeta; | 178 x4->params.i_deblocking_filter_beta = avctx->deblockbeta; |
179 | 179 |
180 x4->params.rc.i_qp_min = avctx->qmin; | 180 x4->params.rc.i_qp_min = avctx->qmin; |
181 x4->params.rc.i_qp_max = avctx->qmax; | 181 x4->params.rc.i_qp_max = avctx->qmax; |
208 x4->params.analyse.inter |= X264_ANALYSE_BSUB16x16; | 208 x4->params.analyse.inter |= X264_ANALYSE_BSUB16x16; |
209 } | 209 } |
210 | 210 |
211 x4->params.analyse.i_direct_mv_pred = avctx->directpred; | 211 x4->params.analyse.i_direct_mv_pred = avctx->directpred; |
212 | 212 |
213 x4->params.analyse.b_weighted_bipred = (avctx->flags2 & CODEC_FLAG2_WPRED); | 213 x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED; |
214 | 214 |
215 if(avctx->me_method == ME_EPZS) | 215 if(avctx->me_method == ME_EPZS) |
216 x4->params.analyse.i_me_method = X264_ME_DIA; | 216 x4->params.analyse.i_me_method = X264_ME_DIA; |
217 else if(avctx->me_method == ME_HEX) | 217 else if(avctx->me_method == ME_HEX) |
218 x4->params.analyse.i_me_method = X264_ME_HEX; | 218 x4->params.analyse.i_me_method = X264_ME_HEX; |
223 else x4->params.analyse.i_me_method = X264_ME_HEX; | 223 else x4->params.analyse.i_me_method = X264_ME_HEX; |
224 | 224 |
225 x4->params.analyse.i_me_range = avctx->me_range; | 225 x4->params.analyse.i_me_range = avctx->me_range; |
226 x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; | 226 x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality; |
227 | 227 |
228 x4->params.analyse.b_bidir_me = (avctx->bidir_refine > 0); | 228 x4->params.analyse.b_bidir_me = avctx->bidir_refine > 0; |
229 x4->params.analyse.b_bframe_rdo = (avctx->flags2 & CODEC_FLAG2_BRDO); | 229 x4->params.analyse.b_bframe_rdo = avctx->flags2 & CODEC_FLAG2_BRDO; |
230 x4->params.analyse.b_mixed_references = | 230 x4->params.analyse.b_mixed_references = |
231 (avctx->flags2 & CODEC_FLAG2_MIXED_REFS); | 231 avctx->flags2 & CODEC_FLAG2_MIXED_REFS; |
232 x4->params.analyse.b_chroma_me = (avctx->me_cmp & FF_CMP_CHROMA); | 232 x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA; |
233 x4->params.analyse.b_transform_8x8 = (avctx->flags2 & CODEC_FLAG2_8X8DCT); | 233 x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT; |
234 x4->params.analyse.b_fast_pskip = (avctx->flags2 & CODEC_FLAG2_FASTPSKIP); | 234 x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP; |
235 | 235 |
236 x4->params.analyse.i_trellis = avctx->trellis; | 236 x4->params.analyse.i_trellis = avctx->trellis; |
237 x4->params.analyse.i_noise_reduction = avctx->noise_reduction; | 237 x4->params.analyse.i_noise_reduction = avctx->noise_reduction; |
238 | 238 |
239 if(avctx->level > 0) x4->params.i_level_idc = avctx->level; | 239 if(avctx->level > 0) x4->params.i_level_idc = avctx->level; |
251 x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor); | 251 x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor); |
252 x4->params.rc.f_pb_factor = avctx->b_quant_factor; | 252 x4->params.rc.f_pb_factor = avctx->b_quant_factor; |
253 x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; | 253 x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; |
254 x4->params.rc.psz_rc_eq = avctx->rc_eq; | 254 x4->params.rc.psz_rc_eq = avctx->rc_eq; |
255 | 255 |
256 x4->params.analyse.b_psnr = (avctx->flags & CODEC_FLAG_PSNR); | 256 x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR; |
257 x4->params.i_log_level = X264_LOG_DEBUG; | 257 x4->params.i_log_level = X264_LOG_DEBUG; |
258 | 258 |
259 x4->params.b_aud = (avctx->flags2 & CODEC_FLAG2_AUD); | 259 x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD; |
260 | 260 |
261 x4->params.i_threads = avctx->thread_count; | 261 x4->params.i_threads = avctx->thread_count; |
262 | 262 |
263 if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){ | 263 if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){ |
264 x4->params.b_repeat_headers = 0; | 264 x4->params.b_repeat_headers = 0; |