wok-current rev 23070

transcode: update for ffmpeg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 10 09:38:48 2020 +0100 (2020-03-10)
parents 93cfbe138cae
children 91a008a5fdf1
files transcode/receipt transcode/stuff/ffmpeg4.u
line diff
     1.1 --- a/transcode/receipt	Tue Mar 10 08:35:31 2020 +0100
     1.2 +++ b/transcode/receipt	Tue Mar 10 09:38:48 2020 +0100
     1.3 @@ -22,6 +22,15 @@
     1.4  		wget -P $SOURCES_REPOSITORY $EXTRA_SOURCE_FILES
     1.5  	patch -p1 < $SOURCES_REPOSITORY/$(basename $EXTRA_SOURCE_FILES)
     1.6  	sed -i 's/av_close_input_file(/avformat_close_input(\&/' import/probe_ffmpeg.c
     1.7 +
     1.8 +	patch -p1 < $stuff/ffmpeg4.u
     1.9 +	grep -rl PIX_FMT_ * | xargs sed -i 's|PIX_FMT_|AV_&|'
    1.10 +	sed -i 's|CODEC_ID|AV_&|;s|AVAV_COD|AV_COD|;s|LIBAV_COD|LIBAVCOD|' */*.c
    1.11 +	sed -e 's|tcmodule-plugin.h"|&\n#include <libavresample/avresample.h>|' \
    1.12 +		-e 's|ReSampleContext|AVAudioResampleContext|' \
    1.13 +		-i filter/filter_resample.c
    1.14 +	sed -i 's|r_frame_rate|avg_frame_rate|g' import/probe_ffmpeg.c
    1.15 +
    1.16  	./configure --prefix=/usr --infodir=/usr/share/info \
    1.17  		--mandir=/usr/share/man \
    1.18  		$CONFIGURE_ARGS &&
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/transcode/stuff/ffmpeg4.u	Tue Mar 10 09:38:48 2020 +0100
     2.3 @@ -0,0 +1,508 @@
     2.4 +Index: transcode-1.1.7/encode/encode_lavc.c
     2.5 +===================================================================
     2.6 +--- transcode-1.1.7.orig/encode/encode_lavc.c
     2.7 ++++ transcode-1.1.7/encode/encode_lavc.c
     2.8 +@@ -77,6 +77,13 @@ struct tclavcconfigdata_ {
     2.9 +     int luma_elim_threshold;
    2.10 +     int chroma_elim_threshold;
    2.11 +     int quantizer_noise_shaping;
    2.12 ++    int inter_quant_bias;
    2.13 ++    int intra_quant_bias;
    2.14 ++    int scenechange_factor;
    2.15 ++    int rc_strategy;
    2.16 ++    float rc_initial_cplx;
    2.17 ++    float rc_qsquish;
    2.18 ++    float border_masking;
    2.19 + 
    2.20 +     /* same as above for flags */
    2.21 +     struct {
    2.22 +@@ -684,7 +691,7 @@ static int tc_lavc_init_multipass(TCLavc
    2.23 +     switch (vob->divxmultipass) {
    2.24 +       case 1:
    2.25 +         CAN_DO_MULTIPASS(multipass_flag);
    2.26 +-        pd->ff_vcontext.flags |= CODEC_FLAG_PASS1;
    2.27 ++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS1;
    2.28 +         pd->stats_file = fopen(vob->divxlogfile, "w");
    2.29 +         if (pd->stats_file == NULL) {
    2.30 +             tc_log_error(MOD_NAME, "could not create 2pass log file"
    2.31 +@@ -694,7 +701,7 @@ static int tc_lavc_init_multipass(TCLavc
    2.32 +         break;
    2.33 +       case 2:
    2.34 +         CAN_DO_MULTIPASS(multipass_flag);
    2.35 +-        pd->ff_vcontext.flags |= CODEC_FLAG_PASS2;
    2.36 ++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS2;
    2.37 +         pd->stats_file = fopen(vob->divxlogfile, "r");
    2.38 +         if (pd->stats_file == NULL){
    2.39 +             tc_log_error(MOD_NAME, "could not open 2pass log file \"%s\""
    2.40 +@@ -723,7 +730,7 @@ static int tc_lavc_init_multipass(TCLavc
    2.41 +         break;
    2.42 +       case 3:
    2.43 +         /* fixed qscale :p */
    2.44 +-        pd->ff_vcontext.flags |= CODEC_FLAG_QSCALE;
    2.45 ++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_QSCALE;
    2.46 +         pd->ff_venc_frame.quality = vob->divxbitrate;
    2.47 +         break;
    2.48 +     }
    2.49 +@@ -970,7 +977,7 @@ static void tc_lavc_config_defaults(TCLa
    2.50 +     pd->confdata.rc_buffer_size  = 0;
    2.51 +     pd->confdata.lmin            = 2;
    2.52 +     pd->confdata.lmax            = 31;
    2.53 +-    pd->confdata.me_method       = ME_EPZS;
    2.54 ++    pd->confdata.me_method       = 0;
    2.55 + 
    2.56 +     memset(&pd->confdata.flags, 0, sizeof(pd->confdata.flags));
    2.57 +     pd->confdata.turbo_setup = 0;
    2.58 +@@ -983,12 +990,12 @@ static void tc_lavc_config_defaults(TCLa
    2.59 +     pd->ff_vcontext.me_range                = 0;
    2.60 +     pd->ff_vcontext.mb_decision             = 0;
    2.61 +     pd->ff_vcontext.scenechange_threshold   = 0;
    2.62 +-    pd->ff_vcontext.scenechange_factor      = 1;
    2.63 ++    pd->confdata.scenechange_factor         = 1;
    2.64 +     pd->ff_vcontext.b_frame_strategy        = 0;
    2.65 +     pd->ff_vcontext.b_sensitivity           = 40;
    2.66 +     pd->ff_vcontext.brd_scale               = 0;
    2.67 +     pd->ff_vcontext.bidir_refine            = 0;
    2.68 +-    pd->ff_vcontext.rc_strategy             = 2;
    2.69 ++    pd->confdata.rc_strategy                = 2;
    2.70 +     pd->ff_vcontext.b_quant_factor          = 1.25;
    2.71 +     pd->ff_vcontext.i_quant_factor          = 0.8;
    2.72 +     pd->ff_vcontext.b_quant_offset          = 1.25;
    2.73 +@@ -996,8 +1003,8 @@ static void tc_lavc_config_defaults(TCLa
    2.74 +     pd->ff_vcontext.qblur                   = 0.5;
    2.75 +     pd->ff_vcontext.qcompress               = 0.5;
    2.76 +     pd->ff_vcontext.mpeg_quant              = 0;
    2.77 +-    pd->ff_vcontext.rc_initial_cplx         = 0.0;
    2.78 +-    pd->ff_vcontext.rc_qsquish              = 1.0;
    2.79 ++    pd->confdata.rc_initial_cplx            = 0.0;
    2.80 ++    pd->confdata.rc_qsquish              = 1.0;
    2.81 +     pd->confdata.luma_elim_threshold     = 0;
    2.82 +     pd->confdata.chroma_elim_threshold   = 0;
    2.83 +     pd->ff_vcontext.strict_std_compliance   = 0;
    2.84 +@@ -1008,7 +1015,7 @@ static void tc_lavc_config_defaults(TCLa
    2.85 +     pd->ff_vcontext.temporal_cplx_masking   = 0.0;
    2.86 +     pd->ff_vcontext.spatial_cplx_masking    = 0.0;
    2.87 +     pd->ff_vcontext.p_masking               = 0.0;
    2.88 +-    pd->ff_vcontext.border_masking          = 0.0;
    2.89 ++    pd->confdata.border_masking          = 0.0;
    2.90 +     pd->ff_vcontext.me_pre_cmp              = 0;
    2.91 +     pd->ff_vcontext.me_cmp                  = 0;
    2.92 +     pd->ff_vcontext.me_sub_cmp              = 0;
    2.93 +@@ -1020,8 +1027,6 @@ static void tc_lavc_config_defaults(TCLa
    2.94 +     pd->ff_vcontext.pre_me                  = 1;
    2.95 +     pd->ff_vcontext.me_subpel_quality       = 8;
    2.96 +     pd->ff_vcontext.refs                    = 1;
    2.97 +-    pd->ff_vcontext.intra_quant_bias        = FF_DEFAULT_QUANT_BIAS;
    2.98 +-    pd->ff_vcontext.inter_quant_bias        = FF_DEFAULT_QUANT_BIAS;
    2.99 +     pd->ff_vcontext.noise_reduction         = 0;
   2.100 +     pd->confdata.quantizer_noise_shaping = 0;
   2.101 +     pd->ff_vcontext.flags                   = 0;
   2.102 +@@ -1044,19 +1049,19 @@ static void tc_lavc_config_defaults(TCLa
   2.103 +  */
   2.104 + static void tc_lavc_dispatch_settings(TCLavcPrivateData *pd)
   2.105 + {
   2.106 ++    char buf[1024];
   2.107 +     /* some translation... */
   2.108 +     pd->ff_vcontext.bit_rate_tolerance = pd->confdata.vrate_tolerance * 1000;
   2.109 +     pd->ff_vcontext.rc_min_rate = pd->confdata.rc_min_rate * 1000;
   2.110 +     pd->ff_vcontext.rc_max_rate = pd->confdata.rc_max_rate * 1000;
   2.111 +     pd->ff_vcontext.rc_buffer_size = pd->confdata.rc_buffer_size * 1024;
   2.112 +-    pd->ff_vcontext.lmin = (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5);
   2.113 +-    pd->ff_vcontext.lmax = (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5);
   2.114 +-    pd->ff_vcontext.me_method = ME_ZERO + pd->confdata.me_method;
   2.115 ++    snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5));
   2.116 ++    av_dict_set(&(pd->ff_opts), "lmin", buf, 0);
   2.117 ++    snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5));
   2.118 ++    av_dict_set(&(pd->ff_opts), "lmax", buf, 0);
   2.119 + 
   2.120 +     pd->ff_vcontext.flags = 0;
   2.121 +-    SET_FLAG(pd, mv0);
   2.122 +     SET_FLAG(pd, qpel);
   2.123 +-    SET_FLAG(pd, naq);
   2.124 +     SET_FLAG(pd, ilme);
   2.125 +     SET_FLAG(pd, ildct);
   2.126 +     SET_FLAG(pd, aic);
   2.127 +@@ -1077,8 +1082,8 @@ static void tc_lavc_dispatch_settings(TC
   2.128 +     }
   2.129 +     if (pd->interlacing.active) {
   2.130 +         /* enforce interlacing */
   2.131 +-        pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT;
   2.132 +-        pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME;
   2.133 ++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_DCT;
   2.134 ++        pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_ME;
   2.135 +     }
   2.136 +     if (pd->confdata.flags.alt) {
   2.137 +         av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0);
   2.138 +@@ -1095,15 +1100,31 @@ static void tc_lavc_dispatch_settings(TC
   2.139 +     if (pd->confdata.flags.cbp) {
   2.140 +     	av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0);
   2.141 +     }
   2.142 ++    if (pd->confdata.flags.mv0) {
   2.143 ++    	av_dict_set(&(pd->ff_opts), "mpv_flags", "+mv0", 0);
   2.144 ++    }
   2.145 ++    if (pd->confdata.flags.naq) {
   2.146 ++    	av_dict_set(&(pd->ff_opts), "mpv_flags", "+naq", 0);
   2.147 ++    }
   2.148 + 
   2.149 +-    char buf[1024];
   2.150 + #define set_dict_opt(val, opt) \
   2.151 +     snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\
   2.152 +     av_dict_set(&(pd->ff_opts), opt, buf, 0)
   2.153 ++#define set_dict_float_opt(val, opt) \
   2.154 ++    snprintf(buf, sizeof(buf), "%f", pd->confdata.val);\
   2.155 ++    av_dict_set(&(pd->ff_opts), opt, buf, 0)
   2.156 + 
   2.157 +     set_dict_opt(luma_elim_threshold, "luma_elim_threshold");
   2.158 +     set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold");
   2.159 +     set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping");
   2.160 ++    set_dict_opt(inter_quant_bias, "pbias");
   2.161 ++    set_dict_opt(intra_quant_bias, "ibias");
   2.162 ++    set_dict_opt(me_method, "me_method");
   2.163 ++    set_dict_opt(scenechange_factor, "sc_factor");
   2.164 ++    set_dict_opt(rc_strategy, "rc_strategy");
   2.165 ++    set_dict_float_opt(rc_initial_cplx, "rc_init_cplx");
   2.166 ++    set_dict_float_opt(rc_qsquish, "qsquish");
   2.167 ++    set_dict_float_opt(border_masking, "border_mask");
   2.168 + }
   2.169 + 
   2.170 + #undef SET_FLAG
   2.171 +@@ -1159,12 +1180,12 @@ static int tc_lavc_read_config(TCLavcPri
   2.172 +         { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
   2.173 +         { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
   2.174 +         { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 },
   2.175 +-        { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES },
   2.176 ++        { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX },
   2.177 +         { "vme", PAUX(me_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16, },
   2.178 +         { "me_range", PCTX(me_range), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000 },
   2.179 +         { "mbd", PCTX(mb_decision), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
   2.180 +         { "sc_threshold", PCTX(scenechange_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000 },
   2.181 +-        { "sc_factor", PCTX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 },
   2.182 ++        { "sc_factor", PAUX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 },
   2.183 +         { "vb_strategy", PCTX(b_frame_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
   2.184 +         { "b_sensitivity", PCTX(b_sensitivity), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 100 },
   2.185 +         { "brd_scale", PCTX(brd_scale), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
   2.186 +@@ -1175,7 +1196,7 @@ static int tc_lavc_read_config(TCLavcPri
   2.187 +         { "vrc_maxrate", PAUX(rc_max_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 },
   2.188 +         { "vrc_minrate", PAUX(rc_min_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 },
   2.189 +         { "vrc_buf_size", PAUX(rc_buffer_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000 },
   2.190 +-        { "vrc_strategy", PCTX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 },
   2.191 ++        { "vrc_strategy", PAUX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 },
   2.192 +         { "vb_qfactor", PCTX(b_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 },
   2.193 +         { "vi_qfactor", PCTX(i_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 },
   2.194 +         { "vb_qoffset", PCTX(b_quant_offset), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0 },
   2.195 +@@ -1185,9 +1206,9 @@ static int tc_lavc_read_config(TCLavcPri
   2.196 +         { "mpeg_quant", PCTX(mpeg_quant), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.197 +         //  { "vrc_eq",     }, // not yet supported
   2.198 +         { "vrc_override", rc_override_buf, TCCONF_TYPE_STRING, 0, 0, 0 },
   2.199 +-        { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
   2.200 ++        { "vrc_init_cplx", PAUX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
   2.201 +         //  { "vrc_init_occupancy",   }, // not yet supported
   2.202 +-        { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
   2.203 ++        { "vqsquish", PAUX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
   2.204 +         { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
   2.205 +         { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
   2.206 +         { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
   2.207 +@@ -1199,7 +1220,7 @@ static int tc_lavc_read_config(TCLavcPri
   2.208 +         { "tcplx_mask", PCTX(temporal_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
   2.209 +         { "scplx_mask", PCTX(spatial_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
   2.210 +         { "p_mask", PCTX(p_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
   2.211 +-        { "border_mask", PCTX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
   2.212 ++        { "border_mask", PAUX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
   2.213 +         { "pred", PCTX(prediction_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 4 },
   2.214 +         { "precmp", PCTX(me_pre_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 },
   2.215 +         { "cmp", PCTX(me_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 },
   2.216 +@@ -1212,37 +1233,37 @@ static int tc_lavc_read_config(TCLavcPri
   2.217 +         { "pre_me", PCTX(pre_me), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
   2.218 +         { "subq", PCTX(me_subpel_quality), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8 },
   2.219 +         { "refs", PCTX(refs), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 8 },
   2.220 +-        { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
   2.221 +-        { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
   2.222 ++        { "ibias", PAUX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
   2.223 ++        { "pbias", PAUX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
   2.224 +         { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
   2.225 +         { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
   2.226 +         { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
   2.227 +         { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
   2.228 +     
   2.229 +-        { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
   2.230 ++        { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.231 +         { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.232 +-        { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
   2.233 ++        { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL },
   2.234 +         { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.235 +-        { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
   2.236 +-        { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT },
   2.237 +-        { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP },
   2.238 ++        { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME },
   2.239 ++        { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_DCT },
   2.240 ++        { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.241 +         { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.242 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
   2.243 +         { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC },
   2.244 + #else        
   2.245 +-        { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED },
   2.246 ++        { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED },
   2.247 + #endif
   2.248 +         { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.249 +         { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.250 +-        { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR },
   2.251 ++        { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR },
   2.252 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
   2.253 +         { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT },
   2.254 + #else
   2.255 +         { "trell", PCTX(trellis), TCCONF_TYPE_FLAG, 0, 0, 1 },
   2.256 + #endif
   2.257 +-        { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY },
   2.258 +-        { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV },
   2.259 +-        { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP },
   2.260 ++        { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY },
   2.261 ++        { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV },
   2.262 ++        { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP },
   2.263 +     
   2.264 +         //  { "turbo", PAUX(turbo_setup), TCCONF_TYPE_FLAG, 0, 0, 1 }, // not yet  supported
   2.265 +         /* End of the config file */
   2.266 +Index: transcode-1.1.7/export/export_ffmpeg.c
   2.267 +===================================================================
   2.268 +--- transcode-1.1.7.orig/export/export_ffmpeg.c
   2.269 ++++ transcode-1.1.7/export/export_ffmpeg.c
   2.270 +@@ -828,14 +828,11 @@ MOD_init
   2.271 + 
   2.272 +     lavc_venc_context->bit_rate           = vob->divxbitrate * 1000;
   2.273 +     lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
   2.274 +-    lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
   2.275 +-    lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
   2.276 +     lavc_venc_context->max_qdiff          = lavc_param_vqdiff;
   2.277 +     lavc_venc_context->qcompress          = lavc_param_vqcompress;
   2.278 +     lavc_venc_context->qblur              = lavc_param_vqblur;
   2.279 +     lavc_venc_context->max_b_frames       = lavc_param_vmax_b_frames;
   2.280 +     lavc_venc_context->b_quant_factor     = lavc_param_vb_qfactor;
   2.281 +-    lavc_venc_context->rc_strategy        = lavc_param_vrc_strategy;
   2.282 +     lavc_venc_context->b_frame_strategy   = lavc_param_vb_strategy;
   2.283 +     lavc_venc_context->b_quant_offset     = lavc_param_vb_qoffset;
   2.284 + 
   2.285 +@@ -843,8 +840,23 @@ MOD_init
   2.286 + #define set_dict_opt(val, opt) \
   2.287 + 	snprintf(buf, sizeof(buf), "%i", val); \
   2.288 + 	av_dict_set(&lavc_venc_opts, opt, buf, 0)
   2.289 ++#define set_dict_float_opt(val, opt) \
   2.290 ++	snprintf(buf, sizeof(buf), "%f", val); \
   2.291 ++	av_dict_set(&lavc_venc_opts, opt, buf, 0)
   2.292 +     set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold");
   2.293 +     set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold");
   2.294 ++    set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5), "lmin");
   2.295 ++    set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5), "lmax");
   2.296 ++    set_dict_opt(lavc_param_vrc_strategy, "rc_strategy");
   2.297 ++    set_dict_float_opt(lavc_param_rc_qsquish, "qsquish");
   2.298 ++    set_dict_float_opt(lavc_param_rc_qmod_amp, "rc_qmod_amp");
   2.299 ++    set_dict_opt(lavc_param_rc_qmod_freq, "rc_qmod_freq");
   2.300 ++    set_dict_opt(lavc_param_rc_eq, "rc_eq");
   2.301 ++    set_dict_opt(lavc_param_vme, "me_method");
   2.302 ++    set_dict_opt(lavc_param_ibias, "ibias");
   2.303 ++    set_dict_opt(lavc_param_pbias, "pbias");
   2.304 ++    set_dict_float_opt(lavc_param_rc_buffer_aggressivity, "rc_buf_aggressivity");
   2.305 ++    set_dict_float_opt(lavc_param_rc_initial_cplx, "rc_init_cplx");
   2.306 +     lavc_venc_context->rtp_payload_size   = lavc_param_packet_size;
   2.307 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)   
   2.308 +     if (lavc_param_packet_size)
   2.309 +@@ -853,15 +865,9 @@ MOD_init
   2.310 +     lavc_venc_context->strict_std_compliance= lavc_param_strict;
   2.311 +     lavc_venc_context->i_quant_factor     = lavc_param_vi_qfactor;
   2.312 +     lavc_venc_context->i_quant_offset     = lavc_param_vi_qoffset;
   2.313 +-    lavc_venc_context->rc_qsquish         = lavc_param_rc_qsquish;
   2.314 +-    lavc_venc_context->rc_qmod_amp        = lavc_param_rc_qmod_amp;
   2.315 +-    lavc_venc_context->rc_qmod_freq       = lavc_param_rc_qmod_freq;
   2.316 +-    lavc_venc_context->rc_eq              = lavc_param_rc_eq;
   2.317 +     lavc_venc_context->rc_max_rate        = lavc_param_rc_max_rate * 1000;
   2.318 +     lavc_venc_context->rc_min_rate        = lavc_param_rc_min_rate * 1000;
   2.319 +     lavc_venc_context->rc_buffer_size     = lavc_param_rc_buffer_size * 1024;
   2.320 +-    lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity;
   2.321 +-    lavc_venc_context->rc_initial_cplx    = lavc_param_rc_initial_cplx;
   2.322 +     lavc_venc_context->debug              = lavc_param_debug;
   2.323 +     lavc_venc_context->last_predictor_count= lavc_param_last_pred;
   2.324 +     lavc_venc_context->pre_me             = lavc_param_pre_me;
   2.325 +@@ -869,8 +875,6 @@ MOD_init
   2.326 +     lavc_venc_context->pre_dia_size       = lavc_param_pre_dia_size;
   2.327 +     lavc_venc_context->me_subpel_quality  = lavc_param_me_subpel_quality;
   2.328 +     lavc_venc_context->me_range           = lavc_param_me_range;
   2.329 +-    lavc_venc_context->intra_quant_bias   = lavc_param_ibias;
   2.330 +-    lavc_venc_context->inter_quant_bias   = lavc_param_pbias;
   2.331 +     lavc_venc_context->coder_type         = lavc_param_coder;
   2.332 +     lavc_venc_context->context_model      = lavc_param_context;
   2.333 +     lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
   2.334 +@@ -1076,6 +1080,8 @@ MOD_init
   2.335 +     lavc_venc_context->flags |= lavc_param_mv0;
   2.336 +     if(lavc_param_qp_rd)
   2.337 +     	av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0);
   2.338 ++    if (lavc_param_normalize_aqp)
   2.339 ++    	av_dict_set(&lavc_venc_opts, "mpv_flags", "+naq", 0);
   2.340 +     lavc_venc_context->flags |= lavc_param_ilme;
   2.341 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)   
   2.342 +     lavc_venc_context->flags |= lavc_param_trell;
   2.343 +@@ -1084,9 +1090,7 @@ MOD_init
   2.344 + #endif
   2.345 + 
   2.346 +     if (lavc_param_gray)
   2.347 +-        lavc_venc_context->flags |= CODEC_FLAG_GRAY;
   2.348 +-    if (lavc_param_normalize_aqp)
   2.349 +-        lavc_venc_context->flags |= CODEC_FLAG_NORMALIZE_AQP;
   2.350 ++        lavc_venc_context->flags |= AV_CODEC_FLAG_GRAY;
   2.351 + 
   2.352 +     switch(vob->encode_fields) {
   2.353 +     case TC_ENCODE_FIELDS_TOP_FIRST:
   2.354 +@@ -1104,9 +1108,9 @@ MOD_init
   2.355 +     }
   2.356 + 
   2.357 +     lavc_venc_context->flags |= interlacing_active ?
   2.358 +-        CODEC_FLAG_INTERLACED_DCT : 0;
   2.359 ++        AV_CODEC_FLAG_INTERLACED_DCT : 0;
   2.360 +     lavc_venc_context->flags |= interlacing_active ?
   2.361 +-        CODEC_FLAG_INTERLACED_ME : 0;
   2.362 ++        AV_CODEC_FLAG_INTERLACED_ME : 0;
   2.363 + 
   2.364 +     lavc_venc_context->flags |= lavc_param_psnr;
   2.365 +     do_psnr = lavc_param_psnr;
   2.366 +@@ -1153,7 +1157,7 @@ MOD_init
   2.367 +                   "encoding.");
   2.368 +           return TC_EXPORT_ERROR;
   2.369 +         }
   2.370 +-        lavc_venc_context->flags |= CODEC_FLAG_PASS1;
   2.371 ++        lavc_venc_context->flags |= AV_CODEC_FLAG_PASS1;
   2.372 +         stats_file = fopen(vob->divxlogfile, "w");
   2.373 +         if (stats_file == NULL){
   2.374 +           tc_log_warn(MOD_NAME, "Could not create 2pass log file \"%s\".",
   2.375 +@@ -1167,7 +1175,7 @@ MOD_init
   2.376 +                   "encoding.");
   2.377 +           return TC_EXPORT_ERROR;
   2.378 +         }
   2.379 +-        lavc_venc_context->flags |= CODEC_FLAG_PASS2;
   2.380 ++        lavc_venc_context->flags |= AV_CODEC_FLAG_PASS2;
   2.381 +         stats_file= fopen(vob->divxlogfile, "r");
   2.382 +         if (stats_file==NULL){
   2.383 +           tc_log_warn(MOD_NAME, "Could not open 2pass log file \"%s\" for "
   2.384 +@@ -1198,12 +1203,11 @@ MOD_init
   2.385 +         break;
   2.386 +       case 3:
   2.387 +         /* fixed qscale :p */
   2.388 +-        lavc_venc_context->flags   |= CODEC_FLAG_QSCALE;
   2.389 ++        lavc_venc_context->flags   |= AV_CODEC_FLAG_QSCALE;
   2.390 +         lavc_venc_frame->quality  = vob->divxbitrate;
   2.391 +         break;
   2.392 +     }
   2.393 + 
   2.394 +-    lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
   2.395 + 
   2.396 + 	/* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
   2.397 + 	if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) {
   2.398 +Index: transcode-1.1.7/export/ffmpeg_cfg.c
   2.399 +===================================================================
   2.400 +--- transcode-1.1.7.orig/export/ffmpeg_cfg.c
   2.401 ++++ transcode-1.1.7/export/ffmpeg_cfg.c
   2.402 +@@ -93,8 +93,8 @@ int lavc_param_last_pred= 0;
   2.403 + int lavc_param_pre_me= 1;
   2.404 + int lavc_param_me_subpel_quality= 8;
   2.405 + int lavc_param_me_range=0;
   2.406 +-int lavc_param_ibias=FF_DEFAULT_QUANT_BIAS;
   2.407 +-int lavc_param_pbias=FF_DEFAULT_QUANT_BIAS;
   2.408 ++int lavc_param_ibias=0;
   2.409 ++int lavc_param_pbias=0;
   2.410 + int lavc_param_coder=0;
   2.411 + int lavc_param_context=0;
   2.412 + char *lavc_param_intra_matrix = NULL;
   2.413 +@@ -136,7 +136,7 @@ TCConfigEntry lavcopts_conf[]={
   2.414 +     {"vratetol", &lavc_param_vrate_tolerance, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000},
   2.415 +     {"vhq", &lavc_param_mb_decision, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.416 +     {"mbd", &lavc_param_mb_decision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9},
   2.417 +-    {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV},
   2.418 ++    {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV},
   2.419 +     {"vme", &lavc_param_vme, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 5},
   2.420 + //    {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
   2.421 + //    {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
   2.422 +@@ -147,7 +147,7 @@ TCConfigEntry lavcopts_conf[]={
   2.423 +     {"vqcomp", &lavc_param_vqcompress, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
   2.424 +     {"vqblur", &lavc_param_vqblur, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
   2.425 +     {"vb_qfactor", &lavc_param_vb_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
   2.426 +-    {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES},
   2.427 ++    {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX},
   2.428 + //    {"vpass", &lavc_param_vpass, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
   2.429 +     {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
   2.430 +     {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
   2.431 +@@ -158,7 +158,7 @@ TCConfigEntry lavcopts_conf[]={
   2.432 +     {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
   2.433 +     {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.434 + //    {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
   2.435 +-    {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY},
   2.436 ++    {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY},
   2.437 +     {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.438 +     {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
   2.439 +     {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
   2.440 +@@ -184,7 +184,7 @@ TCConfigEntry lavcopts_conf[]={
   2.441 +     {"pred", &lavc_param_prediction_method, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20},
   2.442 +     {"format", &lavc_param_format, TCCONF_TYPE_STRING, 0, 0, 0},
   2.443 +     {"debug", &lavc_param_debug, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
   2.444 +-    {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR},
   2.445 ++    {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR},
   2.446 +     {"precmp", &lavc_param_me_pre_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
   2.447 +     {"cmp", &lavc_param_me_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
   2.448 +     {"subcmp", &lavc_param_me_sub_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
   2.449 +@@ -192,9 +192,9 @@ TCConfigEntry lavcopts_conf[]={
   2.450 +     {"ildctcmp", &lavc_param_ildct_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
   2.451 +     {"predia", &lavc_param_pre_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000},
   2.452 +     {"dia", &lavc_param_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000},
   2.453 +-    {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL},
   2.454 ++    {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL},
   2.455 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)   
   2.456 +-    {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT},
   2.457 ++    {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRELLIS_QUANT},
   2.458 + #else
   2.459 +     {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.460 + #endif
   2.461 +@@ -203,9 +203,9 @@ TCConfigEntry lavcopts_conf[]={
   2.462 +     {"subq", &lavc_param_me_subpel_quality, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8},
   2.463 +     {"me_range", &lavc_param_me_range, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000},
   2.464 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)   
   2.465 +-    {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC},
   2.466 ++    {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_H263P_AIC},
   2.467 + #else
   2.468 +-    {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED},
   2.469 ++    {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED},
   2.470 + #endif    
   2.471 +     {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.472 +     {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
   2.473 +@@ -215,20 +215,20 @@ TCConfigEntry lavcopts_conf[]={
   2.474 +     {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
   2.475 +     {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
   2.476 +     {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.477 +-    {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
   2.478 ++    {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.479 +     {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
   2.480 +     {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.481 +     {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
   2.482 +     {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.483 +     {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.484 +     {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.485 +-    {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
   2.486 ++    {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME},
   2.487 +     {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
   2.488 +     {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
   2.489 +     {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1},
   2.490 +-    {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC},
   2.491 +-    {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRUNCATED},
   2.492 +-    {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP},
   2.493 ++    {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, 1},
   2.494 ++    {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRUNCATED},
   2.495 ++    {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP},
   2.496 +     {"intra_dc_precision", &lavc_param_intra_dc_precision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16},
   2.497 +     {"skip_top", &lavc_param_skip_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
   2.498 +     {"skip_bottom", &lavc_param_skip_bottom, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
   2.499 +Index: transcode-1.1.7/import/import_ffmpeg.c
   2.500 +===================================================================
   2.501 +--- transcode-1.1.7.orig/import/import_ffmpeg.c
   2.502 ++++ transcode-1.1.7/import/import_ffmpeg.c
   2.503 +@@ -310,7 +310,7 @@ do_avi:
   2.504 +     lavc_dec_context->width  = x_dim;
   2.505 +     lavc_dec_context->height = y_dim;
   2.506 + 
   2.507 +-    if (vob->decolor) lavc_dec_context->flags |= CODEC_FLAG_GRAY;
   2.508 ++    if (vob->decolor) lavc_dec_context->flags |= AV_CODEC_FLAG_GRAY;
   2.509 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
   2.510 +     lavc_dec_context->error_resilience  = 2;
   2.511 + #else