wok view transcode/stuff/ffmpeg4.u @ rev 23692
updated tcplay (2.0 -> 3.3)
author | Hans-G?nter Theisgen |
---|---|
date | Mon Apr 27 06:44:33 2020 +0100 (2020-04-27) |
parents | |
children |
line source
1 Index: transcode-1.1.7/encode/encode_lavc.c
2 ===================================================================
3 --- transcode-1.1.7.orig/encode/encode_lavc.c
4 +++ transcode-1.1.7/encode/encode_lavc.c
5 @@ -77,6 +77,13 @@ struct tclavcconfigdata_ {
6 int luma_elim_threshold;
7 int chroma_elim_threshold;
8 int quantizer_noise_shaping;
9 + int inter_quant_bias;
10 + int intra_quant_bias;
11 + int scenechange_factor;
12 + int rc_strategy;
13 + float rc_initial_cplx;
14 + float rc_qsquish;
15 + float border_masking;
17 /* same as above for flags */
18 struct {
19 @@ -684,7 +691,7 @@ static int tc_lavc_init_multipass(TCLavc
20 switch (vob->divxmultipass) {
21 case 1:
22 CAN_DO_MULTIPASS(multipass_flag);
23 - pd->ff_vcontext.flags |= CODEC_FLAG_PASS1;
24 + pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS1;
25 pd->stats_file = fopen(vob->divxlogfile, "w");
26 if (pd->stats_file == NULL) {
27 tc_log_error(MOD_NAME, "could not create 2pass log file"
28 @@ -694,7 +701,7 @@ static int tc_lavc_init_multipass(TCLavc
29 break;
30 case 2:
31 CAN_DO_MULTIPASS(multipass_flag);
32 - pd->ff_vcontext.flags |= CODEC_FLAG_PASS2;
33 + pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS2;
34 pd->stats_file = fopen(vob->divxlogfile, "r");
35 if (pd->stats_file == NULL){
36 tc_log_error(MOD_NAME, "could not open 2pass log file \"%s\""
37 @@ -723,7 +730,7 @@ static int tc_lavc_init_multipass(TCLavc
38 break;
39 case 3:
40 /* fixed qscale :p */
41 - pd->ff_vcontext.flags |= CODEC_FLAG_QSCALE;
42 + pd->ff_vcontext.flags |= AV_CODEC_FLAG_QSCALE;
43 pd->ff_venc_frame.quality = vob->divxbitrate;
44 break;
45 }
46 @@ -970,7 +977,7 @@ static void tc_lavc_config_defaults(TCLa
47 pd->confdata.rc_buffer_size = 0;
48 pd->confdata.lmin = 2;
49 pd->confdata.lmax = 31;
50 - pd->confdata.me_method = ME_EPZS;
51 + pd->confdata.me_method = 0;
53 memset(&pd->confdata.flags, 0, sizeof(pd->confdata.flags));
54 pd->confdata.turbo_setup = 0;
55 @@ -983,12 +990,12 @@ static void tc_lavc_config_defaults(TCLa
56 pd->ff_vcontext.me_range = 0;
57 pd->ff_vcontext.mb_decision = 0;
58 pd->ff_vcontext.scenechange_threshold = 0;
59 - pd->ff_vcontext.scenechange_factor = 1;
60 + pd->confdata.scenechange_factor = 1;
61 pd->ff_vcontext.b_frame_strategy = 0;
62 pd->ff_vcontext.b_sensitivity = 40;
63 pd->ff_vcontext.brd_scale = 0;
64 pd->ff_vcontext.bidir_refine = 0;
65 - pd->ff_vcontext.rc_strategy = 2;
66 + pd->confdata.rc_strategy = 2;
67 pd->ff_vcontext.b_quant_factor = 1.25;
68 pd->ff_vcontext.i_quant_factor = 0.8;
69 pd->ff_vcontext.b_quant_offset = 1.25;
70 @@ -996,8 +1003,8 @@ static void tc_lavc_config_defaults(TCLa
71 pd->ff_vcontext.qblur = 0.5;
72 pd->ff_vcontext.qcompress = 0.5;
73 pd->ff_vcontext.mpeg_quant = 0;
74 - pd->ff_vcontext.rc_initial_cplx = 0.0;
75 - pd->ff_vcontext.rc_qsquish = 1.0;
76 + pd->confdata.rc_initial_cplx = 0.0;
77 + pd->confdata.rc_qsquish = 1.0;
78 pd->confdata.luma_elim_threshold = 0;
79 pd->confdata.chroma_elim_threshold = 0;
80 pd->ff_vcontext.strict_std_compliance = 0;
81 @@ -1008,7 +1015,7 @@ static void tc_lavc_config_defaults(TCLa
82 pd->ff_vcontext.temporal_cplx_masking = 0.0;
83 pd->ff_vcontext.spatial_cplx_masking = 0.0;
84 pd->ff_vcontext.p_masking = 0.0;
85 - pd->ff_vcontext.border_masking = 0.0;
86 + pd->confdata.border_masking = 0.0;
87 pd->ff_vcontext.me_pre_cmp = 0;
88 pd->ff_vcontext.me_cmp = 0;
89 pd->ff_vcontext.me_sub_cmp = 0;
90 @@ -1020,8 +1027,6 @@ static void tc_lavc_config_defaults(TCLa
91 pd->ff_vcontext.pre_me = 1;
92 pd->ff_vcontext.me_subpel_quality = 8;
93 pd->ff_vcontext.refs = 1;
94 - pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS;
95 - pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS;
96 pd->ff_vcontext.noise_reduction = 0;
97 pd->confdata.quantizer_noise_shaping = 0;
98 pd->ff_vcontext.flags = 0;
99 @@ -1044,19 +1049,19 @@ static void tc_lavc_config_defaults(TCLa
100 */
101 static void tc_lavc_dispatch_settings(TCLavcPrivateData *pd)
102 {
103 + char buf[1024];
104 /* some translation... */
105 pd->ff_vcontext.bit_rate_tolerance = pd->confdata.vrate_tolerance * 1000;
106 pd->ff_vcontext.rc_min_rate = pd->confdata.rc_min_rate * 1000;
107 pd->ff_vcontext.rc_max_rate = pd->confdata.rc_max_rate * 1000;
108 pd->ff_vcontext.rc_buffer_size = pd->confdata.rc_buffer_size * 1024;
109 - pd->ff_vcontext.lmin = (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5);
110 - pd->ff_vcontext.lmax = (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5);
111 - pd->ff_vcontext.me_method = ME_ZERO + pd->confdata.me_method;
112 + snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5));
113 + av_dict_set(&(pd->ff_opts), "lmin", buf, 0);
114 + snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5));
115 + av_dict_set(&(pd->ff_opts), "lmax", buf, 0);
117 pd->ff_vcontext.flags = 0;
118 - SET_FLAG(pd, mv0);
119 SET_FLAG(pd, qpel);
120 - SET_FLAG(pd, naq);
121 SET_FLAG(pd, ilme);
122 SET_FLAG(pd, ildct);
123 SET_FLAG(pd, aic);
124 @@ -1077,8 +1082,8 @@ static void tc_lavc_dispatch_settings(TC
125 }
126 if (pd->interlacing.active) {
127 /* enforce interlacing */
128 - pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT;
129 - pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME;
130 + pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_DCT;
131 + pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_ME;
132 }
133 if (pd->confdata.flags.alt) {
134 av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0);
135 @@ -1095,15 +1100,31 @@ static void tc_lavc_dispatch_settings(TC
136 if (pd->confdata.flags.cbp) {
137 av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0);
138 }
139 + if (pd->confdata.flags.mv0) {
140 + av_dict_set(&(pd->ff_opts), "mpv_flags", "+mv0", 0);
141 + }
142 + if (pd->confdata.flags.naq) {
143 + av_dict_set(&(pd->ff_opts), "mpv_flags", "+naq", 0);
144 + }
146 - char buf[1024];
147 #define set_dict_opt(val, opt) \
148 snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\
149 av_dict_set(&(pd->ff_opts), opt, buf, 0)
150 +#define set_dict_float_opt(val, opt) \
151 + snprintf(buf, sizeof(buf), "%f", pd->confdata.val);\
152 + av_dict_set(&(pd->ff_opts), opt, buf, 0)
154 set_dict_opt(luma_elim_threshold, "luma_elim_threshold");
155 set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold");
156 set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping");
157 + set_dict_opt(inter_quant_bias, "pbias");
158 + set_dict_opt(intra_quant_bias, "ibias");
159 + set_dict_opt(me_method, "me_method");
160 + set_dict_opt(scenechange_factor, "sc_factor");
161 + set_dict_opt(rc_strategy, "rc_strategy");
162 + set_dict_float_opt(rc_initial_cplx, "rc_init_cplx");
163 + set_dict_float_opt(rc_qsquish, "qsquish");
164 + set_dict_float_opt(border_masking, "border_mask");
165 }
167 #undef SET_FLAG
168 @@ -1159,12 +1180,12 @@ static int tc_lavc_read_config(TCLavcPri
169 { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
170 { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
171 { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 },
172 - { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES },
173 + { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX },
174 { "vme", PAUX(me_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16, },
175 { "me_range", PCTX(me_range), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000 },
176 { "mbd", PCTX(mb_decision), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
177 { "sc_threshold", PCTX(scenechange_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000 },
178 - { "sc_factor", PCTX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 },
179 + { "sc_factor", PAUX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 },
180 { "vb_strategy", PCTX(b_frame_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
181 { "b_sensitivity", PCTX(b_sensitivity), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 100 },
182 { "brd_scale", PCTX(brd_scale), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 },
183 @@ -1175,7 +1196,7 @@ static int tc_lavc_read_config(TCLavcPri
184 { "vrc_maxrate", PAUX(rc_max_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 },
185 { "vrc_minrate", PAUX(rc_min_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 },
186 { "vrc_buf_size", PAUX(rc_buffer_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000 },
187 - { "vrc_strategy", PCTX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 },
188 + { "vrc_strategy", PAUX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 },
189 { "vb_qfactor", PCTX(b_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 },
190 { "vi_qfactor", PCTX(i_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 },
191 { "vb_qoffset", PCTX(b_quant_offset), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0 },
192 @@ -1185,9 +1206,9 @@ static int tc_lavc_read_config(TCLavcPri
193 { "mpeg_quant", PCTX(mpeg_quant), TCCONF_TYPE_FLAG, 0, 0, 1 },
194 // { "vrc_eq", }, // not yet supported
195 { "vrc_override", rc_override_buf, TCCONF_TYPE_STRING, 0, 0, 0 },
196 - { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
197 + { "vrc_init_cplx", PAUX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 },
198 // { "vrc_init_occupancy", }, // not yet supported
199 - { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
200 + { "vqsquish", PAUX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 },
201 { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
202 { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
203 { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 },
204 @@ -1199,7 +1220,7 @@ static int tc_lavc_read_config(TCLavcPri
205 { "tcplx_mask", PCTX(temporal_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
206 { "scplx_mask", PCTX(spatial_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
207 { "p_mask", PCTX(p_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
208 - { "border_mask", PCTX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
209 + { "border_mask", PAUX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 },
210 { "pred", PCTX(prediction_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 4 },
211 { "precmp", PCTX(me_pre_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 },
212 { "cmp", PCTX(me_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 },
213 @@ -1212,37 +1233,37 @@ static int tc_lavc_read_config(TCLavcPri
214 { "pre_me", PCTX(pre_me), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
215 { "subq", PCTX(me_subpel_quality), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8 },
216 { "refs", PCTX(refs), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 8 },
217 - { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
218 - { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
219 + { "ibias", PAUX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
220 + { "pbias", PAUX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 },
221 { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
222 { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 },
223 { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
224 { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 },
226 - { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 },
227 + { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, 1 },
228 { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 },
229 - { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL },
230 + { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL },
231 { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 },
232 - { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME },
233 - { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT },
234 - { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP },
235 + { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME },
236 + { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_DCT },
237 + { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, 1 },
238 { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 },
239 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
240 { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC },
241 #else
242 - { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED },
243 + { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED },
244 #endif
245 { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 },
246 { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 },
247 - { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR },
248 + { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR },
249 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
250 { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT },
251 #else
252 { "trell", PCTX(trellis), TCCONF_TYPE_FLAG, 0, 0, 1 },
253 #endif
254 - { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY },
255 - { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV },
256 - { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP },
257 + { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY },
258 + { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV },
259 + { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP },
261 // { "turbo", PAUX(turbo_setup), TCCONF_TYPE_FLAG, 0, 0, 1 }, // not yet supported
262 /* End of the config file */
263 Index: transcode-1.1.7/export/export_ffmpeg.c
264 ===================================================================
265 --- transcode-1.1.7.orig/export/export_ffmpeg.c
266 +++ transcode-1.1.7/export/export_ffmpeg.c
267 @@ -828,14 +828,11 @@ MOD_init
269 lavc_venc_context->bit_rate = vob->divxbitrate * 1000;
270 lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
271 - lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
272 - lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
273 lavc_venc_context->max_qdiff = lavc_param_vqdiff;
274 lavc_venc_context->qcompress = lavc_param_vqcompress;
275 lavc_venc_context->qblur = lavc_param_vqblur;
276 lavc_venc_context->max_b_frames = lavc_param_vmax_b_frames;
277 lavc_venc_context->b_quant_factor = lavc_param_vb_qfactor;
278 - lavc_venc_context->rc_strategy = lavc_param_vrc_strategy;
279 lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy;
280 lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset;
282 @@ -843,8 +840,23 @@ MOD_init
283 #define set_dict_opt(val, opt) \
284 snprintf(buf, sizeof(buf), "%i", val); \
285 av_dict_set(&lavc_venc_opts, opt, buf, 0)
286 +#define set_dict_float_opt(val, opt) \
287 + snprintf(buf, sizeof(buf), "%f", val); \
288 + av_dict_set(&lavc_venc_opts, opt, buf, 0)
289 set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold");
290 set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold");
291 + set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5), "lmin");
292 + set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5), "lmax");
293 + set_dict_opt(lavc_param_vrc_strategy, "rc_strategy");
294 + set_dict_float_opt(lavc_param_rc_qsquish, "qsquish");
295 + set_dict_float_opt(lavc_param_rc_qmod_amp, "rc_qmod_amp");
296 + set_dict_opt(lavc_param_rc_qmod_freq, "rc_qmod_freq");
297 + set_dict_opt(lavc_param_rc_eq, "rc_eq");
298 + set_dict_opt(lavc_param_vme, "me_method");
299 + set_dict_opt(lavc_param_ibias, "ibias");
300 + set_dict_opt(lavc_param_pbias, "pbias");
301 + set_dict_float_opt(lavc_param_rc_buffer_aggressivity, "rc_buf_aggressivity");
302 + set_dict_float_opt(lavc_param_rc_initial_cplx, "rc_init_cplx");
303 lavc_venc_context->rtp_payload_size = lavc_param_packet_size;
304 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
305 if (lavc_param_packet_size)
306 @@ -853,15 +865,9 @@ MOD_init
307 lavc_venc_context->strict_std_compliance= lavc_param_strict;
308 lavc_venc_context->i_quant_factor = lavc_param_vi_qfactor;
309 lavc_venc_context->i_quant_offset = lavc_param_vi_qoffset;
310 - lavc_venc_context->rc_qsquish = lavc_param_rc_qsquish;
311 - lavc_venc_context->rc_qmod_amp = lavc_param_rc_qmod_amp;
312 - lavc_venc_context->rc_qmod_freq = lavc_param_rc_qmod_freq;
313 - lavc_venc_context->rc_eq = lavc_param_rc_eq;
314 lavc_venc_context->rc_max_rate = lavc_param_rc_max_rate * 1000;
315 lavc_venc_context->rc_min_rate = lavc_param_rc_min_rate * 1000;
316 lavc_venc_context->rc_buffer_size = lavc_param_rc_buffer_size * 1024;
317 - lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity;
318 - lavc_venc_context->rc_initial_cplx = lavc_param_rc_initial_cplx;
319 lavc_venc_context->debug = lavc_param_debug;
320 lavc_venc_context->last_predictor_count= lavc_param_last_pred;
321 lavc_venc_context->pre_me = lavc_param_pre_me;
322 @@ -869,8 +875,6 @@ MOD_init
323 lavc_venc_context->pre_dia_size = lavc_param_pre_dia_size;
324 lavc_venc_context->me_subpel_quality = lavc_param_me_subpel_quality;
325 lavc_venc_context->me_range = lavc_param_me_range;
326 - lavc_venc_context->intra_quant_bias = lavc_param_ibias;
327 - lavc_venc_context->inter_quant_bias = lavc_param_pbias;
328 lavc_venc_context->coder_type = lavc_param_coder;
329 lavc_venc_context->context_model = lavc_param_context;
330 lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
331 @@ -1076,6 +1080,8 @@ MOD_init
332 lavc_venc_context->flags |= lavc_param_mv0;
333 if(lavc_param_qp_rd)
334 av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0);
335 + if (lavc_param_normalize_aqp)
336 + av_dict_set(&lavc_venc_opts, "mpv_flags", "+naq", 0);
337 lavc_venc_context->flags |= lavc_param_ilme;
338 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
339 lavc_venc_context->flags |= lavc_param_trell;
340 @@ -1084,9 +1090,7 @@ MOD_init
341 #endif
343 if (lavc_param_gray)
344 - lavc_venc_context->flags |= CODEC_FLAG_GRAY;
345 - if (lavc_param_normalize_aqp)
346 - lavc_venc_context->flags |= CODEC_FLAG_NORMALIZE_AQP;
347 + lavc_venc_context->flags |= AV_CODEC_FLAG_GRAY;
349 switch(vob->encode_fields) {
350 case TC_ENCODE_FIELDS_TOP_FIRST:
351 @@ -1104,9 +1108,9 @@ MOD_init
352 }
354 lavc_venc_context->flags |= interlacing_active ?
355 - CODEC_FLAG_INTERLACED_DCT : 0;
356 + AV_CODEC_FLAG_INTERLACED_DCT : 0;
357 lavc_venc_context->flags |= interlacing_active ?
358 - CODEC_FLAG_INTERLACED_ME : 0;
359 + AV_CODEC_FLAG_INTERLACED_ME : 0;
361 lavc_venc_context->flags |= lavc_param_psnr;
362 do_psnr = lavc_param_psnr;
363 @@ -1153,7 +1157,7 @@ MOD_init
364 "encoding.");
365 return TC_EXPORT_ERROR;
366 }
367 - lavc_venc_context->flags |= CODEC_FLAG_PASS1;
368 + lavc_venc_context->flags |= AV_CODEC_FLAG_PASS1;
369 stats_file = fopen(vob->divxlogfile, "w");
370 if (stats_file == NULL){
371 tc_log_warn(MOD_NAME, "Could not create 2pass log file \"%s\".",
372 @@ -1167,7 +1175,7 @@ MOD_init
373 "encoding.");
374 return TC_EXPORT_ERROR;
375 }
376 - lavc_venc_context->flags |= CODEC_FLAG_PASS2;
377 + lavc_venc_context->flags |= AV_CODEC_FLAG_PASS2;
378 stats_file= fopen(vob->divxlogfile, "r");
379 if (stats_file==NULL){
380 tc_log_warn(MOD_NAME, "Could not open 2pass log file \"%s\" for "
381 @@ -1198,12 +1203,11 @@ MOD_init
382 break;
383 case 3:
384 /* fixed qscale :p */
385 - lavc_venc_context->flags |= CODEC_FLAG_QSCALE;
386 + lavc_venc_context->flags |= AV_CODEC_FLAG_QSCALE;
387 lavc_venc_frame->quality = vob->divxbitrate;
388 break;
389 }
391 - lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
393 /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
394 if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) {
395 Index: transcode-1.1.7/export/ffmpeg_cfg.c
396 ===================================================================
397 --- transcode-1.1.7.orig/export/ffmpeg_cfg.c
398 +++ transcode-1.1.7/export/ffmpeg_cfg.c
399 @@ -93,8 +93,8 @@ int lavc_param_last_pred= 0;
400 int lavc_param_pre_me= 1;
401 int lavc_param_me_subpel_quality= 8;
402 int lavc_param_me_range=0;
403 -int lavc_param_ibias=FF_DEFAULT_QUANT_BIAS;
404 -int lavc_param_pbias=FF_DEFAULT_QUANT_BIAS;
405 +int lavc_param_ibias=0;
406 +int lavc_param_pbias=0;
407 int lavc_param_coder=0;
408 int lavc_param_context=0;
409 char *lavc_param_intra_matrix = NULL;
410 @@ -136,7 +136,7 @@ TCConfigEntry lavcopts_conf[]={
411 {"vratetol", &lavc_param_vrate_tolerance, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000},
412 {"vhq", &lavc_param_mb_decision, TCCONF_TYPE_FLAG, 0, 0, 1},
413 {"mbd", &lavc_param_mb_decision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9},
414 - {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV},
415 + {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV},
416 {"vme", &lavc_param_vme, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 5},
417 // {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
418 // {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
419 @@ -147,7 +147,7 @@ TCConfigEntry lavcopts_conf[]={
420 {"vqcomp", &lavc_param_vqcompress, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
421 {"vqblur", &lavc_param_vqblur, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
422 {"vb_qfactor", &lavc_param_vb_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
423 - {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES},
424 + {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX},
425 // {"vpass", &lavc_param_vpass, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
426 {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
427 {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
428 @@ -158,7 +158,7 @@ TCConfigEntry lavcopts_conf[]={
429 {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
430 {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1},
431 // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
432 - {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY},
433 + {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY},
434 {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1},
435 {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
436 {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
437 @@ -184,7 +184,7 @@ TCConfigEntry lavcopts_conf[]={
438 {"pred", &lavc_param_prediction_method, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20},
439 {"format", &lavc_param_format, TCCONF_TYPE_STRING, 0, 0, 0},
440 {"debug", &lavc_param_debug, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
441 - {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR},
442 + {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR},
443 {"precmp", &lavc_param_me_pre_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
444 {"cmp", &lavc_param_me_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
445 {"subcmp", &lavc_param_me_sub_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
446 @@ -192,9 +192,9 @@ TCConfigEntry lavcopts_conf[]={
447 {"ildctcmp", &lavc_param_ildct_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
448 {"predia", &lavc_param_pre_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000},
449 {"dia", &lavc_param_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000},
450 - {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL},
451 + {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL},
452 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
453 - {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT},
454 + {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRELLIS_QUANT},
455 #else
456 {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, 1},
457 #endif
458 @@ -203,9 +203,9 @@ TCConfigEntry lavcopts_conf[]={
459 {"subq", &lavc_param_me_subpel_quality, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8},
460 {"me_range", &lavc_param_me_range, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000},
461 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
462 - {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC},
463 + {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_H263P_AIC},
464 #else
465 - {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED},
466 + {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED},
467 #endif
468 {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1},
469 {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
470 @@ -215,20 +215,20 @@ TCConfigEntry lavcopts_conf[]={
471 {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
472 {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
473 {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1},
474 - {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
475 + {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, 1},
476 {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
477 {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1},
478 {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
479 {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1},
480 {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1},
481 {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1},
482 - {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
483 + {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME},
484 {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
485 {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
486 {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1},
487 - {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC},
488 - {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRUNCATED},
489 - {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP},
490 + {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, 1},
491 + {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRUNCATED},
492 + {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP},
493 {"intra_dc_precision", &lavc_param_intra_dc_precision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16},
494 {"skip_top", &lavc_param_skip_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
495 {"skip_bottom", &lavc_param_skip_bottom, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
496 Index: transcode-1.1.7/import/import_ffmpeg.c
497 ===================================================================
498 --- transcode-1.1.7.orig/import/import_ffmpeg.c
499 +++ transcode-1.1.7/import/import_ffmpeg.c
500 @@ -310,7 +310,7 @@ do_avi:
501 lavc_dec_context->width = x_dim;
502 lavc_dec_context->height = y_dim;
504 - if (vob->decolor) lavc_dec_context->flags |= CODEC_FLAG_GRAY;
505 + if (vob->decolor) lavc_dec_context->flags |= AV_CODEC_FLAG_GRAY;
506 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
507 lavc_dec_context->error_resilience = 2;
508 #else