summaryrefslogtreecommitdiff
path: root/src/libffmpeg/diff_to_ffmpeg_cvs.txt
blob: ebaaf82256e5e18085f5e86e7ae25d9d6ec16ed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
--- /home/melanson/projects/ffmpeg/libavcodec/avcodec.h	2006-08-01 20:03:33.000000000 -0700
+++ libavcodec/avcodec.h	2006-08-01 20:55:16.000000000 -0700
@@ -27,6 +27,13 @@
 #define AV_TIME_BASE            1000000
 #define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
 
+/* FIXME: We cannot use ffmpeg's XvMC capabilities, since that would require
+ * linking the ffmpeg plugin against XvMC libraries, which is a bad thing,
+ * since they are output dependend.
+ * The correct fix would be to reimplement the XvMC functions libavcodec uses
+ * and do the necessary talking with our XvMC output plugin there. */
+#undef HAVE_XVMC
+
 enum CodecID {
     CODEC_ID_NONE,
     CODEC_ID_MPEG1VIDEO,
@@ -2629,6 +2636,13 @@
 
 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
 
+/* unused static macro */
+#if defined(__GNUC__) && !defined(DEBUG)
+/* since we do not compile the encoder part of ffmpeg, some static
+ * functions will be unused; this is ok, the compiler will take care */
+#  define static static __attribute__((__unused__))
+#endif
+
 #ifdef __cplusplus
 }
 #endif

--- /home/melanson/projects/ffmpeg/libavcodec/dsputil.h	2006-08-01 20:03:33.000000000 -0700
+++ libavcodec/dsputil.h	2006-08-01 20:55:16.000000000 -0700
@@ -31,6 +31,9 @@
 #include "common.h"
 #include "avcodec.h"
 
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#define HAVE_MMX 1
+#endif
 
 //#define DEBUG
 /* dct code */

--- /home/melanson/projects/ffmpeg/libavcodec/motion_est.c	2006-07-02 20:16:54.000000000 -0700
+++ libavcodec/motion_est.c	2006-08-01 21:18:45.000000000 -0700
@@ -21,6 +21,9 @@
  * new Motion Estimation (X1/EPZS) by Michael Niedermayer <michaelni@gmx.at>
  */
 
+/* motion estimation only needed for encoders */
+#ifdef CONFIG_ENCODERS
+
 /**
  * @file motion_est.c
  * Motion estimation.
@@ -2113,3 +2116,5 @@
         }
     }
 }
+
+#endif /* CONFIG_ENCODERS */

--- /home/melanson/projects/ffmpeg/libavcodec/mpeg12.c	2006-07-02 20:16:54.000000000 -0700
+++ libavcodec/mpeg12.c	2006-08-01 21:18:45.000000000 -0700
@@ -34,6 +34,13 @@
 //#include <assert.h>
 
 
+/* if xine's MPEG encoder is enabled, enable the encoding features in
+ * this particular module */
+#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
+#define CONFIG_ENCODERS
+#endif
+
+
 /* Start codes. */
 #define SEQ_END_CODE            0x000001b7
 #define SEQ_START_CODE          0x000001b3

--- /home/melanson/projects/ffmpeg/libavcodec/mpegvideo.c	2006-08-01 20:03:33.000000000 -0700
+++ libavcodec/mpegvideo.c	2006-08-01 21:18:45.000000000 -0700
@@ -38,6 +38,14 @@
 //#undef NDEBUG
 //#include <assert.h>
 
+
+/* if xine's MPEG encoder is enabled, enable the encoding features in
+ * this particular module */
+#if defined(XINE_MPEG_ENCODER) && !defined(CONFIG_ENCODERS)
+#define CONFIG_ENCODERS
+#endif
+
+
 #ifdef CONFIG_ENCODERS
 static void encode_picture(MpegEncContext *s, int picture_number);
 #endif //CONFIG_ENCODERS
@@ -1165,6 +1173,8 @@
         s->low_delay= 0; //s->max_b_frames ? 0 : 1;
         avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1);
         break;
+/* xine: this is never used in either decode or MPEG-1 encode mode */
+#if 0
     case CODEC_ID_MPEG2VIDEO:
         s->out_format = FMT_MPEG1;
         s->low_delay= 0; //s->max_b_frames ? 0 : 1;
@@ -1300,6 +1310,7 @@
         avctx->delay=0;
         s->low_delay=1;
         break;
+#endif /* #if 0 */
     default:
         return -1;
     }
@@ -1321,6 +1332,8 @@
     ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp);
     ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp);
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
 #ifdef CONFIG_H261_ENCODER
     if (s->out_format == FMT_H261)
         ff_h261_encode_init(s);
@@ -1329,6 +1342,8 @@
         h263_encode_init(s);
     if(s->msmpeg4_version)
         ff_msmpeg4_encode_init(s);
+#endif /* #if 0 */
+/* xine: we DO want this for MPEG-1 encoding */
     if (s->out_format == FMT_MPEG1)
         ff_mpeg1_encode_init(s);
 
