OSDN Git Service

Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 8 Aug 2011 21:35:22 +0000 (23:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 8 Aug 2011 22:01:48 +0000 (00:01 +0200)
* qatar/master:
  libx264: do not set pic quality if no frame is output
  libx264: add preset, tune, profile and fastfirstpass private options

Conflicts:
libavcodec/libx264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/libx264.c

@@@ -296,18 -249,14 +296,20 @@@ static av_cold int X264_init(AVCodecCon
      x4->params.analyse.i_trellis          = avctx->trellis;
      x4->params.analyse.i_noise_reduction  = avctx->noise_reduction;
  
 -    if (avctx->level > 0)
 -        x4->params.i_level_idc = avctx->level;
 +    x4->params.rc.b_mb_tree               = !!(avctx->flags2 & CODEC_FLAG2_MBTREE);
 +    x4->params.rc.f_ip_factor             = 1 / fabs(avctx->i_quant_factor);
 +    x4->params.rc.f_pb_factor             = avctx->b_quant_factor;
 +    x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
 +
 +    if (!x4->preset)
 +        check_default_settings(avctx);
  
 -    if (x4->preset || x4->tune)
 +    if (x4->preset || x4->tune) {
-         if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0)
-             return -1;
+         if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0) {
+             av_log(avctx, AV_LOG_ERROR, "Error setting preset/tune %s/%s.\n", x4->preset, x4->tune);
+             return AVERROR(EINVAL);
+         }
 +    }
  
      x4->params.pf_log               = X264_log;
      x4->params.p_log_private        = avctx;