Merge commit '2f325a6fd4421c4dd4e26d7065e5d4bf26ed52f2'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 24 Feb 2013 13:05:16 +0000 (14:05 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 24 Feb 2013 13:05:16 +0000 (14:05 +0100)
* commit '2f325a6fd4421c4dd4e26d7065e5d4bf26ed52f2':
  libx264: change i_qfactor to use x264cli's default
  qtrle: use AV_LOG_ERROR in an error message.

Conflicts:
libavcodec/libx264.c

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

@@@ -286,21 -237,9 +286,20 @@@ static av_cold int X264_init(AVCodecCon
  
      x4->params.b_deblocking_filter         = avctx->flags & CODEC_FLAG_LOOP_FILTER;
  
-     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 || x4->tune)
          if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0) {
 +            int i;
              av_log(avctx, AV_LOG_ERROR, "Error setting preset/tune %s/%s.\n", x4->preset, x4->tune);
 +            av_log(avctx, AV_LOG_INFO, "Possible presets:");
 +            for (i = 0; x264_preset_names[i]; i++)
 +                av_log(avctx, AV_LOG_INFO, " %s", x264_preset_names[i]);
 +            av_log(avctx, AV_LOG_INFO, "\n");
 +            av_log(avctx, AV_LOG_INFO, "Possible tunes:");
 +            for (i = 0; x264_tune_names[i]; i++)
 +                av_log(avctx, AV_LOG_INFO, " %s", x264_tune_names[i]);
 +            av_log(avctx, AV_LOG_INFO, "\n");
              return AVERROR(EINVAL);
          }
  
              (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
      }
  
 -    x4->params.rc.f_pb_factor             = avctx->b_quant_factor;
 -    x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
 +    OPT_STR("level", x4->level);
 +
 +    if(x4->x264opts){
 +        const char *p= x4->x264opts;
 +        while(p){
 +            char param[256]={0}, val[256]={0};
 +            if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
 +                OPT_STR(param, "1");
 +            }else
 +                OPT_STR(param, val);
 +            p= strchr(p, ':');
 +            p+=!!p;
 +        }
 +    }
 +
+     if (avctx->i_quant_factor > 0)
+         x4->params.rc.f_ip_factor         = 1 / fabs(avctx->i_quant_factor);
      if (avctx->me_method == ME_EPZS)
          x4->params.analyse.i_me_method = X264_ME_DIA;
      else if (avctx->me_method == ME_HEX)
@@@ -691,8 -559,8 +693,9 @@@ static const AVClass rgbclass = 
  static const AVCodecDefault x264_defaults[] = {
      { "b",                "0" },
      { "bf",               "-1" },
 +    { "flags2",           "0" },
      { "g",                "-1" },
+     { "i_qfactor",        "-1" },
      { "qmin",             "-1" },
      { "qmax",             "-1" },
      { "qdiff",            "-1" },
Simple merge