@@ -1373,9 +1388,12 @@
 
     ff_rate_control_uninit(s);
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     MPV_common_end(s);
     if (s->out_format == FMT_MJPEG)
         mjpeg_close(s);
+#endif /* #if 0 */
 
     av_freep(&avctx->extradata);
 
@@ -2516,8 +2534,11 @@
 
         MPV_frame_end(s);
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
         if (s->out_format == FMT_MJPEG)
             mjpeg_picture_trailer(s);
+#endif /* #if 0 */
 
         if(s->flags&CODEC_FLAG_PASS1)
             ff_write_pass1_stats(s);
@@ -4516,6 +4537,8 @@
     case CODEC_ID_MPEG1VIDEO:
     case CODEC_ID_MPEG2VIDEO:
         mpeg1_encode_mb(s, s->block, motion_x, motion_y); break;
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     case CODEC_ID_MPEG4:
         mpeg4_encode_mb(s, s->block, motion_x, motion_y); break;
     case CODEC_ID_MSMPEG4V2:
@@ -4536,6 +4559,7 @@
         h263_encode_mb(s, s->block, motion_x, motion_y); break;
     case CODEC_ID_MJPEG:
         mjpeg_encode_mb(s, s->block); break;
+#endif /* #if 0 */
     default:
         assert(0);
     }
@@ -4757,6 +4781,8 @@
                +sse(s, s->new_picture.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], w>>1, h>>1, s->uvlinesize);
 }
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
 static int pre_estimate_motion_thread(AVCodecContext *c, void *arg){
     MpegEncContext *s= arg;
 
@@ -4800,6 +4826,7 @@
     }
     return 0;
 }
+#endif /* #if 0 */
 
 static int mb_var_thread(AVCodecContext *c, void *arg){
     MpegEncContext *s= arg;
@@ -4824,6 +4851,8 @@
 }
 
 static void write_slice_end(MpegEncContext *s){
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     if(s->codec_id==CODEC_ID_MPEG4){
         if(s->partitioned_frame){
             ff_mpeg4_merge_partitions(s);
@@ -4833,6 +4862,7 @@
     }else if(s->out_format == FMT_MJPEG){
         ff_mjpeg_stuffing(&s->pb);
     }
+#endif /* #if 0 */
 
     align_put_bits(&s->pb);
     flush_put_bits(&s->pb);
@@ -4886,10 +4916,13 @@
     case CODEC_ID_FLV1:
         s->gob_index = ff_h263_get_gob_height(s);
         break;
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     case CODEC_ID_MPEG4:
         if(s->partitioned_frame)
             ff_mpeg4_init_partitions(s);
         break;
+#endif /* #if 0 */
     }
 
     s->resync_mb_x=0;
@@ -4962,9 +4995,12 @@
                     if(s->start_mb_y != mb_y || mb_x!=0){
                         write_slice_end(s);
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
                         if(s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame){
                             ff_mpeg4_init_partitions(s);
                         }
+#endif /* #if 0 */
                     }
 
                     assert((put_bits_count(&s->pb)&7) == 0);
@@ -4988,19 +5024,25 @@
                     }
 
                     switch(s->codec_id){
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
                     case CODEC_ID_MPEG4:
                         ff_mpeg4_encode_video_packet_header(s);
                         ff_mpeg4_clean_buffers(s);
                     break;
+#endif /* #if 0 */
                     case CODEC_ID_MPEG1VIDEO:
                     case CODEC_ID_MPEG2VIDEO:
                         ff_mpeg1_encode_slice_header(s);
                         ff_mpeg1_clean_buffers(s);
                     break;
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
                     case CODEC_ID_H263:
                     case CODEC_ID_H263P:
                         h263_encode_gob_header(s, mb_y);
                     break;
+#endif /* #if 0 */
                     }
 
                     if(s->flags&CODEC_FLAG_PASS1){
@@ -5113,7 +5155,10 @@
 
                     s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
                     s->mb_intra= 0;
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
                     ff_mpeg4_set_direct_mv(s, mx, my);
+#endif /* #if 0 */
                     encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
                                  &dmin, &next_block, mx, my);
                 }
@@ -5299,7 +5344,10 @@
                     s->mb_intra= 0;
                     motion_x=s->b_direct_mv_table[xy][0];
                     motion_y=s->b_direct_mv_table[xy][1];
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
                     ff_mpeg4_set_direct_mv(s, motion_x, motion_y);
+#endif /* #if 0 */
                     break;
                 case CANDIDATE_MB_TYPE_BIDIR:
                     s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD;
@@ -5407,8 +5455,11 @@
     }
 
     //not beautiful here but we must write it before flushing so it has to be here
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == I_TYPE)
         msmpeg4_encode_ext_header(s);
+#endif /* #if 0 */
 
     write_slice_end(s);
 
