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