wok-6.x diff transcode/stuff/ffmpeg4.u @ rev 24409
updated clamav and clamav-dev again (0.102.3 -> 0.104.2)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Feb 09 14:21:34 2022 +0100 (2022-02-09) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/transcode/stuff/ffmpeg4.u Wed Feb 09 14:21:34 2022 +0100 1.3 @@ -0,0 +1,508 @@ 1.4 +Index: transcode-1.1.7/encode/encode_lavc.c 1.5 +=================================================================== 1.6 +--- transcode-1.1.7.orig/encode/encode_lavc.c 1.7 ++++ transcode-1.1.7/encode/encode_lavc.c 1.8 +@@ -77,6 +77,13 @@ struct tclavcconfigdata_ { 1.9 + int luma_elim_threshold; 1.10 + int chroma_elim_threshold; 1.11 + int quantizer_noise_shaping; 1.12 ++ int inter_quant_bias; 1.13 ++ int intra_quant_bias; 1.14 ++ int scenechange_factor; 1.15 ++ int rc_strategy; 1.16 ++ float rc_initial_cplx; 1.17 ++ float rc_qsquish; 1.18 ++ float border_masking; 1.19 + 1.20 + /* same as above for flags */ 1.21 + struct { 1.22 +@@ -684,7 +691,7 @@ static int tc_lavc_init_multipass(TCLavc 1.23 + switch (vob->divxmultipass) { 1.24 + case 1: 1.25 + CAN_DO_MULTIPASS(multipass_flag); 1.26 +- pd->ff_vcontext.flags |= CODEC_FLAG_PASS1; 1.27 ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS1; 1.28 + pd->stats_file = fopen(vob->divxlogfile, "w"); 1.29 + if (pd->stats_file == NULL) { 1.30 + tc_log_error(MOD_NAME, "could not create 2pass log file" 1.31 +@@ -694,7 +701,7 @@ static int tc_lavc_init_multipass(TCLavc 1.32 + break; 1.33 + case 2: 1.34 + CAN_DO_MULTIPASS(multipass_flag); 1.35 +- pd->ff_vcontext.flags |= CODEC_FLAG_PASS2; 1.36 ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS2; 1.37 + pd->stats_file = fopen(vob->divxlogfile, "r"); 1.38 + if (pd->stats_file == NULL){ 1.39 + tc_log_error(MOD_NAME, "could not open 2pass log file \"%s\"" 1.40 +@@ -723,7 +730,7 @@ static int tc_lavc_init_multipass(TCLavc 1.41 + break; 1.42 + case 3: 1.43 + /* fixed qscale :p */ 1.44 +- pd->ff_vcontext.flags |= CODEC_FLAG_QSCALE; 1.45 ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_QSCALE; 1.46 + pd->ff_venc_frame.quality = vob->divxbitrate; 1.47 + break; 1.48 + } 1.49 +@@ -970,7 +977,7 @@ static void tc_lavc_config_defaults(TCLa 1.50 + pd->confdata.rc_buffer_size = 0; 1.51 + pd->confdata.lmin = 2; 1.52 + pd->confdata.lmax = 31; 1.53 +- pd->confdata.me_method = ME_EPZS; 1.54 ++ pd->confdata.me_method = 0; 1.55 + 1.56 + memset(&pd->confdata.flags, 0, sizeof(pd->confdata.flags)); 1.57 + pd->confdata.turbo_setup = 0; 1.58 +@@ -983,12 +990,12 @@ static void tc_lavc_config_defaults(TCLa 1.59 + pd->ff_vcontext.me_range = 0; 1.60 + pd->ff_vcontext.mb_decision = 0; 1.61 + pd->ff_vcontext.scenechange_threshold = 0; 1.62 +- pd->ff_vcontext.scenechange_factor = 1; 1.63 ++ pd->confdata.scenechange_factor = 1; 1.64 + pd->ff_vcontext.b_frame_strategy = 0; 1.65 + pd->ff_vcontext.b_sensitivity = 40; 1.66 + pd->ff_vcontext.brd_scale = 0; 1.67 + pd->ff_vcontext.bidir_refine = 0; 1.68 +- pd->ff_vcontext.rc_strategy = 2; 1.69 ++ pd->confdata.rc_strategy = 2; 1.70 + pd->ff_vcontext.b_quant_factor = 1.25; 1.71 + pd->ff_vcontext.i_quant_factor = 0.8; 1.72 + pd->ff_vcontext.b_quant_offset = 1.25; 1.73 +@@ -996,8 +1003,8 @@ static void tc_lavc_config_defaults(TCLa 1.74 + pd->ff_vcontext.qblur = 0.5; 1.75 + pd->ff_vcontext.qcompress = 0.5; 1.76 + pd->ff_vcontext.mpeg_quant = 0; 1.77 +- pd->ff_vcontext.rc_initial_cplx = 0.0; 1.78 +- pd->ff_vcontext.rc_qsquish = 1.0; 1.79 ++ pd->confdata.rc_initial_cplx = 0.0; 1.80 ++ pd->confdata.rc_qsquish = 1.0; 1.81 + pd->confdata.luma_elim_threshold = 0; 1.82 + pd->confdata.chroma_elim_threshold = 0; 1.83 + pd->ff_vcontext.strict_std_compliance = 0; 1.84 +@@ -1008,7 +1015,7 @@ static void tc_lavc_config_defaults(TCLa 1.85 + pd->ff_vcontext.temporal_cplx_masking = 0.0; 1.86 + pd->ff_vcontext.spatial_cplx_masking = 0.0; 1.87 + pd->ff_vcontext.p_masking = 0.0; 1.88 +- pd->ff_vcontext.border_masking = 0.0; 1.89 ++ pd->confdata.border_masking = 0.0; 1.90 + pd->ff_vcontext.me_pre_cmp = 0; 1.91 + pd->ff_vcontext.me_cmp = 0; 1.92 + pd->ff_vcontext.me_sub_cmp = 0; 1.93 +@@ -1020,8 +1027,6 @@ static void tc_lavc_config_defaults(TCLa 1.94 + pd->ff_vcontext.pre_me = 1; 1.95 + pd->ff_vcontext.me_subpel_quality = 8; 1.96 + pd->ff_vcontext.refs = 1; 1.97 +- pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS; 1.98 +- pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS; 1.99 + pd->ff_vcontext.noise_reduction = 0; 1.100 + pd->confdata.quantizer_noise_shaping = 0; 1.101 + pd->ff_vcontext.flags = 0; 1.102 +@@ -1044,19 +1049,19 @@ static void tc_lavc_config_defaults(TCLa 1.103 + */ 1.104 + static void tc_lavc_dispatch_settings(TCLavcPrivateData *pd) 1.105 + { 1.106 ++ char buf[1024]; 1.107 + /* some translation... */ 1.108 + pd->ff_vcontext.bit_rate_tolerance = pd->confdata.vrate_tolerance * 1000; 1.109 + pd->ff_vcontext.rc_min_rate = pd->confdata.rc_min_rate * 1000; 1.110 + pd->ff_vcontext.rc_max_rate = pd->confdata.rc_max_rate * 1000; 1.111 + pd->ff_vcontext.rc_buffer_size = pd->confdata.rc_buffer_size * 1024; 1.112 +- pd->ff_vcontext.lmin = (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5); 1.113 +- pd->ff_vcontext.lmax = (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5); 1.114 +- pd->ff_vcontext.me_method = ME_ZERO + pd->confdata.me_method; 1.115 ++ snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5)); 1.116 ++ av_dict_set(&(pd->ff_opts), "lmin", buf, 0); 1.117 ++ snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5)); 1.118 ++ av_dict_set(&(pd->ff_opts), "lmax", buf, 0); 1.119 + 1.120 + pd->ff_vcontext.flags = 0; 1.121 +- SET_FLAG(pd, mv0); 1.122 + SET_FLAG(pd, qpel); 1.123 +- SET_FLAG(pd, naq); 1.124 + SET_FLAG(pd, ilme); 1.125 + SET_FLAG(pd, ildct); 1.126 + SET_FLAG(pd, aic); 1.127 +@@ -1077,8 +1082,8 @@ static void tc_lavc_dispatch_settings(TC 1.128 + } 1.129 + if (pd->interlacing.active) { 1.130 + /* enforce interlacing */ 1.131 +- pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT; 1.132 +- pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME; 1.133 ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_DCT; 1.134 ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_ME; 1.135 + } 1.136 + if (pd->confdata.flags.alt) { 1.137 + av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0); 1.138 +@@ -1095,15 +1100,31 @@ static void tc_lavc_dispatch_settings(TC 1.139 + if (pd->confdata.flags.cbp) { 1.140 + av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0); 1.141 + } 1.142 ++ if (pd->confdata.flags.mv0) { 1.143 ++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+mv0", 0); 1.144 ++ } 1.145 ++ if (pd->confdata.flags.naq) { 1.146 ++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+naq", 0); 1.147 ++ } 1.148 + 1.149 +- char buf[1024]; 1.150 + #define set_dict_opt(val, opt) \ 1.151 + snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\ 1.152 + av_dict_set(&(pd->ff_opts), opt, buf, 0) 1.153 ++#define set_dict_float_opt(val, opt) \ 1.154 ++ snprintf(buf, sizeof(buf), "%f", pd->confdata.val);\ 1.155 ++ av_dict_set(&(pd->ff_opts), opt, buf, 0) 1.156 + 1.157 + set_dict_opt(luma_elim_threshold, "luma_elim_threshold"); 1.158 + set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold"); 1.159 + set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping"); 1.160 ++ set_dict_opt(inter_quant_bias, "pbias"); 1.161 ++ set_dict_opt(intra_quant_bias, "ibias"); 1.162 ++ set_dict_opt(me_method, "me_method"); 1.163 ++ set_dict_opt(scenechange_factor, "sc_factor"); 1.164 ++ set_dict_opt(rc_strategy, "rc_strategy"); 1.165 ++ set_dict_float_opt(rc_initial_cplx, "rc_init_cplx"); 1.166 ++ set_dict_float_opt(rc_qsquish, "qsquish"); 1.167 ++ set_dict_float_opt(border_masking, "border_mask"); 1.168 + } 1.169 + 1.170 + #undef SET_FLAG 1.171 +@@ -1159,12 +1180,12 @@ static int tc_lavc_read_config(TCLavcPri 1.172 + { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 }, 1.173 + { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 }, 1.174 + { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 }, 1.175 +- { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES }, 1.176 ++ { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX }, 1.177 + { "vme", PAUX(me_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16, }, 1.178 + { "me_range", PCTX(me_range), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000 }, 1.179 + { "mbd", PCTX(mb_decision), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, 1.180 + { "sc_threshold", PCTX(scenechange_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000 }, 1.181 +- { "sc_factor", PCTX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 }, 1.182 ++ { "sc_factor", PAUX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 }, 1.183 + { "vb_strategy", PCTX(b_frame_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 }, 1.184 + { "b_sensitivity", PCTX(b_sensitivity), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 100 }, 1.185 + { "brd_scale", PCTX(brd_scale), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 }, 1.186 +@@ -1175,7 +1196,7 @@ static int tc_lavc_read_config(TCLavcPri 1.187 + { "vrc_maxrate", PAUX(rc_max_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 }, 1.188 + { "vrc_minrate", PAUX(rc_min_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 }, 1.189 + { "vrc_buf_size", PAUX(rc_buffer_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000 }, 1.190 +- { "vrc_strategy", PCTX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 }, 1.191 ++ { "vrc_strategy", PAUX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 }, 1.192 + { "vb_qfactor", PCTX(b_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 }, 1.193 + { "vi_qfactor", PCTX(i_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 }, 1.194 + { "vb_qoffset", PCTX(b_quant_offset), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0 }, 1.195 +@@ -1185,9 +1206,9 @@ static int tc_lavc_read_config(TCLavcPri 1.196 + { "mpeg_quant", PCTX(mpeg_quant), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.197 + // { "vrc_eq", }, // not yet supported 1.198 + { "vrc_override", rc_override_buf, TCCONF_TYPE_STRING, 0, 0, 0 }, 1.199 +- { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 }, 1.200 ++ { "vrc_init_cplx", PAUX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 }, 1.201 + // { "vrc_init_occupancy", }, // not yet supported 1.202 +- { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 }, 1.203 ++ { "vqsquish", PAUX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 }, 1.204 + { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, 1.205 + { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, 1.206 + { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, 1.207 +@@ -1199,7 +1220,7 @@ static int tc_lavc_read_config(TCLavcPri 1.208 + { "tcplx_mask", PCTX(temporal_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, 1.209 + { "scplx_mask", PCTX(spatial_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, 1.210 + { "p_mask", PCTX(p_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, 1.211 +- { "border_mask", PCTX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, 1.212 ++ { "border_mask", PAUX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, 1.213 + { "pred", PCTX(prediction_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 4 }, 1.214 + { "precmp", PCTX(me_pre_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 }, 1.215 + { "cmp", PCTX(me_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 }, 1.216 +@@ -1212,37 +1233,37 @@ static int tc_lavc_read_config(TCLavcPri 1.217 + { "pre_me", PCTX(pre_me), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, 1.218 + { "subq", PCTX(me_subpel_quality), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8 }, 1.219 + { "refs", PCTX(refs), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 8 }, 1.220 +- { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, 1.221 +- { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, 1.222 ++ { "ibias", PAUX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, 1.223 ++ { "pbias", PAUX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, 1.224 + { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, 1.225 + { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, 1.226 + { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 }, 1.227 + { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 }, 1.228 + 1.229 +- { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 }, 1.230 ++ { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.231 + { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.232 +- { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL }, 1.233 ++ { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL }, 1.234 + { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.235 +- { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME }, 1.236 +- { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT }, 1.237 +- { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP }, 1.238 ++ { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME }, 1.239 ++ { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_DCT }, 1.240 ++ { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.241 + { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.242 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.243 + { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC }, 1.244 + #else 1.245 +- { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED }, 1.246 ++ { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED }, 1.247 + #endif 1.248 + { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.249 + { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.250 +- { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR }, 1.251 ++ { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR }, 1.252 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.253 + { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT }, 1.254 + #else 1.255 + { "trell", PCTX(trellis), TCCONF_TYPE_FLAG, 0, 0, 1 }, 1.256 + #endif 1.257 +- { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY }, 1.258 +- { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV }, 1.259 +- { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP }, 1.260 ++ { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY }, 1.261 ++ { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV }, 1.262 ++ { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP }, 1.263 + 1.264 + // { "turbo", PAUX(turbo_setup), TCCONF_TYPE_FLAG, 0, 0, 1 }, // not yet supported 1.265 + /* End of the config file */ 1.266 +Index: transcode-1.1.7/export/export_ffmpeg.c 1.267 +=================================================================== 1.268 +--- transcode-1.1.7.orig/export/export_ffmpeg.c 1.269 ++++ transcode-1.1.7/export/export_ffmpeg.c 1.270 +@@ -828,14 +828,11 @@ MOD_init 1.271 + 1.272 + lavc_venc_context->bit_rate = vob->divxbitrate * 1000; 1.273 + lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000; 1.274 +- lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5); 1.275 +- lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5); 1.276 + lavc_venc_context->max_qdiff = lavc_param_vqdiff; 1.277 + lavc_venc_context->qcompress = lavc_param_vqcompress; 1.278 + lavc_venc_context->qblur = lavc_param_vqblur; 1.279 + lavc_venc_context->max_b_frames = lavc_param_vmax_b_frames; 1.280 + lavc_venc_context->b_quant_factor = lavc_param_vb_qfactor; 1.281 +- lavc_venc_context->rc_strategy = lavc_param_vrc_strategy; 1.282 + lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy; 1.283 + lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset; 1.284 + 1.285 +@@ -843,8 +840,23 @@ MOD_init 1.286 + #define set_dict_opt(val, opt) \ 1.287 + snprintf(buf, sizeof(buf), "%i", val); \ 1.288 + av_dict_set(&lavc_venc_opts, opt, buf, 0) 1.289 ++#define set_dict_float_opt(val, opt) \ 1.290 ++ snprintf(buf, sizeof(buf), "%f", val); \ 1.291 ++ av_dict_set(&lavc_venc_opts, opt, buf, 0) 1.292 + set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold"); 1.293 + set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold"); 1.294 ++ set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5), "lmin"); 1.295 ++ set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5), "lmax"); 1.296 ++ set_dict_opt(lavc_param_vrc_strategy, "rc_strategy"); 1.297 ++ set_dict_float_opt(lavc_param_rc_qsquish, "qsquish"); 1.298 ++ set_dict_float_opt(lavc_param_rc_qmod_amp, "rc_qmod_amp"); 1.299 ++ set_dict_opt(lavc_param_rc_qmod_freq, "rc_qmod_freq"); 1.300 ++ set_dict_opt(lavc_param_rc_eq, "rc_eq"); 1.301 ++ set_dict_opt(lavc_param_vme, "me_method"); 1.302 ++ set_dict_opt(lavc_param_ibias, "ibias"); 1.303 ++ set_dict_opt(lavc_param_pbias, "pbias"); 1.304 ++ set_dict_float_opt(lavc_param_rc_buffer_aggressivity, "rc_buf_aggressivity"); 1.305 ++ set_dict_float_opt(lavc_param_rc_initial_cplx, "rc_init_cplx"); 1.306 + lavc_venc_context->rtp_payload_size = lavc_param_packet_size; 1.307 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.308 + if (lavc_param_packet_size) 1.309 +@@ -853,15 +865,9 @@ MOD_init 1.310 + lavc_venc_context->strict_std_compliance= lavc_param_strict; 1.311 + lavc_venc_context->i_quant_factor = lavc_param_vi_qfactor; 1.312 + lavc_venc_context->i_quant_offset = lavc_param_vi_qoffset; 1.313 +- lavc_venc_context->rc_qsquish = lavc_param_rc_qsquish; 1.314 +- lavc_venc_context->rc_qmod_amp = lavc_param_rc_qmod_amp; 1.315 +- lavc_venc_context->rc_qmod_freq = lavc_param_rc_qmod_freq; 1.316 +- lavc_venc_context->rc_eq = lavc_param_rc_eq; 1.317 + lavc_venc_context->rc_max_rate = lavc_param_rc_max_rate * 1000; 1.318 + lavc_venc_context->rc_min_rate = lavc_param_rc_min_rate * 1000; 1.319 + lavc_venc_context->rc_buffer_size = lavc_param_rc_buffer_size * 1024; 1.320 +- lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity; 1.321 +- lavc_venc_context->rc_initial_cplx = lavc_param_rc_initial_cplx; 1.322 + lavc_venc_context->debug = lavc_param_debug; 1.323 + lavc_venc_context->last_predictor_count= lavc_param_last_pred; 1.324 + lavc_venc_context->pre_me = lavc_param_pre_me; 1.325 +@@ -869,8 +875,6 @@ MOD_init 1.326 + lavc_venc_context->pre_dia_size = lavc_param_pre_dia_size; 1.327 + lavc_venc_context->me_subpel_quality = lavc_param_me_subpel_quality; 1.328 + lavc_venc_context->me_range = lavc_param_me_range; 1.329 +- lavc_venc_context->intra_quant_bias = lavc_param_ibias; 1.330 +- lavc_venc_context->inter_quant_bias = lavc_param_pbias; 1.331 + lavc_venc_context->coder_type = lavc_param_coder; 1.332 + lavc_venc_context->context_model = lavc_param_context; 1.333 + lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold; 1.334 +@@ -1076,6 +1080,8 @@ MOD_init 1.335 + lavc_venc_context->flags |= lavc_param_mv0; 1.336 + if(lavc_param_qp_rd) 1.337 + av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0); 1.338 ++ if (lavc_param_normalize_aqp) 1.339 ++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+naq", 0); 1.340 + lavc_venc_context->flags |= lavc_param_ilme; 1.341 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.342 + lavc_venc_context->flags |= lavc_param_trell; 1.343 +@@ -1084,9 +1090,7 @@ MOD_init 1.344 + #endif 1.345 + 1.346 + if (lavc_param_gray) 1.347 +- lavc_venc_context->flags |= CODEC_FLAG_GRAY; 1.348 +- if (lavc_param_normalize_aqp) 1.349 +- lavc_venc_context->flags |= CODEC_FLAG_NORMALIZE_AQP; 1.350 ++ lavc_venc_context->flags |= AV_CODEC_FLAG_GRAY; 1.351 + 1.352 + switch(vob->encode_fields) { 1.353 + case TC_ENCODE_FIELDS_TOP_FIRST: 1.354 +@@ -1104,9 +1108,9 @@ MOD_init 1.355 + } 1.356 + 1.357 + lavc_venc_context->flags |= interlacing_active ? 1.358 +- CODEC_FLAG_INTERLACED_DCT : 0; 1.359 ++ AV_CODEC_FLAG_INTERLACED_DCT : 0; 1.360 + lavc_venc_context->flags |= interlacing_active ? 1.361 +- CODEC_FLAG_INTERLACED_ME : 0; 1.362 ++ AV_CODEC_FLAG_INTERLACED_ME : 0; 1.363 + 1.364 + lavc_venc_context->flags |= lavc_param_psnr; 1.365 + do_psnr = lavc_param_psnr; 1.366 +@@ -1153,7 +1157,7 @@ MOD_init 1.367 + "encoding."); 1.368 + return TC_EXPORT_ERROR; 1.369 + } 1.370 +- lavc_venc_context->flags |= CODEC_FLAG_PASS1; 1.371 ++ lavc_venc_context->flags |= AV_CODEC_FLAG_PASS1; 1.372 + stats_file = fopen(vob->divxlogfile, "w"); 1.373 + if (stats_file == NULL){ 1.374 + tc_log_warn(MOD_NAME, "Could not create 2pass log file \"%s\".", 1.375 +@@ -1167,7 +1175,7 @@ MOD_init 1.376 + "encoding."); 1.377 + return TC_EXPORT_ERROR; 1.378 + } 1.379 +- lavc_venc_context->flags |= CODEC_FLAG_PASS2; 1.380 ++ lavc_venc_context->flags |= AV_CODEC_FLAG_PASS2; 1.381 + stats_file= fopen(vob->divxlogfile, "r"); 1.382 + if (stats_file==NULL){ 1.383 + tc_log_warn(MOD_NAME, "Could not open 2pass log file \"%s\" for " 1.384 +@@ -1198,12 +1203,11 @@ MOD_init 1.385 + break; 1.386 + case 3: 1.387 + /* fixed qscale :p */ 1.388 +- lavc_venc_context->flags |= CODEC_FLAG_QSCALE; 1.389 ++ lavc_venc_context->flags |= AV_CODEC_FLAG_QSCALE; 1.390 + lavc_venc_frame->quality = vob->divxbitrate; 1.391 + break; 1.392 + } 1.393 + 1.394 +- lavc_venc_context->me_method = ME_ZERO + lavc_param_vme; 1.395 + 1.396 + /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */ 1.397 + if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) { 1.398 +Index: transcode-1.1.7/export/ffmpeg_cfg.c 1.399 +=================================================================== 1.400 +--- transcode-1.1.7.orig/export/ffmpeg_cfg.c 1.401 ++++ transcode-1.1.7/export/ffmpeg_cfg.c 1.402 +@@ -93,8 +93,8 @@ int lavc_param_last_pred= 0; 1.403 + int lavc_param_pre_me= 1; 1.404 + int lavc_param_me_subpel_quality= 8; 1.405 + int lavc_param_me_range=0; 1.406 +-int lavc_param_ibias=FF_DEFAULT_QUANT_BIAS; 1.407 +-int lavc_param_pbias=FF_DEFAULT_QUANT_BIAS; 1.408 ++int lavc_param_ibias=0; 1.409 ++int lavc_param_pbias=0; 1.410 + int lavc_param_coder=0; 1.411 + int lavc_param_context=0; 1.412 + char *lavc_param_intra_matrix = NULL; 1.413 +@@ -136,7 +136,7 @@ TCConfigEntry lavcopts_conf[]={ 1.414 + {"vratetol", &lavc_param_vrate_tolerance, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000}, 1.415 + {"vhq", &lavc_param_mb_decision, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.416 + {"mbd", &lavc_param_mb_decision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9}, 1.417 +- {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV}, 1.418 ++ {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV}, 1.419 + {"vme", &lavc_param_vme, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 5}, 1.420 + // {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, 1.421 + // {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, 1.422 +@@ -147,7 +147,7 @@ TCConfigEntry lavcopts_conf[]={ 1.423 + {"vqcomp", &lavc_param_vqcompress, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0}, 1.424 + {"vqblur", &lavc_param_vqblur, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0}, 1.425 + {"vb_qfactor", &lavc_param_vb_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0}, 1.426 +- {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES}, 1.427 ++ {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX}, 1.428 + // {"vpass", &lavc_param_vpass, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2}, 1.429 + {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2}, 1.430 + {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, 1.431 +@@ -158,7 +158,7 @@ TCConfigEntry lavcopts_conf[]={ 1.432 + {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, 1.433 + {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.434 + // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0}, 1.435 +- {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY}, 1.436 ++ {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY}, 1.437 + {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.438 + {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0}, 1.439 + {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0}, 1.440 +@@ -184,7 +184,7 @@ TCConfigEntry lavcopts_conf[]={ 1.441 + {"pred", &lavc_param_prediction_method, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20}, 1.442 + {"format", &lavc_param_format, TCCONF_TYPE_STRING, 0, 0, 0}, 1.443 + {"debug", &lavc_param_debug, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000}, 1.444 +- {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR}, 1.445 ++ {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR}, 1.446 + {"precmp", &lavc_param_me_pre_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, 1.447 + {"cmp", &lavc_param_me_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, 1.448 + {"subcmp", &lavc_param_me_sub_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, 1.449 +@@ -192,9 +192,9 @@ TCConfigEntry lavcopts_conf[]={ 1.450 + {"ildctcmp", &lavc_param_ildct_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, 1.451 + {"predia", &lavc_param_pre_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000}, 1.452 + {"dia", &lavc_param_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000}, 1.453 +- {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL}, 1.454 ++ {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL}, 1.455 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.456 +- {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT}, 1.457 ++ {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRELLIS_QUANT}, 1.458 + #else 1.459 + {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.460 + #endif 1.461 +@@ -203,9 +203,9 @@ TCConfigEntry lavcopts_conf[]={ 1.462 + {"subq", &lavc_param_me_subpel_quality, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8}, 1.463 + {"me_range", &lavc_param_me_range, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000}, 1.464 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.465 +- {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC}, 1.466 ++ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_H263P_AIC}, 1.467 + #else 1.468 +- {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED}, 1.469 ++ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED}, 1.470 + #endif 1.471 + {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.472 + {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, 1.473 +@@ -215,20 +215,20 @@ TCConfigEntry lavcopts_conf[]={ 1.474 + {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0}, 1.475 + {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0}, 1.476 + {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.477 +- {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0}, 1.478 ++ {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.479 + {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, 1.480 + {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.481 + {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16}, 1.482 + {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.483 + {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.484 + {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.485 +- {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME}, 1.486 ++ {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME}, 1.487 + {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, 1.488 + {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, 1.489 + {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1}, 1.490 +- {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC}, 1.491 +- {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRUNCATED}, 1.492 +- {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP}, 1.493 ++ {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, 1}, 1.494 ++ {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRUNCATED}, 1.495 ++ {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP}, 1.496 + {"intra_dc_precision", &lavc_param_intra_dc_precision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16}, 1.497 + {"skip_top", &lavc_param_skip_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000}, 1.498 + {"skip_bottom", &lavc_param_skip_bottom, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000}, 1.499 +Index: transcode-1.1.7/import/import_ffmpeg.c 1.500 +=================================================================== 1.501 +--- transcode-1.1.7.orig/import/import_ffmpeg.c 1.502 ++++ transcode-1.1.7/import/import_ffmpeg.c 1.503 +@@ -310,7 +310,7 @@ do_avi: 1.504 + lavc_dec_context->width = x_dim; 1.505 + lavc_dec_context->height = y_dim; 1.506 + 1.507 +- if (vob->decolor) lavc_dec_context->flags |= CODEC_FLAG_GRAY; 1.508 ++ if (vob->decolor) lavc_dec_context->flags |= AV_CODEC_FLAG_GRAY; 1.509 + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) 1.510 + lavc_dec_context->error_resilience = 2; 1.511 + #else