@@ -5469,6 +5520,8 @@
         s->current_picture.quality = ff_rate_estimate_qscale(s, dry_run);
 
     if(s->adaptive_quant){
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
         switch(s->codec_id){
         case CODEC_ID_MPEG4:
             ff_clean_mpeg4_qscales(s);
@@ -5479,6 +5532,7 @@
             ff_clean_h263_qscales(s);
             break;
         }
+#endif /* #if 0 */
 
         s->lambda= s->lambda_table[0];
         //FIXME broken
@@ -5499,10 +5553,13 @@
     s->me.mb_var_sum_temp    =
     s->me.mc_mb_var_sum_temp = 0;
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     /* we need to initialize some time vars before we can encode b-frames */
     // RAL: Condition added for MPEG1VIDEO
     if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4))
         ff_set_mpeg4_time(s, s->picture_number);  //FIXME rename and use has_b_frames or similar
+#endif /* #if 0 */
 
     s->me.scene_change_score=0;
 
@@ -5532,6 +5589,8 @@
         ff_update_duplicate_context(s->thread_context[i], s);
     }
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     ff_init_me(s);
 
     /* Estimate motion for every MB */
@@ -5546,6 +5605,8 @@
 
         s->avctx->execute(s->avctx, estimate_motion_thread, (void**)&(s->thread_context[0]), NULL, s->avctx->thread_count);
     }else /* if(s->pict_type == I_TYPE) */{
+#endif /* #if 0 */
+    {
         /* I-Frame */
         for(i=0; i<s->mb_stride*s->mb_height; i++)
             s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
@@ -5569,6 +5630,8 @@
 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
     }
 
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     if(!s->umvplus){
         if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) {
             s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
@@ -5622,6 +5685,7 @@
             }
         }
     }
+#endif /* #if 0 */
 
     estimate_qp(s, 0);
 
@@ -5652,6 +5716,8 @@
 
     s->last_bits= put_bits_count(&s->pb);
     switch(s->out_format) {
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     case FMT_MJPEG:
         mjpeg_picture_header(s);
         break;
@@ -5680,11 +5746,15 @@
         else
             h263_encode_picture_header(s, picture_number);
         break;
+#endif /* #if 0 */
     case FMT_MPEG1:
         mpeg1_encode_picture_header(s, picture_number);
         break;
+/* xine: do not need this for decode or MPEG-1 encoding modes */
+#if 0
     case FMT_H264:
         break;
+#endif /* #if 0 */
     default:
         assert(0);
     }

--- /home/melanson/projects/ffmpeg/libavcodec/snow.c	2006-07-02 20:16:54.000000000 -0700
+++ libavcodec/snow.c	2006-08-01 21:18:45.000000000 -0700
@@ -1975,6 +1975,7 @@
 #define P_MV1 P[9]
 #define FLAG_QPEL   1 //must be 1
 
+#ifdef CONFIG_ENCODERS
 static int encode_q_branch(SnowContext *s, int level, int x, int y){
     uint8_t p_buffer[1024];
     uint8_t i_buffer[1024];
@@ -2203,6 +2204,7 @@
         return score;
     }
 }
+#endif
 
 static always_inline int same_block(BlockNode *a, BlockNode *b){
     if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){
@@ -2317,6 +2319,7 @@
     }
 }
 
+#ifdef CONFIG_ENCODERS
 static void encode_blocks(SnowContext *s){
     int x, y;
     int w= s->b_width;
@@ -2338,6 +2341,7 @@
         }
     }
 }
+#endif
 
 static void decode_blocks(SnowContext *s){
     int x, y;
@@ -4030,6 +4034,7 @@
     }
 }
 
+#ifdef CONFIG_ENCODERS
 static int encode_init(AVCodecContext *avctx)
 {
     SnowContext *s = avctx->priv_data;
@@ -4117,6 +4122,7 @@
 
     return 0;
 }
+#endif
 
 static int frame_start(SnowContext *s){
    AVFrame tmp;
@@ -4155,6 +4161,7 @@
     return 0;
 }
 
+#ifdef CONFIG_ENCODERS
 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
     SnowContext *s = avctx->priv_data;
     RangeCoder * const c= &s->c;
@@ -4382,6 +4389,7 @@
 
     return ff_rac_terminate(c);
 }
+#endif
 
 static void common_end(SnowContext *s){
     int plane_index, level, orientation, i;
@@ -4413,6 +4421,7 @@
     }
 }
 
+#ifdef CONFIG_ENCODERS
 static int encode_end(AVCodecContext *avctx)
 {
     SnowContext *s = avctx->priv_data;
@@ -4422,6 +4431,7 @@
 
     return 0;
 }
+#endif
 
 static int decode_init(AVCodecContext *avctx)
 {

--- /home/melanson/projects/ffmpeg/libavutil/common.h	2006-08-01 20:03:31.000000000 -0700
+++ libavutil/./common.h	2006-08-01 21:18:45.000000000 -0700
@@ -358,4 +358,16 @@
 void *av_realloc(void *ptr, unsigned int size);
 void av_free(void *ptr);
 
+/* xine: inline causes trouble for debug compiling */
+#ifdef DISABLE_INLINE
+# ifdef inline
+#  undef inline
+# endif
+# ifdef always_inline
+#  undef always_inline
+# endif
+# define inline
+# define always_inline
+#endif
+
 #endif /* COMMON_H */