Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master: (27 commits)
ppc: Add ff_ prefix to nonstatic symbols
sh4: Add ff_ prefix to nonstatic symbols
mpegvideo: Add ff_ prefix to nonstatic functions
rtjpeg: Add ff_ prefix to nonstatic symbols
rv: Add ff_ prefix to nonstatic symbols
vp56: Add ff_ prefix to nonstatic symbols
vorbis: Add ff_ prefix to nonstatic symbols
msmpeg4: Add ff_ prefix to nonstatic symbols
vc1: Add ff_ prefix to nonstatic symbols
msmpeg4: Add ff_ prefixes to nonstatic symbols
snow: Add ff_ prefix to nonstatic symbols
mpeg12: Add ff_ prefix to nonstatic symbols
mpeg4: Add ff_ prefixes to nonstatic symbols
lagarith: Add ff_ prefix to lag_rac_init
libavcodec: Add ff_ prefix to j_rev_dct*
dsputil: Add ff_ prefix to inv_zigzag_direct16
libavcodec: Prefix fdct_ifast, fdct_ifast248
dsputil: Add ff_ prefix to the dsputil*_init* functions
libavcodec: Add ff_ prefix to some nonstatic symbols
vlc/rl: Add ff_ prefix to the nonstatic symbols
...

Conflicts:
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/dnxhddec.c
libavcodec/ffv1.c
libavcodec/h263.h
libavcodec/h263dec.c
libavcodec/h264.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo_enc.c
libavcodec/nuv.c
libavcodec/ppc/dsputil_ppc.c
libavcodec/proresdsp.c
libavcodec/svq3.c
libavcodec/version.h
libavformat/dv.h
libavformat/dvenc.c
libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/02/16 08:49:16
Showing 201 changed files
... ...
@@ -5,6 +5,7 @@ version next:
5 5
 - v408 Quicktime and Microsoft AYUV Uncompressed 4:4:4:4 encoder and decoder
6 6
 - setfield filter
7 7
 - CDXL demuxer and decoder
8
+- Apple ProRes encoder
8 9
 
9 10
 
10 11
 version 0.10:
... ...
@@ -925,7 +925,7 @@ static av_cold void common_init(AVCodecContext *avctx)
925 925
 {
926 926
     FourXContext * const f = avctx->priv_data;
927 927
 
928
-    dsputil_init(&f->dsp, avctx);
928
+    ff_dsputil_init(&f->dsp, avctx);
929 929
 
930 930
     f->avctx = avctx;
931 931
 }
... ...
@@ -969,7 +969,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
969 969
         av_freep(&f->cfrm[i].data);
970 970
         f->cfrm[i].allocated_size = 0;
971 971
     }
972
-    free_vlc(&f->pre_vlc);
972
+    ff_free_vlc(&f->pre_vlc);
973 973
     if (f->current_picture.data[0])
974 974
         avctx->release_buffer(avctx, &f->current_picture);
975 975
     if (f->last_picture.data[0])
... ...
@@ -333,6 +333,7 @@ OBJS-$(CONFIG_PRORES_DECODER)          += proresdec2.o
333 333
 OBJS-$(CONFIG_PRORES_LGPL_DECODER)     += proresdec_lgpl.o proresdsp.o
334 334
 OBJS-$(CONFIG_PRORES_ENCODER)          += proresenc_anatoliy.o
335 335
 OBJS-$(CONFIG_PRORES_ANATOLIY_ENCODER) += proresenc_anatoliy.o
336
+OBJS-$(CONFIG_PRORES_KOSTYA_ENCODER)   += proresenc_kostya.o proresdata.o proresdsp.o
336 337
 OBJS-$(CONFIG_PTX_DECODER)             += ptx.o
337 338
 OBJS-$(CONFIG_QCELP_DECODER)           += qcelpdec.o celp_math.o         \
338 339
                                           celp_filters.o acelp_vectors.o \
... ...
@@ -825,7 +825,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
825 825
 
826 826
     ff_aac_sbr_init();
827 827
 
828
-    dsputil_init(&ac->dsp, avctx);
828
+    ff_dsputil_init(&ac->dsp, avctx);
829 829
     ff_fmt_convert_init(&ac->fmt_conv, avctx);
830 830
 
831 831
     ac->random_state = 0x1f2e3d4c;
... ...
@@ -669,7 +669,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
669 669
 {
670 670
     int ret = 0;
671 671
 
672
-    dsputil_init(&s->dsp, avctx);
672
+    ff_dsputil_init(&s->dsp, avctx);
673 673
 
674 674
     // window init
675 675
     ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
... ...
@@ -167,7 +167,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
167 167
     ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
168 168
     ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
169 169
     ff_kbd_window_init(s->window, 5.0, 256);
170
-    dsputil_init(&s->dsp, avctx);
170
+    ff_dsputil_init(&s->dsp, avctx);
171 171
     ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
172 172
     ff_fmt_convert_init(&s->fmt_conv, avctx);
173 173
     av_lfg_init(&s->dith_state, 0);
... ...
@@ -2467,7 +2467,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
2467 2467
     if (!avctx->coded_frame)
2468 2468
         goto init_fail;
2469 2469
 
2470
-    dsputil_init(&s->dsp, avctx);
2470
+    ff_dsputil_init(&s->dsp, avctx);
2471 2471
     ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
2472 2472
 
2473 2473
     dprint_options(s);
... ...
@@ -182,6 +182,7 @@ void avcodec_register_all(void)
182 182
     REGISTER_ENCDEC  (PPM, ppm);
183 183
     REGISTER_ENCDEC  (PRORES, prores);
184 184
     REGISTER_ENCODER (PRORES_ANATOLIY, prores_anatoliy);
185
+    REGISTER_ENCODER (PRORES_KOSTYA, prores_kostya);
185 186
     REGISTER_DECODER (PRORES_LGPL, prores_lgpl);
186 187
     REGISTER_DECODER (PTX, ptx);
187 188
     REGISTER_DECODER (QDRAW, qdraw);
... ...
@@ -268,7 +268,7 @@ static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels,
268 268
     put_pixels_axp_asm(block + 8, pixels + 8, line_size, h);
269 269
 }
270 270
 
271
-void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
271
+void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx)
272 272
 {
273 273
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
274 274
 
... ...
@@ -103,7 +103,7 @@ static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,
103 103
     dct_unquantize_h263_axp(block, n_coeffs, qscale, (qscale - 1) | 1);
104 104
 }
105 105
 
106
-void MPV_common_init_axp(MpegEncContext *s)
106
+void ff_MPV_common_init_axp(MpegEncContext *s)
107 107
 {
108 108
     s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_axp;
109 109
     s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_axp;
... ...
@@ -1724,7 +1724,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
1724 1724
         }
1725 1725
     }
1726 1726
 
1727
-    dsputil_init(&ctx->dsp, avctx);
1727
+    ff_dsputil_init(&ctx->dsp, avctx);
1728 1728
 
1729 1729
     avcodec_get_frame_defaults(&ctx->frame);
1730 1730
     avctx->coded_frame = &ctx->frame;
... ...
@@ -231,7 +231,7 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
231 231
                          filter_alloc_fail);
232 232
     }
233 233
 
234
-    dsputil_init(&s->dsp, avctx);
234
+    ff_dsputil_init(&s->dsp, avctx);
235 235
     avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
236 236
 
237 237
     avcodec_get_frame_defaults(&s->frame);
... ...
@@ -73,7 +73,7 @@ static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
73 73
     ff_add_pixels_clamped(block, dest, line_size);
74 74
 }
75 75
 
76
-void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
76
+void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
77 77
 {
78 78
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
79 79
 
... ...
@@ -38,17 +38,17 @@ void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, DCTELEM *block,
38 38
 void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block,
39 39
                                        int n, int qscale);
40 40
 
41
-void MPV_common_init_arm(MpegEncContext *s)
41
+void ff_MPV_common_init_arm(MpegEncContext *s)
42 42
 {
43 43
     /* IWMMXT support is a superset of armv5te, so
44 44
      * allow optimized functions for armv5te unless
45 45
      * a better iwmmxt function exists
46 46
      */
47 47
 #if HAVE_ARMV5TE
48
-    MPV_common_init_armv5te(s);
48
+    ff_MPV_common_init_armv5te(s);
49 49
 #endif
50 50
 #if HAVE_IWMMXT
51
-    MPV_common_init_iwmmxt(s);
51
+    ff_MPV_common_init_iwmmxt(s);
52 52
 #endif
53 53
 
54 54
     if (HAVE_NEON) {
... ...
@@ -21,7 +21,7 @@
21 21
 
22 22
 #include "libavcodec/mpegvideo.h"
23 23
 
24
-void MPV_common_init_iwmmxt(MpegEncContext *s);
25
-void MPV_common_init_armv5te(MpegEncContext *s);
24
+void ff_MPV_common_init_iwmmxt(MpegEncContext *s);
25
+void ff_MPV_common_init_armv5te(MpegEncContext *s);
26 26
 
27 27
 #endif /* AVCODEC_ARM_MPEGVIDEO_H */
... ...
@@ -94,7 +94,7 @@ static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
94 94
     ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
95 95
 }
96 96
 
97
-void MPV_common_init_armv5te(MpegEncContext *s)
97
+void ff_MPV_common_init_armv5te(MpegEncContext *s)
98 98
 {
99 99
     s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
100 100
     s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
... ...
@@ -93,7 +93,7 @@ static void dct_unquantize_h263_intra_iwmmxt(MpegEncContext *s,
93 93
     block_orig[0] = level;
94 94
 }
95 95
 
96
-void MPV_common_init_iwmmxt(MpegEncContext *s)
96
+void ff_MPV_common_init_iwmmxt(MpegEncContext *s)
97 97
 {
98 98
     if (!(mm_flags & AV_CPU_FLAG_IWMMXT)) return;
99 99
 
... ...
@@ -519,7 +519,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
519 519
 static av_cold void common_init(AVCodecContext *avctx){
520 520
     ASV1Context * const a = avctx->priv_data;
521 521
 
522
-    dsputil_init(&a->dsp, avctx);
522
+    ff_dsputil_init(&a->dsp, avctx);
523 523
 
524 524
     a->mb_width   = (avctx->width  + 15) / 16;
525 525
     a->mb_height  = (avctx->height + 15) / 16;
... ...
@@ -48,7 +48,7 @@ static const float qmf_48tap_half[24] = {
48 48
  * Generate common tables
49 49
  */
50 50
 
51
-void atrac_generate_tables(void)
51
+void ff_atrac_generate_tables(void)
52 52
 {
53 53
     int i;
54 54
     float s;
... ...
@@ -79,7 +79,7 @@ void atrac_generate_tables(void)
79 79
  */
80 80
 
81 81
 
82
-void atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
82
+void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
83 83
 {
84 84
     int   i, j;
85 85
     float   *p1, *p3;
... ...
@@ -30,7 +30,7 @@
30 30
 
31 31
 extern float ff_atrac_sf_table[64];
32 32
 
33
-void atrac_generate_tables(void);
34
-void atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp);
33
+void ff_atrac_generate_tables(void);
34
+void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp);
35 35
 
36 36
 #endif /* AVCODEC_ATRAC_H */
... ...
@@ -262,14 +262,14 @@ static void at1_subband_synthesis(AT1Ctx *q, AT1SUCtx* su, float *pOut)
262 262
     float iqmf_temp[512 + 46];
263 263
 
264 264
     /* combine low and middle bands */
265
-    atrac_iqmf(q->bands[0], q->bands[1], 128, temp, su->fst_qmf_delay, iqmf_temp);
265
+    ff_atrac_iqmf(q->bands[0], q->bands[1], 128, temp, su->fst_qmf_delay, iqmf_temp);
266 266
 
267 267
     /* delay the signal of the high band by 23 samples */
268 268
     memcpy( su->last_qmf_delay,    &su->last_qmf_delay[256], sizeof(float) *  23);
269 269
     memcpy(&su->last_qmf_delay[23], q->bands[2],             sizeof(float) * 256);
270 270
 
271 271
     /* combine (low + middle) and high bands */
272
-    atrac_iqmf(temp, su->last_qmf_delay, 256, pOut, su->snd_qmf_delay, iqmf_temp);
272
+    ff_atrac_iqmf(temp, su->last_qmf_delay, 256, pOut, su->snd_qmf_delay, iqmf_temp);
273 273
 }
274 274
 
275 275
 
... ...
@@ -378,9 +378,9 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
378 378
 
379 379
     ff_init_ff_sine_windows(5);
380 380
 
381
-    atrac_generate_tables();
381
+    ff_atrac_generate_tables();
382 382
 
383
-    dsputil_init(&q->dsp, avctx);
383
+    ff_dsputil_init(&q->dsp, avctx);
384 384
     ff_fmt_convert_init(&q->fmt_conv, avctx);
385 385
 
386 386
     q->bands[0] = q->low;
... ...
@@ -814,9 +814,9 @@ static int decodeFrame(ATRAC3Context *q, const uint8_t* databuf,
814 814
         p2= p1+256;
815 815
         p3= p2+256;
816 816
         p4= p3+256;
817
-        atrac_iqmf (p1, p2, 256, p1, q->pUnits[i].delayBuf1, q->tempBuf);
818
-        atrac_iqmf (p4, p3, 256, p3, q->pUnits[i].delayBuf2, q->tempBuf);
819
-        atrac_iqmf (p1, p3, 512, p1, q->pUnits[i].delayBuf3, q->tempBuf);
817
+        ff_atrac_iqmf (p1, p2, 256, p1, q->pUnits[i].delayBuf1, q->tempBuf);
818
+        ff_atrac_iqmf (p4, p3, 256, p3, q->pUnits[i].delayBuf2, q->tempBuf);
819
+        ff_atrac_iqmf (p1, p3, 512, p1, q->pUnits[i].delayBuf3, q->tempBuf);
820 820
     }
821 821
 
822 822
     return 0;
... ...
@@ -1016,7 +1016,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
1016 1016
         return ret;
1017 1017
     }
1018 1018
 
1019
-    atrac_generate_tables();
1019
+    ff_atrac_generate_tables();
1020 1020
 
1021 1021
     /* Generate gain tables. */
1022 1022
     for (i=0 ; i<16 ; i++)
... ...
@@ -1039,7 +1039,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
1039 1039
         q->matrix_coeff_index_next[i] = 3;
1040 1040
     }
1041 1041
 
1042
-    dsputil_init(&dsp, avctx);
1042
+    ff_dsputil_init(&dsp, avctx);
1043 1043
     ff_fmt_convert_init(&q->fmt_conv, avctx);
1044 1044
 
1045 1045
     q->pUnits = av_mallocz(sizeof(channel_unit)*q->channels);
... ...
@@ -195,7 +195,7 @@ static int bfin_pix_abs8_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_si
195 195
 
196 196
 */
197 197
 
198
-void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
198
+void ff_dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
199 199
 {
200 200
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
201 201
 
... ...
@@ -146,7 +146,7 @@ static int dct_quantize_bfin (MpegEncContext *s,
146 146
     return last_non_zero;
147 147
 }
148 148
 
149
-void MPV_common_init_bfin (MpegEncContext *s)
149
+void ff_MPV_common_init_bfin (MpegEncContext *s)
150 150
 {
151 151
 /*     s->dct_quantize= dct_quantize_bfin; */
152 152
 }
... ...
@@ -1298,7 +1298,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
1298 1298
     avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P;
1299 1299
 
1300 1300
     avctx->idct_algo = FF_IDCT_BINK;
1301
-    dsputil_init(&c->dsp, avctx);
1301
+    ff_dsputil_init(&c->dsp, avctx);
1302 1302
     ff_binkdsp_init(&c->bdsp);
1303 1303
 
1304 1304
     init_bundles(c);
... ...
@@ -79,7 +79,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
79 79
     int i;
80 80
     int frame_len_bits;
81 81
 
82
-    dsputil_init(&s->dsp, avctx);
82
+    ff_dsputil_init(&s->dsp, avctx);
83 83
     ff_fmt_convert_init(&s->fmt_conv, avctx);
84 84
 
85 85
     /* determine frame length */
... ...
@@ -253,9 +253,9 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
253 253
    (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables.
254 254
 
255 255
    'use_static' should be set to 1 for tables, which should be freed
256
-   with av_free_static(), 0 if free_vlc() will be used.
256
+   with av_free_static(), 0 if ff_free_vlc() will be used.
257 257
 */
258
-int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
258
+int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
259 259
              const void *bits, int bits_wrap, int bits_size,
260 260
              const void *codes, int codes_wrap, int codes_size,
261 261
              const void *symbols, int symbols_wrap, int symbols_size,
... ...
@@ -318,7 +318,7 @@ int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
318 318
 }
319 319
 
320 320
 
321
-void free_vlc(VLC *vlc)
321
+void ff_free_vlc(VLC *vlc)
322 322
 {
323 323
     av_freep(&vlc->table);
324 324
 }
... ...
@@ -671,7 +671,7 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) {
671 671
     AVSContext *h = avctx->priv_data;
672 672
     MpegEncContext * const s = &h->s;
673 673
 
674
-    MPV_decode_defaults(s);
674
+    ff_MPV_decode_defaults(s);
675 675
     ff_cavsdsp_init(&h->cdsp, avctx);
676 676
     s->avctx = avctx;
677 677
 
... ...
@@ -470,7 +470,7 @@ static int decode_pic(AVSContext *h) {
470 470
 
471 471
     if (!s->context_initialized) {
472 472
         s->avctx->idct_algo = FF_IDCT_CAVS;
473
-        if (MPV_common_init(s) < 0)
473
+        if (ff_MPV_common_init(s) < 0)
474 474
             return -1;
475 475
         ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct);
476 476
     }
... ...
@@ -321,11 +321,11 @@ static av_cold int cook_decode_close(AVCodecContext *avctx)
321 321
 
322 322
     /* Free the VLC tables. */
323 323
     for (i = 0; i < 13; i++)
324
-        free_vlc(&q->envelope_quant_index[i]);
324
+        ff_free_vlc(&q->envelope_quant_index[i]);
325 325
     for (i = 0; i < 7; i++)
326
-        free_vlc(&q->sqvh[i]);
326
+        ff_free_vlc(&q->sqvh[i]);
327 327
     for (i = 0; i < q->num_subpackets; i++)
328
-        free_vlc(&q->subpacket[i].ccpl);
328
+        ff_free_vlc(&q->subpacket[i].ccpl);
329 329
 
330 330
     av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n");
331 331
 
... ...
@@ -1926,7 +1926,7 @@ static av_cold int dca_decode_init(AVCodecContext *avctx)
1926 1926
     s->avctx = avctx;
1927 1927
     dca_init_vlcs();
1928 1928
 
1929
-    dsputil_init(&s->dsp, avctx);
1929
+    ff_dsputil_init(&s->dsp, avctx);
1930 1930
     ff_mdct_init(&s->imdct, 6, 1, 1.0);
1931 1931
     ff_synth_filter_init(&s->synth);
1932 1932
     ff_dcadsp_init(&s->dcadsp);
... ...
@@ -85,7 +85,7 @@ static int cpu_flags;
85 85
 static const struct algo fdct_tab[] = {
86 86
     { "REF-DBL",        ff_ref_fdct,           NO_PERM    },
87 87
     { "FAAN",           ff_faandct,            FAAN_SCALE },
88
-    { "IJG-AAN-INT",    fdct_ifast,            SCALE_PERM },
88
+    { "IJG-AAN-INT",    ff_fdct_ifast,         SCALE_PERM },
89 89
     { "IJG-LLM-INT",    ff_jpeg_fdct_islow_8,  NO_PERM    },
90 90
 
91 91
 #if HAVE_MMX
... ...
@@ -124,7 +124,7 @@ static void ff_prores_idct_put_10_sse2_wrap(uint16_t *dst){
124 124
 static const struct algo idct_tab[] = {
125 125
     { "FAANI",          ff_faanidct,           NO_PERM  },
126 126
     { "REF-DBL",        ff_ref_idct,           NO_PERM  },
127
-    { "INT",            j_rev_dct,             MMX_PERM },
127
+    { "INT",            ff_j_rev_dct,          MMX_PERM },
128 128
     { "SIMPLE-C",       ff_simple_idct_8,      NO_PERM  },
129 129
 
130 130
 #if HAVE_MMX
... ...
@@ -84,9 +84,9 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
84 84
         }
85 85
         ctx->cid_table = &ff_dnxhd_cid_table[index];
86 86
 
87
-        free_vlc(&ctx->ac_vlc);
88
-        free_vlc(&ctx->dc_vlc);
89
-        free_vlc(&ctx->run_vlc);
87
+        ff_free_vlc(&ctx->ac_vlc);
88
+        ff_free_vlc(&ctx->dc_vlc);
89
+        ff_free_vlc(&ctx->run_vlc);
90 90
 
91 91
         init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257,
92 92
                  ctx->cid_table->ac_bits, 1, 1,
... ...
@@ -132,7 +132,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
132 132
         ctx->avctx->pix_fmt = PIX_FMT_YUV422P10;
133 133
         ctx->avctx->bits_per_raw_sample = 10;
134 134
         if (ctx->bit_depth != 10) {
135
-            dsputil_init(&ctx->dsp, ctx->avctx);
135
+            ff_dsputil_init(&ctx->dsp, ctx->avctx);
136 136
             ctx->bit_depth = 10;
137 137
             ctx->decode_dct_block = dnxhd_decode_dct_block_10;
138 138
         }
... ...
@@ -140,7 +140,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
140 140
         ctx->avctx->pix_fmt = PIX_FMT_YUV422P;
141 141
         ctx->avctx->bits_per_raw_sample = 8;
142 142
         if (ctx->bit_depth != 8) {
143
-            dsputil_init(&ctx->dsp, ctx->avctx);
143
+            ff_dsputil_init(&ctx->dsp, ctx->avctx);
144 144
             ctx->bit_depth = 8;
145 145
             ctx->decode_dct_block = dnxhd_decode_dct_block_8;
146 146
         }
... ...
@@ -414,9 +414,9 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx)
414 414
 
415 415
     if (ctx->picture.data[0])
416 416
         ff_thread_release_buffer(avctx, &ctx->picture);
417
-    free_vlc(&ctx->ac_vlc);
418
-    free_vlc(&ctx->dc_vlc);
419
-    free_vlc(&ctx->run_vlc);
417
+    ff_free_vlc(&ctx->ac_vlc);
418
+    ff_free_vlc(&ctx->dc_vlc);
419
+    ff_free_vlc(&ctx->run_vlc);
420 420
     return 0;
421 421
 }
422 422
 
... ...
@@ -267,10 +267,10 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
267 267
 
268 268
     avctx->bits_per_raw_sample = ctx->cid_table->bit_depth;
269 269
 
270
-    dsputil_init(&ctx->m.dsp, avctx);
270
+    ff_dsputil_init(&ctx->m.dsp, avctx);
271 271
     ff_dct_common_init(&ctx->m);
272 272
     if (!ctx->m.dct_quantize)
273
-        ctx->m.dct_quantize = dct_quantize_c;
273
+        ctx->m.dct_quantize = ff_dct_quantize_c;
274 274
 
275 275
     if (ctx->cid_table->bit_depth == 10) {
276 276
        ctx->m.dct_quantize = dnxhd_10bit_dct_quantize;
... ...
@@ -83,7 +83,7 @@ const uint8_t ff_zigzag248_direct[64] = {
83 83
 };
84 84
 
85 85
 /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
86
-DECLARE_ALIGNED(16, uint16_t, inv_zigzag_direct16)[64];
86
+DECLARE_ALIGNED(16, uint16_t, ff_inv_zigzag_direct16)[64];
87 87
 
88 88
 const uint8_t ff_alternate_horizontal_scan[64] = {
89 89
     0,  1,   2,  3,  8,  9, 16, 17,
... ...
@@ -2746,34 +2746,34 @@ static void ff_wmv2_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block)
2746 2746
 }
2747 2747
 static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
2748 2748
 {
2749
-    j_rev_dct (block);
2749
+    ff_j_rev_dct (block);
2750 2750
     ff_put_pixels_clamped_c(block, dest, line_size);
2751 2751
 }
2752 2752
 static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
2753 2753
 {
2754
-    j_rev_dct (block);
2754
+    ff_j_rev_dct (block);
2755 2755
     ff_add_pixels_clamped_c(block, dest, line_size);
2756 2756
 }
2757 2757
 
2758 2758
 static void ff_jref_idct4_put(uint8_t *dest, int line_size, DCTELEM *block)
2759 2759
 {
2760
-    j_rev_dct4 (block);
2760
+    ff_j_rev_dct4 (block);
2761 2761
     put_pixels_clamped4_c(block, dest, line_size);
2762 2762
 }
2763 2763
 static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block)
2764 2764
 {
2765
-    j_rev_dct4 (block);
2765
+    ff_j_rev_dct4 (block);
2766 2766
     add_pixels_clamped4_c(block, dest, line_size);
2767 2767
 }
2768 2768
 
2769 2769
 static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block)
2770 2770
 {
2771
-    j_rev_dct2 (block);
2771
+    ff_j_rev_dct2 (block);
2772 2772
     put_pixels_clamped2_c(block, dest, line_size);
2773 2773
 }
2774 2774
 static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block)
2775 2775
 {
2776
-    j_rev_dct2 (block);
2776
+    ff_j_rev_dct2 (block);
2777 2777
     add_pixels_clamped2_c(block, dest, line_size);
2778 2778
 }
2779 2779
 
... ...
@@ -2793,7 +2793,7 @@ static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block)
2793 2793
 static void just_return(void *mem av_unused, int stride av_unused, int h av_unused) { return; }
2794 2794
 
2795 2795
 /* init static data */
2796
-av_cold void dsputil_static_init(void)
2796
+av_cold void ff_dsputil_static_init(void)
2797 2797
 {
2798 2798
     int i;
2799 2799
 
... ...
@@ -2807,7 +2807,7 @@ av_cold void dsputil_static_init(void)
2807 2807
         ff_squareTbl[i] = (i - 256) * (i - 256);
2808 2808
     }
2809 2809
 
2810
-    for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
2810
+    for(i=0; i<64; i++) ff_inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1;
2811 2811
 }
2812 2812
 
2813 2813
 int ff_check_alignment(void){
... ...
@@ -2830,7 +2830,7 @@ int ff_check_alignment(void){
2830 2830
     return 0;
2831 2831
 }
2832 2832
 
2833
-av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
2833
+av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
2834 2834
 {
2835 2835
     int i;
2836 2836
 
... ...
@@ -2842,8 +2842,8 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
2842 2842
         c->fdct248 = ff_fdct248_islow_10;
2843 2843
     } else {
2844 2844
         if(avctx->dct_algo==FF_DCT_FASTINT) {
2845
-            c->fdct    = fdct_ifast;
2846
-            c->fdct248 = fdct_ifast248;
2845
+            c->fdct    = ff_fdct_ifast;
2846
+            c->fdct248 = ff_fdct_ifast248;
2847 2847
         }
2848 2848
         else if(avctx->dct_algo==FF_DCT_FAAN) {
2849 2849
             c->fdct    = ff_faandct;
... ...
@@ -2859,17 +2859,17 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
2859 2859
     if(avctx->lowres==1){
2860 2860
         c->idct_put= ff_jref_idct4_put;
2861 2861
         c->idct_add= ff_jref_idct4_add;
2862
-        c->idct    = j_rev_dct4;
2862
+        c->idct    = ff_j_rev_dct4;
2863 2863
         c->idct_permutation_type= FF_NO_IDCT_PERM;
2864 2864
     }else if(avctx->lowres==2){
2865 2865
         c->idct_put= ff_jref_idct2_put;
2866 2866
         c->idct_add= ff_jref_idct2_add;
2867
-        c->idct    = j_rev_dct2;
2867
+        c->idct    = ff_j_rev_dct2;
2868 2868
         c->idct_permutation_type= FF_NO_IDCT_PERM;
2869 2869
     }else if(avctx->lowres==3){
2870 2870
         c->idct_put= ff_jref_idct1_put;
2871 2871
         c->idct_add= ff_jref_idct1_add;
2872
-        c->idct    = j_rev_dct1;
2872
+        c->idct    = ff_j_rev_dct1;
2873 2873
         c->idct_permutation_type= FF_NO_IDCT_PERM;
2874 2874
     }else{
2875 2875
         if (avctx->bits_per_raw_sample == 10) {
... ...
@@ -2881,7 +2881,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
2881 2881
         if(avctx->idct_algo==FF_IDCT_INT){
2882 2882
             c->idct_put= ff_jref_idct_put;
2883 2883
             c->idct_add= ff_jref_idct_add;
2884
-            c->idct    = j_rev_dct;
2884
+            c->idct    = ff_j_rev_dct;
2885 2885
             c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
2886 2886
         }else if((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER ) &&
2887 2887
                 avctx->idct_algo==FF_IDCT_VP3){
... ...
@@ -3062,7 +3062,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
3062 3062
     c->add_8x8basis= add_8x8basis_c;
3063 3063
 
3064 3064
 #if CONFIG_VORBIS_DECODER
3065
-    c->vorbis_inverse_coupling = vorbis_inverse_coupling;
3065
+    c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling;
3066 3066
 #endif
3067 3067
 #if CONFIG_AC3_DECODER
3068 3068
     c->ac3_downmix = ff_ac3_downmix_c;
... ...
@@ -3182,14 +3182,14 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
3182 3182
     }
3183 3183
 
3184 3184
 
3185
-    if (HAVE_MMX)        dsputil_init_mmx   (c, avctx);
3186
-    if (ARCH_ARM)        dsputil_init_arm   (c, avctx);
3187
-    if (HAVE_VIS)        dsputil_init_vis   (c, avctx);
3188
-    if (ARCH_ALPHA)      dsputil_init_alpha (c, avctx);
3189
-    if (ARCH_PPC)        dsputil_init_ppc   (c, avctx);
3190
-    if (HAVE_MMI)        dsputil_init_mmi   (c, avctx);
3191
-    if (ARCH_SH4)        dsputil_init_sh4   (c, avctx);
3192
-    if (ARCH_BFIN)       dsputil_init_bfin  (c, avctx);
3185
+    if (HAVE_MMX)        ff_dsputil_init_mmx   (c, avctx);
3186
+    if (ARCH_ARM)        ff_dsputil_init_arm   (c, avctx);
3187
+    if (HAVE_VIS)        ff_dsputil_init_vis   (c, avctx);
3188
+    if (ARCH_ALPHA)      ff_dsputil_init_alpha (c, avctx);
3189
+    if (ARCH_PPC)        ff_dsputil_init_ppc   (c, avctx);
3190
+    if (HAVE_MMI)        ff_dsputil_init_mmi   (c, avctx);
3191
+    if (ARCH_SH4)        ff_dsputil_init_sh4   (c, avctx);
3192
+    if (ARCH_BFIN)       ff_dsputil_init_bfin  (c, avctx);
3193 3193
 
3194 3194
     for(i=0; i<64; i++){
3195 3195
         if(!c->put_2tap_qpel_pixels_tab[0][i])
... ...
@@ -3201,3 +3201,8 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
3201 3201
     ff_init_scantable_permutation(c->idct_permutation,
3202 3202
                                   c->idct_permutation_type);
3203 3203
 }
3204
+
3205
+av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
3206
+{
3207
+    ff_dsputil_init(c, avctx);
3208
+}
... ...
@@ -38,17 +38,17 @@
38 38
 /* dct code */
39 39
 typedef short DCTELEM;
40 40
 
41
-void fdct_ifast (DCTELEM *data);
42
-void fdct_ifast248 (DCTELEM *data);
41
+void ff_fdct_ifast (DCTELEM *data);
42
+void ff_fdct_ifast248 (DCTELEM *data);
43 43
 void ff_jpeg_fdct_islow_8(DCTELEM *data);
44 44
 void ff_jpeg_fdct_islow_10(DCTELEM *data);
45 45
 void ff_fdct248_islow_8(DCTELEM *data);
46 46
 void ff_fdct248_islow_10(DCTELEM *data);
47 47
 
48
-void j_rev_dct (DCTELEM *data);
49
-void j_rev_dct4 (DCTELEM *data);
50
-void j_rev_dct2 (DCTELEM *data);
51
-void j_rev_dct1 (DCTELEM *data);
48
+void ff_j_rev_dct (DCTELEM *data);
49
+void ff_j_rev_dct4 (DCTELEM *data);
50
+void ff_j_rev_dct2 (DCTELEM *data);
51
+void ff_j_rev_dct1 (DCTELEM *data);
52 52
 void ff_wmv2_idct_c(DCTELEM *data);
53 53
 
54 54
 void ff_fdct_mmx(DCTELEM *block);
... ...
@@ -581,8 +581,9 @@ typedef struct DSPContext {
581 581
     op_fill_func fill_block_tab[2];
582 582
 } DSPContext;
583 583
 
584
-void dsputil_static_init(void);
585
-void dsputil_init(DSPContext* p, AVCodecContext *avctx);
584
+void ff_dsputil_static_init(void);
585
+void ff_dsputil_init(DSPContext* p, AVCodecContext *avctx);
586
+attribute_deprecated void dsputil_init(DSPContext* c, AVCodecContext *avctx);
586 587
 
587 588
 int ff_check_alignment(void);
588 589
 
... ...
@@ -641,14 +642,14 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){
641 641
     }
642 642
 }
643 643
 
644
-void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
645
-void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
646
-void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
647
-void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
648
-void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
649
-void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
650
-void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
651
-void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
644
+void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
645
+void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
646
+void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
647
+void ff_dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
648
+void ff_dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
649
+void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
650
+void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
651
+void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
652 652
 
653 653
 void ff_dsputil_init_dwt(DSPContext *c);
654 654
 void ff_intrax8dsp_init(DSPContext* c, AVCodecContext *avctx);
... ...
@@ -313,13 +313,13 @@ static av_cold int dvvideo_init(AVCodecContext *avctx)
313 313
             dv_rl_vlc[i].level = level;
314 314
             dv_rl_vlc[i].run   = run;
315 315
         }
316
-        free_vlc(&dv_vlc);
316
+        ff_free_vlc(&dv_vlc);
317 317
 
318 318
         dv_vlc_map_tableinit();
319 319
     }
320 320
 
321 321
     /* Generic DSP setup */
322
-    dsputil_init(&dsp, avctx);
322
+    ff_dsputil_init(&dsp, avctx);
323 323
     ff_set_cmp(&dsp, dsp.ildct_cmp, avctx->ildct_cmp);
324 324
     s->get_pixels = dsp.get_pixels;
325 325
     s->ildct_cmp = dsp.ildct_cmp[5];
... ...
@@ -65,7 +65,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
65 65
     avctx->pix_fmt = PIX_FMT_YUV420P;
66 66
     if (avctx->idct_algo == FF_IDCT_AUTO)
67 67
         avctx->idct_algo = FF_IDCT_EA;
68
-    dsputil_init(&s->dsp, avctx);
68
+    ff_dsputil_init(&s->dsp, avctx);
69 69
     ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
70 70
     ff_mpeg12_init_vlcs();
71 71
     return 0;
... ...
@@ -50,7 +50,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){
50 50
     s->avctx = avctx;
51 51
     if(avctx->idct_algo==FF_IDCT_AUTO)
52 52
         avctx->idct_algo=FF_IDCT_EA;
53
-    dsputil_init(&s->dsp, avctx);
53
+    ff_dsputil_init(&s->dsp, avctx);
54 54
     ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
55 55
     avctx->time_base = (AVRational){1, 15};
56 56
     avctx->pix_fmt = PIX_FMT_YUV420P;
... ...
@@ -48,7 +48,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx)
48 48
     s->avctx = avctx;
49 49
     if(avctx->idct_algo==FF_IDCT_AUTO)
50 50
         avctx->idct_algo=FF_IDCT_EA;
51
-    dsputil_init(&s->dsp, avctx);
51
+    ff_dsputil_init(&s->dsp, avctx);
52 52
     ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
53 53
     s->qscale = 1;
54 54
     avctx->time_base = (AVRational){1, 15};
... ...
@@ -69,7 +69,7 @@ static void decode_mb(MpegEncContext *s, int ref)
69 69
         ff_h264_hl_decode_mb(h);
70 70
     } else {
71 71
         assert(ref == 0);
72
-        MPV_decode_mb(s, s->block);
72
+        ff_MPV_decode_mb(s, s->block);
73 73
     }
74 74
 }
75 75
 
... ...
@@ -110,11 +110,11 @@ av_cold void ff_ccitt_unpack_init(void)
110 110
     ccitt_vlc[1].table = code_table2;
111 111
     ccitt_vlc[1].table_allocated = 648;
112 112
     for(i = 0; i < 2; i++){
113
-        init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS,
114
-                        ccitt_codes_lens[i], 1, 1,
115
-                        ccitt_codes_bits[i], 1, 1,
116
-                        ccitt_syms, 2, 2,
117
-                        INIT_VLC_USE_NEW_STATIC);
113
+        ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS,
114
+                           ccitt_codes_lens[i], 1, 1,
115
+                           ccitt_codes_bits[i], 1, 1,
116
+                           ccitt_syms, 2, 2,
117
+                           INIT_VLC_USE_NEW_STATIC);
118 118
     }
119 119
     INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11,
120 120
                     ccitt_group3_2d_lens, 1, 1,
... ...
@@ -674,7 +674,7 @@ static av_cold int common_init(AVCodecContext *avctx){
674 674
 
675 675
     avcodec_get_frame_defaults(&s->picture);
676 676
 
677
-    dsputil_init(&s->dsp, avctx);
677
+    ff_dsputil_init(&s->dsp, avctx);
678 678
 
679 679
     s->width = avctx->width;
680 680
     s->height= avctx->height;
... ...
@@ -89,9 +89,9 @@ AVCodec ff_flv_encoder = {
89 89
     .type           = AVMEDIA_TYPE_VIDEO,
90 90
     .id             = CODEC_ID_FLV1,
91 91
     .priv_data_size = sizeof(MpegEncContext),
92
-    .init           = MPV_encode_init,
93
-    .encode         = MPV_encode_picture,
94
-    .close          = MPV_encode_end,
92
+    .init           = ff_MPV_encode_init,
93
+    .encode         = ff_MPV_encode_picture,
94
+    .close          = ff_MPV_encode_end,
95 95
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
96 96
     .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"),
97 97
 };
... ...
@@ -67,7 +67,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
67 67
     s->avctx = avctx;
68 68
     s->tmpbuf = NULL;
69 69
 
70
-    dsputil_init(&s->dsp, avctx);
70
+    ff_dsputil_init(&s->dsp, avctx);
71 71
 
72 72
     return 0;
73 73
 }
... ...
@@ -114,13 +114,13 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
114 114
             if(j) dst[i] += dst[i - stride];
115 115
             else if(Uoff) dst[i] += 0x80;
116 116
             if (get_bits_left(&gb) < 0) {
117
-                free_vlc(&vlc);
117
+                ff_free_vlc(&vlc);
118 118
                 return AVERROR_INVALIDDATA;
119 119
             }
120 120
         }
121 121
         dst += stride;
122 122
     }
123
-    free_vlc(&vlc);
123
+    ff_free_vlc(&vlc);
124 124
     return 0;
125 125
 }
126 126
 
... ...
@@ -360,19 +360,19 @@ static inline void align_get_bits(GetBitContext *s)
360 360
                  bits, bits_wrap, bits_size,            \
361 361
                  codes, codes_wrap, codes_size,         \
362 362
                  flags)                                 \
363
-        init_vlc_sparse(vlc, nb_bits, nb_codes,         \
364
-                        bits, bits_wrap, bits_size,     \
365
-                        codes, codes_wrap, codes_size,  \
366
-                        NULL, 0, 0, flags)
363
+        ff_init_vlc_sparse(vlc, nb_bits, nb_codes,         \
364
+                           bits, bits_wrap, bits_size,     \
365
+                           codes, codes_wrap, codes_size,  \
366
+                           NULL, 0, 0, flags)
367 367
 
368
-int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
368
+int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
369 369
              const void *bits, int bits_wrap, int bits_size,
370 370
              const void *codes, int codes_wrap, int codes_size,
371 371
              const void *symbols, int symbols_wrap, int symbols_size,
372 372
              int flags);
373 373
 #define INIT_VLC_LE         2
374 374
 #define INIT_VLC_USE_NEW_STATIC 4
375
-void free_vlc(VLC *vlc);
375
+void ff_free_vlc(VLC *vlc);
376 376
 
377 377
 #define INIT_VLC_STATIC(vlc, bits, a,b,c,d,e,f,g, static_size) do {     \
378 378
         static VLC_TYPE table[static_size][2];                          \
... ...
@@ -66,7 +66,7 @@ static av_cold void h261_decode_init_vlc(H261Context *h){
66 66
         INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63,
67 67
                  &h261_cbp_tab[0][1], 2, 1,
68 68
                  &h261_cbp_tab[0][0], 2, 1, 512);
69
-        init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store);
69
+        ff_init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store);
70 70
         INIT_VLC_RL(h261_rl_tcoeff, 552);
71 71
     }
72 72
 }
... ...
@@ -76,7 +76,7 @@ static av_cold int h261_decode_init(AVCodecContext *avctx){
76 76
     MpegEncContext * const s = &h->s;
77 77
 
78 78
     // set defaults
79
-    MPV_decode_defaults(s);
79
+    ff_MPV_decode_defaults(s);
80 80
     s->avctx = avctx;
81 81
 
82 82
     s->width  = s->avctx->coded_width;
... ...
@@ -221,7 +221,7 @@ static int h261_decode_mb_skipped(H261Context *h, int mba1, int mba2 )
221 221
         s->mb_skipped = 1;
222 222
         h->mtype &= ~MB_TYPE_H261_FIL;
223 223
 
224
-        MPV_decode_mb(s, s->block);
224
+        ff_MPV_decode_mb(s, s->block);
225 225
     }
226 226
 
227 227
     return 0;
... ...
@@ -349,7 +349,7 @@ intra:
349 349
             s->block_last_index[i]= -1;
350 350
     }
351 351
 
352
-    MPV_decode_mb(s, s->block);
352
+    ff_MPV_decode_mb(s, s->block);
353 353
 
354 354
     return SLICE_OK;
355 355
 }
... ...
@@ -565,7 +565,7 @@ retry:
565 565
     init_get_bits(&s->gb, buf, buf_size*8);
566 566
 
567 567
     if(!s->context_initialized){
568
-        if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
568
+        if (ff_MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
569 569
             return -1;
570 570
     }
571 571
 
... ...
@@ -588,7 +588,7 @@ retry:
588 588
     if (s->width != avctx->coded_width || s->height != avctx->coded_height){
589 589
         ParseContext pc= s->parse_context; //FIXME move this demuxing hack to libavformat
590 590
         s->parse_context.buffer=0;
591
-        MPV_common_end(s);
591
+        ff_MPV_common_end(s);
592 592
         s->parse_context= pc;
593 593
     }
594 594
     if (!s->context_initialized) {
... ...
@@ -606,7 +606,7 @@ retry:
606 606
        || avctx->skip_frame >= AVDISCARD_ALL)
607 607
         return get_consumed_bytes(s, buf_size);
608 608
 
609
-    if(MPV_frame_start(s, avctx) < 0)
609
+    if(ff_MPV_frame_start(s, avctx) < 0)
610 610
         return -1;
611 611
 
612 612
     ff_er_frame_start(s);
... ...
@@ -620,7 +620,7 @@ retry:
620 620
             break;
621 621
         h261_decode_gob(h);
622 622
     }
623
-    MPV_frame_end(s);
623
+    ff_MPV_frame_end(s);
624 624
 
625 625
 assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
626 626
 assert(s->current_picture.f.pict_type == s->pict_type);
... ...
@@ -637,7 +637,7 @@ static av_cold int h261_decode_end(AVCodecContext *avctx)
637 637
     H261Context *h= avctx->priv_data;
638 638
     MpegEncContext *s = &h->s;
639 639
 
640
-    MPV_common_end(s);
640
+    ff_MPV_common_end(s);
641 641
     return 0;
642 642
 }
643 643
 
... ...
@@ -240,7 +240,7 @@ void ff_h261_encode_init(MpegEncContext *s){
240 240
 
241 241
     if (!done) {
242 242
         done = 1;
243
-        init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store);
243
+        ff_init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store);
244 244
     }
245 245
 
246 246
     s->min_qcoeff= -127;
... ...
@@ -326,9 +326,9 @@ AVCodec ff_h261_encoder = {
326 326
     .type           = AVMEDIA_TYPE_VIDEO,
327 327
     .id             = CODEC_ID_H261,
328 328
     .priv_data_size = sizeof(H261Context),
329
-    .init           = MPV_encode_init,
330
-    .encode         = MPV_encode_picture,
331
-    .close          = MPV_encode_end,
329
+    .init           = ff_MPV_encode_init,
330
+    .encode         = ff_MPV_encode_picture,
331
+    .close          = ff_MPV_encode_end,
332 332
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
333 333
     .long_name= NULL_IF_CONFIG_SMALL("H.261"),
334 334
 };
... ...
@@ -98,7 +98,7 @@ void ff_h263_update_motion_val(MpegEncContext * s){
98 98
     }
99 99
 }
100 100
 
101
-int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr)
101
+int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr)
102 102
 {
103 103
     int x, y, wrap, a, c, pred_dc;
104 104
     int16_t *dc_val;
... ...
@@ -226,7 +226,7 @@ void ff_h263_loop_filter(MpegEncContext * s){
226 226
     }
227 227
 }
228 228
 
229
-void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
229
+void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
230 230
 {
231 231
     int x, y, wrap, a, c, pred_dc, scale, i;
232 232
     int16_t *dc_val, *ac_val, *ac_val1;
... ...
@@ -313,8 +313,8 @@ void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
313 313
         ac_val1[8 + i] = block[s->dsp.idct_permutation[i   ]];
314 314
 }
315 315
 
316
-int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
317
-                        int *px, int *py)
316
+int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
317
+                             int *px, int *py)
318 318
 {
319 319
     int wrap;
320 320
     int16_t *A, *B, *C, (*mot_val)[2];
... ...
@@ -38,16 +38,16 @@
38 38
 extern const AVRational ff_h263_pixel_aspect[16];
39 39
 extern const uint8_t ff_h263_cbpy_tab[16][2];
40 40
 
41
-extern const uint8_t cbpc_b_tab[4][2];
41
+extern const uint8_t ff_cbpc_b_tab[4][2];
42 42
 
43
-extern const uint8_t mvtab[33][2];
43
+extern const uint8_t ff_mvtab[33][2];
44 44
 
45 45
 extern const uint8_t ff_h263_intra_MCBPC_code[9];
46 46
 extern const uint8_t ff_h263_intra_MCBPC_bits[9];
47 47
 
48 48
 extern const uint8_t ff_h263_inter_MCBPC_code[28];
49 49
 extern const uint8_t ff_h263_inter_MCBPC_bits[28];
50
-extern const uint8_t h263_mbtype_b_tab[15][2];
50
+extern const uint8_t ff_h263_mbtype_b_tab[15][2];
51 51
 
52 52
 extern VLC ff_h263_intra_MCBPC_vlc;
53 53
 extern VLC ff_h263_inter_MCBPC_vlc;
... ...
@@ -55,41 +55,41 @@ extern VLC ff_h263_cbpy_vlc;
55 55
 
56 56
 extern RLTable ff_h263_rl_inter;
57 57
 
58
-extern RLTable rl_intra_aic;
58
+extern RLTable ff_rl_intra_aic;
59 59
 
60
-extern const uint16_t h263_format[8][2];
61
-extern const uint8_t modified_quant_tab[2][32];
60
+extern const uint16_t ff_h263_format[8][2];
61
+extern const uint8_t ff_modified_quant_tab[2][32];
62 62
 extern const uint16_t ff_mba_max[6];
63 63
 extern const uint8_t ff_mba_length[7];
64 64
 
65 65
 extern uint8_t ff_h263_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
66 66
 
67 67
 
68
-int h263_decode_motion(MpegEncContext * s, int pred, int f_code);
68
+int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code);
69 69
 av_const int ff_h263_aspect_to_info(AVRational aspect);
70 70
 int ff_h263_decode_init(AVCodecContext *avctx);
71 71
 int ff_h263_decode_frame(AVCodecContext *avctx,
72 72
                              void *data, int *data_size,
73 73
                              AVPacket *avpkt);
74 74
 int ff_h263_decode_end(AVCodecContext *avctx);
75
-void h263_encode_mb(MpegEncContext *s,
76
-                    DCTELEM block[6][64],
77
-                    int motion_x, int motion_y);
78
-void h263_encode_picture_header(MpegEncContext *s, int picture_number);
79
-void h263_encode_gob_header(MpegEncContext * s, int mb_line);
80
-int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir,
81
-                        int *px, int *py);
82
-void h263_encode_init(MpegEncContext *s);
83
-void h263_decode_init_vlc(MpegEncContext *s);
84
-int h263_decode_picture_header(MpegEncContext *s);
75
+void ff_h263_encode_mb(MpegEncContext *s,
76
+                       DCTELEM block[6][64],
77
+                       int motion_x, int motion_y);
78
+void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number);
79
+void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line);
80
+int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir,
81
+                             int *px, int *py);
82
+void ff_h263_encode_init(MpegEncContext *s);
83
+void ff_h263_decode_init_vlc(MpegEncContext *s);
84
+int ff_h263_decode_picture_header(MpegEncContext *s);
85 85
 int ff_h263_decode_gob_header(MpegEncContext *s);
86 86
 void ff_h263_update_motion_val(MpegEncContext * s);
87 87
 void ff_h263_loop_filter(MpegEncContext * s);
88 88
 int ff_h263_decode_mba(MpegEncContext *s);
89 89
 void ff_h263_encode_mba(MpegEncContext *s);
90 90
 void ff_init_qscale_tab(MpegEncContext *s);
91
-int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
92
-void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n);
91
+int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
92
+void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n);
93 93
 
94 94
 
95 95
 /**
... ...
@@ -119,7 +119,7 @@ static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code
119 119
     int l, bit_size, code;
120 120
 
121 121
     if (val == 0) {
122
-        return mvtab[0][1];
122
+        return ff_mvtab[0][1];
123 123
     } else {
124 124
         bit_size = f_code - 1;
125 125
         /* modulo encoding */
... ...
@@ -128,7 +128,7 @@ static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code
128 128
         val--;
129 129
         code = (val >> bit_size) + 1;
130 130
 
131
-        return mvtab[code][1] + 1 + bit_size;
131
+        return ff_mvtab[code][1] + 1 + bit_size;
132 132
     }
133 133
 }
134 134
 
... ...
@@ -57,7 +57,7 @@ const uint8_t ff_h263_inter_MCBPC_bits[28] = {
57 57
     11, 13, 13, 13,/* inter4Q*/
58 58
 };
59 59
 
60
-const uint8_t h263_mbtype_b_tab[15][2] = {
60
+const uint8_t ff_h263_mbtype_b_tab[15][2] = {
61 61
  {1, 1},
62 62
  {3, 3},
63 63
  {1, 5},
... ...
@@ -75,7 +75,7 @@ const uint8_t h263_mbtype_b_tab[15][2] = {
75 75
  {1, 8},
76 76
 };
77 77
 
78
-const uint8_t cbpc_b_tab[4][2] = {
78
+const uint8_t ff_cbpc_b_tab[4][2] = {
79 79
 {0, 1},
80 80
 {2, 2},
81 81
 {7, 3},
... ...
@@ -88,7 +88,7 @@ const uint8_t ff_h263_cbpy_tab[16][2] =
88 88
   {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2}
89 89
 };
90 90
 
91
-const uint8_t mvtab[33][2] =
91
+const uint8_t ff_mvtab[33][2] =
92 92
 {
93 93
   {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7},
94 94
   {11,9}, {10,9}, {9,9}, {17,10}, {16,10}, {15,10}, {14,10}, {13,10},
... ...
@@ -98,7 +98,7 @@ const uint8_t mvtab[33][2] =
98 98
 };
99 99
 
100 100
 /* third non intra table */
101
-const uint16_t inter_vlc[103][2] = {
101
+const uint16_t ff_inter_vlc[103][2] = {
102 102
 { 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 },
103 103
 { 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 },
104 104
 { 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 },
... ...
@@ -127,7 +127,7 @@ const uint16_t inter_vlc[103][2] = {
127 127
 { 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 },
128 128
 };
129 129
 
130
-const int8_t inter_level[102] = {
130
+const int8_t ff_inter_level[102] = {
131 131
   1,  2,  3,  4,  5,  6,  7,  8,
132 132
   9, 10, 11, 12,  1,  2,  3,  4,
133 133
   5,  6,  1,  2,  3,  4,  1,  2,
... ...
@@ -143,7 +143,7 @@ const int8_t inter_level[102] = {
143 143
   1,  1,  1,  1,  1,  1,
144 144
 };
145 145
 
146
-const int8_t inter_run[102] = {
146
+const int8_t ff_inter_run[102] = {
147 147
   0,  0,  0,  0,  0,  0,  0,  0,
148 148
   0,  0,  0,  0,  1,  1,  1,  1,
149 149
   1,  1,  2,  2,  2,  2,  3,  3,
... ...
@@ -162,9 +162,9 @@ const int8_t inter_run[102] = {
162 162
 RLTable ff_h263_rl_inter = {
163 163
     102,
164 164
     58,
165
-    inter_vlc,
166
-    inter_run,
167
-    inter_level,
165
+    ff_inter_vlc,
166
+    ff_inter_run,
167
+    ff_inter_level,
168 168
 };
169 169
 
170 170
 static const uint16_t intra_vlc_aic[103][2] = {
... ...
@@ -228,7 +228,7 @@ static const int8_t intra_level_aic[102] = {
228 228
  1,  1,  1,  1,  1,  1,
229 229
 };
230 230
 
231
-RLTable rl_intra_aic = {
231
+RLTable ff_rl_intra_aic = {
232 232
     102,
233 233
     58,
234 234
     intra_vlc_aic,
... ...
@@ -236,7 +236,7 @@ RLTable rl_intra_aic = {
236 236
     intra_level_aic,
237 237
 };
238 238
 
239
-const uint16_t h263_format[8][2] = {
239
+const uint16_t ff_h263_format[8][2] = {
240 240
     { 0, 0 },
241 241
     { 128, 96 },
242 242
     { 176, 144 },
... ...
@@ -250,7 +250,7 @@ const uint8_t ff_aic_dc_scale_table[32]={
250 250
     0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
251 251
 };
252 252
 
253
-const uint8_t modified_quant_tab[2][32]={
253
+const uint8_t ff_modified_quant_tab[2][32]={
254 254
 //  0  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
255 255
 {
256 256
     0, 3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9,10,11,12,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28
... ...
@@ -56,7 +56,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
56 56
     s->workaround_bugs= avctx->workaround_bugs;
57 57
 
58 58
     // set defaults
59
-    MPV_decode_defaults(s);
59
+    ff_MPV_decode_defaults(s);
60 60
     s->quant_precision=5;
61 61
     s->decode_mb= ff_h263_decode_mb;
62 62
     s->low_delay= 1;
... ...
@@ -112,10 +112,10 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
112 112
 
113 113
     /* for h263, we allocate the images after having read the header */
114 114
     if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
115
-        if (MPV_common_init(s) < 0)
115
+        if (ff_MPV_common_init(s) < 0)
116 116
             return -1;
117 117
 
118
-        h263_decode_init_vlc(s);
118
+        ff_h263_decode_init_vlc(s);
119 119
 
120 120
     return 0;
121 121
 }
... ...
@@ -124,7 +124,7 @@ av_cold int ff_h263_decode_end(AVCodecContext *avctx)
124 124
 {
125 125
     MpegEncContext *s = avctx->priv_data;
126 126
 
127
-    MPV_common_end(s);
127
+    ff_MPV_common_end(s);
128 128
     return 0;
129 129
 }
130 130
 
... ...
@@ -222,7 +222,7 @@ static int decode_slice(MpegEncContext *s){
222 222
             if(ret<0){
223 223
                 const int xy= s->mb_x + s->mb_y*s->mb_stride;
224 224
                 if(ret==SLICE_END){
225
-                    MPV_decode_mb(s, s->block);
225
+                    ff_MPV_decode_mb(s, s->block);
226 226
                     if(s->loop_filter)
227 227
                         ff_h263_loop_filter(s);
228 228
 
... ...
@@ -234,7 +234,7 @@ static int decode_slice(MpegEncContext *s){
234 234
                     if(++s->mb_x >= s->mb_width){
235 235
                         s->mb_x=0;
236 236
                         ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size);
237
-                        MPV_report_decode_progress(s);
237
+                        ff_MPV_report_decode_progress(s);
238 238
                         s->mb_y++;
239 239
                     }
240 240
                     return 0;
... ...
@@ -249,13 +249,13 @@ static int decode_slice(MpegEncContext *s){
249 249
                 return -1;
250 250
             }
251 251
 
252
-            MPV_decode_mb(s, s->block);
252
+            ff_MPV_decode_mb(s, s->block);
253 253
             if(s->loop_filter)
254 254
                 ff_h263_loop_filter(s);
255 255
         }
256 256
 
257 257
         ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size);
258
-        MPV_report_decode_progress(s);
258
+        ff_MPV_report_decode_progress(s);
259 259
 
260 260
         s->mb_x= 0;
261 261
     }
... ...
@@ -404,7 +404,7 @@ retry:
404 404
     s->bitstream_buffer_size=0;
405 405
 
406 406
     if (!s->context_initialized) {
407
-        if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
407
+        if (ff_MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
408 408
             return -1;
409 409
     }
410 410
 
... ...
@@ -421,7 +421,7 @@ retry:
421 421
     if (CONFIG_WMV2_DECODER && s->msmpeg4_version==5) {
422 422
         ret= ff_wmv2_decode_picture_header(s);
423 423
     } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) {
424
-        ret = msmpeg4_decode_picture_header(s);
424
+        ret = ff_msmpeg4_decode_picture_header(s);
425 425
     } else if (CONFIG_MPEG4_DECODER && s->h263_pred) {
426 426
         if(s->avctx->extradata_size && s->picture_number==0){
427 427
             GetBitContext gb;
... ...
@@ -435,7 +435,7 @@ retry:
435 435
     } else if (CONFIG_FLV_DECODER && s->h263_flv) {
436 436
         ret = ff_flv_decode_picture_header(s);
437 437
     } else {
438
-        ret = h263_decode_picture_header(s);
438
+        ret = ff_h263_decode_picture_header(s);
439 439
     }
440 440
 
441 441
     if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_size);
... ...
@@ -591,7 +591,7 @@ retry:
591 591
         }
592 592
 
593 593
         s->parse_context.buffer=0;
594
-        MPV_common_end(s);
594
+        ff_MPV_common_end(s);
595 595
         s->parse_context= pc;
596 596
     }
597 597
     if (!s->context_initialized) {
... ...
@@ -632,7 +632,7 @@ retry:
632 632
         s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
633 633
     }
634 634
 
635
-    if(MPV_frame_start(s, avctx) < 0)
635
+    if(ff_MPV_frame_start(s, avctx) < 0)
636 636
         return -1;
637 637
 
638 638
     if (!s->divx_packed) ff_thread_finish_setup(avctx);
... ...
@@ -650,7 +650,7 @@ retry:
650 650
     ff_er_frame_start(s);
651 651
 
652 652
     //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type
653
-    //which is not available before MPV_frame_start()
653
+    //which is not available before ff_MPV_frame_start()
654 654
     if (CONFIG_WMV2_DECODER && s->msmpeg4_version==5){
655 655
         ret = ff_wmv2_decode_secondary_picture_header(s);
656 656
         if(ret<0) return ret;
... ...
@@ -681,7 +681,7 @@ retry:
681 681
     }
682 682
 
683 683
     if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type==AV_PICTURE_TYPE_I)
684
-        if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){
684
+        if(!CONFIG_MSMPEG4_DECODER || ff_msmpeg4_decode_ext_header(s, buf_size) < 0){
685 685
             s->error_status_table[s->mb_num-1]= ER_MB_ERROR;
686 686
         }
687 687
 
... ...
@@ -722,7 +722,7 @@ intrax8_decoded:
722 722
             return -1;
723 723
     }
724 724
 
725
-    MPV_frame_end(s);
725
+    ff_MPV_frame_end(s);
726 726
 
727 727
     assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
728 728
     assert(s->current_picture.f.pict_type == s->pict_type);
... ...
@@ -1051,7 +1051,7 @@ static av_cold void common_init(H264Context *h){
1051 1051
     s->unrestricted_mv=1;
1052 1052
 
1053 1053
     s->dsp.dct_bits = 16;
1054
-    dsputil_init(&s->dsp, s->avctx); // needed so that idct permutation is known early
1054
+    ff_dsputil_init(&s->dsp, s->avctx); // needed so that idct permutation is known early
1055 1055
 
1056 1056
     memset(h->pps.scaling_matrix4, 16, 6*16*sizeof(uint8_t));
1057 1057
     memset(h->pps.scaling_matrix8, 16, 2*64*sizeof(uint8_t));
... ...
@@ -1117,7 +1117,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){
1117 1117
     MpegEncContext * const s = &h->s;
1118 1118
     int i;
1119 1119
 
1120
-    MPV_decode_defaults(s);
1120
+    ff_MPV_decode_defaults(s);
1121 1121
 
1122 1122
     s->avctx = avctx;
1123 1123
     common_init(h);
... ...
@@ -1303,11 +1303,11 @@ int ff_h264_frame_start(H264Context *h){
1303 1303
     int i;
1304 1304
     const int pixel_shift = h->pixel_shift;
1305 1305
 
1306
-    if(MPV_frame_start(s, s->avctx) < 0)
1306
+    if(ff_MPV_frame_start(s, s->avctx) < 0)
1307 1307
         return -1;
1308 1308
     ff_er_frame_start(s);
1309 1309
     /*
1310
-     * MPV_frame_start uses pict_type to derive key_frame.
1310
+     * ff_MPV_frame_start uses pict_type to derive key_frame.
1311 1311
      * This is incorrect for H.264; IDR markings must be used.
1312 1312
      * Zero here; IDR markings per slice in frame or fields are ORed in later.
1313 1313
      * See decode_nal_units().
... ...
@@ -1342,7 +1342,7 @@ int ff_h264_frame_start(H264Context *h){
1342 1342
 
1343 1343
     // We mark the current picture as non-reference after allocating it, so
1344 1344
     // that if we break out due to an error it can be released automatically
1345
-    // in the next MPV_frame_start().
1345
+    // in the next ff_MPV_frame_start().
1346 1346
     // SVQ3 as well as most other codecs have only last/next/current and thus
1347 1347
     // get released even with set reference, besides SVQ3 and others do not
1348 1348
     // mark frames as reference later "naturally".
... ...
@@ -2549,7 +2549,7 @@ static int field_end(H264Context *h, int in_setup){
2549 2549
     if (!FIELD_PICTURE)
2550 2550
         ff_er_frame_end(s);
2551 2551
 
2552
-    MPV_frame_end(s);
2552
+    ff_MPV_frame_end(s);
2553 2553
 
2554 2554
     h->current_slice=0;
2555 2555
 
... ...
@@ -2612,7 +2612,7 @@ int ff_h264_get_profile(SPS *sps)
2612 2612
 
2613 2613
 /**
2614 2614
  * Decode a slice header.
2615
- * This will also call MPV_common_init() and frame_start() as needed.
2615
+ * This will also call ff_MPV_common_init() and frame_start() as needed.
2616 2616
  *
2617 2617
  * @param h h264context
2618 2618
  * @param h0 h264 master context (differs from 'h' when doing sliced based parallel decoding)
... ...
@@ -2720,7 +2720,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2720 2720
         }
2721 2721
         free_tables(h, 0);
2722 2722
         flush_dpb(s->avctx);
2723
-        MPV_common_end(s);
2723
+        ff_MPV_common_end(s);
2724 2724
         h->list_count = 0;
2725 2725
     }
2726 2726
     if (!s->context_initialized) {
... ...
@@ -2745,7 +2745,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2745 2745
                 ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma, h->sps.chroma_format_idc);
2746 2746
                 ff_h264_pred_init(&h->hpc, s->codec_id, h->sps.bit_depth_luma, h->sps.chroma_format_idc);
2747 2747
                 s->dsp.dct_bits = h->sps.bit_depth_luma > 8 ? 32 : 16;
2748
-                dsputil_init(&s->dsp, s->avctx);
2748
+                ff_dsputil_init(&s->dsp, s->avctx);
2749 2749
             } else {
2750 2750
                 av_log(s->avctx, AV_LOG_ERROR, "Unsupported bit depth: %d chroma_idc: %d\n",
2751 2751
                        h->sps.bit_depth_luma, h->sps.chroma_format_idc);
... ...
@@ -2816,8 +2816,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2816 2816
 
2817 2817
         s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt);
2818 2818
 
2819
-        if (MPV_common_init(s) < 0) {
2820
-            av_log(h->s.avctx, AV_LOG_ERROR, "MPV_common_init() failed.\n");
2819
+        if (ff_MPV_common_init(s) < 0) {
2820
+            av_log(h->s.avctx, AV_LOG_ERROR, "ff_MPV_common_init() failed.\n");
2821 2821
             return -1;
2822 2822
         }
2823 2823
         s->first_field = 0;
... ...
@@ -4169,7 +4169,7 @@ av_cold int ff_h264_decode_end(AVCodecContext *avctx)
4169 4169
     ff_h264_remove_all_refs(h);
4170 4170
     ff_h264_free_context(h);
4171 4171
 
4172
-    MPV_common_end(s);
4172
+    ff_MPV_common_end(s);
4173 4173
 
4174 4174
 //    memset(h, 0, sizeof(H264Context));
4175 4175
 
... ...
@@ -61,7 +61,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags)
61 61
     int pos = 0;
62 62
 
63 63
     get_tree_codes(bits, lens, xlat, nodes, head, 0, 0, &pos, no_zero_count);
64
-    return init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
64
+    return ff_init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0);
65 65
 }
66 66
 
67 67
 
... ...
@@ -322,8 +322,8 @@ static void generate_joint_tables(HYuvContext *s){
322 322
                         i++;
323 323
                 }
324 324
             }
325
-            free_vlc(&s->vlc[3+p]);
326
-            init_vlc_sparse(&s->vlc[3+p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0);
325
+            ff_free_vlc(&s->vlc[3+p]);
326
+            ff_init_vlc_sparse(&s->vlc[3+p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0);
327 327
         }
328 328
     }else{
329 329
         uint8_t (*map)[4] = (uint8_t(*)[4])s->pix_bgr_map;
... ...
@@ -363,7 +363,7 @@ static void generate_joint_tables(HYuvContext *s){
363 363
                 }
364 364
             }
365 365
         }
366
-        free_vlc(&s->vlc[3]);
366
+        ff_free_vlc(&s->vlc[3]);
367 367
         init_vlc(&s->vlc[3], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0);
368 368
     }
369 369
 }
... ...
@@ -380,7 +380,7 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
380 380
         if(generate_bits_table(s->bits[i], s->len[i])<0){
381 381
             return -1;
382 382
         }
383
-        free_vlc(&s->vlc[i]);
383
+        ff_free_vlc(&s->vlc[i]);
384 384
         init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
385 385
     }
386 386
 
... ...
@@ -412,7 +412,7 @@ static int read_old_huffman_tables(HYuvContext *s){
412 412
     memcpy(s->len[2] , s->len [1], 256*sizeof(uint8_t));
413 413
 
414 414
     for(i=0; i<3; i++){
415
-        free_vlc(&s->vlc[i]);
415
+        ff_free_vlc(&s->vlc[i]);
416 416
         init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
417 417
     }
418 418
 
... ...
@@ -443,7 +443,7 @@ static av_cold int common_init(AVCodecContext *avctx){
443 443
     s->avctx= avctx;
444 444
     s->flags= avctx->flags;
445 445
 
446
-    dsputil_init(&s->dsp, avctx);
446
+    ff_dsputil_init(&s->dsp, avctx);
447 447
 
448 448
     s->width= avctx->width;
449 449
     s->height= avctx->height;
... ...
@@ -1253,7 +1253,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
1253 1253
     av_freep(&s->bitstream_buffer);
1254 1254
 
1255 1255
     for(i=0; i<6; i++){
1256
-        free_vlc(&s->vlc[i]);
1256
+        ff_free_vlc(&s->vlc[i]);
1257 1257
     }
1258 1258
 
1259 1259
     return 0;
... ...
@@ -166,7 +166,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx)
166 166
         av_log(avctx, AV_LOG_INFO, "FFT init failed\n");
167 167
         return ret;
168 168
     }
169
-    dsputil_init(&q->dsp, avctx);
169
+    ff_dsputil_init(&q->dsp, avctx);
170 170
     avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
171 171
     avctx->channel_layout = AV_CH_LAYOUT_MONO;
172 172
 
... ...
@@ -995,7 +995,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
995 995
 
996 996
     build_requant_tab();
997 997
 
998
-    dsputil_init(&ctx->dsp, avctx);
998
+    ff_dsputil_init(&ctx->dsp, avctx);
999 999
 
1000 1000
     return allocate_frame_buffers(ctx, avctx);
1001 1001
 }
... ...
@@ -816,7 +816,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
816 816
     ff_ivi_free_buffers(&ctx->planes[0]);
817 817
 
818 818
     if (ctx->mb_vlc.cust_tab.table)
819
-        free_vlc(&ctx->mb_vlc.cust_tab);
819
+        ff_free_vlc(&ctx->mb_vlc.cust_tab);
820 820
 
821 821
     if (ctx->frame.data[0])
822 822
         avctx->release_buffer(avctx, &ctx->frame);
... ...
@@ -65,8 +65,8 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
65 65
     s->pb_frame = get_bits1(&s->gb);
66 66
 
67 67
     if (format < 6) {
68
-        s->width = h263_format[format][0];
69
-        s->height = h263_format[format][1];
68
+        s->width = ff_h263_format[format][0];
69
+        s->height = ff_h263_format[format][1];
70 70
         s->avctx->sample_aspect_ratio.num = 12;
71 71
         s->avctx->sample_aspect_ratio.den = 11;
72 72
     } else {
... ...
@@ -1017,7 +1017,7 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
1017 1017
     s->is_16bpp = avctx->bits_per_coded_sample == 16;
1018 1018
     avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8;
1019 1019
 
1020
-    dsputil_init(&s->dsp, avctx);
1020
+    ff_dsputil_init(&s->dsp, avctx);
1021 1021
 
1022 1022
     avcodec_get_frame_defaults(&s->second_last_frame);
1023 1023
     avcodec_get_frame_defaults(&s->last_frame);
... ...
@@ -696,9 +696,9 @@ av_cold void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s
696 696
     assert(s->mb_width>0);
697 697
     w->prediction_table=av_mallocz(s->mb_width*2*2);//two rows, 2 blocks per cannon mb
698 698
 
699
-    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], wmv1_scantable[0]);
700
-    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], wmv1_scantable[2]);
701
-    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], wmv1_scantable[3]);
699
+    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], ff_wmv1_scantable[0]);
700
+    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], ff_wmv1_scantable[2]);
701
+    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], ff_wmv1_scantable[3]);
702 702
 }
703 703
 
704 704
 /**
... ...
@@ -721,7 +721,7 @@ av_cold void ff_intrax8_common_end(IntraX8Context * w)
721 721
  * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
722 722
  * @param quant_offset offset away from zero
723 723
  */
724
-//FIXME extern uint8_t wmv3_dc_scale_table[32];
724
+//FIXME extern uint8_t ff_wmv3_dc_scale_table[32];
725 725
 int ff_intrax8_decode_picture(IntraX8Context * const w, int dquant, int quant_offset){
726 726
     MpegEncContext * const s= w->s;
727 727
     int mb_xy;
... ...
@@ -103,7 +103,7 @@ static VLC cbpc_b_vlc;
103 103
 /* init vlcs */
104 104
 
105 105
 /* XXX: find a better solution to handle static init */
106
-void h263_decode_init_vlc(MpegEncContext *s)
106
+void ff_h263_decode_init_vlc(MpegEncContext *s)
107 107
 {
108 108
     static int done = 0;
109 109
 
... ...
@@ -120,18 +120,18 @@ void h263_decode_init_vlc(MpegEncContext *s)
120 120
                  &ff_h263_cbpy_tab[0][1], 2, 1,
121 121
                  &ff_h263_cbpy_tab[0][0], 2, 1, 64);
122 122
         INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33,
123
-                 &mvtab[0][1], 2, 1,
124
-                 &mvtab[0][0], 2, 1, 538);
125
-        init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
126
-        init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]);
123
+                 &ff_mvtab[0][1], 2, 1,
124
+                 &ff_mvtab[0][0], 2, 1, 538);
125
+        ff_init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
126
+        ff_init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]);
127 127
         INIT_VLC_RL(ff_h263_rl_inter, 554);
128
-        INIT_VLC_RL(rl_intra_aic, 554);
128
+        INIT_VLC_RL(ff_rl_intra_aic, 554);
129 129
         INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15,
130
-                 &h263_mbtype_b_tab[0][1], 2, 1,
131
-                 &h263_mbtype_b_tab[0][0], 2, 1, 80);
130
+                 &ff_h263_mbtype_b_tab[0][1], 2, 1,
131
+                 &ff_h263_mbtype_b_tab[0][0], 2, 1, 80);
132 132
         INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4,
133
-                 &cbpc_b_tab[0][1], 2, 1,
134
-                 &cbpc_b_tab[0][0], 2, 1, 8);
133
+                 &ff_cbpc_b_tab[0][1], 2, 1,
134
+                 &ff_cbpc_b_tab[0][0], 2, 1, 8);
135 135
     }
136 136
 }
137 137
 
... ...
@@ -240,7 +240,7 @@ int ff_h263_resync(MpegEncContext *s){
240 240
     if(show_bits(&s->gb, 16)==0){
241 241
         pos= get_bits_count(&s->gb);
242 242
         if(CONFIG_MPEG4_DECODER && s->codec_id==CODEC_ID_MPEG4)
243
-            ret= mpeg4_decode_video_packet_header(s);
243
+            ret= ff_mpeg4_decode_video_packet_header(s);
244 244
         else
245 245
             ret= h263_decode_gob_header(s);
246 246
         if(ret>=0)
... ...
@@ -257,7 +257,7 @@ int ff_h263_resync(MpegEncContext *s){
257 257
 
258 258
             pos= get_bits_count(&s->gb);
259 259
             if(CONFIG_MPEG4_DECODER && s->codec_id==CODEC_ID_MPEG4)
260
-                ret= mpeg4_decode_video_packet_header(s);
260
+                ret= ff_mpeg4_decode_video_packet_header(s);
261 261
             else
262 262
                 ret= h263_decode_gob_header(s);
263 263
             if(ret>=0)
... ...
@@ -271,7 +271,7 @@ int ff_h263_resync(MpegEncContext *s){
271 271
     return -1;
272 272
 }
273 273
 
274
-int h263_decode_motion(MpegEncContext * s, int pred, int f_code)
274
+int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code)
275 275
 {
276 276
     int code, val, sign, shift;
277 277
     code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2);
... ...
@@ -381,16 +381,16 @@ static void preview_obmc(MpegEncContext *s){
381 381
         if ((cbpc & 16) == 0) {
382 382
                 s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
383 383
                 /* 16x16 motion prediction */
384
-                mot_val= h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
384
+                mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
385 385
                 if (s->umvplus)
386 386
                    mx = h263p_decode_umotion(s, pred_x);
387 387
                 else
388
-                   mx = h263_decode_motion(s, pred_x, 1);
388
+                   mx = ff_h263_decode_motion(s, pred_x, 1);
389 389
 
390 390
                 if (s->umvplus)
391 391
                    my = h263p_decode_umotion(s, pred_y);
392 392
                 else
393
-                   my = h263_decode_motion(s, pred_y, 1);
393
+                   my = ff_h263_decode_motion(s, pred_y, 1);
394 394
 
395 395
                 mot_val[0       ]= mot_val[2       ]=
396 396
                 mot_val[0+stride]= mot_val[2+stride]= mx;
... ...
@@ -399,16 +399,16 @@ static void preview_obmc(MpegEncContext *s){
399 399
         } else {
400 400
             s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
401 401
             for(i=0;i<4;i++) {
402
-                mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
402
+                mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
403 403
                 if (s->umvplus)
404 404
                   mx = h263p_decode_umotion(s, pred_x);
405 405
                 else
406
-                  mx = h263_decode_motion(s, pred_x, 1);
406
+                  mx = ff_h263_decode_motion(s, pred_x, 1);
407 407
 
408 408
                 if (s->umvplus)
409 409
                   my = h263p_decode_umotion(s, pred_y);
410 410
                 else
411
-                  my = h263_decode_motion(s, pred_y, 1);
411
+                  my = ff_h263_decode_motion(s, pred_y, 1);
412 412
                 if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1)
413 413
                   skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */
414 414
                 mot_val[0] = mx;
... ...
@@ -432,7 +432,7 @@ static void h263_decode_dquant(MpegEncContext *s){
432 432
 
433 433
     if(s->modified_quant){
434 434
         if(get_bits1(&s->gb))
435
-            s->qscale= modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
435
+            s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ];
436 436
         else
437 437
             s->qscale= get_bits(&s->gb, 5);
438 438
     }else
... ...
@@ -450,7 +450,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
450 450
 
451 451
     scan_table = s->intra_scantable.permutated;
452 452
     if (s->h263_aic && s->mb_intra) {
453
-        rl = &rl_intra_aic;
453
+        rl = &ff_rl_intra_aic;
454 454
         i = 0;
455 455
         if (s->ac_pred) {
456 456
             if (s->h263_aic_dir)
... ...
@@ -467,7 +467,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
467 467
             component = (n <= 3 ? 0 : n - 4 + 1);
468 468
             level = s->last_dc[component];
469 469
             if (s->rv10_first_dc_coded[component]) {
470
-                diff = rv_decode_dc(s, n);
470
+                diff = ff_rv_decode_dc(s, n);
471 471
                 if (diff == 0xffff)
472 472
                     return -1;
473 473
                 level += diff;
... ...
@@ -539,7 +539,7 @@ retry:
539 539
         if (i >= 64){
540 540
             if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){
541 541
                 //Looks like a hack but no, it's the way it is supposed to work ...
542
-                rl = &rl_intra_aic;
542
+                rl = &ff_rl_intra_aic;
543 543
                 i = 0;
544 544
                 s->gb= gb;
545 545
                 s->dsp.clear_block(block);
... ...
@@ -556,7 +556,7 @@ retry:
556 556
     }
557 557
 not_coded:
558 558
     if (s->mb_intra && s->h263_aic) {
559
-        h263_pred_acdc(s, block, n);
559
+        ff_h263_pred_acdc(s, block, n);
560 560
         i = 63;
561 561
     }
562 562
     s->block_last_index[n] = i;
... ...
@@ -655,11 +655,11 @@ int ff_h263_decode_mb(MpegEncContext *s,
655 655
             s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
656 656
             /* 16x16 motion prediction */
657 657
             s->mv_type = MV_TYPE_16X16;
658
-            h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
658
+            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
659 659
             if (s->umvplus)
660 660
                mx = h263p_decode_umotion(s, pred_x);
661 661
             else
662
-               mx = h263_decode_motion(s, pred_x, 1);
662
+               mx = ff_h263_decode_motion(s, pred_x, 1);
663 663
 
664 664
             if (mx >= 0xffff)
665 665
                 return -1;
... ...
@@ -667,7 +667,7 @@ int ff_h263_decode_mb(MpegEncContext *s,
667 667
             if (s->umvplus)
668 668
                my = h263p_decode_umotion(s, pred_y);
669 669
             else
670
-               my = h263_decode_motion(s, pred_y, 1);
670
+               my = ff_h263_decode_motion(s, pred_y, 1);
671 671
 
672 672
             if (my >= 0xffff)
673 673
                 return -1;
... ...
@@ -680,18 +680,18 @@ int ff_h263_decode_mb(MpegEncContext *s,
680 680
             s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
681 681
             s->mv_type = MV_TYPE_8X8;
682 682
             for(i=0;i<4;i++) {
683
-                mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
683
+                mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
684 684
                 if (s->umvplus)
685 685
                   mx = h263p_decode_umotion(s, pred_x);
686 686
                 else
687
-                  mx = h263_decode_motion(s, pred_x, 1);
687
+                  mx = ff_h263_decode_motion(s, pred_x, 1);
688 688
                 if (mx >= 0xffff)
689 689
                     return -1;
690 690
 
691 691
                 if (s->umvplus)
692 692
                   my = h263p_decode_umotion(s, pred_y);
693 693
                 else
694
-                  my = h263_decode_motion(s, pred_y, 1);
694
+                  my = ff_h263_decode_motion(s, pred_y, 1);
695 695
                 if (my >= 0xffff)
696 696
                     return -1;
697 697
                 s->mv[0][i][0] = mx;
... ...
@@ -763,11 +763,11 @@ int ff_h263_decode_mb(MpegEncContext *s,
763 763
 //FIXME UMV
764 764
 
765 765
             if(USES_LIST(mb_type, 0)){
766
-                int16_t *mot_val= h263_pred_motion(s, 0, 0, &mx, &my);
766
+                int16_t *mot_val= ff_h263_pred_motion(s, 0, 0, &mx, &my);
767 767
                 s->mv_dir = MV_DIR_FORWARD;
768 768
 
769
-                mx = h263_decode_motion(s, mx, 1);
770
-                my = h263_decode_motion(s, my, 1);
769
+                mx = ff_h263_decode_motion(s, mx, 1);
770
+                my = ff_h263_decode_motion(s, my, 1);
771 771
 
772 772
                 s->mv[0][0][0] = mx;
773 773
                 s->mv[0][0][1] = my;
... ...
@@ -776,11 +776,11 @@ int ff_h263_decode_mb(MpegEncContext *s,
776 776
             }
777 777
 
778 778
             if(USES_LIST(mb_type, 1)){
779
-                int16_t *mot_val= h263_pred_motion(s, 0, 1, &mx, &my);
779
+                int16_t *mot_val= ff_h263_pred_motion(s, 0, 1, &mx, &my);
780 780
                 s->mv_dir |= MV_DIR_BACKWARD;
781 781
 
782
-                mx = h263_decode_motion(s, mx, 1);
783
-                my = h263_decode_motion(s, my, 1);
782
+                mx = ff_h263_decode_motion(s, mx, 1);
783
+                my = ff_h263_decode_motion(s, my, 1);
784 784
 
785 785
                 s->mv[1][0][0] = mx;
786 786
                 s->mv[1][0][1] = my;
... ...
@@ -831,8 +831,8 @@ intra:
831 831
     }
832 832
 
833 833
     while(pb_mv_count--){
834
-        h263_decode_motion(s, 0, 1);
835
-        h263_decode_motion(s, 0, 1);
834
+        ff_h263_decode_motion(s, 0, 1);
835
+        ff_h263_decode_motion(s, 0, 1);
836 836
     }
837 837
 
838 838
     /* decode each block */
... ...
@@ -866,7 +866,7 @@ end:
866 866
 }
867 867
 
868 868
 /* most is hardcoded. should extend to handle all h263 streams */
869
-int h263_decode_picture_header(MpegEncContext *s)
869
+int ff_h263_decode_picture_header(MpegEncContext *s)
870 870
 {
871 871
     int format, width, height, i;
872 872
     uint32_t startcode;
... ...
@@ -918,8 +918,8 @@ int h263_decode_picture_header(MpegEncContext *s)
918 918
     if (format != 7 && format != 6) {
919 919
         s->h263_plus = 0;
920 920
         /* H.263v1 */
921
-        width = h263_format[format][0];
922
-        height = h263_format[format][1];
921
+        width = ff_h263_format[format][0];
922
+        height = ff_h263_format[format][1];
923 923
         if (!width)
924 924
             return -1;
925 925
 
... ...
@@ -1026,8 +1026,8 @@ int h263_decode_picture_header(MpegEncContext *s)
1026 1026
                     s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info];
1027 1027
                 }
1028 1028
             } else {
1029
-                width = h263_format[format][0];
1030
-                height = h263_format[format][1];
1029
+                width = ff_h263_format[format][0];
1030
+                height = ff_h263_format[format][1];
1031 1031
                 s->avctx->sample_aspect_ratio= (AVRational){12,11};
1032 1032
             }
1033 1033
             if ((width == 0) || (height == 0))
... ...
@@ -102,7 +102,7 @@ av_const int ff_h263_aspect_to_info(AVRational aspect){
102 102
     return FF_ASPECT_EXTENDED;
103 103
 }
104 104
 
105
-void h263_encode_picture_header(MpegEncContext * s, int picture_number)
105
+void ff_h263_encode_picture_header(MpegEncContext * s, int picture_number)
106 106
 {
107 107
     int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref;
108 108
     int best_clock_code=1;
... ...
@@ -141,7 +141,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
141 141
     put_bits(&s->pb, 1, 0);     /* camera  off */
142 142
     put_bits(&s->pb, 1, 0);     /* freeze picture release off */
143 143
 
144
-    format = ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height);
144
+    format = ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format), s->width, s->height);
145 145
     if (!s->h263_plus) {
146 146
         /* H.263v1 */
147 147
         put_bits(&s->pb, 3, format);
... ...
@@ -247,7 +247,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
247 247
 /**
248 248
  * Encode a group of blocks header.
249 249
  */
250
-void h263_encode_gob_header(MpegEncContext * s, int mb_line)
250
+void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line)
251 251
 {
252 252
     put_bits(&s->pb, 17, 1); /* GBSC */
253 253
 
... ...
@@ -333,7 +333,7 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n)
333 333
     } else {
334 334
         i = 0;
335 335
         if (s->h263_aic && s->mb_intra)
336
-            rl = &rl_intra_aic;
336
+            rl = &ff_rl_intra_aic;
337 337
 
338 338
         if(s->alt_inter_vlc && !s->mb_intra){
339 339
             int aic_vlc_bits=0;
... ...
@@ -353,14 +353,14 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n)
353 353
                     if(level<0) level= -level;
354 354
 
355 355
                     code = get_rl_index(rl, last, run, level);
356
-                    aic_code = get_rl_index(&rl_intra_aic, last, run, level);
356
+                    aic_code = get_rl_index(&ff_rl_intra_aic, last, run, level);
357 357
                     inter_vlc_bits += rl->table_vlc[code][1]+1;
358
-                    aic_vlc_bits   += rl_intra_aic.table_vlc[aic_code][1]+1;
358
+                    aic_vlc_bits   += ff_rl_intra_aic.table_vlc[aic_code][1]+1;
359 359
 
360 360
                     if (code == rl->n) {
361 361
                         inter_vlc_bits += 1+6+8-1;
362 362
                     }
363
-                    if (aic_code == rl_intra_aic.n) {
363
+                    if (aic_code == ff_rl_intra_aic.n) {
364 364
                         aic_vlc_bits += 1+6+8-1;
365 365
                         wrong_pos += run + 1;
366 366
                     }else
... ...
@@ -370,7 +370,7 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n)
370 370
             }
371 371
             i = 0;
372 372
             if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63)
373
-                rl = &rl_intra_aic;
373
+                rl = &ff_rl_intra_aic;
374 374
         }
375 375
     }
376 376
 
... ...
@@ -454,9 +454,9 @@ static void h263p_encode_umotion(MpegEncContext * s, int val)
454 454
     }
455 455
 }
456 456
 
457
-void h263_encode_mb(MpegEncContext * s,
458
-                    DCTELEM block[6][64],
459
-                    int motion_x, int motion_y)
457
+void ff_h263_encode_mb(MpegEncContext * s,
458
+                       DCTELEM block[6][64],
459
+                       int motion_x, int motion_y)
460 460
 {
461 461
     int cbpc, cbpy, i, cbp, pred_x, pred_y;
462 462
     int16_t pred_dc;
... ...
@@ -500,7 +500,7 @@ void h263_encode_mb(MpegEncContext * s,
500 500
             }
501 501
 
502 502
             /* motion vectors: 16x16 mode */
503
-            h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
503
+            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
504 504
 
505 505
             if (!s->umvplus) {
506 506
                 ff_h263_encode_motion_vector(s, motion_x - pred_x,
... ...
@@ -527,7 +527,7 @@ void h263_encode_mb(MpegEncContext * s,
527 527
 
528 528
             for(i=0; i<4; i++){
529 529
                 /* motion vectors: 8x8 mode*/
530
-                h263_pred_motion(s, i, 0, &pred_x, &pred_y);
530
+                ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
531 531
 
532 532
                 motion_x = s->current_picture.f.motion_val[0][s->block_index[i]][0];
533 533
                 motion_y = s->current_picture.f.motion_val[0][s->block_index[i]][1];
... ...
@@ -561,7 +561,7 @@ void h263_encode_mb(MpegEncContext * s,
561 561
                 if(i<4) scale= s->y_dc_scale;
562 562
                 else    scale= s->c_dc_scale;
563 563
 
564
-                pred_dc = h263_pred_dc(s, i, &dc_ptr[i]);
564
+                pred_dc = ff_h263_pred_dc(s, i, &dc_ptr[i]);
565 565
                 level -= pred_dc;
566 566
                 /* Quant */
567 567
                 if (level >= 0)
... ...
@@ -662,7 +662,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code)
662 662
     if (val == 0) {
663 663
         /* zero vector */
664 664
         code = 0;
665
-        put_bits(&s->pb, mvtab[code][1], mvtab[code][0]);
665
+        put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
666 666
     } else {
667 667
         bit_size = f_code - 1;
668 668
         range = 1 << bit_size;
... ...
@@ -676,7 +676,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code)
676 676
         code = (val >> bit_size) + 1;
677 677
         bits = val & (range - 1);
678 678
 
679
-        put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
679
+        put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign);
680 680
         if (bit_size > 0) {
681 681
             put_bits(&s->pb, bit_size, bits);
682 682
         }
... ...
@@ -692,7 +692,7 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s)
692 692
         for(mv=-MAX_MV; mv<=MAX_MV; mv++){
693 693
             int len;
694 694
 
695
-            if(mv==0) len= mvtab[0][1];
695
+            if(mv==0) len= ff_mvtab[0][1];
696 696
             else{
697 697
                 int val, bit_size, code;
698 698
 
... ...
@@ -704,9 +704,9 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s)
704 704
                 val--;
705 705
                 code = (val >> bit_size) + 1;
706 706
                 if(code<33){
707
-                    len= mvtab[code][1] + 1 + bit_size;
707
+                    len= ff_mvtab[code][1] + 1 + bit_size;
708 708
                 }else{
709
-                    len= mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
709
+                    len= ff_mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
710 710
                 }
711 711
             }
712 712
 
... ...
@@ -768,17 +768,17 @@ static void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_t
768 768
     }
769 769
 }
770 770
 
771
-void h263_encode_init(MpegEncContext *s)
771
+void ff_h263_encode_init(MpegEncContext *s)
772 772
 {
773 773
     static int done = 0;
774 774
 
775 775
     if (!done) {
776 776
         done = 1;
777 777
 
778
-        init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
779
-        init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]);
778
+        ff_init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]);
779
+        ff_init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]);
780 780
 
781
-        init_uni_h263_rl_tab(&rl_intra_aic, NULL, uni_h263_intra_aic_rl_len);
781
+        init_uni_h263_rl_tab(&ff_rl_intra_aic, NULL, uni_h263_intra_aic_rl_len);
782 782
         init_uni_h263_rl_tab(&ff_h263_rl_inter    , NULL, uni_h263_inter_rl_len);
783 783
 
784 784
         init_mv_penalty_and_fcode(s);
... ...
@@ -132,7 +132,7 @@ int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab,
132 132
                 ff_ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff);
133 133
 
134 134
                 if (huff_tab->cust_tab.table)
135
-                    free_vlc(&huff_tab->cust_tab);
135
+                    ff_free_vlc(&huff_tab->cust_tab);
136 136
                 result = ff_ivi_create_huff_from_desc(&huff_tab->cust_desc,
137 137
                         &huff_tab->cust_tab, 0);
138 138
                 if (result) {
... ...
@@ -237,7 +237,7 @@ void av_cold ff_ivi_free_buffers(IVIPlaneDesc *planes)
237 237
             av_freep(&planes[p].bands[b].bufs[2]);
238 238
 
239 239
             if (planes[p].bands[b].blk_vlc.cust_tab.table)
240
-                free_vlc(&planes[p].bands[b].blk_vlc.cust_tab);
240
+                ff_free_vlc(&planes[p].bands[b].blk_vlc.cust_tab);
241 241
             for (t = 0; t < planes[p].bands[b].num_tiles; t++)
242 242
                 av_freep(&planes[p].bands[b].tiles[t].mbs);
243 243
             av_freep(&planes[p].bands[b].tiles);
... ...
@@ -205,7 +205,7 @@ static av_always_inline void row_fdct(DCTELEM * data){
205 205
  */
206 206
 
207 207
 GLOBAL(void)
208
-fdct_ifast (DCTELEM * data)
208
+ff_fdct_ifast (DCTELEM * data)
209 209
 {
210 210
   int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
211 211
   int tmp10, tmp11, tmp12, tmp13;
... ...
@@ -271,7 +271,7 @@ fdct_ifast (DCTELEM * data)
271 271
  */
272 272
 
273 273
 GLOBAL(void)
274
-fdct_ifast248 (DCTELEM * data)
274
+ff_fdct_ifast248 (DCTELEM * data)
275 275
 {
276 276
   int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
277 277
   int tmp10, tmp11, tmp12, tmp13;
... ...
@@ -207,7 +207,7 @@ ones here or successive P-frames will drift too much with Reference frame coding
207 207
  * Perform the inverse DCT on one block of coefficients.
208 208
  */
209 209
 
210
-void j_rev_dct(DCTBLOCK data)
210
+void ff_j_rev_dct(DCTBLOCK data)
211 211
 {
212 212
   int32_t tmp0, tmp1, tmp2, tmp3;
213 213
   int32_t tmp10, tmp11, tmp12, tmp13;
... ...
@@ -945,7 +945,7 @@ void j_rev_dct(DCTBLOCK data)
945 945
 #define DCTSIZE 4
946 946
 #define DCTSTRIDE 8
947 947
 
948
-void j_rev_dct4(DCTBLOCK data)
948
+void ff_j_rev_dct4(DCTBLOCK data)
949 949
 {
950 950
   int32_t tmp0, tmp1, tmp2, tmp3;
951 951
   int32_t tmp10, tmp11, tmp12, tmp13;
... ...
@@ -1132,7 +1132,7 @@ void j_rev_dct4(DCTBLOCK data)
1132 1132
   }
1133 1133
 }
1134 1134
 
1135
-void j_rev_dct2(DCTBLOCK data){
1135
+void ff_j_rev_dct2(DCTBLOCK data){
1136 1136
   int d00, d01, d10, d11;
1137 1137
 
1138 1138
   data[0] += 4;
... ...
@@ -1147,7 +1147,7 @@ void j_rev_dct2(DCTBLOCK data){
1147 1147
   data[1+1*DCTSTRIDE]= (d01 - d11)>>3;
1148 1148
 }
1149 1149
 
1150
-void j_rev_dct1(DCTBLOCK data){
1150
+void ff_j_rev_dct1(DCTBLOCK data){
1151 1151
   data[0] = (data[0] + 4)>>3;
1152 1152
 }
1153 1153
 
... ...
@@ -41,7 +41,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
41 41
 {
42 42
     JvContext *s = avctx->priv_data;
43 43
     avctx->pix_fmt = PIX_FMT_PAL8;
44
-    dsputil_init(&s->dsp, avctx);
44
+    ff_dsputil_init(&s->dsp, avctx);
45 45
     return 0;
46 46
 }
47 47
 
... ...
@@ -383,7 +383,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
383 383
         if (lag_read_prob_header(&rac, &gb) < 0)
384 384
             return -1;
385 385
 
386
-        lag_rac_init(&rac, &gb, length - stride);
386
+        ff_lag_rac_init(&rac, &gb, length - stride);
387 387
 
388 388
         for (i = 0; i < height; i++)
389 389
             read += lag_decode_line(l, &rac, dst + (i * stride), width,
... ...
@@ -572,7 +572,7 @@ static av_cold int lag_decode_init(AVCodecContext *avctx)
572 572
     LagarithContext *l = avctx->priv_data;
573 573
     l->avctx = avctx;
574 574
 
575
-    dsputil_init(&l->dsp, avctx);
575
+    ff_dsputil_init(&l->dsp, avctx);
576 576
 
577 577
     return 0;
578 578
 }
... ...
@@ -30,7 +30,7 @@
30 30
 #include "get_bits.h"
31 31
 #include "lagarithrac.h"
32 32
 
33
-void lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
33
+void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
34 34
 {
35 35
     int i, j;
36 36
 
... ...
@@ -51,7 +51,7 @@ typedef struct lag_rac {
51 51
     uint8_t  range_hash[256];   /**< Hash table mapping upper byte to approximate symbol. */
52 52
 } lag_rac;
53 53
 
54
-void lag_rac_init(lag_rac *l, GetBitContext *gb, int length);
54
+void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length);
55 55
 
56 56
 /* TODO: Optimize */
57 57
 static inline void lag_rac_refill(lag_rac *l)
... ...
@@ -199,8 +199,8 @@ AVCodec ff_ljpeg_encoder = { //FIXME avoid MPV_* lossless JPEG should not need t
199 199
     .type           = AVMEDIA_TYPE_VIDEO,
200 200
     .id             = CODEC_ID_LJPEG,
201 201
     .priv_data_size = sizeof(MpegEncContext),
202
-    .init           = MPV_encode_init,
202
+    .init           = ff_MPV_encode_init,
203 203
     .encode         = encode_picture_lossless,
204
-    .close          = MPV_encode_end,
204
+    .close          = ff_MPV_encode_end,
205 205
     .long_name      = NULL_IF_CONFIG_SMALL("Lossless JPEG"),
206 206
 };
... ...
@@ -214,7 +214,7 @@ static int decode_frame(AVCodecContext *avctx,
214 214
 static av_cold void mdec_common_init(AVCodecContext *avctx){
215 215
     MDECContext * const a = avctx->priv_data;
216 216
 
217
-    dsputil_init(&a->dsp, avctx);
217
+    ff_dsputil_init(&a->dsp, avctx);
218 218
 
219 219
     a->mb_width   = (avctx->coded_width  + 15) / 16;
220 220
     a->mb_height  = (avctx->coded_height + 15) / 16;
... ...
@@ -121,7 +121,7 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx)
121 121
         av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n");
122 122
         return -1;
123 123
     }
124
-    dsputil_init(&ctx->dsp, avctx);
124
+    ff_dsputil_init(&ctx->dsp, avctx);
125 125
     ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, col_zag);
126 126
 
127 127
     return 0;
... ...
@@ -411,7 +411,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx)
411 411
     for(i = 0; i < 16; i++)
412 412
         if(ctx->buf_ptrs[i].data[0])
413 413
             ff_thread_release_buffer(avctx, &ctx->buf_ptrs[i]);
414
-    free_vlc(&ctx->vlc);
414
+    ff_free_vlc(&ctx->vlc);
415 415
 
416 416
     return 0;
417 417
 }
... ...
@@ -135,7 +135,7 @@ static void put_pixels16_mmi(uint8_t *block, const uint8_t *pixels, int line_siz
135 135
 }
136 136
 
137 137
 
138
-void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx)
138
+void ff_dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx)
139 139
 {
140 140
     const int idct_algo= avctx->idct_algo;
141 141
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
... ...
@@ -80,7 +80,7 @@ static void dct_unquantize_h263_mmi(MpegEncContext *s,
80 80
 }
81 81
 
82 82
 
83
-void MPV_common_init_mmi(MpegEncContext *s)
83
+void ff_MPV_common_init_mmi(MpegEncContext *s)
84 84
 {
85 85
     s->dct_unquantize_h263_intra =
86 86
     s->dct_unquantize_h263_inter = dct_unquantize_h263_mmi;
... ...
@@ -63,8 +63,8 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table,
63 63
     if (is_ac)
64 64
         huff_sym[0] = 16 * 256;
65 65
 
66
-    return init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1,
67
-                           huff_code, 2, 2, huff_sym, 2, 2, use_static);
66
+    return ff_init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1,
67
+                              huff_code, 2, 2, huff_sym, 2, 2, use_static);
68 68
 }
69 69
 
70 70
 static void build_basic_mjpeg_vlc(MJpegDecodeContext *s)
... ...
@@ -92,7 +92,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
92 92
     avcodec_get_frame_defaults(&s->picture);
93 93
 
94 94
     s->avctx = avctx;
95
-    dsputil_init(&s->dsp, avctx);
95
+    ff_dsputil_init(&s->dsp, avctx);
96 96
     ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
97 97
     s->buffer_size   = 0;
98 98
     s->buffer        = NULL;
... ...
@@ -193,7 +193,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
193 193
         len -= n;
194 194
 
195 195
         /* build VLC and flush previous vlc if present */
196
-        free_vlc(&s->vlcs[class][index]);
196
+        ff_free_vlc(&s->vlcs[class][index]);
197 197
         av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n",
198 198
                class, index, code_max + 1);
199 199
         if (build_vlc(&s->vlcs[class][index], bits_table, val_table,
... ...
@@ -201,7 +201,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
201 201
             return -1;
202 202
 
203 203
         if (class > 0) {
204
-            free_vlc(&s->vlcs[2][index]);
204
+            ff_free_vlc(&s->vlcs[2][index]);
205 205
             if (build_vlc(&s->vlcs[2][index], bits_table, val_table,
206 206
                           code_max + 1, 0, 0) < 0)
207 207
                 return -1;
... ...
@@ -1767,7 +1767,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
1767 1767
 
1768 1768
     for (i = 0; i < 3; i++) {
1769 1769
         for (j = 0; j < 4; j++)
1770
-            free_vlc(&s->vlcs[i][j]);
1770
+            ff_free_vlc(&s->vlcs[i][j]);
1771 1771
     }
1772 1772
     for (i = 0; i < MAX_COMPONENTS; i++) {
1773 1773
         av_freep(&s->blocks[i]);
... ...
@@ -469,7 +469,7 @@ static int amv_encode_picture(AVCodecContext *avctx,
469 469
         pic->data[i] += (pic->linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 ));
470 470
         pic->linesize[i] *= -1;
471 471
     }
472
-    return MPV_encode_picture(avctx,buf, buf_size, pic);
472
+    return ff_MPV_encode_picture(avctx,buf, buf_size, pic);
473 473
 }
474 474
 
475 475
 AVCodec ff_mjpeg_encoder = {
... ...
@@ -477,9 +477,9 @@ AVCodec ff_mjpeg_encoder = {
477 477
     .type           = AVMEDIA_TYPE_VIDEO,
478 478
     .id             = CODEC_ID_MJPEG,
479 479
     .priv_data_size = sizeof(MpegEncContext),
480
-    .init           = MPV_encode_init,
481
-    .encode         = MPV_encode_picture,
482
-    .close          = MPV_encode_end,
480
+    .init           = ff_MPV_encode_init,
481
+    .encode         = ff_MPV_encode_picture,
482
+    .close          = ff_MPV_encode_end,
483 483
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE},
484 484
     .long_name= NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"),
485 485
 };
... ...
@@ -489,9 +489,9 @@ AVCodec ff_amv_encoder = {
489 489
     .type           = AVMEDIA_TYPE_VIDEO,
490 490
     .id             = CODEC_ID_AMV,
491 491
     .priv_data_size = sizeof(MpegEncContext),
492
-    .init           = MPV_encode_init,
492
+    .init           = ff_MPV_encode_init,
493 493
     .encode         = amv_encode_picture,
494
-    .close          = MPV_encode_end,
494
+    .close          = ff_MPV_encode_end,
495 495
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE},
496 496
     .long_name      = NULL_IF_CONFIG_SMALL("AMV Video"),
497 497
 };
... ...
@@ -241,7 +241,7 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
241 241
     m->avctx = avctx;
242 242
     for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
243 243
         m->substream[substr].lossless_check_data = 0xffffffff;
244
-    dsputil_init(&m->dsp, avctx);
244
+    ff_dsputil_init(&m->dsp, avctx);
245 245
 
246 246
     avcodec_get_frame_defaults(&m->frame);
247 247
     avctx->coded_frame = &m->frame;
... ...
@@ -144,11 +144,11 @@ int main(int argc, char **argv)
144 144
 
145 145
     ctx = avcodec_alloc_context3(NULL);
146 146
     ctx->dsp_mask = AV_CPU_FLAG_FORCE;
147
-    dsputil_init(&cctx, ctx);
147
+    ff_dsputil_init(&cctx, ctx);
148 148
     for (c = 0; c < flags_size; c++) {
149 149
         int x;
150 150
         ctx->dsp_mask = AV_CPU_FLAG_FORCE | flags[c];
151
-        dsputil_init(&mmxctx, ctx);
151
+        ff_dsputil_init(&mmxctx, ctx);
152 152
 
153 153
         for (x = 0; x < 2; x++) {
154 154
             printf("%s for %dx%d pixels\n", c ? "mmx2" : "mmx",
... ...
@@ -57,7 +57,7 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
57 57
 
58 58
     motionpixels_tableinit();
59 59
     mp->avctx = avctx;
60
-    dsputil_init(&mp->dsp, avctx);
60
+    ff_dsputil_init(&mp->dsp, avctx);
61 61
     mp->changes_map = av_mallocz(avctx->width * h4);
62 62
     mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
63 63
     mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
... ...
@@ -287,7 +287,7 @@ static int mp_decode_frame(AVCodecContext *avctx,
287 287
     if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0))
288 288
         goto end;
289 289
     mp_decode_frame_helper(mp, &gb);
290
-    free_vlc(&mp->vlc);
290
+    ff_free_vlc(&mp->vlc);
291 291
 
292 292
 end:
293 293
     *data_size = sizeof(AVFrame);
... ...
@@ -74,7 +74,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
74 74
     }
75 75
     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
76 76
     av_lfg_init(&c->rnd, 0xDEADBEEF);
77
-    dsputil_init(&c->dsp, avctx);
77
+    ff_dsputil_init(&c->dsp, avctx);
78 78
     ff_mpadsp_init(&c->mpadsp);
79 79
     c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4);
80 80
     ff_mpc_init();
... ...
@@ -118,7 +118,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
118 118
     }
119 119
     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
120 120
     av_lfg_init(&c->rnd, 0xDEADBEEF);
121
-    dsputil_init(&c->dsp, avctx);
121
+    ff_dsputil_init(&c->dsp, avctx);
122 122
     ff_mpadsp_init(&c->mpadsp);
123 123
 
124 124
     ff_mpc_init();
... ...
@@ -184,13 +184,13 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
184 184
 
185 185
     q3_vlc[0].table = q3_0_table;
186 186
     q3_vlc[0].table_allocated = 512;
187
-    init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE,
187
+    ff_init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE,
188 188
              mpc8_q3_bits,  1, 1,
189 189
              mpc8_q3_codes, 1, 1,
190 190
              mpc8_q3_syms,  1, 1, INIT_VLC_USE_NEW_STATIC);
191 191
     q3_vlc[1].table = q3_1_table;
192 192
     q3_vlc[1].table_allocated = 516;
193
-    init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE,
193
+    ff_init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE,
194 194
              mpc8_q4_bits,  1, 1,
195 195
              mpc8_q4_codes, 1, 1,
196 196
              mpc8_q4_syms,  1, 1, INIT_VLC_USE_NEW_STATIC);
... ...
@@ -697,8 +697,8 @@ av_cold void ff_mpeg12_init_vlcs(void)
697 697
         INIT_VLC_STATIC(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11,
698 698
                         &table_mb_btype[0][1], 2, 1,
699 699
                         &table_mb_btype[0][0], 2, 1, 64);
700
-        init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
701
-        init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
700
+        ff_init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
701
+        ff_init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
702 702
 
703 703
         INIT_2D_VLC_RL(ff_rl_mpeg1, 680);
704 704
         INIT_2D_VLC_RL(ff_rl_mpeg2, 674);
... ...
@@ -1126,7 +1126,7 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
1126 1126
     for (i = 0; i < 64; i++)
1127 1127
        s2->dsp.idct_permutation[i]=i;
1128 1128
 
1129
-    MPV_decode_defaults(s2);
1129
+    ff_MPV_decode_defaults(s2);
1130 1130
 
1131 1131
     s->mpeg_enc_ctx.avctx  = avctx;
1132 1132
     s->mpeg_enc_ctx.flags  = avctx->flags;
... ...
@@ -1258,7 +1258,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
1258 1258
         if (s1->mpeg_enc_ctx_allocated) {
1259 1259
             ParseContext pc = s->parse_context;
1260 1260
             s->parse_context.buffer = 0;
1261
-            MPV_common_end(s);
1261
+            ff_MPV_common_end(s);
1262 1262
             s->parse_context = pc;
1263 1263
         }
1264 1264
 
... ...
@@ -1336,7 +1336,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
1336 1336
          * if DCT permutation is changed. */
1337 1337
         memcpy(old_permutation, s->dsp.idct_permutation, 64 * sizeof(uint8_t));
1338 1338
 
1339
-        if (MPV_common_init(s) < 0)
1339
+        if (ff_MPV_common_init(s) < 0)
1340 1340
             return -2;
1341 1341
 
1342 1342
         quant_matrix_rebuild(s->intra_matrix,        old_permutation, s->dsp.idct_permutation);
... ...
@@ -1600,7 +1600,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
1600 1600
 
1601 1601
     /* start frame decoding */
1602 1602
     if (s->first_field || s->picture_structure == PICT_FRAME) {
1603
-        if (MPV_frame_start(s, avctx) < 0)
1603
+        if (ff_MPV_frame_start(s, avctx) < 0)
1604 1604
             return -1;
1605 1605
 
1606 1606
         ff_er_frame_start(s);
... ...
@@ -1790,13 +1790,13 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
1790 1790
         s->dest[1] +=(16 >> lowres) >> s->chroma_x_shift;
1791 1791
         s->dest[2] +=(16 >> lowres) >> s->chroma_x_shift;
1792 1792
 
1793
-        MPV_decode_mb(s, s->block);
1793
+        ff_MPV_decode_mb(s, s->block);
1794 1794
 
1795 1795
         if (++s->mb_x >= s->mb_width) {
1796 1796
             const int mb_size = 16 >> s->avctx->lowres;
1797 1797
 
1798 1798
             ff_draw_horiz_band(s, mb_size*(s->mb_y >> field_pic), mb_size);
1799
-            MPV_report_decode_progress(s);
1799
+            ff_MPV_report_decode_progress(s);
1800 1800
 
1801 1801
             s->mb_x = 0;
1802 1802
             s->mb_y += 1 << field_pic;
... ...
@@ -1949,7 +1949,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
1949 1949
 
1950 1950
         ff_er_frame_end(s);
1951 1951
 
1952
-        MPV_frame_end(s);
1952
+        ff_MPV_frame_end(s);
1953 1953
 
1954 1954
         if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
1955 1955
             *pict = *(AVFrame*)s->current_picture_ptr;
... ...
@@ -2060,7 +2060,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
2060 2060
     /* start new MPEG-1 context decoding */
2061 2061
     s->out_format = FMT_MPEG1;
2062 2062
     if (s1->mpeg_enc_ctx_allocated) {
2063
-        MPV_common_end(s);
2063
+        ff_MPV_common_end(s);
2064 2064
     }
2065 2065
     s->width  = avctx->coded_width;
2066 2066
     s->height = avctx->coded_height;
... ...
@@ -2074,7 +2074,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
2074 2074
         if (avctx->idct_algo == FF_IDCT_AUTO)
2075 2075
             avctx->idct_algo = FF_IDCT_SIMPLE;
2076 2076
 
2077
-    if (MPV_common_init(s) < 0)
2077
+    if (ff_MPV_common_init(s) < 0)
2078 2078
         return -1;
2079 2079
     s1->mpeg_enc_ctx_allocated = 1;
2080 2080
 
... ...
@@ -2541,7 +2541,7 @@ static int mpeg_decode_end(AVCodecContext *avctx)
2541 2541
     Mpeg1Context *s = avctx->priv_data;
2542 2542
 
2543 2543
     if (s->mpeg_enc_ctx_allocated)
2544
-        MPV_common_end(&s->mpeg_enc_ctx);
2544
+        ff_MPV_common_end(&s->mpeg_enc_ctx);
2545 2545
     return 0;
2546 2546
 }
2547 2547
 
... ...
@@ -132,7 +132,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
132 132
 {
133 133
     MpegEncContext *s = avctx->priv_data;
134 134
 
135
-    if(MPV_encode_init(avctx) < 0)
135
+    if(ff_MPV_encode_init(avctx) < 0)
136 136
         return -1;
137 137
 
138 138
     if(find_frame_rate_index(s) < 0){
... ...
@@ -341,7 +341,7 @@ void ff_mpeg1_encode_slice_header(MpegEncContext *s){
341 341
     put_bits(&s->pb, 1, 0); /* slice extra information */
342 342
 }
343 343
 
344
-void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
344
+void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
345 345
 {
346 346
     mpeg1_encode_sequence_header(s);
347 347
 
... ...
@@ -666,7 +666,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
666 666
     }
667 667
 }
668 668
 
669
-void mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)
669
+void ff_mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)
670 670
 {
671 671
     if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6);
672 672
     else                                mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8);
... ...
@@ -725,8 +725,8 @@ void ff_mpeg1_encode_init(MpegEncContext *s)
725 725
         int i;
726 726
 
727 727
         done=1;
728
-        init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
729
-        init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
728
+        ff_init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
729
+        ff_init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
730 730
 
731 731
         for(i=0; i<64; i++)
732 732
         {
... ...
@@ -966,8 +966,8 @@ AVCodec ff_mpeg1video_encoder = {
966 966
     .id             = CODEC_ID_MPEG1VIDEO,
967 967
     .priv_data_size = sizeof(MpegEncContext),
968 968
     .init           = encode_init,
969
-    .encode         = MPV_encode_picture,
970
-    .close          = MPV_encode_end,
969
+    .encode         = ff_MPV_encode_picture,
970
+    .close          = ff_MPV_encode_end,
971 971
     .supported_framerates= avpriv_frame_rate_tab+1,
972 972
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
973 973
     .capabilities= CODEC_CAP_DELAY,
... ...
@@ -981,8 +981,8 @@ AVCodec ff_mpeg2video_encoder = {
981 981
     .id             = CODEC_ID_MPEG2VIDEO,
982 982
     .priv_data_size = sizeof(MpegEncContext),
983 983
     .init           = encode_init,
984
-    .encode         = MPV_encode_picture,
985
-    .close          = MPV_encode_end,
984
+    .encode         = ff_MPV_encode_picture,
985
+    .close          = ff_MPV_encode_end,
986 986
     .supported_framerates= avpriv_frame_rate_tab+1,
987 987
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE},
988 988
     .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
... ...
@@ -211,7 +211,7 @@ static const int8_t inter_rvlc_level[169]={
211 211
  1,  1,
212 212
 };
213 213
 
214
-RLTable rvlc_rl_inter = {
214
+RLTable ff_rvlc_rl_inter = {
215 215
     169,
216 216
     103,
217 217
     inter_rvlc,
... ...
@@ -315,7 +315,7 @@ static const int8_t intra_rvlc_level[169]={
315 315
  1,  1,
316 316
 };
317 317
 
318
-RLTable rvlc_rl_intra = {
318
+RLTable ff_rvlc_rl_intra = {
319 319
     169,
320 320
     103,
321 321
     intra_rvlc,
... ...
@@ -323,13 +323,13 @@ RLTable rvlc_rl_intra = {
323 323
     intra_rvlc_level,
324 324
 };
325 325
 
326
-const uint16_t sprite_trajectory_tab[15][2] = {
326
+const uint16_t ff_sprite_trajectory_tab[15][2] = {
327 327
  {0x00, 2}, {0x02, 3},  {0x03, 3},  {0x04, 3}, {0x05, 3}, {0x06, 3},
328 328
  {0x0E, 4}, {0x1E, 5},  {0x3E, 6},  {0x7E, 7}, {0xFE, 8},
329 329
  {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12},
330 330
 };
331 331
 
332
-const uint8_t mb_type_b_tab[4][2] = {
332
+const uint8_t ff_mb_type_b_tab[4][2] = {
333 333
  {1, 1}, {1, 2}, {1, 3}, {1, 4},
334 334
 };
335 335
 
... ...
@@ -369,7 +369,7 @@ const uint16_t ff_mpeg4_resync_prefix[8]={
369 369
     0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000
370 370
 };
371 371
 
372
-const uint8_t mpeg4_dc_threshold[8]={
372
+const uint8_t ff_mpeg4_dc_threshold[8]={
373 373
     99, 13, 15, 17, 19, 21, 23, 0
374 374
 };
375 375
 
... ...
@@ -66,11 +66,11 @@ extern const uint16_t ff_mpeg4_intra_vlc[103][2];
66 66
 extern RLTable ff_mpeg4_rl_intra;
67 67
 
68 68
 /* Note this is identical to the intra rvlc except that it is reordered. */
69
-extern RLTable rvlc_rl_inter;
70
-extern RLTable rvlc_rl_intra;
69
+extern RLTable ff_rvlc_rl_inter;
70
+extern RLTable ff_rvlc_rl_intra;
71 71
 
72
-extern const uint16_t sprite_trajectory_tab[15][2];
73
-extern const uint8_t mb_type_b_tab[4][2];
72
+extern const uint16_t ff_sprite_trajectory_tab[15][2];
73
+extern const uint8_t ff_mb_type_b_tab[4][2];
74 74
 
75 75
 /* these matrixes will be permuted for the idct */
76 76
 extern const int16_t ff_mpeg4_default_intra_matrix[64];
... ...
@@ -80,15 +80,15 @@ extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
80 80
 extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
81 81
 extern const uint16_t ff_mpeg4_resync_prefix[8];
82 82
 
83
-extern const uint8_t mpeg4_dc_threshold[8];
83
+extern const uint8_t ff_mpeg4_dc_threshold[8];
84 84
 
85
-void mpeg4_encode_mb(MpegEncContext *s,
86
-                    DCTELEM block[6][64],
87
-                    int motion_x, int motion_y);
88
-void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
89
-                   int dir);
85
+void ff_mpeg4_encode_mb(MpegEncContext *s,
86
+                        DCTELEM block[6][64],
87
+                        int motion_x, int motion_y);
88
+void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
89
+                      int dir);
90 90
 void ff_set_mpeg4_time(MpegEncContext * s);
91
-void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
91
+void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
92 92
 
93 93
 int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb);
94 94
 void ff_mpeg4_encode_video_packet_header(MpegEncContext *s);
... ...
@@ -99,7 +99,7 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s);
99 99
 void ff_clean_mpeg4_qscales(MpegEncContext *s);
100 100
 int ff_mpeg4_decode_partitions(MpegEncContext *s);
101 101
 int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s);
102
-int mpeg4_decode_video_packet_header(MpegEncContext *s);
102
+int ff_mpeg4_decode_video_packet_header(MpegEncContext *s);
103 103
 void ff_mpeg4_init_direct_mv(MpegEncContext *s);
104 104
 
105 105
 /**
... ...
@@ -53,8 +53,8 @@ static const int mb_type_b_map[4]= {
53 53
  * @param n block index (0-3 are luma, 4-5 are chroma)
54 54
  * @param dir the ac prediction direction
55 55
  */
56
-void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
57
-                   int dir)
56
+void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
57
+                      int dir)
58 58
 {
59 59
     int i;
60 60
     int16_t *ac_val, *ac_val1;
... ...
@@ -358,7 +358,7 @@ static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
358 358
  * Decode the next video packet.
359 359
  * @return <0 if something went wrong
360 360
  */
361
-int mpeg4_decode_video_packet_header(MpegEncContext *s)
361
+int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
362 362
 {
363 363
     int mb_num_bits= av_log2(s->mb_num - 1) + 1;
364 364
     int header_extension=0, mb_num, len;
... ...
@@ -654,13 +654,13 @@ try_again:
654 654
                     if ((cbpc & 16) == 0) {
655 655
                         /* 16x16 motion prediction */
656 656
 
657
-                        h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
657
+                        ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
658 658
                         if(!s->mcsel){
659
-                            mx = h263_decode_motion(s, pred_x, s->f_code);
659
+                            mx = ff_h263_decode_motion(s, pred_x, s->f_code);
660 660
                             if (mx >= 0xffff)
661 661
                                 return -1;
662 662
 
663
-                            my = h263_decode_motion(s, pred_y, s->f_code);
663
+                            my = ff_h263_decode_motion(s, pred_y, s->f_code);
664 664
                             if (my >= 0xffff)
665 665
                                 return -1;
666 666
                             s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
... ...
@@ -678,12 +678,12 @@ try_again:
678 678
                         int i;
679 679
                         s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
680 680
                         for(i=0;i<4;i++) {
681
-                            int16_t *mot_val= h263_pred_motion(s, i, 0, &pred_x, &pred_y);
682
-                            mx = h263_decode_motion(s, pred_x, s->f_code);
681
+                            int16_t *mot_val= ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
682
+                            mx = ff_h263_decode_motion(s, pred_x, s->f_code);
683 683
                             if (mx >= 0xffff)
684 684
                                 return -1;
685 685
 
686
-                            my = h263_decode_motion(s, pred_y, s->f_code);
686
+                            my = ff_h263_decode_motion(s, pred_y, s->f_code);
687 687
                             if (my >= 0xffff)
688 688
                                 return -1;
689 689
                             mot_val[0] = mx;
... ...
@@ -878,8 +878,8 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
878 878
           goto not_coded;
879 879
 
880 880
       if(rvlc){
881
-          rl = &rvlc_rl_intra;
882
-          rl_vlc = rvlc_rl_intra.rl_vlc[0];
881
+          rl = &ff_rvlc_rl_intra;
882
+          rl_vlc = ff_rvlc_rl_intra.rl_vlc[0];
883 883
       }else{
884 884
           rl = &ff_mpeg4_rl_intra;
885 885
           rl_vlc = ff_mpeg4_rl_intra.rl_vlc[0];
... ...
@@ -900,7 +900,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
900 900
             s->block_last_index[n] = i;
901 901
             return 0;
902 902
         }
903
-        if(rvlc) rl = &rvlc_rl_inter;
903
+        if(rvlc) rl = &ff_rvlc_rl_inter;
904 904
         else     rl = &ff_h263_rl_inter;
905 905
 
906 906
         scan_table = s->intra_scantable.permutated;
... ...
@@ -909,7 +909,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
909 909
             qmul=1;
910 910
             qadd=0;
911 911
             if(rvlc){
912
-                rl_vlc = rvlc_rl_inter.rl_vlc[0];
912
+                rl_vlc = ff_rvlc_rl_inter.rl_vlc[0];
913 913
             }else{
914 914
                 rl_vlc = ff_h263_rl_inter.rl_vlc[0];
915 915
             }
... ...
@@ -917,7 +917,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
917 917
             qmul = s->qscale << 1;
918 918
             qadd = (s->qscale - 1) | 1;
919 919
             if(rvlc){
920
-                rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale];
920
+                rl_vlc = ff_rvlc_rl_inter.rl_vlc[s->qscale];
921 921
             }else{
922 922
                 rl_vlc = ff_h263_rl_inter.rl_vlc[s->qscale];
923 923
             }
... ...
@@ -1076,7 +1076,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
1076 1076
             i -= i>>31; //if(i == -1) i=0;
1077 1077
         }
1078 1078
 
1079
-        mpeg4_pred_ac(s, block, n, dc_pred_dir);
1079
+        ff_mpeg4_pred_ac(s, block, n, dc_pred_dir);
1080 1080
         if (s->ac_pred) {
1081 1081
             i = 63; /* XXX: not optimal */
1082 1082
         }
... ...
@@ -1248,14 +1248,14 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1248 1248
                 s->field_select[0][0]= get_bits1(&s->gb);
1249 1249
                 s->field_select[0][1]= get_bits1(&s->gb);
1250 1250
 
1251
-                h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
1251
+                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
1252 1252
 
1253 1253
                 for(i=0; i<2; i++){
1254
-                    mx = h263_decode_motion(s, pred_x, s->f_code);
1254
+                    mx = ff_h263_decode_motion(s, pred_x, s->f_code);
1255 1255
                     if (mx >= 0xffff)
1256 1256
                         return -1;
1257 1257
 
1258
-                    my = h263_decode_motion(s, pred_y/2, s->f_code);
1258
+                    my = ff_h263_decode_motion(s, pred_y/2, s->f_code);
1259 1259
                     if (my >= 0xffff)
1260 1260
                         return -1;
1261 1261
 
... ...
@@ -1266,13 +1266,13 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1266 1266
                 s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0;
1267 1267
                 /* 16x16 motion prediction */
1268 1268
                 s->mv_type = MV_TYPE_16X16;
1269
-                h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
1270
-                mx = h263_decode_motion(s, pred_x, s->f_code);
1269
+                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
1270
+                mx = ff_h263_decode_motion(s, pred_x, s->f_code);
1271 1271
 
1272 1272
                 if (mx >= 0xffff)
1273 1273
                     return -1;
1274 1274
 
1275
-                my = h263_decode_motion(s, pred_y, s->f_code);
1275
+                my = ff_h263_decode_motion(s, pred_y, s->f_code);
1276 1276
 
1277 1277
                 if (my >= 0xffff)
1278 1278
                     return -1;
... ...
@@ -1283,12 +1283,12 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1283 1283
             s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0;
1284 1284
             s->mv_type = MV_TYPE_8X8;
1285 1285
             for(i=0;i<4;i++) {
1286
-                mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y);
1287
-                mx = h263_decode_motion(s, pred_x, s->f_code);
1286
+                mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
1287
+                mx = ff_h263_decode_motion(s, pred_x, s->f_code);
1288 1288
                 if (mx >= 0xffff)
1289 1289
                     return -1;
1290 1290
 
1291
-                my = h263_decode_motion(s, pred_y, s->f_code);
1291
+                my = ff_h263_decode_motion(s, pred_y, s->f_code);
1292 1292
                 if (my >= 0xffff)
1293 1293
                     return -1;
1294 1294
                 s->mv[0][i][0] = mx;
... ...
@@ -1384,8 +1384,8 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1384 1384
                 if(USES_LIST(mb_type, 0)){
1385 1385
                     s->mv_dir = MV_DIR_FORWARD;
1386 1386
 
1387
-                    mx = h263_decode_motion(s, s->last_mv[0][0][0], s->f_code);
1388
-                    my = h263_decode_motion(s, s->last_mv[0][0][1], s->f_code);
1387
+                    mx = ff_h263_decode_motion(s, s->last_mv[0][0][0], s->f_code);
1388
+                    my = ff_h263_decode_motion(s, s->last_mv[0][0][1], s->f_code);
1389 1389
                     s->last_mv[0][1][0]= s->last_mv[0][0][0]= s->mv[0][0][0] = mx;
1390 1390
                     s->last_mv[0][1][1]= s->last_mv[0][0][1]= s->mv[0][0][1] = my;
1391 1391
                 }
... ...
@@ -1393,8 +1393,8 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1393 1393
                 if(USES_LIST(mb_type, 1)){
1394 1394
                     s->mv_dir |= MV_DIR_BACKWARD;
1395 1395
 
1396
-                    mx = h263_decode_motion(s, s->last_mv[1][0][0], s->b_code);
1397
-                    my = h263_decode_motion(s, s->last_mv[1][0][1], s->b_code);
1396
+                    mx = ff_h263_decode_motion(s, s->last_mv[1][0][0], s->b_code);
1397
+                    my = ff_h263_decode_motion(s, s->last_mv[1][0][1], s->b_code);
1398 1398
                     s->last_mv[1][1][0]= s->last_mv[1][0][0]= s->mv[1][0][0] = mx;
1399 1399
                     s->last_mv[1][1][1]= s->last_mv[1][0][1]= s->mv[1][0][1] = my;
1400 1400
                 }
... ...
@@ -1405,8 +1405,8 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1405 1405
                     s->mv_dir = MV_DIR_FORWARD;
1406 1406
 
1407 1407
                     for(i=0; i<2; i++){
1408
-                        mx = h263_decode_motion(s, s->last_mv[0][i][0]  , s->f_code);
1409
-                        my = h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code);
1408
+                        mx = ff_h263_decode_motion(s, s->last_mv[0][i][0]  , s->f_code);
1409
+                        my = ff_h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code);
1410 1410
                         s->last_mv[0][i][0]=  s->mv[0][i][0] = mx;
1411 1411
                         s->last_mv[0][i][1]= (s->mv[0][i][1] = my)*2;
1412 1412
                     }
... ...
@@ -1416,8 +1416,8 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1416 1416
                     s->mv_dir |= MV_DIR_BACKWARD;
1417 1417
 
1418 1418
                     for(i=0; i<2; i++){
1419
-                        mx = h263_decode_motion(s, s->last_mv[1][i][0]  , s->b_code);
1420
-                        my = h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code);
1419
+                        mx = ff_h263_decode_motion(s, s->last_mv[1][i][0]  , s->b_code);
1420
+                        my = ff_h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code);
1421 1421
                         s->last_mv[1][i][0]=  s->mv[1][i][0] = mx;
1422 1422
                         s->last_mv[1][i][1]= (s->mv[1][i][1] = my)*2;
1423 1423
                     }
... ...
@@ -1429,8 +1429,8 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1429 1429
             if(IS_SKIP(mb_type))
1430 1430
                 mx=my=0;
1431 1431
             else{
1432
-                mx = h263_decode_motion(s, 0, 1);
1433
-                my = h263_decode_motion(s, 0, 1);
1432
+                mx = ff_h263_decode_motion(s, 0, 1);
1433
+                my = ff_h263_decode_motion(s, 0, 1);
1434 1434
             }
1435 1435
 
1436 1436
             s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
... ...
@@ -2035,7 +2035,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2035 2035
          if(s->pict_type == AV_PICTURE_TYPE_B)
2036 2036
             skip_bits_long(gb, s->cplx_estimation_trash_b);
2037 2037
 
2038
-         s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ];
2038
+         s->intra_dc_threshold= ff_mpeg4_dc_threshold[ get_bits(gb, 3) ];
2039 2039
          if(!s->progressive_sequence){
2040 2040
              s->top_field_first= get_bits1(gb);
2041 2041
              s->alternate_scan= get_bits1(gb);
... ...
@@ -2237,12 +2237,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
2237 2237
     if (!done) {
2238 2238
         done = 1;
2239 2239
 
2240
-        init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
2241
-        init_rl(&rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
2242
-        init_rl(&rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
2240
+        ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
2241
+        ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
2242
+        ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
2243 2243
         INIT_VLC_RL(ff_mpeg4_rl_intra, 554);
2244
-        INIT_VLC_RL(rvlc_rl_inter, 1072);
2245
-        INIT_VLC_RL(rvlc_rl_intra, 1072);
2244
+        INIT_VLC_RL(ff_rvlc_rl_inter, 1072);
2245
+        INIT_VLC_RL(ff_rvlc_rl_intra, 1072);
2246 2246
         INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
2247 2247
                  &ff_mpeg4_DCtab_lum[0][1], 2, 1,
2248 2248
                  &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512);
... ...
@@ -2250,11 +2250,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
2250 2250
                  &ff_mpeg4_DCtab_chrom[0][1], 2, 1,
2251 2251
                  &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512);
2252 2252
         INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
2253
-                 &sprite_trajectory_tab[0][1], 4, 2,
2254
-                 &sprite_trajectory_tab[0][0], 4, 2, 128);
2253
+                 &ff_sprite_trajectory_tab[0][1], 4, 2,
2254
+                 &ff_sprite_trajectory_tab[0][0], 4, 2, 128);
2255 2255
         INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
2256
-                 &mb_type_b_tab[0][1], 2, 1,
2257
-                 &mb_type_b_tab[0][0], 2, 1, 16);
2256
+                 &ff_mb_type_b_tab[0][1], 2, 1,
2257
+                 &ff_mb_type_b_tab[0][0], 2, 1, 16);
2258 2258
     }
2259 2259
 
2260 2260
     s->h263_pred = 1;
... ...
@@ -468,9 +468,9 @@ static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64],
468 468
 //FIXME this is duplicated to h263.c
469 469
 static const int dquant_code[5]= {1,0,9,2,3};
470 470
 
471
-void mpeg4_encode_mb(MpegEncContext * s,
472
-                    DCTELEM block[6][64],
473
-                    int motion_x, int motion_y)
471
+void ff_mpeg4_encode_mb(MpegEncContext * s,
472
+                        DCTELEM block[6][64],
473
+                        int motion_x, int motion_y)
474 474
 {
475 475
     int cbpc, cbpy, pred_x, pred_y;
476 476
     PutBitContext * const pb2    = s->data_partitioning                         ? &s->pb2    : &s->pb;
... ...
@@ -705,7 +705,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
705 705
                 }
706 706
 
707 707
                 /* motion vectors: 16x16 mode */
708
-                h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
708
+                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
709 709
 
710 710
                 ff_h263_encode_motion_vector(s, motion_x - pred_x,
711 711
                                                 motion_y - pred_y, s->f_code);
... ...
@@ -729,7 +729,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
729 729
                 }
730 730
 
731 731
                 /* motion vectors: 16x8 interlaced mode */
732
-                h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
732
+                ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
733 733
                 pred_y /=2;
734 734
 
735 735
                 put_bits(&s->pb, 1, s->field_select[0][0]);
... ...
@@ -757,7 +757,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
757 757
 
758 758
                 for(i=0; i<4; i++){
759 759
                     /* motion vectors: 8x8 mode*/
760
-                    h263_pred_motion(s, i, 0, &pred_x, &pred_y);
760
+                    ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y);
761 761
 
762 762
                     ff_h263_encode_motion_vector(s, s->current_picture.f.motion_val[0][ s->block_index[i] ][0] - pred_x,
763 763
                                                     s->current_picture.f.motion_val[0][ s->block_index[i] ][1] - pred_y, s->f_code);
... ...
@@ -1038,7 +1038,7 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n
1038 1038
 }
1039 1039
 
1040 1040
 /* write mpeg4 VOP header */
1041
-void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1041
+void ff_mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1042 1042
 {
1043 1043
     int time_incr;
1044 1044
     int time_div, time_mod;
... ...
@@ -1232,7 +1232,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
1232 1232
     int ret;
1233 1233
     static int done = 0;
1234 1234
 
1235
-    if((ret=MPV_encode_init(avctx)) < 0)
1235
+    if((ret=ff_MPV_encode_init(avctx)) < 0)
1236 1236
         return ret;
1237 1237
 
1238 1238
     if (!done) {
... ...
@@ -1240,7 +1240,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
1240 1240
 
1241 1241
         init_uni_dc_tab();
1242 1242
 
1243
-        init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
1243
+        ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
1244 1244
 
1245 1245
         init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len);
1246 1246
         init_uni_mpeg4_rl_tab(&ff_h263_rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len);
... ...
@@ -1346,8 +1346,8 @@ AVCodec ff_mpeg4_encoder = {
1346 1346
     .id             = CODEC_ID_MPEG4,
1347 1347
     .priv_data_size = sizeof(MpegEncContext),
1348 1348
     .init           = encode_init,
1349
-    .encode         = MPV_encode_picture,
1350
-    .close          = MPV_encode_end,
1349
+    .encode         = ff_MPV_encode_picture,
1350
+    .close          = ff_MPV_encode_end,
1351 1351
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
1352 1352
     .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
1353 1353
     .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
... ...
@@ -176,7 +176,7 @@ const uint8_t *avpriv_mpv_find_start_code(const uint8_t *restrict p,
176 176
 /* init common dct for both encoder and decoder */
177 177
 av_cold int ff_dct_common_init(MpegEncContext *s)
178 178
 {
179
-    dsputil_init(&s->dsp, s->avctx);
179
+    ff_dsputil_init(&s->dsp, s->avctx);
180 180
 
181 181
     s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c;
182 182
     s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c;
... ...
@@ -188,17 +188,17 @@ av_cold int ff_dct_common_init(MpegEncContext *s)
188 188
     s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
189 189
 
190 190
 #if HAVE_MMX
191
-    MPV_common_init_mmx(s);
191
+    ff_MPV_common_init_mmx(s);
192 192
 #elif ARCH_ALPHA
193
-    MPV_common_init_axp(s);
193
+    ff_MPV_common_init_axp(s);
194 194
 #elif HAVE_MMI
195
-    MPV_common_init_mmi(s);
195
+    ff_MPV_common_init_mmi(s);
196 196
 #elif ARCH_ARM
197
-    MPV_common_init_arm(s);
197
+    ff_MPV_common_init_arm(s);
198 198
 #elif HAVE_ALTIVEC
199
-    MPV_common_init_altivec(s);
199
+    ff_MPV_common_init_altivec(s);
200 200
 #elif ARCH_BFIN
201
-    MPV_common_init_bfin(s);
201
+    ff_MPV_common_init_bfin(s);
202 202
 #endif
203 203
 
204 204
     /* load & permutate scantables
... ...
@@ -458,7 +458,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base)
458 458
 
459 459
     return 0;
460 460
 fail:
461
-    return -1; // free() through MPV_common_end()
461
+    return -1; // free() through ff_MPV_common_end()
462 462
 }
463 463
 
464 464
 static void free_duplicate_context(MpegEncContext *s)
... ...
@@ -544,7 +544,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
544 544
         if (s1->context_initialized){
545 545
             s->picture_range_start  += MAX_PICTURE_COUNT;
546 546
             s->picture_range_end    += MAX_PICTURE_COUNT;
547
-            MPV_common_init(s);
547
+            ff_MPV_common_init(s);
548 548
         }
549 549
     }
550 550
 
... ...
@@ -618,7 +618,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
618 618
  * The changed fields will not depend upon the
619 619
  * prior state of the MpegEncContext.
620 620
  */
621
-void MPV_common_defaults(MpegEncContext *s)
621
+void ff_MPV_common_defaults(MpegEncContext *s)
622 622
 {
623 623
     s->y_dc_scale_table      =
624 624
     s->c_dc_scale_table      = ff_mpeg1_dc_scale_table;
... ...
@@ -647,16 +647,16 @@ void MPV_common_defaults(MpegEncContext *s)
647 647
  * the changed fields will not depend upon
648 648
  * the prior state of the MpegEncContext.
649 649
  */
650
-void MPV_decode_defaults(MpegEncContext *s)
650
+void ff_MPV_decode_defaults(MpegEncContext *s)
651 651
 {
652
-    MPV_common_defaults(s);
652
+    ff_MPV_common_defaults(s);
653 653
 }
654 654
 
655 655
 /**
656 656
  * init common structure for both encoder and decoder.
657 657
  * this assumes that some variables like width/height are already set
658 658
  */
659
-av_cold int MPV_common_init(MpegEncContext *s)
659
+av_cold int ff_MPV_common_init(MpegEncContext *s)
660 660
 {
661 661
     int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y;
662 662
     int nb_slices = (HAVE_THREADS &&
... ...
@@ -862,12 +862,12 @@ av_cold int MPV_common_init(MpegEncContext *s)
862 862
 
863 863
     return 0;
864 864
  fail:
865
-    MPV_common_end(s);
865
+    ff_MPV_common_end(s);
866 866
     return -1;
867 867
 }
868 868
 
869 869
 /* init common structure for both encoder and decoder */
870
-void MPV_common_end(MpegEncContext *s)
870
+void ff_MPV_common_end(MpegEncContext *s)
871 871
 {
872 872
     int i, j, k;
873 873
 
... ...
@@ -956,8 +956,8 @@ void MPV_common_end(MpegEncContext *s)
956 956
         avcodec_default_free_buffers(s->avctx);
957 957
 }
958 958
 
959
-void init_rl(RLTable *rl,
960
-             uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3])
959
+void ff_init_rl(RLTable *rl,
960
+                uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3])
961 961
 {
962 962
     int8_t  max_level[MAX_RUN + 1], max_run[MAX_LEVEL + 1];
963 963
     uint8_t index_run[MAX_RUN + 1];
... ...
@@ -1008,7 +1008,7 @@ void init_rl(RLTable *rl,
1008 1008
     }
1009 1009
 }
1010 1010
 
1011
-void init_vlc_rl(RLTable *rl)
1011
+void ff_init_vlc_rl(RLTable *rl)
1012 1012
 {
1013 1013
     int i, q;
1014 1014
 
... ...
@@ -1125,7 +1125,7 @@ static void update_noise_reduction(MpegEncContext *s)
1125 1125
  * generic function for encode/decode called after coding/decoding
1126 1126
  * the header and before a frame is coded/decoded.
1127 1127
  */
1128
-int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1128
+int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1129 1129
 {
1130 1130
     int i;
1131 1131
     Picture *pic;
... ...
@@ -1328,7 +1328,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1328 1328
 
1329 1329
 /* generic function for encode/decode called after a
1330 1330
  * frame has been coded/decoded. */
1331
-void MPV_frame_end(MpegEncContext *s)
1331
+void ff_MPV_frame_end(MpegEncContext *s)
1332 1332
 {
1333 1333
     int i;
1334 1334
     /* redraw edges for the frame if decoding didn't complete */
... ...
@@ -2156,7 +2156,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
2156 2156
 /**
2157 2157
  * find the lowest MB row referenced in the MVs
2158 2158
  */
2159
-int MPV_lowest_referenced_row(MpegEncContext *s, int dir)
2159
+int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir)
2160 2160
 {
2161 2161
     int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;
2162 2162
     int my, off, i, mvs;
... ...
@@ -2346,10 +2346,10 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
2346 2346
 
2347 2347
                 if(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) {
2348 2348
                     if (s->mv_dir & MV_DIR_FORWARD) {
2349
-                        ff_thread_await_progress((AVFrame*)s->last_picture_ptr, MPV_lowest_referenced_row(s, 0), 0);
2349
+                        ff_thread_await_progress((AVFrame*)s->last_picture_ptr, ff_MPV_lowest_referenced_row(s, 0), 0);
2350 2350
                     }
2351 2351
                     if (s->mv_dir & MV_DIR_BACKWARD) {
2352
-                        ff_thread_await_progress((AVFrame*)s->next_picture_ptr, MPV_lowest_referenced_row(s, 1), 0);
2352
+                        ff_thread_await_progress((AVFrame*)s->next_picture_ptr, ff_MPV_lowest_referenced_row(s, 1), 0);
2353 2353
                     }
2354 2354
                 }
2355 2355
 
... ...
@@ -2500,7 +2500,7 @@ skip_idct:
2500 2500
     }
2501 2501
 }
2502 2502
 
2503
-void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){
2503
+void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){
2504 2504
 #if !CONFIG_SMALL
2505 2505
     if(s->out_format == FMT_MPEG1) {
2506 2506
         if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1);
... ...
@@ -2864,7 +2864,7 @@ void ff_set_qscale(MpegEncContext * s, int qscale)
2864 2864
     s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ];
2865 2865
 }
2866 2866
 
2867
-void MPV_report_decode_progress(MpegEncContext *s)
2867
+void ff_MPV_report_decode_progress(MpegEncContext *s)
2868 2868
 {
2869 2869
     if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->error_occurred)
2870 2870
         ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0);
... ...
@@ -694,21 +694,21 @@ typedef struct MpegEncContext {
694 694
         &new_ctx->picture[pic - old_ctx->picture] : pic - (Picture*)old_ctx + (Picture*)new_ctx)\
695 695
     : NULL)
696 696
 
697
-void MPV_decode_defaults(MpegEncContext *s);
698
-int MPV_common_init(MpegEncContext *s);
699
-void MPV_common_end(MpegEncContext *s);
700
-void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]);
701
-int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
702
-void MPV_frame_end(MpegEncContext *s);
703
-int MPV_encode_init(AVCodecContext *avctx);
704
-int MPV_encode_end(AVCodecContext *avctx);
705
-int MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data);
706
-void MPV_common_init_mmx(MpegEncContext *s);
707
-void MPV_common_init_axp(MpegEncContext *s);
708
-void MPV_common_init_mmi(MpegEncContext *s);
709
-void MPV_common_init_arm(MpegEncContext *s);
710
-void MPV_common_init_altivec(MpegEncContext *s);
711
-void MPV_common_init_bfin(MpegEncContext *s);
697
+void ff_MPV_decode_defaults(MpegEncContext *s);
698
+int ff_MPV_common_init(MpegEncContext *s);
699
+void ff_MPV_common_end(MpegEncContext *s);
700
+void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]);
701
+int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
702
+void ff_MPV_frame_end(MpegEncContext *s);
703
+int ff_MPV_encode_init(AVCodecContext *avctx);
704
+int ff_MPV_encode_end(AVCodecContext *avctx);
705
+int ff_MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data);
706
+void ff_MPV_common_init_mmx(MpegEncContext *s);
707
+void ff_MPV_common_init_axp(MpegEncContext *s);
708
+void ff_MPV_common_init_mmi(MpegEncContext *s);
709
+void ff_MPV_common_init_arm(MpegEncContext *s);
710
+void ff_MPV_common_init_altivec(MpegEncContext *s);
711
+void ff_MPV_common_init_bfin(MpegEncContext *s);
712 712
 void ff_clean_intra_table_entries(MpegEncContext *s);
713 713
 void ff_draw_horiz_band(MpegEncContext *s, int y, int h);
714 714
 void ff_mpeg_flush(AVCodecContext *avctx);
... ...
@@ -718,8 +718,8 @@ void ff_release_unused_pictures(MpegEncContext *s, int remove_current);
718 718
 int ff_find_unused_picture(MpegEncContext *s, int shared);
719 719
 void ff_denoise_dct(MpegEncContext *s, DCTELEM *block);
720 720
 void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);
721
-int MPV_lowest_referenced_row(MpegEncContext *s, int dir);
722
-void MPV_report_decode_progress(MpegEncContext *s);
721
+int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir);
722
+void ff_MPV_report_decode_progress(MpegEncContext *s);
723 723
 int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src);
724 724
 const uint8_t *avpriv_mpv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
725 725
 void ff_set_qscale(MpegEncContext * s, int qscale);
... ...
@@ -796,10 +796,10 @@ int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
796 796
 extern const uint8_t ff_mpeg1_dc_scale_table[128];
797 797
 extern const uint8_t * const ff_mpeg2_dc_scale_table[4];
798 798
 
799
-void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
800
-void mpeg1_encode_mb(MpegEncContext *s,
801
-                     DCTELEM block[6][64],
802
-                     int motion_x, int motion_y);
799
+void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
800
+void ff_mpeg1_encode_mb(MpegEncContext *s,
801
+                        DCTELEM block[6][64],
802
+                        int motion_x, int motion_y);
803 803
 void ff_mpeg1_encode_init(MpegEncContext *s);
804 804
 void ff_mpeg1_encode_slice_header(MpegEncContext *s);
805 805
 void ff_mpeg1_clean_buffers(MpegEncContext *s);
... ...
@@ -821,19 +821,19 @@ int ff_h261_get_picture_format(int width, int height);
821 821
 
822 822
 
823 823
 /* rv10.c */
824
-void rv10_encode_picture_header(MpegEncContext *s, int picture_number);
825
-int rv_decode_dc(MpegEncContext *s, int n);
826
-void rv20_encode_picture_header(MpegEncContext *s, int picture_number);
824
+void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number);
825
+int ff_rv_decode_dc(MpegEncContext *s, int n);
826
+void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number);
827 827
 
828 828
 
829 829
 /* msmpeg4.c */
830
-void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
831
-void msmpeg4_encode_ext_header(MpegEncContext * s);
832
-void msmpeg4_encode_mb(MpegEncContext * s,
833
-                       DCTELEM block[6][64],
834
-                       int motion_x, int motion_y);
835
-int msmpeg4_decode_picture_header(MpegEncContext * s);
836
-int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
830
+void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
831
+void ff_msmpeg4_encode_ext_header(MpegEncContext * s);
832
+void ff_msmpeg4_encode_mb(MpegEncContext * s,
833
+                          DCTELEM block[6][64],
834
+                          int motion_x, int motion_y);
835
+int ff_msmpeg4_decode_picture_header(MpegEncContext * s);
836
+int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
837 837
 int ff_msmpeg4_decode_init(AVCodecContext *avctx);
838 838
 void ff_msmpeg4_encode_init(MpegEncContext *s);
839 839
 int ff_wmv2_decode_picture_header(MpegEncContext * s);
... ...
@@ -39,19 +39,13 @@
39 39
 #include "faandct.h"
40 40
 #include <limits.h>
41 41
 
42
-int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
43
-
44
-/**
45
- * Allocate a Picture.
46
- * The pixels are allocated/set by calling get_buffer() if shared = 0.
47
- */
48
-int alloc_picture(MpegEncContext *s, Picture *pic, int shared);
42
+int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
49 43
 
50 44
 /**
51 45
  * Set the given MpegEncContext to common defaults (same for encoding and decoding).
52 46
  * The changed fields will not depend upon the prior state of the MpegEncContext.
53 47
  */
54
-void MPV_common_defaults(MpegEncContext *s);
48
+void ff_MPV_common_defaults(MpegEncContext *s);
55 49
 
56 50
 static inline void gmc1_motion(MpegEncContext *s,
57 51
                                uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
... ...
@@ -90,7 +90,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
90 90
                 qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
91 91
                                         (qscale * quant_matrix[j]));
92 92
             }
93
-        } else if (dsp->fdct == fdct_ifast
93
+        } else if (dsp->fdct == ff_fdct_ifast
94 94
 #ifndef FAAN_POSTSCALE
95 95
                    || dsp->fdct == ff_faandct
96 96
 #endif
... ...
@@ -132,7 +132,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
132 132
 
133 133
         for (i = intra; i < 64; i++) {
134 134
             int64_t max = 8191;
135
-            if (dsp->fdct == fdct_ifast
135
+            if (dsp->fdct == ff_fdct_ifast
136 136
 #ifndef FAAN_POSTSCALE
137 137
                 || dsp->fdct == ff_faandct
138 138
 #endif
... ...
@@ -264,7 +264,7 @@ static void update_duplicate_context_after_me(MpegEncContext *dst,
264 264
 static void MPV_encode_defaults(MpegEncContext *s)
265 265
 {
266 266
     int i;
267
-    MPV_common_defaults(s);
267
+    ff_MPV_common_defaults(s);
268 268
 
269 269
     for (i = -16; i < 16; i++) {
270 270
         default_fcode_tab[i + MAX_MV] = 1;
... ...
@@ -274,7 +274,7 @@ static void MPV_encode_defaults(MpegEncContext *s)
274 274
 }
275 275
 
276 276
 /* init video encoder */
277
-av_cold int MPV_encode_init(AVCodecContext *avctx)
277
+av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
278 278
 {
279 279
     MpegEncContext *s = avctx->priv_data;
280 280
     int i;
... ...
@@ -665,7 +665,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
665 665
     case CODEC_ID_H263:
666 666
         if (!CONFIG_H263_ENCODER)
667 667
             return -1;
668
-        if (ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format),
668
+        if (ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format),
669 669
                              s->width, s->height) == 8) {
670 670
             av_log(avctx, AV_LOG_ERROR,
671 671
                    "The specified picture size of %dx%d is not valid for "
... ...
@@ -771,11 +771,11 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
771 771
                                 s->alternate_scan);
772 772
 
773 773
     /* init */
774
-    if (MPV_common_init(s) < 0)
774
+    if (ff_MPV_common_init(s) < 0)
775 775
         return -1;
776 776
 
777 777
     if (!s->dct_quantize)
778
-        s->dct_quantize = dct_quantize_c;
778
+        s->dct_quantize = ff_dct_quantize_c;
779 779
     if (!s->denoise_dct)
780 780
         s->denoise_dct  = denoise_dct_c;
781 781
     s->fast_dct_quantize = s->dct_quantize;
... ...
@@ -793,7 +793,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
793 793
     if (CONFIG_H261_ENCODER && s->out_format == FMT_H261)
794 794
         ff_h261_encode_init(s);
795 795
     if (CONFIG_H263_ENCODER && s->out_format == FMT_H263)
796
-        h263_encode_init(s);
796
+        ff_h263_encode_init(s);
797 797
     if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
798 798
         ff_msmpeg4_encode_init(s);
799 799
     if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
... ...
@@ -838,13 +838,13 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
838 838
     return 0;
839 839
 }
840 840
 
841
-av_cold int MPV_encode_end(AVCodecContext *avctx)
841
+av_cold int ff_MPV_encode_end(AVCodecContext *avctx)
842 842
 {
843 843
     MpegEncContext *s = avctx->priv_data;
844 844
 
845 845
     ff_rate_control_uninit(s);
846 846
 
847
-    MPV_common_end(s);
847
+    ff_MPV_common_end(s);
848 848
     if ((CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER) &&
849 849
         s->out_format == FMT_MJPEG)
850 850
         ff_mjpeg_encode_close(s);
... ...
@@ -1384,8 +1384,8 @@ no_output_pic:
1384 1384
     return 0;
1385 1385
 }
1386 1386
 
1387
-int MPV_encode_picture(AVCodecContext *avctx,
1388
-                       unsigned char *buf, int buf_size, void *data)
1387
+int ff_MPV_encode_picture(AVCodecContext *avctx,
1388
+                          unsigned char *buf, int buf_size, void *data)
1389 1389
 {
1390 1390
     MpegEncContext *s = avctx->priv_data;
1391 1391
     AVFrame *pic_arg  = data;
... ...
@@ -1417,7 +1417,7 @@ int MPV_encode_picture(AVCodecContext *avctx,
1417 1417
         //emms_c();
1418 1418
         //printf("qs:%f %f %d\n", s->new_picture.quality,
1419 1419
         //       s->current_picture.quality, s->qscale);
1420
-        MPV_frame_start(s, avctx);
1420
+        ff_MPV_frame_start(s, avctx);
1421 1421
 vbv_retry:
1422 1422
         if (encode_picture(s, s->picture_number) < 0)
1423 1423
             return -1;
... ...
@@ -1432,7 +1432,7 @@ vbv_retry:
1432 1432
         avctx->p_count     = s->mb_num - s->i_count - s->skip_count;
1433 1433
         avctx->skip_count  = s->skip_count;
1434 1434
 
1435
-        MPV_frame_end(s);
1435
+        ff_MPV_frame_end(s);
1436 1436
 
1437 1437
         if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
1438 1438
             ff_mjpeg_encode_picture_trailer(s);
... ...
@@ -1987,7 +1987,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
1987 1987
     }
1988 1988
 
1989 1989
     // non c quantize code returns incorrect block_last_index FIXME
1990
-    if (s->alternate_scan && s->dct_quantize != dct_quantize_c) {
1990
+    if (s->alternate_scan && s->dct_quantize != ff_dct_quantize_c) {
1991 1991
         for (i = 0; i < mb_block_count; i++) {
1992 1992
             int j;
1993 1993
             if (s->block_last_index[i] > 0) {
... ...
@@ -2005,17 +2005,17 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
2005 2005
     case CODEC_ID_MPEG1VIDEO:
2006 2006
     case CODEC_ID_MPEG2VIDEO:
2007 2007
         if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
2008
-            mpeg1_encode_mb(s, s->block, motion_x, motion_y);
2008
+            ff_mpeg1_encode_mb(s, s->block, motion_x, motion_y);
2009 2009
         break;
2010 2010
     case CODEC_ID_MPEG4:
2011 2011
         if (CONFIG_MPEG4_ENCODER)
2012
-            mpeg4_encode_mb(s, s->block, motion_x, motion_y);
2012
+            ff_mpeg4_encode_mb(s, s->block, motion_x, motion_y);
2013 2013
         break;
2014 2014
     case CODEC_ID_MSMPEG4V2:
2015 2015
     case CODEC_ID_MSMPEG4V3:
2016 2016
     case CODEC_ID_WMV1:
2017 2017
         if (CONFIG_MSMPEG4_ENCODER)
2018
-            msmpeg4_encode_mb(s, s->block, motion_x, motion_y);
2018
+            ff_msmpeg4_encode_mb(s, s->block, motion_x, motion_y);
2019 2019
         break;
2020 2020
     case CODEC_ID_WMV2:
2021 2021
         if (CONFIG_WMV2_ENCODER)
... ...
@@ -2031,7 +2031,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
2031 2031
     case CODEC_ID_RV10:
2032 2032
     case CODEC_ID_RV20:
2033 2033
         if (CONFIG_H263_ENCODER)
2034
-            h263_encode_mb(s, s->block, motion_x, motion_y);
2034
+            ff_h263_encode_mb(s, s->block, motion_x, motion_y);
2035 2035
         break;
2036 2036
     case CODEC_ID_MJPEG:
2037 2037
     case CODEC_ID_AMV:
... ...
@@ -2149,7 +2149,7 @@ static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegE
2149 2149
     }
2150 2150
 
2151 2151
     if(s->avctx->mb_decision == FF_MB_DECISION_RD){
2152
-        MPV_decode_mb(s, s->block);
2152
+        ff_MPV_decode_mb(s, s->block);
2153 2153
 
2154 2154
         score *= s->lambda2;
2155 2155
         score += sse_mb(s) << FF_LAMBDA_SHIFT;
... ...
@@ -2467,7 +2467,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2467 2467
                     case CODEC_ID_H263:
2468 2468
                     case CODEC_ID_H263P:
2469 2469
                         if (CONFIG_H263_ENCODER)
2470
-                            h263_encode_gob_header(s, mb_y);
2470
+                            ff_h263_encode_gob_header(s, mb_y);
2471 2471
                     break;
2472 2472
                     }
2473 2473
 
... ...
@@ -2760,7 +2760,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2760 2760
                 }
2761 2761
 
2762 2762
                 if(s->avctx->mb_decision == FF_MB_DECISION_BITS)
2763
-                    MPV_decode_mb(s, s->block);
2763
+                    ff_MPV_decode_mb(s, s->block);
2764 2764
             } else {
2765 2765
                 int motion_x = 0, motion_y = 0;
2766 2766
                 s->mv_type=MV_TYPE_16X16;
... ...
@@ -2880,7 +2880,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2880 2880
                     s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
2881 2881
                     ff_h263_update_motion_val(s);
2882 2882
 
2883
-                MPV_decode_mb(s, s->block);
2883
+                ff_MPV_decode_mb(s, s->block);
2884 2884
             }
2885 2885
 
2886 2886
             /* clean the MV table in IPS frames for direct mode in B frames */
... ...
@@ -2916,7 +2916,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2916 2916
 
2917 2917
     //not beautiful here but we must write it before flushing so it has to be here
2918 2918
     if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I)
2919
-        msmpeg4_encode_ext_header(s);
2919
+        ff_msmpeg4_encode_ext_header(s);
2920 2920
 
2921 2921
     write_slice_end(s);
2922 2922
 
... ...
@@ -3233,21 +3233,21 @@ static int encode_picture(MpegEncContext *s, int picture_number)
3233 3233
         if (CONFIG_WMV2_ENCODER && s->codec_id == CODEC_ID_WMV2)
3234 3234
             ff_wmv2_encode_picture_header(s, picture_number);
3235 3235
         else if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
3236
-            msmpeg4_encode_picture_header(s, picture_number);
3236
+            ff_msmpeg4_encode_picture_header(s, picture_number);
3237 3237
         else if (CONFIG_MPEG4_ENCODER && s->h263_pred)
3238
-            mpeg4_encode_picture_header(s, picture_number);
3238
+            ff_mpeg4_encode_picture_header(s, picture_number);
3239 3239
         else if (CONFIG_RV10_ENCODER && s->codec_id == CODEC_ID_RV10)
3240
-            rv10_encode_picture_header(s, picture_number);
3240
+            ff_rv10_encode_picture_header(s, picture_number);
3241 3241
         else if (CONFIG_RV20_ENCODER && s->codec_id == CODEC_ID_RV20)
3242
-            rv20_encode_picture_header(s, picture_number);
3242
+            ff_rv20_encode_picture_header(s, picture_number);
3243 3243
         else if (CONFIG_FLV_ENCODER && s->codec_id == CODEC_ID_FLV1)
3244 3244
             ff_flv_encode_picture_header(s, picture_number);
3245 3245
         else if (CONFIG_H263_ENCODER)
3246
-            h263_encode_picture_header(s, picture_number);
3246
+            ff_h263_encode_picture_header(s, picture_number);
3247 3247
         break;
3248 3248
     case FMT_MPEG1:
3249 3249
         if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
3250
-            mpeg1_encode_picture_header(s, picture_number);
3250
+            ff_mpeg1_encode_picture_header(s, picture_number);
3251 3251
         break;
3252 3252
     case FMT_H264:
3253 3253
         break;
... ...
@@ -3413,7 +3413,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
3413 3413
         int dct_coeff= FFABS(block[ scantable[i] ]);
3414 3414
         int best_score=256*256*256*120;
3415 3415
 
3416
-        if (   s->dsp.fdct == fdct_ifast
3416
+        if (   s->dsp.fdct == ff_fdct_ifast
3417 3417
 #ifndef FAAN_POSTSCALE
3418 3418
             || s->dsp.fdct == ff_faandct
3419 3419
 #endif
... ...
@@ -3983,7 +3983,7 @@ STOP_TIMER("iterative search")
3983 3983
     return last_non_zero;
3984 3984
 }
3985 3985
 
3986
-int dct_quantize_c(MpegEncContext *s,
3986
+int ff_dct_quantize_c(MpegEncContext *s,
3987 3987
                         DCTELEM *block, int n,
3988 3988
                         int qscale, int *overflow)
3989 3989
 {
... ...
@@ -4083,9 +4083,9 @@ AVCodec ff_h263_encoder = {
4083 4083
     .type           = AVMEDIA_TYPE_VIDEO,
4084 4084
     .id             = CODEC_ID_H263,
4085 4085
     .priv_data_size = sizeof(MpegEncContext),
4086
-    .init           = MPV_encode_init,
4087
-    .encode         = MPV_encode_picture,
4088
-    .close          = MPV_encode_end,
4086
+    .init           = ff_MPV_encode_init,
4087
+    .encode         = ff_MPV_encode_picture,
4088
+    .close          = ff_MPV_encode_end,
4089 4089
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
4090 4090
     .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"),
4091 4091
     .priv_class     = &h263_class,
... ...
@@ -4110,9 +4110,9 @@ AVCodec ff_h263p_encoder = {
4110 4110
     .type           = AVMEDIA_TYPE_VIDEO,
4111 4111
     .id             = CODEC_ID_H263P,
4112 4112
     .priv_data_size = sizeof(MpegEncContext),
4113
-    .init           = MPV_encode_init,
4114
-    .encode         = MPV_encode_picture,
4115
-    .close          = MPV_encode_end,
4113
+    .init           = ff_MPV_encode_init,
4114
+    .encode         = ff_MPV_encode_picture,
4115
+    .close          = ff_MPV_encode_end,
4116 4116
     .capabilities = CODEC_CAP_SLICE_THREADS,
4117 4117
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
4118 4118
     .long_name= NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
... ...
@@ -4124,9 +4124,9 @@ AVCodec ff_msmpeg4v2_encoder = {
4124 4124
     .type           = AVMEDIA_TYPE_VIDEO,
4125 4125
     .id             = CODEC_ID_MSMPEG4V2,
4126 4126
     .priv_data_size = sizeof(MpegEncContext),
4127
-    .init           = MPV_encode_init,
4128
-    .encode         = MPV_encode_picture,
4129
-    .close          = MPV_encode_end,
4127
+    .init           = ff_MPV_encode_init,
4128
+    .encode         = ff_MPV_encode_picture,
4129
+    .close          = ff_MPV_encode_end,
4130 4130
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
4131 4131
     .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
4132 4132
 };
... ...
@@ -4136,9 +4136,9 @@ AVCodec ff_msmpeg4v3_encoder = {
4136 4136
     .type           = AVMEDIA_TYPE_VIDEO,
4137 4137
     .id             = CODEC_ID_MSMPEG4V3,
4138 4138
     .priv_data_size = sizeof(MpegEncContext),
4139
-    .init           = MPV_encode_init,
4140
-    .encode         = MPV_encode_picture,
4141
-    .close          = MPV_encode_end,
4139
+    .init           = ff_MPV_encode_init,
4140
+    .encode         = ff_MPV_encode_picture,
4141
+    .close          = ff_MPV_encode_end,
4142 4142
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
4143 4143
     .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
4144 4144
 };
... ...
@@ -4148,9 +4148,9 @@ AVCodec ff_wmv1_encoder = {
4148 4148
     .type           = AVMEDIA_TYPE_VIDEO,
4149 4149
     .id             = CODEC_ID_WMV1,
4150 4150
     .priv_data_size = sizeof(MpegEncContext),
4151
-    .init           = MPV_encode_init,
4152
-    .encode         = MPV_encode_picture,
4153
-    .close          = MPV_encode_end,
4151
+    .init           = ff_MPV_encode_init,
4152
+    .encode         = ff_MPV_encode_picture,
4153
+    .close          = ff_MPV_encode_end,
4154 4154
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
4155 4155
     .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
4156 4156
 };
... ...
@@ -60,7 +60,7 @@ static uint32_t v2_dc_lum_table[512][2];
60 60
 static uint32_t v2_dc_chroma_table[512][2];
61 61
 
62 62
 /* vc1 externs */
63
-extern const uint8_t wmv3_dc_scale_table[32];
63
+extern const uint8_t ff_wmv3_dc_scale_table[32];
64 64
 
65 65
 #include "msmpeg4data.h"
66 66
 
... ...
@@ -138,8 +138,8 @@ static av_cold void common_init(MpegEncContext * s)
138 138
         break;
139 139
     case 3:
140 140
         if(s->workaround_bugs){
141
-            s->y_dc_scale_table= old_ff_y_dc_scale_table;
142
-            s->c_dc_scale_table= wmv1_c_dc_scale_table;
141
+            s->y_dc_scale_table= ff_old_ff_y_dc_scale_table;
142
+            s->c_dc_scale_table= ff_wmv1_c_dc_scale_table;
143 143
         } else{
144 144
             s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table;
145 145
             s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table;
... ...
@@ -147,13 +147,13 @@ static av_cold void common_init(MpegEncContext * s)
147 147
         break;
148 148
     case 4:
149 149
     case 5:
150
-        s->y_dc_scale_table= wmv1_y_dc_scale_table;
151
-        s->c_dc_scale_table= wmv1_c_dc_scale_table;
150
+        s->y_dc_scale_table= ff_wmv1_y_dc_scale_table;
151
+        s->c_dc_scale_table= ff_wmv1_c_dc_scale_table;
152 152
         break;
153 153
 #if CONFIG_VC1_DECODER
154 154
     case 6:
155
-        s->y_dc_scale_table= wmv3_dc_scale_table;
156
-        s->c_dc_scale_table= wmv3_dc_scale_table;
155
+        s->y_dc_scale_table= ff_wmv3_dc_scale_table;
156
+        s->c_dc_scale_table= ff_wmv3_dc_scale_table;
157 157
         break;
158 158
 #endif
159 159
 
... ...
@@ -161,10 +161,10 @@ static av_cold void common_init(MpegEncContext * s)
161 161
 
162 162
 
163 163
     if(s->msmpeg4_version>=4){
164
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable  , wmv1_scantable[1]);
165
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, wmv1_scantable[2]);
166
-        ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, wmv1_scantable[3]);
167
-        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable  , wmv1_scantable[0]);
164
+        ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable  , ff_wmv1_scantable[1]);
165
+        ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_wmv1_scantable[2]);
166
+        ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_wmv1_scantable[3]);
167
+        ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable  , ff_wmv1_scantable[0]);
168 168
     }
169 169
     //Note the default tables are set in common_init in mpegvideo.c
170 170
 
... ...
@@ -259,10 +259,10 @@ av_cold void ff_msmpeg4_encode_init(MpegEncContext *s)
259 259
     if (!init_done) {
260 260
         /* init various encoding tables */
261 261
         init_done = 1;
262
-        init_mv_table(&mv_tables[0]);
263
-        init_mv_table(&mv_tables[1]);
262
+        init_mv_table(&ff_mv_tables[0]);
263
+        init_mv_table(&ff_mv_tables[1]);
264 264
         for(i=0;i<NB_RL_TABLES;i++)
265
-            init_rl(&rl_table[i], static_rl_table_store[i]);
265
+            ff_init_rl(&ff_rl_table[i], static_rl_table_store[i]);
266 266
 
267 267
         for(i=0; i<NB_RL_TABLES; i++){
268 268
             int level;
... ...
@@ -271,7 +271,7 @@ av_cold void ff_msmpeg4_encode_init(MpegEncContext *s)
271 271
                 for(run=0; run<=MAX_RUN; run++){
272 272
                     int last;
273 273
                     for(last=0; last<2; last++){
274
-                        rl_length[i][level][run][last]= get_size_of_code(s, &rl_table[  i], last, run, level, 0);
274
+                        rl_length[i][level][run][last]= get_size_of_code(s, &ff_rl_table[  i], last, run, level, 0);
275 275
                     }
276 276
                 }
277 277
             }
... ...
@@ -347,7 +347,7 @@ static void find_best_tables(MpegEncContext * s)
347 347
 }
348 348
 
349 349
 /* write MSMPEG4 compatible frame header */
350
-void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
350
+void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
351 351
 {
352 352
     find_best_tables(s);
353 353
 
... ...
@@ -373,7 +373,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
373 373
         put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height);
374 374
 
375 375
         if(s->msmpeg4_version==4){
376
-            msmpeg4_encode_ext_header(s);
376
+            ff_msmpeg4_encode_ext_header(s);
377 377
             if(s->bit_rate>MBAC_BITRATE)
378 378
                 put_bits(&s->pb, 1, s->per_mb_rl_table);
379 379
         }
... ...
@@ -406,7 +406,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
406 406
     s->esc3_run_length= 0;
407 407
 }
408 408
 
409
-void msmpeg4_encode_ext_header(MpegEncContext * s)
409
+void ff_msmpeg4_encode_ext_header(MpegEncContext * s)
410 410
 {
411 411
         put_bits(&s->pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
412 412
 
... ...
@@ -474,7 +474,7 @@ void ff_msmpeg4_encode_motion(MpegEncContext * s,
474 474
         (unsigned)my >= 64)
475 475
         av_log(s->avctx, AV_LOG_ERROR, "error mx=%d my=%d\n", mx, my);
476 476
 #endif
477
-    mv = &mv_tables[s->mv_table_index];
477
+    mv = &ff_mv_tables[s->mv_table_index];
478 478
 
479 479
     code = mv->table_mv_index[(mx << 6) | my];
480 480
     put_bits(&s->pb,
... ...
@@ -507,7 +507,7 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
507 507
     if (val == 0) {
508 508
         /* zero vector */
509 509
         code = 0;
510
-        put_bits(&s->pb, mvtab[code][1], mvtab[code][0]);
510
+        put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
511 511
     } else {
512 512
         bit_size = s->f_code - 1;
513 513
         range = 1 << bit_size;
... ...
@@ -526,16 +526,16 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
526 526
         code = (val >> bit_size) + 1;
527 527
         bits = val & (range - 1);
528 528
 
529
-        put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign);
529
+        put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign);
530 530
         if (bit_size > 0) {
531 531
             put_bits(&s->pb, bit_size, bits);
532 532
         }
533 533
     }
534 534
 }
535 535
 
536
-void msmpeg4_encode_mb(MpegEncContext * s,
537
-                       DCTELEM block[6][64],
538
-                       int motion_x, int motion_y)
536
+void ff_msmpeg4_encode_mb(MpegEncContext * s,
537
+                          DCTELEM block[6][64],
538
+                          int motion_x, int motion_y)
539 539
 {
540 540
     int cbp, coded_cbp, i;
541 541
     int pred_x, pred_y;
... ...
@@ -564,8 +564,8 @@ void msmpeg4_encode_mb(MpegEncContext * s,
564 564
 
565 565
         if(s->msmpeg4_version<=2){
566 566
             put_bits(&s->pb,
567
-                     v2_mb_type[cbp&3][1],
568
-                     v2_mb_type[cbp&3][0]);
567
+                     ff_v2_mb_type[cbp&3][1],
568
+                     ff_v2_mb_type[cbp&3][0]);
569 569
             if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
570 570
             else             coded_cbp= cbp;
571 571
 
... ...
@@ -575,18 +575,18 @@ void msmpeg4_encode_mb(MpegEncContext * s,
575 575
 
576 576
             s->misc_bits += get_bits_diff(s);
577 577
 
578
-            h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
578
+            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
579 579
             msmpeg4v2_encode_motion(s, motion_x - pred_x);
580 580
             msmpeg4v2_encode_motion(s, motion_y - pred_y);
581 581
         }else{
582 582
             put_bits(&s->pb,
583
-                     table_mb_non_intra[cbp + 64][1],
584
-                     table_mb_non_intra[cbp + 64][0]);
583
+                     ff_table_mb_non_intra[cbp + 64][1],
584
+                     ff_table_mb_non_intra[cbp + 64][0]);
585 585
 
586 586
             s->misc_bits += get_bits_diff(s);
587 587
 
588 588
             /* motion vector */
589
-            h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
589
+            ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
590 590
             ff_msmpeg4_encode_motion(s, motion_x - pred_x,
591 591
                                   motion_y - pred_y);
592 592
         }
... ...
@@ -617,13 +617,13 @@ void msmpeg4_encode_mb(MpegEncContext * s,
617 617
         if(s->msmpeg4_version<=2){
618 618
             if (s->pict_type == AV_PICTURE_TYPE_I) {
619 619
                 put_bits(&s->pb,
620
-                         v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]);
620
+                         ff_v2_intra_cbpc[cbp&3][1], ff_v2_intra_cbpc[cbp&3][0]);
621 621
             } else {
622 622
                 if (s->use_skip_mb_code)
623 623
                     put_bits(&s->pb, 1, 0);     /* mb coded */
624 624
                 put_bits(&s->pb,
625
-                         v2_mb_type[(cbp&3) + 4][1],
626
-                         v2_mb_type[(cbp&3) + 4][0]);
625
+                         ff_v2_mb_type[(cbp&3) + 4][1],
626
+                         ff_v2_mb_type[(cbp&3) + 4][0]);
627 627
             }
628 628
             put_bits(&s->pb, 1, 0);             /* no AC prediction yet */
629 629
             put_bits(&s->pb,
... ...
@@ -637,13 +637,13 @@ void msmpeg4_encode_mb(MpegEncContext * s,
637 637
                 if (s->use_skip_mb_code)
638 638
                     put_bits(&s->pb, 1, 0);     /* mb coded */
639 639
                 put_bits(&s->pb,
640
-                         table_mb_non_intra[cbp][1],
641
-                         table_mb_non_intra[cbp][0]);
640
+                         ff_table_mb_non_intra[cbp][1],
641
+                         ff_table_mb_non_intra[cbp][0]);
642 642
             }
643 643
             put_bits(&s->pb, 1, 0);             /* no AC prediction yet */
644 644
             if(s->inter_intra_pred){
645 645
                 s->h263_aic_dir=0;
646
-                put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]);
646
+                put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]);
647 647
             }
648 648
         }
649 649
         s->misc_bits += get_bits_diff(s);
... ...
@@ -927,15 +927,15 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
927 927
         msmpeg4_encode_dc(s, block[0], n, &dc_pred_dir);
928 928
         i = 1;
929 929
         if (n < 4) {
930
-            rl = &rl_table[s->rl_table_index];
930
+            rl = &ff_rl_table[s->rl_table_index];
931 931
         } else {
932
-            rl = &rl_table[3 + s->rl_chroma_table_index];
932
+            rl = &ff_rl_table[3 + s->rl_chroma_table_index];
933 933
         }
934 934
         run_diff = s->msmpeg4_version>=4;
935 935
         scantable= s->intra_scantable.permutated;
936 936
     } else {
937 937
         i = 0;
938
-        rl = &rl_table[3 + s->rl_table_index];
938
+        rl = &ff_rl_table[3 + s->rl_table_index];
939 939
         if(s->msmpeg4_version<=2)
940 940
             run_diff = 0;
941 941
         else
... ...
@@ -1134,7 +1134,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
1134 1134
         cbp|= cbpy<<2;
1135 1135
         if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C;
1136 1136
 
1137
-        h263_pred_motion(s, 0, 0, &mx, &my);
1137
+        ff_h263_pred_motion(s, 0, 0, &mx, &my);
1138 1138
         mx= msmpeg4v2_decode_motion(s, mx, 1);
1139 1139
         my= msmpeg4v2_decode_motion(s, my, 1);
1140 1140
 
... ...
@@ -1220,7 +1220,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
1220 1220
             s->rl_table_index = decode012(&s->gb);
1221 1221
             s->rl_chroma_table_index = s->rl_table_index;
1222 1222
         }
1223
-        h263_pred_motion(s, 0, 0, &mx, &my);
1223
+        ff_h263_pred_motion(s, 0, 0, &mx, &my);
1224 1224
         if (ff_msmpeg4_decode_motion(s, &mx, &my) < 0)
1225 1225
             return -1;
1226 1226
         s->mv_dir = MV_DIR_FORWARD;
... ...
@@ -1271,20 +1271,20 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
1271 1271
         done = 1;
1272 1272
 
1273 1273
         for(i=0;i<NB_RL_TABLES;i++) {
1274
-            init_rl(&rl_table[i], static_rl_table_store[i]);
1274
+            ff_init_rl(&ff_rl_table[i], static_rl_table_store[i]);
1275 1275
         }
1276
-        INIT_VLC_RL(rl_table[0], 642);
1277
-        INIT_VLC_RL(rl_table[1], 1104);
1278
-        INIT_VLC_RL(rl_table[2], 554);
1279
-        INIT_VLC_RL(rl_table[3], 940);
1280
-        INIT_VLC_RL(rl_table[4], 962);
1281
-        INIT_VLC_RL(rl_table[5], 554);
1282
-
1283
-        mv = &mv_tables[0];
1276
+        INIT_VLC_RL(ff_rl_table[0], 642);
1277
+        INIT_VLC_RL(ff_rl_table[1], 1104);
1278
+        INIT_VLC_RL(ff_rl_table[2], 554);
1279
+        INIT_VLC_RL(ff_rl_table[3], 940);
1280
+        INIT_VLC_RL(ff_rl_table[4], 962);
1281
+        INIT_VLC_RL(ff_rl_table[5], 554);
1282
+
1283
+        mv = &ff_mv_tables[0];
1284 1284
         INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, mv->n + 1,
1285 1285
                     mv->table_mv_bits, 1, 1,
1286 1286
                     mv->table_mv_code, 2, 2, 3714);
1287
-        mv = &mv_tables[1];
1287
+        mv = &ff_mv_tables[1];
1288 1288
         INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, mv->n + 1,
1289 1289
                     mv->table_mv_bits, 1, 1,
1290 1290
                     mv->table_mv_code, 2, 2, 2694);
... ...
@@ -1310,35 +1310,35 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
1310 1310
                  &v2_dc_chroma_table[0][0], 8, 4, 1506);
1311 1311
 
1312 1312
         INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4,
1313
-                 &v2_intra_cbpc[0][1], 2, 1,
1314
-                 &v2_intra_cbpc[0][0], 2, 1, 8);
1313
+                 &ff_v2_intra_cbpc[0][1], 2, 1,
1314
+                 &ff_v2_intra_cbpc[0][0], 2, 1, 8);
1315 1315
         INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8,
1316
-                 &v2_mb_type[0][1], 2, 1,
1317
-                 &v2_mb_type[0][0], 2, 1, 128);
1316
+                 &ff_v2_mb_type[0][1], 2, 1,
1317
+                 &ff_v2_mb_type[0][0], 2, 1, 128);
1318 1318
         INIT_VLC_STATIC(&v2_mv_vlc, V2_MV_VLC_BITS, 33,
1319
-                 &mvtab[0][1], 2, 1,
1320
-                 &mvtab[0][0], 2, 1, 538);
1319
+                 &ff_mvtab[0][1], 2, 1,
1320
+                 &ff_mvtab[0][0], 2, 1, 538);
1321 1321
 
1322 1322
         INIT_VLC_STATIC(&ff_mb_non_intra_vlc[0], MB_NON_INTRA_VLC_BITS, 128,
1323
-                     &wmv2_inter_table[0][0][1], 8, 4,
1324
-                     &wmv2_inter_table[0][0][0], 8, 4, 1636);
1323
+                     &ff_wmv2_inter_table[0][0][1], 8, 4,
1324
+                     &ff_wmv2_inter_table[0][0][0], 8, 4, 1636);
1325 1325
         INIT_VLC_STATIC(&ff_mb_non_intra_vlc[1], MB_NON_INTRA_VLC_BITS, 128,
1326
-                     &wmv2_inter_table[1][0][1], 8, 4,
1327
-                     &wmv2_inter_table[1][0][0], 8, 4, 2648);
1326
+                     &ff_wmv2_inter_table[1][0][1], 8, 4,
1327
+                     &ff_wmv2_inter_table[1][0][0], 8, 4, 2648);
1328 1328
         INIT_VLC_STATIC(&ff_mb_non_intra_vlc[2], MB_NON_INTRA_VLC_BITS, 128,
1329
-                     &wmv2_inter_table[2][0][1], 8, 4,
1330
-                     &wmv2_inter_table[2][0][0], 8, 4, 1532);
1329
+                     &ff_wmv2_inter_table[2][0][1], 8, 4,
1330
+                     &ff_wmv2_inter_table[2][0][0], 8, 4, 1532);
1331 1331
         INIT_VLC_STATIC(&ff_mb_non_intra_vlc[3], MB_NON_INTRA_VLC_BITS, 128,
1332
-                     &wmv2_inter_table[3][0][1], 8, 4,
1333
-                     &wmv2_inter_table[3][0][0], 8, 4, 2488);
1332
+                     &ff_wmv2_inter_table[3][0][1], 8, 4,
1333
+                     &ff_wmv2_inter_table[3][0][0], 8, 4, 2488);
1334 1334
 
1335 1335
         INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
1336 1336
                  &ff_msmp4_mb_i_table[0][1], 4, 2,
1337 1337
                  &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
1338 1338
 
1339 1339
         INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
1340
-                 &table_inter_intra[0][1], 2, 1,
1341
-                 &table_inter_intra[0][0], 2, 1, 8);
1340
+                 &ff_table_inter_intra[0][1], 2, 1,
1341
+                 &ff_table_inter_intra[0][0], 2, 1, 8);
1342 1342
     }
1343 1343
 
1344 1344
     switch(s->msmpeg4_version){
... ...
@@ -1363,7 +1363,7 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx)
1363 1363
     return 0;
1364 1364
 }
1365 1365
 
1366
-int msmpeg4_decode_picture_header(MpegEncContext * s)
1366
+int ff_msmpeg4_decode_picture_header(MpegEncContext * s)
1367 1367
 {
1368 1368
     int code;
1369 1369
 
... ...
@@ -1430,7 +1430,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
1430 1430
             s->dc_table_index = get_bits1(&s->gb);
1431 1431
             break;
1432 1432
         case 4:
1433
-            msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8);
1433
+            ff_msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8);
1434 1434
 
1435 1435
             if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb);
1436 1436
             else                           s->per_mb_rl_table= 0;
... ...
@@ -1517,7 +1517,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
1517 1517
     return 0;
1518 1518
 }
1519 1519
 
1520
-int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size)
1520
+int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size)
1521 1521
 {
1522 1522
     int left= buf_size*8 - get_bits_count(&s->gb);
1523 1523
     int length= s->msmpeg4_version>=3 ? 17 : 16;
... ...
@@ -1627,13 +1627,13 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
1627 1627
             else                    return -1;
1628 1628
         }
1629 1629
         if (n < 4) {
1630
-            rl = &rl_table[s->rl_table_index];
1630
+            rl = &ff_rl_table[s->rl_table_index];
1631 1631
             if(level > 256*s->y_dc_scale){
1632 1632
                 av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ L qscale: %d//\n", s->qscale);
1633 1633
                 if(!s->inter_intra_pred) return -1;
1634 1634
             }
1635 1635
         } else {
1636
-            rl = &rl_table[3 + s->rl_chroma_table_index];
1636
+            rl = &ff_rl_table[3 + s->rl_chroma_table_index];
1637 1637
             if(level > 256*s->c_dc_scale){
1638 1638
                 av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ C qscale: %d//\n", s->qscale);
1639 1639
                 if(!s->inter_intra_pred) return -1;
... ...
@@ -1659,7 +1659,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
1659 1659
         qmul = s->qscale << 1;
1660 1660
         qadd = (s->qscale - 1) | 1;
1661 1661
         i = -1;
1662
-        rl = &rl_table[3 + s->rl_table_index];
1662
+        rl = &ff_rl_table[3 + s->rl_table_index];
1663 1663
 
1664 1664
         if(s->msmpeg4_version==2)
1665 1665
             run_diff = 0;
... ...
@@ -1829,7 +1829,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
1829 1829
   }
1830 1830
  not_coded:
1831 1831
     if (s->mb_intra) {
1832
-        mpeg4_pred_ac(s, block, n, dc_pred_dir);
1832
+        ff_mpeg4_pred_ac(s, block, n, dc_pred_dir);
1833 1833
         if (s->ac_pred) {
1834 1834
             i = 63; /* XXX: not optimal */
1835 1835
         }
... ...
@@ -1846,7 +1846,7 @@ int ff_msmpeg4_decode_motion(MpegEncContext * s,
1846 1846
     MVTable *mv;
1847 1847
     int code, mx, my;
1848 1848
 
1849
-    mv = &mv_tables[s->mv_table_index];
1849
+    mv = &ff_mv_tables[s->mv_table_index];
1850 1850
 
1851 1851
     code = get_vlc2(&s->gb, mv->vlc.table, MV_VLC_BITS, 2);
1852 1852
     if (code < 0){
... ...
@@ -54,7 +54,7 @@ const uint16_t ff_msmp4_mb_i_table[64][2] = {
54 54
 };
55 55
 
56 56
 /* non intra picture macroblock coded block pattern + mb type */
57
-const uint32_t table_mb_non_intra[128][2] = {
57
+const uint32_t ff_table_mb_non_intra[128][2] = {
58 58
 {   0x40,  7 },{   0x13c9, 13 },{   0x9fd, 12 },{   0x1fc, 15 },
59 59
 {  0x9fc, 12 },{    0xa83, 18 },{ 0x12d34, 17 },{  0x83bc, 16 },
60 60
 {  0x83a, 12 },{    0x7f8, 17 },{   0x3fd, 16 },{   0x3ff, 16 },
... ...
@@ -592,15 +592,15 @@ static const int8_t table4_run[168] = {
592 592
  29, 30, 31, 32, 33, 34, 35, 36,
593 593
 };
594 594
 
595
-extern const uint16_t inter_vlc[103][2];
596
-extern const int8_t inter_level[102];
597
-extern const int8_t inter_run[102];
595
+extern const uint16_t ff_inter_vlc[103][2];
596
+extern const int8_t ff_inter_level[102];
597
+extern const int8_t ff_inter_run[102];
598 598
 
599 599
 extern const uint16_t ff_mpeg4_intra_vlc[103][2];
600 600
 extern const int8_t ff_mpeg4_intra_level[102];
601 601
 extern const int8_t ff_mpeg4_intra_run[102];
602 602
 
603
-RLTable rl_table[NB_RL_TABLES] = {
603
+RLTable ff_rl_table[NB_RL_TABLES] = {
604 604
     /* intra luminance tables */
605 605
     /* low motion  */
606 606
     {
... ...
@@ -647,9 +647,9 @@ RLTable rl_table[NB_RL_TABLES] = {
647 647
     {
648 648
         102,
649 649
         58,
650
-        inter_vlc,
651
-        inter_run,
652
-        inter_level,
650
+        ff_inter_vlc,
651
+        ff_inter_run,
652
+        ff_inter_level,
653 653
     },
654 654
 };
655 655
 
... ...
@@ -1784,7 +1784,7 @@ static const uint8_t table1_mvy[1099] = {
1784 1784
  34, 28, 21,
1785 1785
 };
1786 1786
 
1787
-MVTable mv_tables[2] = {
1787
+MVTable ff_mv_tables[2] = {
1788 1788
     {
1789 1789
         1099,
1790 1790
         table0_mv_code,
... ...
@@ -1801,30 +1801,30 @@ MVTable mv_tables[2] = {
1801 1801
     }
1802 1802
 };
1803 1803
 
1804
-const uint8_t v2_mb_type[8][2] = {
1804
+const uint8_t ff_v2_mb_type[8][2] = {
1805 1805
  {1, 1}, {0   , 2}, {3   , 3}, {9   , 5},
1806 1806
  {5, 4}, {0x21, 7}, {0x20, 7}, {0x11, 6},
1807 1807
 };
1808 1808
 
1809
-const uint8_t v2_intra_cbpc[4][2] = {
1809
+const uint8_t ff_v2_intra_cbpc[4][2] = {
1810 1810
  {1, 1}, {0, 3}, {1, 3}, {1, 2},
1811 1811
 };
1812 1812
 
1813
-const uint8_t wmv1_y_dc_scale_table[32]={
1813
+const uint8_t ff_wmv1_y_dc_scale_table[32]={
1814 1814
 //  0, 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
1815 1815
     0, 8, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
1816 1816
 };
1817
-const uint8_t wmv1_c_dc_scale_table[32]={
1817
+const uint8_t ff_wmv1_c_dc_scale_table[32]={
1818 1818
 //  0, 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
1819 1819
     0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
1820 1820
 };
1821 1821
 
1822
-const uint8_t old_ff_y_dc_scale_table[32]={
1822
+const uint8_t ff_old_ff_y_dc_scale_table[32]={
1823 1823
 //  0  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
1824 1824
     0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
1825 1825
 };
1826 1826
 
1827
-const uint8_t wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={
1827
+const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={
1828 1828
   {
1829 1829
     0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11,
1830 1830
     0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28,
... ...
@@ -1867,7 +1867,7 @@ const uint8_t wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={
1867 1867
   }
1868 1868
 };
1869 1869
 
1870
-const uint8_t table_inter_intra[4][2]={
1870
+const uint8_t ff_table_inter_intra[4][2]={
1871 1871
     {0,1} /*Luma-Left Chroma-Left*/,
1872 1872
     {2,2} /*Luma-Top  Chroma-Left*/,
1873 1873
     {6,3} /*luma-Left Chroma-Top */,
... ...
@@ -1979,21 +1979,21 @@ static const uint32_t table_mb_non_intra4[128][2] = {
1979 1979
 {0x000011,  5}, {0x0001AC,  9}, {0x0000F3,  8}, {0x000439, 11},
1980 1980
 };
1981 1981
 
1982
-const uint32_t (* const wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={
1982
+const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={
1983 1983
     table_mb_non_intra2,
1984 1984
     table_mb_non_intra3,
1985 1985
     table_mb_non_intra4,
1986
-    table_mb_non_intra,
1986
+    ff_table_mb_non_intra,
1987 1987
 };
1988 1988
 
1989
-const uint8_t wmv2_scantableA[64]={
1989
+const uint8_t ff_wmv2_scantableA[64]={
1990 1990
 0x00, 0x01, 0x02, 0x08, 0x03, 0x09, 0x0A, 0x10,
1991 1991
 0x04, 0x0B, 0x11, 0x18, 0x12, 0x0C, 0x05, 0x13,
1992 1992
 0x19, 0x0D, 0x14, 0x1A, 0x1B, 0x06, 0x15, 0x1C,
1993 1993
 0x0E, 0x16, 0x1D, 0x07, 0x1E, 0x0F, 0x17, 0x1F,
1994 1994
 };
1995 1995
 
1996
-const uint8_t wmv2_scantableB[64]={
1996
+const uint8_t ff_wmv2_scantableB[64]={
1997 1997
 0x00, 0x08, 0x01, 0x10, 0x09, 0x18, 0x11, 0x02,
1998 1998
 0x20, 0x0A, 0x19, 0x28, 0x12, 0x30, 0x21, 0x1A,
1999 1999
 0x38, 0x29, 0x22, 0x03, 0x31, 0x39, 0x0B, 0x2A,
... ...
@@ -54,23 +54,23 @@ extern const uint16_t ff_msmp4_mb_i_table[64][2];
54 54
 
55 55
 #define WMV1_SCANTABLE_COUNT 4
56 56
 
57
-extern const uint8_t wmv1_scantable[WMV1_SCANTABLE_COUNT][64];
57
+extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64];
58 58
 
59 59
 #define NB_RL_TABLES  6
60 60
 
61
-extern RLTable rl_table[NB_RL_TABLES];
61
+extern RLTable ff_rl_table[NB_RL_TABLES];
62 62
 
63
-extern const uint8_t wmv1_y_dc_scale_table[32];
64
-extern const uint8_t wmv1_c_dc_scale_table[32];
65
-extern const uint8_t old_ff_y_dc_scale_table[32];
63
+extern const uint8_t ff_wmv1_y_dc_scale_table[32];
64
+extern const uint8_t ff_wmv1_c_dc_scale_table[32];
65
+extern const uint8_t ff_old_ff_y_dc_scale_table[32];
66 66
 
67
-extern MVTable mv_tables[2];
67
+extern MVTable ff_mv_tables[2];
68 68
 
69
-extern const uint8_t v2_mb_type[8][2];
70
-extern const uint8_t v2_intra_cbpc[4][2];
69
+extern const uint8_t ff_v2_mb_type[8][2];
70
+extern const uint8_t ff_v2_intra_cbpc[4][2];
71 71
 
72
-extern const uint32_t table_mb_non_intra[128][2];
73
-extern const uint8_t  table_inter_intra[4][2];
72
+extern const uint32_t ff_table_mb_non_intra[128][2];
73
+extern const uint8_t  ff_table_inter_intra[4][2];
74 74
 
75 75
 extern const uint32_t ff_table0_dc_lum[120][2];
76 76
 extern const uint32_t ff_table1_dc_lum[120][2];
... ...
@@ -78,9 +78,9 @@ extern const uint32_t ff_table0_dc_chroma[120][2];
78 78
 extern const uint32_t ff_table1_dc_chroma[120][2];
79 79
 
80 80
 #define WMV2_INTER_CBP_TABLE_COUNT 4
81
-extern const uint32_t (* const wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2];
81
+extern const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2];
82 82
 
83
-extern const uint8_t wmv2_scantableA[64];
84
-extern const uint8_t wmv2_scantableB[64];
83
+extern const uint8_t ff_wmv2_scantableA[64];
84
+extern const uint8_t ff_wmv2_scantableB[64];
85 85
 
86 86
 #endif /* AVCODEC_MSMPEG4DATA_H */
... ...
@@ -122,7 +122,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
122 122
     av_lfg_init(&s->random_state, 0);
123 123
     ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0);
124 124
 
125
-    dsputil_init(&s->dsp, avctx);
125
+    ff_dsputil_init(&s->dsp, avctx);
126 126
 
127 127
     if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
128 128
         s->scale_bias = 1.0/(32768*8);
... ...
@@ -148,7 +148,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
148 148
     avctx->frame_size = NELLY_SAMPLES;
149 149
     s->avctx = avctx;
150 150
     ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0);
151
-    dsputil_init(&s->dsp, avctx);
151
+    ff_dsputil_init(&s->dsp, avctx);
152 152
 
153 153
     /* Generate overlap window */
154 154
     ff_sine_window_init(ff_sine_128, 128);
... ...
@@ -125,10 +125,10 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit
125 125
             av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
126 126
             return AVERROR(ENOMEM);
127 127
         }
128
-        rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
128
+        ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
129 129
         return 1;
130 130
     } else if (quality != c->quality)
131
-        rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
131
+        ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
132 132
     return 0;
133 133
 }
134 134
 
... ...
@@ -160,7 +160,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
160 160
         ret = get_quant(avctx, c, buf, buf_size);
161 161
         if (ret < 0)
162 162
             return ret;
163
-        rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
163
+        ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq);
164 164
         return orig_size;
165 165
     }
166 166
 
... ...
@@ -238,7 +238,7 @@ retry:
238 238
         }
239 239
         case NUV_RTJPEG_IN_LZO:
240 240
         case NUV_RTJPEG: {
241
-            rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size);
241
+            ff_rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size);
242 242
             break;
243 243
         }
244 244
         case NUV_BLACK: {
... ...
@@ -272,7 +272,7 @@ static av_cold int decode_init(AVCodecContext *avctx) {
272 272
     c->codec_frameheader = avctx->codec_tag == MKTAG('R', 'J', 'P', 'G');
273 273
     if (avctx->extradata_size)
274 274
         get_quant(avctx, c, avctx->extradata, avctx->extradata_size);
275
-    dsputil_init(&c->dsp, avctx);
275
+    ff_dsputil_init(&c->dsp, avctx);
276 276
     if (codec_reinit(avctx, avctx->width, avctx->height, -1) < 0)
277 277
         return 1;
278 278
     return 0;
... ...
@@ -410,7 +410,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx){
410 410
 
411 411
     avcodec_get_frame_defaults(&s->picture);
412 412
     avctx->coded_frame= &s->picture;
413
-    dsputil_init(&s->dsp, avctx);
413
+    ff_dsputil_init(&s->dsp, avctx);
414 414
 
415 415
     s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED);
416 416
     if(avctx->pix_fmt == PIX_FMT_MONOBLACK)
... ...
@@ -609,7 +609,7 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
609 609
 }
610 610
 
611 611
 /* next one assumes that ((line_size % 16) == 0) */
612
-void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
612
+void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
613 613
 {
614 614
     register vector unsigned char pixelsv1, pixelsv2;
615 615
     register vector unsigned char pixelsv1B, pixelsv2B;
... ...
@@ -651,7 +651,7 @@ void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size,
651 651
 
652 652
 /* next one assumes that ((line_size % 16) == 0) */
653 653
 #define op_avg(a,b)  a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) )
654
-void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
654
+void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
655 655
 {
656 656
     register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
657 657
     register vector unsigned char perm = vec_lvsl(0, pixels);
... ...
@@ -1371,7 +1371,7 @@ static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int l
1371 1371
     }
1372 1372
 }
1373 1373
 
1374
-void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx)
1374
+void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx)
1375 1375
 {
1376 1376
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
1377 1377
 
... ...
@@ -1391,10 +1391,10 @@ void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx)
1391 1391
     if (!high_bit_depth) {
1392 1392
     c->get_pixels = get_pixels_altivec;
1393 1393
     c->clear_block = clear_block_altivec;
1394
-    c->put_pixels_tab[0][0] = put_pixels16_altivec;
1394
+    c->put_pixels_tab[0][0] = ff_put_pixels16_altivec;
1395 1395
     /* the two functions do the same thing, so use the same code */
1396
-    c->put_no_rnd_pixels_tab[0][0] = put_pixels16_altivec;
1397
-    c->avg_pixels_tab[0][0] = avg_pixels16_altivec;
1396
+    c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_altivec;
1397
+    c->avg_pixels_tab[0][0] = ff_avg_pixels16_altivec;
1398 1398
     c->avg_pixels_tab[1][0] = avg_pixels8_altivec;
1399 1399
     c->avg_pixels_tab[1][3] = avg_pixels8_xy2_altivec;
1400 1400
     c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec;
... ...
@@ -26,24 +26,24 @@
26 26
 #include <stdint.h>
27 27
 #include "libavcodec/dsputil.h"
28 28
 
29
-void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
29
+void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
30 30
 
31
-void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
31
+void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
32 32
 
33
-void fdct_altivec(int16_t *block);
34
-void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
35
-                  int x16, int y16, int rounder);
36
-void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
37
-void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
33
+void ff_fdct_altivec(int16_t *block);
34
+void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
35
+                     int x16, int y16, int rounder);
36
+void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
37
+void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
38 38
 
39 39
 void ff_vp3_idct_altivec(DCTELEM *block);
40 40
 void ff_vp3_idct_put_altivec(uint8_t *dest, int line_size, DCTELEM *block);
41 41
 void ff_vp3_idct_add_altivec(uint8_t *dest, int line_size, DCTELEM *block);
42 42
 
43
-void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
43
+void ff_dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
44 44
 
45
-void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
46
-void float_init_altivec(DSPContext* c, AVCodecContext *avctx);
47
-void int_init_altivec(DSPContext* c, AVCodecContext *avctx);
45
+void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
46
+void ff_float_init_altivec(DSPContext* c, AVCodecContext *avctx);
47
+void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx);
48 48
 
49 49
 #endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */
... ...
@@ -143,7 +143,7 @@ static void prefetch_ppc(void *mem, int stride, int h)
143 143
     } while(--h);
144 144
 }
145 145
 
146
-void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
146
+void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
147 147
 {
148 148
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
149 149
     int mm_flags = av_get_cpu_flags();
... ...
@@ -171,27 +171,27 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
171 171
     }
172 172
 
173 173
 #if HAVE_ALTIVEC
174
-    if(CONFIG_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
174
+    if(CONFIG_H264_DECODER) ff_dsputil_h264_init_ppc(c, avctx);
175 175
 
176 176
     if (mm_flags & AV_CPU_FLAG_ALTIVEC) {
177
-        dsputil_init_altivec(c, avctx);
178
-        float_init_altivec(c, avctx);
179
-        int_init_altivec(c, avctx);
180
-        c->gmc1 = gmc1_altivec;
177
+        ff_dsputil_init_altivec(c, avctx);
178
+        ff_float_init_altivec(c, avctx);
179
+        ff_int_init_altivec(c, avctx);
180
+        c->gmc1 = ff_gmc1_altivec;
181 181
 
182 182
 #if CONFIG_ENCODERS
183 183
         if (avctx->bits_per_raw_sample <= 8 &&
184 184
             (avctx->dct_algo == FF_DCT_AUTO ||
185 185
              avctx->dct_algo == FF_DCT_ALTIVEC)) {
186
-            c->fdct = fdct_altivec;
186
+            c->fdct = ff_fdct_altivec;
187 187
         }
188 188
 #endif //CONFIG_ENCODERS
189 189
 
190 190
         if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
191 191
             if ((avctx->idct_algo == FF_IDCT_AUTO) ||
192 192
                 (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
193
-                c->idct_put = idct_put_altivec;
194
-                c->idct_add = idct_add_altivec;
193
+                c->idct_put = ff_idct_put_altivec;
194
+                c->idct_add = ff_idct_add_altivec;
195 195
                 c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
196 196
             }else if((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER) &&
197 197
                      avctx->idct_algo==FF_IDCT_VP3){
... ...
@@ -195,7 +195,7 @@ static vector float fdctconsts[3] = {
195 195
 
196 196
 /* two dimensional discrete cosine transform */
197 197
 
198
-void fdct_altivec(int16_t *block)
198
+void ff_fdct_altivec(int16_t *block)
199 199
 {
200 200
     vector signed short *bp;
201 201
     vector float *cp;
... ...
@@ -122,7 +122,7 @@ static void vector_fmul_window_altivec(float *dst, const float *src0, const floa
122 122
     }
123 123
 }
124 124
 
125
-void float_init_altivec(DSPContext* c, AVCodecContext *avctx)
125
+void ff_float_init_altivec(DSPContext* c, AVCodecContext *avctx)
126 126
 {
127 127
     c->vector_fmul = vector_fmul_altivec;
128 128
     c->vector_fmul_reverse = vector_fmul_reverse_altivec;
... ...
@@ -29,7 +29,7 @@
29 29
   altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8,
30 30
   to preserve proper dst alignment.
31 31
 */
32
-void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
32
+void ff_gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder)
33 33
 {
34 34
     const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder;
35 35
     const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] =
... ...
@@ -72,7 +72,7 @@
72 72
 
73 73
 #define H264_MC(OPNAME, SIZE, CODETYPE) \
74 74
 static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\
75
-    OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
75
+    ff_ ## OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
76 76
 }\
77 77
 \
78 78
 static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \
... ...
@@ -966,7 +966,7 @@ static void ff_biweight_h264_pixels ## W ## _altivec(uint8_t *dst, uint8_t *src,
966 966
 H264_WEIGHT(16)
967 967
 H264_WEIGHT( 8)
968 968
 
969
-void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
969
+void ff_dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
970 970
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
971 971
 
972 972
     if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) {
... ...
@@ -158,7 +158,7 @@ static const vec_s16 constants[5] = {
158 158
     {19266, 26722, 25172, 22654,  19266,  22654, 25172, 26722}
159 159
 };
160 160
 
161
-void idct_put_altivec(uint8_t* dest, int stride, int16_t *blk)
161
+void ff_idct_put_altivec(uint8_t* dest, int stride, int16_t *blk)
162 162
 {
163 163
     vec_s16 *block = (vec_s16*)blk;
164 164
     vec_u8 tmp;
... ...
@@ -180,7 +180,7 @@ void idct_put_altivec(uint8_t* dest, int stride, int16_t *blk)
180 180
     COPY (dest, vx7)
181 181
 }
182 182
 
183
-void idct_add_altivec(uint8_t* dest, int stride, int16_t *blk)
183
+void ff_idct_add_altivec(uint8_t* dest, int stride, int16_t *blk)
184 184
 {
185 185
     vec_s16 *block = (vec_s16*)blk;
186 186
     vec_u8 tmp;
... ...
@@ -144,7 +144,7 @@ static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, const int16_t *
144 144
     return ires;
145 145
 }
146 146
 
147
-void int_init_altivec(DSPContext* c, AVCodecContext *avctx)
147
+void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx)
148 148
 {
149 149
     c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec;
150 150
     c->scalarproduct_int16 = scalarproduct_int16_altivec;
... ...
@@ -559,7 +559,7 @@ static void dct_unquantize_h263_altivec(MpegEncContext *s,
559 559
 }
560 560
 
561 561
 
562
-void MPV_common_init_altivec(MpegEncContext *s)
562
+void ff_MPV_common_init_altivec(MpegEncContext *s)
563 563
 {
564 564
     if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return;
565 565
 
... ...
@@ -268,7 +268,7 @@ EPEL_HV(4,  4,4)
268 268
 
269 269
 static void put_vp8_pixels16_altivec(uint8_t *dst, int stride, uint8_t *src, int s, int h, int mx, int my)
270 270
 {
271
-    put_pixels16_altivec(dst, src, stride, h);
271
+    ff_put_pixels16_altivec(dst, src, stride, h);
272 272
 }
273 273
 
274 274
 av_cold void ff_vp8dsp_init_altivec(VP8DSPContext *c)
275 275
new file mode 100644
... ...
@@ -0,0 +1,72 @@
0
+/*
1
+ * Apple ProRes compatible decoder
2
+ *
3
+ * Copyright (c) 2010-2011 Maxim Poliakovski
4
+ *
5
+ * This file is part of Libav.
6
+ *
7
+ * Libav is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * Libav is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with Libav; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+#include "proresdata.h"
23
+
24
+const uint8_t ff_prores_progressive_scan[64] = {
25
+     0,  1,  8,  9,  2,  3, 10, 11,
26
+    16, 17, 24, 25, 18, 19, 26, 27,
27
+     4,  5, 12, 20, 13,  6,  7, 14,
28
+    21, 28, 29, 22, 15, 23, 30, 31,
29
+    32, 33, 40, 48, 41, 34, 35, 42,
30
+    49, 56, 57, 50, 43, 36, 37, 44,
31
+    51, 58, 59, 52, 45, 38, 39, 46,
32
+    53, 60, 61, 54, 47, 55, 62, 63
33
+};
34
+
35
+const uint8_t ff_prores_interlaced_scan[64] = {
36
+     0,  8,  1,  9, 16, 24, 17, 25,
37
+     2, 10,  3, 11, 18, 26, 19, 27,
38
+    32, 40, 33, 34, 41, 48, 56, 49,
39
+    42, 35, 43, 50, 57, 58, 51, 59,
40
+     4, 12,  5,  6, 13, 20, 28, 21,
41
+    14,  7, 15, 22, 29, 36, 44, 37,
42
+    30, 23, 31, 38, 45, 52, 60, 53,
43
+    46, 39, 47, 54, 61, 62, 55, 63
44
+};
45
+
46
+
47
+const uint8_t ff_prores_dc_codebook[4] = {
48
+    0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0
49
+    0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0
50
+    0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1
51
+    0x70  // rice_order = 3, exp_golomb_order = 4, switch_bits = 0
52
+};
53
+
54
+const uint8_t ff_prores_ac_codebook[7] = {
55
+    0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0
56
+    0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0
57
+    0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0
58
+    0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1
59
+    0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1
60
+    0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2
61
+    0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2
62
+};
63
+
64
+/**
65
+ * Lookup tables for adaptive switching between codebooks
66
+ * according with previous run/level value.
67
+ */
68
+const uint8_t ff_prores_run_to_cb_index[16] =
69
+    { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 };
70
+
71
+const uint8_t ff_prores_lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 };
0 72
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+/*
1
+ * Apple ProRes compatible decoder
2
+ *
3
+ * Copyright (c) 2010-2011 Maxim Poliakovski
4
+ *
5
+ * This file is part of Libav.
6
+ *
7
+ * Libav is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * Libav is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with Libav; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+#ifndef AVCODEC_PRORESDATA_H
23
+#define AVCODEC_PRORESDATA_H
24
+
25
+#include <stdint.h>
26
+
27
+#define FRAME_ID MKBETAG('i', 'c', 'p', 'f')
28
+
29
+extern const uint8_t ff_prores_progressive_scan[64];
30
+extern const uint8_t ff_prores_interlaced_scan[64];
31
+
32
+#define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0
33
+extern const uint8_t ff_prores_dc_codebook[4];
34
+extern const uint8_t ff_prores_ac_codebook[7];
35
+extern const uint8_t ff_prores_run_to_cb_index[16];
36
+extern const uint8_t ff_prores_lev_to_cb_index[10];
37
+
38
+#endif /* AVCODEC_PRORESDATA_H */
... ...
@@ -34,6 +34,7 @@
34 34
 
35 35
 #include "libavutil/intmath.h"
36 36
 #include "avcodec.h"
37
+#include "proresdata.h"
37 38
 #include "proresdsp.h"
38 39
 #include "get_bits.h"
39 40
 
... ...
@@ -42,7 +43,10 @@ typedef struct {
42 42
     int slice_num;
43 43
     int x_pos, y_pos;
44 44
     int slice_width;
45
+    int prev_slice_sf;               ///< scalefactor of the previous decoded slice
45 46
     DECLARE_ALIGNED(16, DCTELEM, blocks)[8 * 4 * 64];
47
+    DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64];
48
+    DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64];
46 49
 } ProresThreadData;
47 50
 
48 51
 typedef struct {
... ...
@@ -56,9 +60,6 @@ typedef struct {
56 56
     uint8_t    qmat_luma[64];            ///< dequantization matrix for luma
57 57
     uint8_t    qmat_chroma[64];          ///< dequantization matrix for chroma
58 58
     int        qmat_changed;             ///< 1 - global quantization matrices changed
59
-    int        prev_slice_sf;            ///< scalefactor of the previous decoded slice
60
-    DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64];
61
-    DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64];
62 59
     int        total_slices;            ///< total number of slices in a picture
63 60
     ProresThreadData *slice_data;
64 61
     int        pic_num;
... ...
@@ -75,29 +76,6 @@ typedef struct {
75 75
 } ProresContext;
76 76
 
77 77
 
78
-static const uint8_t progressive_scan[64] = {
79
-     0,  1,  8,  9,  2,  3, 10, 11,
80
-    16, 17, 24, 25, 18, 19, 26, 27,
81
-     4,  5, 12, 20, 13,  6,  7, 14,
82
-    21, 28, 29, 22, 15, 23, 30, 31,
83
-    32, 33, 40, 48, 41, 34, 35, 42,
84
-    49, 56, 57, 50, 43, 36, 37, 44,
85
-    51, 58, 59, 52, 45, 38, 39, 46,
86
-    53, 60, 61, 54, 47, 55, 62, 63
87
-};
88
-
89
-static const uint8_t interlaced_scan[64] = {
90
-     0,  8,  1,  9, 16, 24, 17, 25,
91
-     2, 10,  3, 11, 18, 26, 19, 27,
92
-    32, 40, 33, 34, 41, 48, 56, 49,
93
-    42, 35, 43, 50, 57, 58, 51, 59,
94
-     4, 12,  5,  6, 13, 20, 28, 21,
95
-    14,  7, 15, 22, 29, 36, 44, 37,
96
-    30, 23, 31, 38, 45, 52, 60, 53,
97
-    46, 39, 47, 54, 61, 62, 55, 63
98
-};
99
-
100
-
101 78
 static av_cold int decode_init(AVCodecContext *avctx)
102 79
 {
103 80
     ProresContext *ctx = avctx->priv_data;
... ...
@@ -116,7 +94,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
116 116
     ctx->scantable_type = -1;   // set scantable type to uninitialized
117 117
     memset(ctx->qmat_luma, 4, 64);
118 118
     memset(ctx->qmat_chroma, 4, 64);
119
-    ctx->prev_slice_sf = 0;
120 119
 
121 120
     return 0;
122 121
 }
... ...
@@ -176,10 +153,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
176 176
     if (ctx->scantable_type != ctx->frame_type) {
177 177
         if (!ctx->frame_type)
178 178
             ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable,
179
-                              progressive_scan);
179
+                              ff_prores_progressive_scan);
180 180
         else
181 181
             ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable,
182
-                              interlaced_scan);
182
+                              ff_prores_interlaced_scan);
183 183
         ctx->scantable_type = ctx->frame_type;
184 184
     }
185 185
 
... ...
@@ -294,9 +271,11 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
294 294
 
295 295
     for (i = 0; i < num_slices; i++) {
296 296
         ctx->slice_data[i].index = data_ptr;
297
+        ctx->slice_data[i].prev_slice_sf = 0;
297 298
         data_ptr += AV_RB16(index_ptr + i * 2);
298 299
     }
299 300
     ctx->slice_data[i].index = data_ptr;
301
+    ctx->slice_data[i].prev_slice_sf = 0;
300 302
 
301 303
     if (data_ptr > buf + data_size) {
302 304
         av_log(avctx, AV_LOG_ERROR, "out of slice data\n");
... ...
@@ -351,16 +330,6 @@ static inline int decode_vlc_codeword(GetBitContext *gb, uint8_t codebook)
351 351
 #define LSB2SIGN(x) (-((x) & 1))
352 352
 #define TOSIGNED(x) (((x) >> 1) ^ LSB2SIGN(x))
353 353
 
354
-#define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0
355
-
356
-static uint8_t dc_codebook[4] = {
357
-    0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0
358
-    0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0
359
-    0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1
360
-    0x70  // rice_order = 3, exp_golomb_order = 4, switch_bits = 0
361
-};
362
-
363
-
364 354
 /**
365 355
  * Decode DC coefficients for all blocks in a slice.
366 356
  */
... ...
@@ -379,7 +348,7 @@ static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out,
379 379
     delta  = 3;
380 380
 
381 381
     for (i = 1; i < nblocks; i++, out += 64) {
382
-        code = decode_vlc_codeword(gb, dc_codebook[FFMIN(FFABS(delta), 3)]);
382
+        code = decode_vlc_codeword(gb, ff_prores_dc_codebook[FFMIN(FFABS(delta), 3)]);
383 383
 
384 384
         sign     = -(((delta >> 15) & 1) ^ (code & 1));
385 385
         delta    = (((code + 1) >> 1) ^ sign) - sign;
... ...
@@ -389,26 +358,6 @@ static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out,
389 389
 }
390 390
 
391 391
 
392
-static uint8_t ac_codebook[7] = {
393
-    0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0
394
-    0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0
395
-    0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0
396
-    0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1
397
-    0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1
398
-    0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2
399
-    0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2
400
-};
401
-
402
-/**
403
- * Lookup tables for adaptive switching between codebooks
404
- * according with previous run/level value.
405
- */
406
-static uint8_t run_to_cb_index[16] =
407
-    { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 };
408
-
409
-static uint8_t lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 };
410
-
411
-
412 392
 /**
413 393
  * Decode AC coefficients for all blocks in a slice.
414 394
  */
... ...
@@ -428,20 +377,20 @@ static inline void decode_ac_coeffs(GetBitContext *gb, DCTELEM *out,
428 428
     block_mask = blocks_per_slice - 1;
429 429
 
430 430
     for (pos = blocks_per_slice - 1; pos < max_coeffs;) {
431
-        run_cb_index = run_to_cb_index[FFMIN(run, 15)];
432
-        lev_cb_index = lev_to_cb_index[FFMIN(level, 9)];
431
+        run_cb_index = ff_prores_run_to_cb_index[FFMIN(run, 15)];
432
+        lev_cb_index = ff_prores_lev_to_cb_index[FFMIN(level, 9)];
433 433
 
434 434
         bits_left = get_bits_left(gb);
435 435
         if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
436 436
             return;
437 437
 
438
-        run = decode_vlc_codeword(gb, ac_codebook[run_cb_index]);
438
+        run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]);
439 439
 
440 440
         bits_left = get_bits_left(gb);
441 441
         if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left)))
442 442
             return;
443 443
 
444
-        level = decode_vlc_codeword(gb, ac_codebook[lev_cb_index]) + 1;
444
+        level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1;
445 445
 
446 446
         pos += run + 1;
447 447
         if (pos >= max_coeffs)
... ...
@@ -561,11 +510,11 @@ static int decode_slice(AVCodecContext *avctx, void *tdata)
561 561
 
562 562
     /* scale quantization matrixes according with slice's scale factor */
563 563
     /* TODO: this can be SIMD-optimized a lot */
564
-    if (ctx->qmat_changed || sf != ctx->prev_slice_sf) {
565
-        ctx->prev_slice_sf = sf;
564
+    if (ctx->qmat_changed || sf != td->prev_slice_sf) {
565
+        td->prev_slice_sf = sf;
566 566
         for (i = 0; i < 64; i++) {
567
-            ctx->qmat_luma_scaled[ctx->dsp.idct_permutation[i]]   = ctx->qmat_luma[i]   * sf;
568
-            ctx->qmat_chroma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_chroma[i] * sf;
567
+            td->qmat_luma_scaled[ctx->dsp.idct_permutation[i]]   = ctx->qmat_luma[i]   * sf;
568
+            td->qmat_chroma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_chroma[i] * sf;
569 569
         }
570 570
     }
571 571
 
... ...
@@ -574,7 +523,7 @@ static int decode_slice(AVCodecContext *avctx, void *tdata)
574 574
                        (uint16_t*) (y_data + (mb_y_pos << 4) * y_linesize +
575 575
                                     (mb_x_pos << 5)), y_linesize,
576 576
                        mbs_per_slice, 4, slice_width_factor + 2,
577
-                       ctx->qmat_luma_scaled);
577
+                       td->qmat_luma_scaled);
578 578
 
579 579
     /* decode U chroma plane */
580 580
     decode_slice_plane(ctx, td, buf + hdr_size + y_data_size, u_data_size,
... ...
@@ -582,7 +531,7 @@ static int decode_slice(AVCodecContext *avctx, void *tdata)
582 582
                                     (mb_x_pos << ctx->mb_chroma_factor)),
583 583
                        u_linesize, mbs_per_slice, ctx->num_chroma_blocks,
584 584
                        slice_width_factor + ctx->chroma_factor - 1,
585
-                       ctx->qmat_chroma_scaled);
585
+                       td->qmat_chroma_scaled);
586 586
 
587 587
     /* decode V chroma plane */
588 588
     decode_slice_plane(ctx, td, buf + hdr_size + y_data_size + u_data_size,
... ...
@@ -591,7 +540,7 @@ static int decode_slice(AVCodecContext *avctx, void *tdata)
591 591
                                     (mb_x_pos << ctx->mb_chroma_factor)),
592 592
                        v_linesize, mbs_per_slice, ctx->num_chroma_blocks,
593 593
                        slice_width_factor + ctx->chroma_factor - 1,
594
-                       ctx->qmat_chroma_scaled);
594
+                       td->qmat_chroma_scaled);
595 595
 
596 596
     return 0;
597 597
 }
... ...
@@ -628,7 +577,6 @@ static int decode_picture(ProresContext *ctx, int pic_num,
628 628
 }
629 629
 
630 630
 
631
-#define FRAME_ID MKBETAG('i', 'c', 'p', 'f')
632 631
 #define MOVE_DATA_PTR(nbytes) buf += (nbytes); buf_size -= (nbytes)
633 632
 
634 633
 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
... ...
@@ -51,13 +51,30 @@ static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const
51 51
     put_pixels(out, linesize >> 1, block);
52 52
 }
53 53
 
54
+static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)
55
+{
56
+    int x, y;
57
+    const uint16_t *tsrc = src;
58
+
59
+    for (y = 0; y < 8; y++) {
60
+        for (x = 0; x < 8; x++)
61
+            block[y * 8 + x] = tsrc[x];
62
+        tsrc += linesize >> 1;
63
+    }
64
+    ff_jpeg_fdct_islow_10(block);
65
+}
66
+
54 67
 void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
55 68
 {
56 69
     dsp->idct_put = prores_idct_put_c;
57 70
     dsp->idct_permutation_type = FF_NO_IDCT_PERM;
71
+    dsp->fdct     = prores_fdct_c;
72
+    dsp->dct_permutation_type  = FF_NO_IDCT_PERM;
58 73
 
59 74
     if (HAVE_MMX) ff_proresdsp_x86_init(dsp, avctx);
60 75
 
61 76
     ff_init_scantable_permutation(dsp->idct_permutation,
62 77
                                   dsp->idct_permutation_type);
78
+    ff_init_scantable_permutation(dsp->dct_permutation,
79
+                                  dsp->dct_permutation_type);
63 80
 }
... ...
@@ -30,7 +30,10 @@
30 30
 typedef struct {
31 31
     int idct_permutation_type;
32 32
     uint8_t idct_permutation[64];
33
+    int dct_permutation_type;
34
+    uint8_t dct_permutation[64];
33 35
     void (* idct_put) (uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat);
36
+    void (* fdct) (const uint16_t *src, int linesize, DCTELEM *block);
34 37
 } ProresDSPContext;
35 38
 
36 39
 void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx);
37 40
new file mode 100644
... ...
@@ -0,0 +1,836 @@
0
+/*
1
+ * Apple ProRes encoder
2
+ *
3
+ * Copyright (c) 2012 Konstantin Shishkov
4
+ *
5
+ * This file is part of Libav.
6
+ *
7
+ * Libav is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * Libav is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with Libav; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+#include "libavutil/opt.h"
23
+#include "avcodec.h"
24
+#include "put_bits.h"
25
+#include "bytestream.h"
26
+#include "internal.h"
27
+#include "proresdsp.h"
28
+#include "proresdata.h"
29
+
30
+#define CFACTOR_Y422 2
31
+#define CFACTOR_Y444 3
32
+
33
+#define MAX_MBS_PER_SLICE 8
34
+
35
+#define MAX_PLANES 3 // should be increased to 4 when there's PIX_FMT_YUV444AP10
36
+
37
+enum {
38
+    PRORES_PROFILE_PROXY = 0,
39
+    PRORES_PROFILE_LT,
40
+    PRORES_PROFILE_STANDARD,
41
+    PRORES_PROFILE_HQ,
42
+};
43
+
44
+#define NUM_MB_LIMITS 4
45
+static const int prores_mb_limits[NUM_MB_LIMITS] = {
46
+    1620, // up to 720x576
47
+    2700, // up to 960x720
48
+    6075, // up to 1440x1080
49
+    9216, // up to 2048x1152
50
+};
51
+
52
+static const struct prores_profile {
53
+    const char *full_name;
54
+    uint32_t    tag;
55
+    int         min_quant;
56
+    int         max_quant;
57
+    int         br_tab[NUM_MB_LIMITS];
58
+    uint8_t     quant[64];
59
+} prores_profile_info[4] = {
60
+    {
61
+        .full_name = "proxy",
62
+        .tag       = MKTAG('a', 'p', 'c', 'o'),
63
+        .min_quant = 4,
64
+        .max_quant = 8,
65
+        .br_tab    = { 300, 242, 220, 194 },
66
+        .quant     = {
67
+             4,  7,  9, 11, 13, 14, 15, 63,
68
+             7,  7, 11, 12, 14, 15, 63, 63,
69
+             9, 11, 13, 14, 15, 63, 63, 63,
70
+            11, 11, 13, 14, 63, 63, 63, 63,
71
+            11, 13, 14, 63, 63, 63, 63, 63,
72
+            13, 14, 63, 63, 63, 63, 63, 63,
73
+            13, 63, 63, 63, 63, 63, 63, 63,
74
+            63, 63, 63, 63, 63, 63, 63, 63,
75
+        },
76
+    },
77
+    {
78
+        .full_name = "LT",
79
+        .tag       = MKTAG('a', 'p', 'c', 's'),
80
+        .min_quant = 1,
81
+        .max_quant = 9,
82
+        .br_tab    = { 720, 560, 490, 440 },
83
+        .quant     = {
84
+             4,  5,  6,  7,  9, 11, 13, 15,
85
+             5,  5,  7,  8, 11, 13, 15, 17,
86
+             6,  7,  9, 11, 13, 15, 15, 17,
87
+             7,  7,  9, 11, 13, 15, 17, 19,
88
+             7,  9, 11, 13, 14, 16, 19, 23,
89
+             9, 11, 13, 14, 16, 19, 23, 29,
90
+             9, 11, 13, 15, 17, 21, 28, 35,
91
+            11, 13, 16, 17, 21, 28, 35, 41,
92
+        },
93
+    },
94
+    {
95
+        .full_name = "standard",
96
+        .tag       = MKTAG('a', 'p', 'c', 'n'),
97
+        .min_quant = 1,
98
+        .max_quant = 6,
99
+        .br_tab    = { 1050, 808, 710, 632 },
100
+        .quant     = {
101
+             4,  4,  5,  5,  6,  7,  7,  9,
102
+             4,  4,  5,  6,  7,  7,  9,  9,
103
+             5,  5,  6,  7,  7,  9,  9, 10,
104
+             5,  5,  6,  7,  7,  9,  9, 10,
105
+             5,  6,  7,  7,  8,  9, 10, 12,
106
+             6,  7,  7,  8,  9, 10, 12, 15,
107
+             6,  7,  7,  9, 10, 11, 14, 17,
108
+             7,  7,  9, 10, 11, 14, 17, 21,
109
+        },
110
+    },
111
+    {
112
+        .full_name = "high quality",
113
+        .tag       = MKTAG('a', 'p', 'c', 'h'),
114
+        .min_quant = 1,
115
+        .max_quant = 6,
116
+        .br_tab    = { 1566, 1216, 1070, 950 },
117
+        .quant     = {
118
+             4,  4,  4,  4,  4,  4,  4,  4,
119
+             4,  4,  4,  4,  4,  4,  4,  4,
120
+             4,  4,  4,  4,  4,  4,  4,  4,
121
+             4,  4,  4,  4,  4,  4,  4,  5,
122
+             4,  4,  4,  4,  4,  4,  5,  5,
123
+             4,  4,  4,  4,  4,  5,  5,  6,
124
+             4,  4,  4,  4,  5,  5,  6,  7,
125
+             4,  4,  4,  4,  5,  6,  7,  7,
126
+        },
127
+    }
128
+// for 4444 profile bitrate numbers are { 2350, 1828, 1600, 1425 }
129
+};
130
+
131
+#define TRELLIS_WIDTH 16
132
+#define SCORE_LIMIT   INT_MAX / 2
133
+
134
+struct TrellisNode {
135
+    int prev_node;
136
+    int quant;
137
+    int bits;
138
+    int score;
139
+};
140
+
141
+typedef struct ProresContext {
142
+    AVClass *class;
143
+    DECLARE_ALIGNED(16, DCTELEM, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE];
144
+    DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16];
145
+    int16_t quants[16][64];
146
+
147
+    ProresDSPContext dsp;
148
+    ScanTable  scantable;
149
+
150
+    int mb_width, mb_height;
151
+    int mbs_per_slice;
152
+    int num_chroma_blocks, chroma_factor;
153
+    int slices_width;
154
+    int num_slices;
155
+    int num_planes;
156
+    int bits_per_mb;
157
+
158
+    int profile;
159
+    const struct prores_profile *profile_info;
160
+
161
+    struct TrellisNode *nodes;
162
+    int *slice_q;
163
+} ProresContext;
164
+
165
+static void get_slice_data(ProresContext *ctx, const uint16_t *src,
166
+                           int linesize, int x, int y, int w, int h,
167
+                           DCTELEM *blocks,
168
+                           int mbs_per_slice, int blocks_per_mb)
169
+{
170
+    const uint16_t *esrc;
171
+    const int mb_width = 4 * blocks_per_mb;
172
+    int elinesize;
173
+    int i, j, k;
174
+
175
+    for (i = 0; i < mbs_per_slice; i++, src += mb_width) {
176
+        if (x >= w) {
177
+            memset(blocks, 0, 64 * (mbs_per_slice - i) * blocks_per_mb
178
+                              * sizeof(*blocks));
179
+            return;
180
+        }
181
+        if (x + mb_width <= w && y + 16 <= h) {
182
+            esrc      = src;
183
+            elinesize = linesize;
184
+        } else {
185
+            int bw, bh, pix;
186
+            const int estride = 16 / sizeof(*ctx->emu_buf);
187
+
188
+            esrc      = ctx->emu_buf;
189
+            elinesize = 16;
190
+
191
+            bw = FFMIN(w - x, mb_width);
192
+            bh = FFMIN(h - y, 16);
193
+
194
+            for (j = 0; j < bh; j++) {
195
+                memcpy(ctx->emu_buf + j * estride, src + j * linesize,
196
+                       bw * sizeof(*src));
197
+                pix = ctx->emu_buf[j * estride + bw - 1];
198
+                for (k = bw; k < mb_width; k++)
199
+                    ctx->emu_buf[j * estride + k] = pix;
200
+            }
201
+            for (; j < 16; j++)
202
+                memcpy(ctx->emu_buf + j * estride,
203
+                       ctx->emu_buf + (bh - 1) * estride,
204
+                       mb_width * sizeof(*ctx->emu_buf));
205
+        }
206
+        ctx->dsp.fdct(esrc, elinesize, blocks);
207
+        blocks += 64;
208
+        if (blocks_per_mb > 2) {
209
+            ctx->dsp.fdct(src + 8, linesize, blocks);
210
+            blocks += 64;
211
+        }
212
+        ctx->dsp.fdct(src + linesize * 4, linesize, blocks);
213
+        blocks += 64;
214
+        if (blocks_per_mb > 2) {
215
+            ctx->dsp.fdct(src + linesize * 4 + 8, linesize, blocks);
216
+            blocks += 64;
217
+        }
218
+
219
+        x += mb_width;
220
+    }
221
+}
222
+
223
+/**
224
+ * Write an unsigned rice/exp golomb codeword.
225
+ */
226
+static inline void encode_vlc_codeword(PutBitContext *pb, uint8_t codebook, int val)
227
+{
228
+    unsigned int rice_order, exp_order, switch_bits, switch_val;
229
+    int exponent;
230
+
231
+    /* number of prefix bits to switch between Rice and expGolomb */
232
+    switch_bits = (codebook & 3) + 1;
233
+    rice_order  =  codebook >> 5;       /* rice code order */
234
+    exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
235
+
236
+    switch_val  = switch_bits << rice_order;
237
+
238
+    if (val >= switch_val) {
239
+        val -= switch_val - (1 << exp_order);
240
+        exponent = av_log2(val);
241
+
242
+        put_bits(pb, exponent - exp_order + switch_bits, 0);
243
+        put_bits(pb, 1, 1);
244
+        put_bits(pb, exponent, val);
245
+    } else {
246
+        exponent = val >> rice_order;
247
+
248
+        if (exponent)
249
+            put_bits(pb, exponent, 0);
250
+        put_bits(pb, 1, 1);
251
+        if (rice_order)
252
+            put_sbits(pb, rice_order, val);
253
+    }
254
+}
255
+
256
+#define GET_SIGN(x)  ((x) >> 31)
257
+#define MAKE_CODE(x) (((x) << 1) ^ GET_SIGN(x))
258
+
259
+static void encode_dcs(PutBitContext *pb, DCTELEM *blocks,
260
+                       int blocks_per_slice, int scale)
261
+{
262
+    int i;
263
+    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;
264
+
265
+    prev_dc = (blocks[0] - 0x4000) / scale;
266
+    encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc));
267
+    codebook = 3;
268
+    blocks  += 64;
269
+
270
+    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {
271
+        dc       = (blocks[0] - 0x4000) / scale;
272
+        delta    = dc - prev_dc;
273
+        new_sign = GET_SIGN(delta);
274
+        delta    = (delta ^ sign) - sign;
275
+        code     = MAKE_CODE(delta);
276
+        encode_vlc_codeword(pb, ff_prores_dc_codebook[codebook], code);
277
+        codebook = (code + (code & 1)) >> 1;
278
+        codebook = FFMIN(codebook, 3);
279
+        sign     = new_sign;
280
+        prev_dc  = dc;
281
+    }
282
+}
283
+
284
+static void encode_acs(PutBitContext *pb, DCTELEM *blocks,
285
+                       int blocks_per_slice,
286
+                       int plane_size_factor,
287
+                       const uint8_t *scan, const int16_t *qmat)
288
+{
289
+    int idx, i;
290
+    int run, level, run_cb, lev_cb;
291
+    int max_coeffs, abs_level;
292
+
293
+    max_coeffs = blocks_per_slice << 6;
294
+    run_cb     = ff_prores_run_to_cb_index[4];
295
+    lev_cb     = ff_prores_lev_to_cb_index[2];
296
+    run        = 0;
297
+
298
+    for (i = 1; i < 64; i++) {
299
+        for (idx = scan[i]; idx < max_coeffs; idx += 64) {
300
+            level = blocks[idx] / qmat[scan[i]];
301
+            if (level) {
302
+                abs_level = FFABS(level);
303
+                encode_vlc_codeword(pb, ff_prores_ac_codebook[run_cb], run);
304
+                encode_vlc_codeword(pb, ff_prores_ac_codebook[lev_cb],
305
+                                    abs_level - 1);
306
+                put_sbits(pb, 1, GET_SIGN(level));
307
+
308
+                run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)];
309
+                lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)];
310
+                run    = 0;
311
+            } else {
312
+                run++;
313
+            }
314
+        }
315
+    }
316
+}
317
+
318
+static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb,
319
+                              const uint16_t *src, int linesize,
320
+                              int mbs_per_slice, DCTELEM *blocks,
321
+                              int blocks_per_mb, int plane_size_factor,
322
+                              const int16_t *qmat)
323
+{
324
+    int blocks_per_slice, saved_pos;
325
+
326
+    saved_pos = put_bits_count(pb);
327
+    blocks_per_slice = mbs_per_slice * blocks_per_mb;
328
+
329
+    encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);
330
+    encode_acs(pb, blocks, blocks_per_slice, plane_size_factor,
331
+               ctx->scantable.permutated, qmat);
332
+    flush_put_bits(pb);
333
+
334
+    return (put_bits_count(pb) - saved_pos) >> 3;
335
+}
336
+
337
+static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
338
+                        PutBitContext *pb,
339
+                        int sizes[4], int x, int y, int quant,
340
+                        int mbs_per_slice)
341
+{
342
+    ProresContext *ctx = avctx->priv_data;
343
+    int i, xp, yp;
344
+    int total_size = 0;
345
+    const uint16_t *src;
346
+    int slice_width_factor = av_log2(mbs_per_slice);
347
+    int num_cblocks, pwidth;
348
+    int plane_factor, is_chroma;
349
+
350
+    for (i = 0; i < ctx->num_planes; i++) {
351
+        is_chroma    = (i == 1 || i == 2);
352
+        plane_factor = slice_width_factor + 2;
353
+        if (is_chroma)
354
+            plane_factor += ctx->chroma_factor - 3;
355
+        if (!is_chroma || ctx->chroma_factor == CFACTOR_Y444) {
356
+            xp          = x << 4;
357
+            yp          = y << 4;
358
+            num_cblocks = 4;
359
+            pwidth      = avctx->width;
360
+        } else {
361
+            xp          = x << 3;
362
+            yp          = y << 4;
363
+            num_cblocks = 2;
364
+            pwidth      = avctx->width >> 1;
365
+        }
366
+        src = (const uint16_t*)(pic->data[i] + yp * pic->linesize[i]) + xp;
367
+
368
+        get_slice_data(ctx, src, pic->linesize[i], xp, yp,
369
+                       pwidth, avctx->height, ctx->blocks[0],
370
+                       mbs_per_slice, num_cblocks);
371
+        sizes[i] = encode_slice_plane(ctx, pb, src, pic->linesize[i],
372
+                                      mbs_per_slice, ctx->blocks[0],
373
+                                      num_cblocks, plane_factor,
374
+                                      ctx->quants[quant]);
375
+        total_size += sizes[i];
376
+    }
377
+    return total_size;
378
+}
379
+
380
+static inline int estimate_vlc(uint8_t codebook, int val)
381
+{
382
+    unsigned int rice_order, exp_order, switch_bits, switch_val;
383
+    int exponent;
384
+
385
+    /* number of prefix bits to switch between Rice and expGolomb */
386
+    switch_bits = (codebook & 3) + 1;
387
+    rice_order  =  codebook >> 5;       /* rice code order */
388
+    exp_order   = (codebook >> 2) & 7;  /* exp golomb code order */
389
+
390
+    switch_val  = switch_bits << rice_order;
391
+
392
+    if (val >= switch_val) {
393
+        val -= switch_val - (1 << exp_order);
394
+        exponent = av_log2(val);
395
+
396
+        return exponent * 2 - exp_order + switch_bits + 1;
397
+    } else {
398
+        return (val >> rice_order) + rice_order + 1;
399
+    }
400
+}
401
+
402
+static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice,
403
+                        int scale)
404
+{
405
+    int i;
406
+    int codebook = 3, code, dc, prev_dc, delta, sign, new_sign;
407
+    int bits;
408
+
409
+    prev_dc  = (blocks[0] - 0x4000) / scale;
410
+    bits     = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc));
411
+    codebook = 3;
412
+    blocks  += 64;
413
+    *error  += FFABS(blocks[0] - 0x4000) % scale;
414
+
415
+    for (i = 1; i < blocks_per_slice; i++, blocks += 64) {
416
+        dc       = (blocks[0] - 0x4000) / scale;
417
+        *error  += FFABS(blocks[0] - 0x4000) % scale;
418
+        delta    = dc - prev_dc;
419
+        new_sign = GET_SIGN(delta);
420
+        delta    = (delta ^ sign) - sign;
421
+        code     = MAKE_CODE(delta);
422
+        bits    += estimate_vlc(ff_prores_dc_codebook[codebook], code);
423
+        codebook = (code + (code & 1)) >> 1;
424
+        codebook = FFMIN(codebook, 3);
425
+        sign     = new_sign;
426
+        prev_dc  = dc;
427
+    }
428
+
429
+    return bits;
430
+}
431
+
432
+static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice,
433
+                        int plane_size_factor,
434
+                        const uint8_t *scan, const int16_t *qmat)
435
+{
436
+    int idx, i;
437
+    int run, level, run_cb, lev_cb;
438
+    int max_coeffs, abs_level;
439
+    int bits = 0;
440
+
441
+    max_coeffs = blocks_per_slice << 6;
442
+    run_cb     = ff_prores_run_to_cb_index[4];
443
+    lev_cb     = ff_prores_lev_to_cb_index[2];
444
+    run        = 0;
445
+
446
+    for (i = 1; i < 64; i++) {
447
+        for (idx = scan[i]; idx < max_coeffs; idx += 64) {
448
+            level   = blocks[idx] / qmat[scan[i]];
449
+            *error += FFABS(blocks[idx]) % qmat[scan[i]];
450
+            if (level) {
451
+                abs_level = FFABS(level);
452
+                bits += estimate_vlc(ff_prores_ac_codebook[run_cb], run);
453
+                bits += estimate_vlc(ff_prores_ac_codebook[lev_cb],
454
+                                     abs_level - 1) + 1;
455
+
456
+                run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)];
457
+                lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)];
458
+                run    = 0;
459
+            } else {
460
+                run++;
461
+            }
462
+        }
463
+    }
464
+
465
+    return bits;
466
+}
467
+
468
+static int estimate_slice_plane(ProresContext *ctx, int *error, int plane,
469
+                                const uint16_t *src, int linesize,
470
+                                int mbs_per_slice,
471
+                                int blocks_per_mb, int plane_size_factor,
472
+                                const int16_t *qmat)
473
+{
474
+    int blocks_per_slice;
475
+    int bits;
476
+
477
+    blocks_per_slice = mbs_per_slice * blocks_per_mb;
478
+
479
+    bits  = estimate_dcs(error, ctx->blocks[plane], blocks_per_slice, qmat[0]);
480
+    bits += estimate_acs(error, ctx->blocks[plane], blocks_per_slice,
481
+                         plane_size_factor, ctx->scantable.permutated, qmat);
482
+
483
+    return FFALIGN(bits, 8);
484
+}
485
+
486
+static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
487
+                            int trellis_node, int x, int y, int mbs_per_slice)
488
+{
489
+    ProresContext *ctx = avctx->priv_data;
490
+    int i, q, pq, xp, yp;
491
+    const uint16_t *src;
492
+    int slice_width_factor = av_log2(mbs_per_slice);
493
+    int num_cblocks[MAX_PLANES], pwidth;
494
+    int plane_factor[MAX_PLANES], is_chroma[MAX_PLANES];
495
+    const int min_quant = ctx->profile_info->min_quant;
496
+    const int max_quant = ctx->profile_info->max_quant;
497
+    int error, bits, bits_limit;
498
+    int mbs, prev, cur, new_score;
499
+    int slice_bits[TRELLIS_WIDTH], slice_score[TRELLIS_WIDTH];
500
+
501
+    mbs = x + mbs_per_slice;
502
+
503
+    for (i = 0; i < ctx->num_planes; i++) {
504
+        is_chroma[i]    = (i == 1 || i == 2);
505
+        plane_factor[i] = slice_width_factor + 2;
506
+        if (is_chroma[i])
507
+            plane_factor[i] += ctx->chroma_factor - 3;
508
+        if (!is_chroma[i] || ctx->chroma_factor == CFACTOR_Y444) {
509
+            xp             = x << 4;
510
+            yp             = y << 4;
511
+            num_cblocks[i] = 4;
512
+            pwidth         = avctx->width;
513
+        } else {
514
+            xp             = x << 3;
515
+            yp             = y << 4;
516
+            num_cblocks[i] = 2;
517
+            pwidth         = avctx->width >> 1;
518
+        }
519
+        src = (const uint16_t*)(pic->data[i] + yp * pic->linesize[i]) + xp;
520
+
521
+        get_slice_data(ctx, src, pic->linesize[i], xp, yp,
522
+                       pwidth, avctx->height, ctx->blocks[i],
523
+                       mbs_per_slice, num_cblocks[i]);
524
+    }
525
+
526
+    for (q = min_quant; q <= max_quant; q++) {
527
+        ctx->nodes[trellis_node + q].prev_node = -1;
528
+        ctx->nodes[trellis_node + q].quant     = q;
529
+    }
530
+
531
+    // todo: maybe perform coarser quantising to fit into frame size when needed
532
+    for (q = min_quant; q <= max_quant; q++) {
533
+        bits  = 0;
534
+        error = 0;
535
+        for (i = 0; i < ctx->num_planes; i++) {
536
+            bits += estimate_slice_plane(ctx, &error, i,
537
+                                         src, pic->linesize[i],
538
+                                         mbs_per_slice,
539
+                                         num_cblocks[i], plane_factor[i],
540
+                                         ctx->quants[q]);
541
+        }
542
+        if (bits > 65000 * 8) {
543
+            error = SCORE_LIMIT;
544
+            break;
545
+        }
546
+        slice_bits[q]  = bits;
547
+        slice_score[q] = error;
548
+    }
549
+
550
+    bits_limit = mbs * ctx->bits_per_mb;
551
+    for (pq = min_quant; pq <= max_quant; pq++) {
552
+        prev = trellis_node - TRELLIS_WIDTH + pq;
553
+
554
+        for (q = min_quant; q <= max_quant; q++) {
555
+            cur = trellis_node + q;
556
+
557
+            bits  = ctx->nodes[prev].bits + slice_bits[q];
558
+            error = slice_score[q];
559
+            if (bits > bits_limit)
560
+                error = SCORE_LIMIT;
561
+
562
+            if (ctx->nodes[prev].score < SCORE_LIMIT && error < SCORE_LIMIT)
563
+                new_score = ctx->nodes[prev].score + error;
564
+            else
565
+                new_score = SCORE_LIMIT;
566
+            if (ctx->nodes[cur].prev_node == -1 ||
567
+                ctx->nodes[cur].score >= new_score) {
568
+
569
+                ctx->nodes[cur].bits      = bits;
570
+                ctx->nodes[cur].score     = new_score;
571
+                ctx->nodes[cur].prev_node = prev;
572
+            }
573
+        }
574
+    }
575
+
576
+    error = ctx->nodes[trellis_node + min_quant].score;
577
+    pq    = trellis_node + min_quant;
578
+    for (q = min_quant + 1; q <= max_quant; q++) {
579
+        if (ctx->nodes[trellis_node + q].score <= error) {
580
+            error = ctx->nodes[trellis_node + q].score;
581
+            pq    = trellis_node + q;
582
+        }
583
+    }
584
+
585
+    return pq;
586
+}
587
+
588
+static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
589
+                        const AVFrame *pic, int *got_packet)
590
+{
591
+    ProresContext *ctx = avctx->priv_data;
592
+    uint8_t *orig_buf, *buf, *slice_hdr, *slice_sizes, *tmp;
593
+    uint8_t *picture_size_pos;
594
+    PutBitContext pb;
595
+    int x, y, i, mb, q = 0;
596
+    int sizes[4] = { 0 };
597
+    int slice_hdr_size = 2 + 2 * (ctx->num_planes - 1);
598
+    int frame_size, picture_size, slice_size;
599
+    int mbs_per_slice = ctx->mbs_per_slice;
600
+    int pkt_size, ret;
601
+
602
+    *avctx->coded_frame           = *pic;
603
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
604
+    avctx->coded_frame->key_frame = 1;
605
+
606
+    pkt_size = ctx->mb_width * ctx->mb_height * 64 * 3 * 12
607
+               + ctx->num_slices * 2 + 200 + FF_MIN_BUFFER_SIZE;
608
+
609
+    if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
610
+        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
611
+        return ret;
612
+    }
613
+
614
+    orig_buf = pkt->data;
615
+
616
+    // frame atom
617
+    orig_buf += 4;                              // frame size
618
+    bytestream_put_be32  (&orig_buf, FRAME_ID); // frame container ID
619
+    buf = orig_buf;
620
+
621
+    // frame header
622
+    tmp = buf;
623
+    buf += 2;                                   // frame header size will be stored here
624
+    bytestream_put_be16  (&buf, 0);             // version 1
625
+    bytestream_put_buffer(&buf, "Lavc", 4);     // creator
626
+    bytestream_put_be16  (&buf, avctx->width);
627
+    bytestream_put_be16  (&buf, avctx->height);
628
+    bytestream_put_byte  (&buf, ctx->chroma_factor << 6); // frame flags
629
+    bytestream_put_byte  (&buf, 0);             // reserved
630
+    bytestream_put_byte  (&buf, 0);             // primaries
631
+    bytestream_put_byte  (&buf, 0);             // transfer function
632
+    bytestream_put_byte  (&buf, 6);             // colour matrix - ITU-R BT.601-4
633
+    bytestream_put_byte  (&buf, 0x40);          // source format and alpha information
634
+    bytestream_put_byte  (&buf, 0);             // reserved
635
+    bytestream_put_byte  (&buf, 0x03);          // matrix flags - both matrices are present
636
+    // luma quantisation matrix
637
+    for (i = 0; i < 64; i++)
638
+        bytestream_put_byte(&buf, ctx->profile_info->quant[i]);
639
+    // chroma quantisation matrix
640
+    for (i = 0; i < 64; i++)
641
+        bytestream_put_byte(&buf, ctx->profile_info->quant[i]);
642
+    bytestream_put_be16  (&tmp, buf - orig_buf); // write back frame header size
643
+
644
+    // picture header
645
+    picture_size_pos = buf + 1;
646
+    bytestream_put_byte  (&buf, 0x40);          // picture header size (in bits)
647
+    buf += 4;                                   // picture data size will be stored here
648
+    bytestream_put_be16  (&buf, ctx->num_slices); // total number of slices
649
+    bytestream_put_byte  (&buf, av_log2(ctx->mbs_per_slice) << 4); // slice width and height in MBs
650
+
651
+    // seek table - will be filled during slice encoding
652
+    slice_sizes = buf;
653
+    buf += ctx->num_slices * 2;
654
+
655
+    // slices
656
+    for (y = 0; y < ctx->mb_height; y++) {
657
+        mbs_per_slice = ctx->mbs_per_slice;
658
+        for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
659
+            while (ctx->mb_width - x < mbs_per_slice)
660
+                mbs_per_slice >>= 1;
661
+            q = find_slice_quant(avctx, pic, (mb + 1) * TRELLIS_WIDTH, x, y,
662
+                                 mbs_per_slice);
663
+        }
664
+
665
+        for (x = ctx->slices_width - 1; x >= 0; x--) {
666
+            ctx->slice_q[x] = ctx->nodes[q].quant;
667
+            q = ctx->nodes[q].prev_node;
668
+        }
669
+
670
+        mbs_per_slice = ctx->mbs_per_slice;
671
+        for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) {
672
+            q = ctx->slice_q[mb];
673
+
674
+            while (ctx->mb_width - x < mbs_per_slice)
675
+                mbs_per_slice >>= 1;
676
+
677
+            bytestream_put_byte(&buf, slice_hdr_size << 3);
678
+            slice_hdr = buf;
679
+            buf += slice_hdr_size - 1;
680
+            init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
681
+            encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
682
+
683
+            bytestream_put_byte(&slice_hdr, q);
684
+            slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];
685
+            for (i = 0; i < ctx->num_planes - 1; i++) {
686
+                bytestream_put_be16(&slice_hdr, sizes[i]);
687
+                slice_size += sizes[i];
688
+            }
689
+            bytestream_put_be16(&slice_sizes, slice_size);
690
+            buf += slice_size - slice_hdr_size;
691
+        }
692
+    }
693
+
694
+    orig_buf -= 8;
695
+    frame_size = buf - orig_buf;
696
+    picture_size = buf - picture_size_pos - 6;
697
+    bytestream_put_be32(&orig_buf, frame_size);
698
+    bytestream_put_be32(&picture_size_pos, picture_size);
699
+
700
+    pkt->size   = frame_size;
701
+    pkt->flags |= AV_PKT_FLAG_KEY;
702
+    *got_packet = 1;
703
+
704
+    return 0;
705
+}
706
+
707
+static av_cold int encode_close(AVCodecContext *avctx)
708
+{
709
+    ProresContext *ctx = avctx->priv_data;
710
+
711
+    if (avctx->coded_frame->data[0])
712
+        avctx->release_buffer(avctx, avctx->coded_frame);
713
+
714
+    av_freep(&avctx->coded_frame);
715
+
716
+    av_freep(&ctx->nodes);
717
+    av_freep(&ctx->slice_q);
718
+
719
+    return 0;
720
+}
721
+
722
+static av_cold int encode_init(AVCodecContext *avctx)
723
+{
724
+    ProresContext *ctx = avctx->priv_data;
725
+    int mps;
726
+    int i, j;
727
+    int min_quant, max_quant;
728
+
729
+    avctx->bits_per_raw_sample = 10;
730
+    avctx->coded_frame = avcodec_alloc_frame();
731
+    if (!avctx->coded_frame)
732
+        return AVERROR(ENOMEM);
733
+
734
+    ff_proresdsp_init(&ctx->dsp, avctx);
735
+    ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable,
736
+                      ff_prores_progressive_scan);
737
+
738
+    mps = ctx->mbs_per_slice;
739
+    if (mps & (mps - 1)) {
740
+        av_log(avctx, AV_LOG_ERROR,
741
+               "there should be an integer power of two MBs per slice\n");
742
+        return AVERROR(EINVAL);
743
+    }
744
+
745
+    ctx->chroma_factor = avctx->pix_fmt == PIX_FMT_YUV422P10
746
+                         ? CFACTOR_Y422
747
+                         : CFACTOR_Y444;
748
+    ctx->profile_info  = prores_profile_info + ctx->profile;
749
+    ctx->num_planes    = 3;
750
+
751
+    ctx->mb_width      = FFALIGN(avctx->width,  16) >> 4;
752
+    ctx->mb_height     = FFALIGN(avctx->height, 16) >> 4;
753
+    ctx->slices_width  = ctx->mb_width / mps;
754
+    ctx->slices_width += av_popcount(ctx->mb_width - ctx->slices_width * mps);
755
+    ctx->num_slices    = ctx->mb_height * ctx->slices_width;
756
+
757
+    for (i = 0; i < NUM_MB_LIMITS - 1; i++)
758
+        if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height)
759
+            break;
760
+    ctx->bits_per_mb   = ctx->profile_info->br_tab[i];
761
+
762
+    min_quant = ctx->profile_info->min_quant;
763
+    max_quant = ctx->profile_info->max_quant;
764
+    for (i = min_quant; i <= max_quant; i++) {
765
+        for (j = 0; j < 64; j++)
766
+            ctx->quants[i][j] = ctx->profile_info->quant[j] * i;
767
+    }
768
+
769
+    avctx->codec_tag   = ctx->profile_info->tag;
770
+
771
+    av_log(avctx, AV_LOG_DEBUG, "profile %d, %d slices, %d bits per MB\n",
772
+           ctx->profile, ctx->num_slices, ctx->bits_per_mb);
773
+
774
+    ctx->nodes = av_malloc((ctx->slices_width + 1) * TRELLIS_WIDTH
775
+                           * sizeof(*ctx->nodes));
776
+    if (!ctx->nodes) {
777
+        encode_close(avctx);
778
+        return AVERROR(ENOMEM);
779
+    }
780
+    for (i = min_quant; i <= max_quant; i++) {
781
+        ctx->nodes[i].prev_node = -1;
782
+        ctx->nodes[i].bits      = 0;
783
+        ctx->nodes[i].score     = 0;
784
+    }
785
+
786
+    ctx->slice_q = av_malloc(ctx->slices_width * sizeof(*ctx->slice_q));
787
+    if (!ctx->slice_q) {
788
+        encode_close(avctx);
789
+        return AVERROR(ENOMEM);
790
+    }
791
+
792
+    return 0;
793
+}
794
+
795
+#define OFFSET(x) offsetof(ProresContext, x)
796
+#define VE     AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
797
+
798
+static const AVOption options[] = {
799
+    { "mbs_per_slice", "macroblocks per slice", OFFSET(mbs_per_slice),
800
+        AV_OPT_TYPE_INT, { 8 }, 1, MAX_MBS_PER_SLICE, VE },
801
+    { "profile",       NULL, OFFSET(profile), AV_OPT_TYPE_INT,
802
+        { PRORES_PROFILE_STANDARD },
803
+        PRORES_PROFILE_PROXY, PRORES_PROFILE_HQ, VE, "profile" },
804
+    { "proxy",         NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_PROXY },
805
+        0, 0, VE, "profile" },
806
+    { "lt",            NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_LT },
807
+        0, 0, VE, "profile" },
808
+    { "standard",      NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_STANDARD },
809
+        0, 0, VE, "profile" },
810
+    { "hq",            NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_HQ },
811
+        0, 0, VE, "profile" },
812
+    { NULL }
813
+};
814
+
815
+static const AVClass proresenc_class = {
816
+    .class_name = "ProRes encoder",
817
+    .item_name  = av_default_item_name,
818
+    .option     = options,
819
+    .version    = LIBAVUTIL_VERSION_INT,
820
+};
821
+
822
+AVCodec ff_prores_kostya_encoder = {
823
+    .name           = "prores_kostya",
824
+    .type           = AVMEDIA_TYPE_VIDEO,
825
+    .id             = CODEC_ID_PRORES,
826
+    .priv_data_size = sizeof(ProresContext),
827
+    .init           = encode_init,
828
+    .close          = encode_close,
829
+    .encode2        = encode_frame,
830
+    .long_name      = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
831
+    .pix_fmts       = (const enum PixelFormat[]) {
832
+                          PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, PIX_FMT_NONE
833
+                      },
834
+    .priv_class     = &proresenc_class,
835
+};
... ...
@@ -62,7 +62,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
62 62
 {
63 63
     RA288Context *ractx = avctx->priv_data;
64 64
     avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
65
-    dsputil_init(&ractx->dsp, avctx);
65
+    ff_dsputil_init(&ractx->dsp, avctx);
66 66
 
67 67
     avcodec_get_frame_defaults(&ractx->frame);
68 68
     avctx->coded_frame = &ractx->frame;
... ...
@@ -53,8 +53,8 @@ typedef struct RLTable {
53 53
  * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold
54 54
  *                     the level and run tables, if this is NULL av_malloc() will be used
55 55
  */
56
-void init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]);
57
-void init_vlc_rl(RLTable *rl);
56
+void ff_init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]);
57
+void ff_init_vlc_rl(RLTable *rl);
58 58
 
59 59
 #define INIT_VLC_RL(rl, static_size)\
60 60
 {\
... ...
@@ -68,7 +68,7 @@ void init_vlc_rl(RLTable *rl);
68 68
         for(q=0; q<32; q++)\
69 69
             rl.rl_vlc[q]= rl_vlc_table[q];\
70 70
 \
71
-        init_vlc_rl(&rl);\
71
+        ff_init_vlc_rl(&rl);\
72 72
     }\
73 73
 }
74 74
 
... ...
@@ -97,15 +97,15 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc
97 97
 
98 98
 /**
99 99
  * @brief decode one rtjpeg YUV420 frame
100
- * @param c context, must be initialized via rtjpeg_decode_init
100
+ * @param c context, must be initialized via ff_rtjpeg_decode_init
101 101
  * @param f AVFrame to place decoded frame into. If parts of the frame
102 102
  *          are not coded they are left unchanged, so consider initializing it
103 103
  * @param buf buffer containing input data
104 104
  * @param buf_size length of input data in bytes
105 105
  * @return number of bytes consumed from the input buffer
106 106
  */
107
-int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
108
-                               const uint8_t *buf, int buf_size) {
107
+int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
108
+                                  const uint8_t *buf, int buf_size) {
109 109
     GetBitContext gb;
110 110
     int w = c->w / 16, h = c->h / 16;
111 111
     int x, y;
... ...
@@ -154,9 +154,9 @@ int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
154 154
  * @param lquant luma quantization table to use
155 155
  * @param cquant chroma quantization table to use
156 156
  */
157
-void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
158
-                        int width, int height,
159
-                        const uint32_t *lquant, const uint32_t *cquant) {
157
+void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
158
+                           int width, int height,
159
+                           const uint32_t *lquant, const uint32_t *cquant) {
160 160
     int i;
161 161
     c->dsp = dsp;
162 162
     for (i = 0; i < 64; i++) {
... ...
@@ -34,10 +34,10 @@ typedef struct {
34 34
     DECLARE_ALIGNED(16, DCTELEM, block)[64];
35 35
 } RTJpegContext;
36 36
 
37
-void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
37
+void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
38 38
                         int width, int height,
39 39
                         const uint32_t *lquant, const uint32_t *cquant);
40 40
 
41
-int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
41
+int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
42 42
                                const uint8_t *buf, int buf_size);
43 43
 #endif /* AVCODEC_RTJPEG_H */
... ...
@@ -186,7 +186,7 @@ static const uint8_t rv_chrom_bits[256] =
186 186
 
187 187
 static VLC rv_dc_lum, rv_dc_chrom;
188 188
 
189
-int rv_decode_dc(MpegEncContext *s, int n)
189
+int ff_rv_decode_dc(MpegEncContext *s, int n)
190 190
 {
191 191
     int code;
192 192
 
... ...
@@ -368,11 +368,11 @@ static int rv20_decode_picture_header(MpegEncContext *s)
368 368
             av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h);
369 369
             if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0)
370 370
                 return -1;
371
-            MPV_common_end(s);
371
+            ff_MPV_common_end(s);
372 372
             avcodec_set_dimensions(s->avctx, new_w, new_h);
373 373
             s->width  = new_w;
374 374
             s->height = new_h;
375
-            if (MPV_common_init(s) < 0)
375
+            if (ff_MPV_common_init(s) < 0)
376 376
                 return -1;
377 377
         }
378 378
 
... ...
@@ -444,7 +444,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
444 444
         return -1;
445 445
     }
446 446
 
447
-    MPV_decode_defaults(s);
447
+    ff_MPV_decode_defaults(s);
448 448
 
449 449
     s->avctx= avctx;
450 450
     s->out_format = FMT_H263;
... ...
@@ -484,10 +484,10 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
484 484
 
485 485
     avctx->pix_fmt = PIX_FMT_YUV420P;
486 486
 
487
-    if (MPV_common_init(s) < 0)
487
+    if (ff_MPV_common_init(s) < 0)
488 488
         return -1;
489 489
 
490
-    h263_decode_init_vlc(s);
490
+    ff_h263_decode_init_vlc(s);
491 491
 
492 492
     /* init rv vlc */
493 493
     if (!done) {
... ...
@@ -507,7 +507,7 @@ static av_cold int rv10_decode_end(AVCodecContext *avctx)
507 507
 {
508 508
     MpegEncContext *s = avctx->priv_data;
509 509
 
510
-    MPV_common_end(s);
510
+    ff_MPV_common_end(s);
511 511
     return 0;
512 512
 }
513 513
 
... ...
@@ -542,10 +542,10 @@ static int rv10_decode_packet(AVCodecContext *avctx,
542 542
     if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) {
543 543
         if(s->current_picture_ptr){ //FIXME write parser so we always have complete frames?
544 544
             ff_er_frame_end(s);
545
-            MPV_frame_end(s);
545
+            ff_MPV_frame_end(s);
546 546
             s->mb_x= s->mb_y = s->resync_mb_x = s->resync_mb_y= 0;
547 547
         }
548
-        if(MPV_frame_start(s, avctx) < 0)
548
+        if(ff_MPV_frame_start(s, avctx) < 0)
549 549
             return -1;
550 550
         ff_er_frame_start(s);
551 551
     } else {
... ...
@@ -613,7 +613,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
613 613
         }
614 614
         if(s->pict_type != AV_PICTURE_TYPE_B)
615 615
             ff_h263_update_motion_val(s);
616
-        MPV_decode_mb(s, s->block);
616
+        ff_MPV_decode_mb(s, s->block);
617 617
         if(s->loop_filter)
618 618
             ff_h263_loop_filter(s);
619 619
 
... ...
@@ -693,7 +693,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
693 693
 
694 694
     if(s->current_picture_ptr != NULL && s->mb_y>=s->mb_height){
695 695
         ff_er_frame_end(s);
696
-        MPV_frame_end(s);
696
+        ff_MPV_frame_end(s);
697 697
 
698 698
         if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
699 699
             *pict= *(AVFrame*)s->current_picture_ptr;
... ...
@@ -28,7 +28,7 @@
28 28
 #include "mpegvideo.h"
29 29
 #include "put_bits.h"
30 30
 
31
-void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
31
+void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number)
32 32
 {
33 33
     int full_frame= 0;
34 34
 
... ...
@@ -61,9 +61,9 @@ AVCodec ff_rv10_encoder = {
61 61
     .type           = AVMEDIA_TYPE_VIDEO,
62 62
     .id             = CODEC_ID_RV10,
63 63
     .priv_data_size = sizeof(MpegEncContext),
64
-    .init           = MPV_encode_init,
65
-    .encode         = MPV_encode_picture,
66
-    .close          = MPV_encode_end,
64
+    .init           = ff_MPV_encode_init,
65
+    .encode         = ff_MPV_encode_picture,
66
+    .close          = ff_MPV_encode_end,
67 67
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
68 68
     .long_name= NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
69 69
 };
... ...
@@ -29,7 +29,7 @@
29 29
 #include "h263.h"
30 30
 #include "put_bits.h"
31 31
 
32
-void rv20_encode_picture_header(MpegEncContext *s, int picture_number){
32
+void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number){
33 33
     put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ?
34 34
     put_bits(&s->pb, 1, 0);     /* unknown bit */
35 35
     put_bits(&s->pb, 5, s->qscale);
... ...
@@ -62,9 +62,9 @@ AVCodec ff_rv20_encoder = {
62 62
     .type           = AVMEDIA_TYPE_VIDEO,
63 63
     .id             = CODEC_ID_RV20,
64 64
     .priv_data_size = sizeof(MpegEncContext),
65
-    .init           = MPV_encode_init,
66
-    .encode         = MPV_encode_picture,
67
-    .close          = MPV_encode_end,
65
+    .init           = ff_MPV_encode_init,
66
+    .encode         = ff_MPV_encode_picture,
67
+    .close          = ff_MPV_encode_end,
68 68
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
69 69
     .long_name= NULL_IF_CONFIG_SMALL("RealVideo 2.0"),
70 70
 };
... ...
@@ -131,10 +131,10 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t
131 131
 
132 132
     vlc->table = &table_data[table_offs[num]];
133 133
     vlc->table_allocated = table_offs[num + 1] - table_offs[num];
134
-    init_vlc_sparse(vlc, FFMIN(maxbits, 9), realsize,
135
-                    bits2, 1, 1,
136
-                    cw,    2, 2,
137
-                    syms,  2, 2, INIT_VLC_USE_NEW_STATIC);
134
+    ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), realsize,
135
+                       bits2, 1, 1,
136
+                       cw,    2, 2,
137
+                       syms,  2, 2, INIT_VLC_USE_NEW_STATIC);
138 138
 }
139 139
 
140 140
 /**
... ...
@@ -1427,17 +1427,17 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
1427 1427
 
1428 1428
             av_log(s->avctx, AV_LOG_WARNING, "Changing dimensions to %dx%d\n",
1429 1429
                    r->si.width, r->si.height);
1430
-            MPV_common_end(s);
1430
+            ff_MPV_common_end(s);
1431 1431
             s->width  = r->si.width;
1432 1432
             s->height = r->si.height;
1433 1433
             avcodec_set_dimensions(s->avctx, s->width, s->height);
1434
-            if ((err = MPV_common_init(s)) < 0)
1434
+            if ((err = ff_MPV_common_init(s)) < 0)
1435 1435
                 return err;
1436 1436
             if ((err = rv34_decoder_realloc(r)) < 0)
1437 1437
                 return err;
1438 1438
         }
1439 1439
         s->pict_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I;
1440
-        if(MPV_frame_start(s, s->avctx) < 0)
1440
+        if(ff_MPV_frame_start(s, s->avctx) < 0)
1441 1441
             return -1;
1442 1442
         ff_er_frame_start(s);
1443 1443
         if (!r->tmp_b_block_base) {
... ...
@@ -1545,7 +1545,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
1545 1545
     MpegEncContext *s = &r->s;
1546 1546
     int ret;
1547 1547
 
1548
-    MPV_decode_defaults(s);
1548
+    ff_MPV_decode_defaults(s);
1549 1549
     s->avctx      = avctx;
1550 1550
     s->out_format = FMT_H263;
1551 1551
     s->codec_id   = avctx->codec_id;
... ...
@@ -1560,7 +1560,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
1560 1560
     avctx->has_b_frames = 1;
1561 1561
     s->low_delay = 0;
1562 1562
 
1563
-    if ((ret = MPV_common_init(s)) < 0)
1563
+    if ((ret = ff_MPV_common_init(s)) < 0)
1564 1564
         return ret;
1565 1565
 
1566 1566
     ff_h264_pred_init(&r->h, CODEC_ID_RV40, 8, 1);
... ...
@@ -1592,7 +1592,7 @@ int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx)
1592 1592
 
1593 1593
     if (avctx->internal->is_copy) {
1594 1594
         r->tmp_b_block_base = NULL;
1595
-        if ((err = MPV_common_init(&r->s)) < 0)
1595
+        if ((err = ff_MPV_common_init(&r->s)) < 0)
1596 1596
             return err;
1597 1597
         if ((err = rv34_decoder_alloc(r)) < 0)
1598 1598
             return err;
... ...
@@ -1610,10 +1610,10 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte
1610 1610
         return 0;
1611 1611
 
1612 1612
     if (s->height != s1->height || s->width != s1->width) {
1613
-        MPV_common_end(s);
1613
+        ff_MPV_common_end(s);
1614 1614
         s->height = s1->height;
1615 1615
         s->width  = s1->width;
1616
-        if ((err = MPV_common_init(s)) < 0)
1616
+        if ((err = ff_MPV_common_init(s)) < 0)
1617 1617
             return err;
1618 1618
         if ((err = rv34_decoder_realloc(r)) < 0)
1619 1619
             return err;
... ...
@@ -1629,7 +1629,7 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte
1629 1629
     memset(&r->si, 0, sizeof(r->si));
1630 1630
 
1631 1631
     /* necessary since it is it the condition checked for in decode_slice
1632
-     * to call MPV_frame_start. cmp. comment at the end of decode_frame */
1632
+     * to call ff_MPV_frame_start. cmp. comment at the end of decode_frame */
1633 1633
     s->current_picture_ptr = NULL;
1634 1634
 
1635 1635
     return 0;
... ...
@@ -1741,7 +1741,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
1741 1741
         if(r->loop_filter)
1742 1742
             r->loop_filter(r, s->mb_height - 1);
1743 1743
         ff_er_frame_end(s);
1744
-        MPV_frame_end(s);
1744
+        ff_MPV_frame_end(s);
1745 1745
 
1746 1746
         if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME))
1747 1747
             ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 0);
... ...
@@ -1765,7 +1765,7 @@ av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
1765 1765
 {
1766 1766
     RV34DecContext *r = avctx->priv_data;
1767 1767
 
1768
-    MPV_common_end(&r->s);
1768
+    ff_MPV_common_end(&r->s);
1769 1769
     rv34_decoder_free(r);
1770 1770
 
1771 1771
     return 0;
... ...
@@ -101,7 +101,7 @@ static const uint8_t rv34_quant_to_vlc_set[2][31] = {
101 101
 
102 102
 /**
103 103
  * table for obtaining the quantizer difference
104
- * @todo Use with modified_quant_tab from h263data.h.
104
+ * @todo Use with ff_modified_quant_tab from h263data.h.
105 105
  */
106 106
 static const uint8_t rv34_dquant_tab[2][32]={
107 107
 //  0  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
... ...
@@ -80,18 +80,18 @@ static av_cold void rv40_init_tables(void)
80 80
     for(i = 0; i < NUM_PTYPE_VLCS; i++){
81 81
         ptype_vlc[i].table = &ptype_table[i << PTYPE_VLC_BITS];
82 82
         ptype_vlc[i].table_allocated = 1 << PTYPE_VLC_BITS;
83
-        init_vlc_sparse(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE,
84
-                         ptype_vlc_bits[i],  1, 1,
85
-                         ptype_vlc_codes[i], 1, 1,
86
-                         ptype_vlc_syms,     1, 1, INIT_VLC_USE_NEW_STATIC);
83
+        ff_init_vlc_sparse(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE,
84
+                            ptype_vlc_bits[i],  1, 1,
85
+                            ptype_vlc_codes[i], 1, 1,
86
+                            ptype_vlc_syms,     1, 1, INIT_VLC_USE_NEW_STATIC);
87 87
     }
88 88
     for(i = 0; i < NUM_BTYPE_VLCS; i++){
89 89
         btype_vlc[i].table = &btype_table[i << BTYPE_VLC_BITS];
90 90
         btype_vlc[i].table_allocated = 1 << BTYPE_VLC_BITS;
91
-        init_vlc_sparse(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE,
92
-                         btype_vlc_bits[i],  1, 1,
93
-                         btype_vlc_codes[i], 1, 1,
94
-                         btype_vlc_syms,     1, 1, INIT_VLC_USE_NEW_STATIC);
91
+        ff_init_vlc_sparse(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE,
92
+                            btype_vlc_bits[i],  1, 1,
93
+                            btype_vlc_codes[i], 1, 1,
94
+                            btype_vlc_syms,     1, 1, INIT_VLC_USE_NEW_STATIC);
95 95
     }
96 96
 }
97 97
 
... ...
@@ -331,7 +331,7 @@ DEFFUNC(avg,no_rnd,xy,16,OP_XY,PACK)
331 331
 
332 332
 #endif
333 333
 
334
-void dsputil_init_align(DSPContext* c, AVCodecContext *avctx)
334
+void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx)
335 335
 {
336 336
         const int high_bit_depth = avctx->bits_per_raw_sample > 8;
337 337
 
... ...
@@ -56,7 +56,7 @@ static void idct_put(uint8_t *dest, int line_size, DCTELEM *block)
56 56
 {
57 57
         int i;
58 58
         uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
59
-        idct_sh4(block);
59
+        ff_idct_sh4(block);
60 60
         for(i=0;i<8;i++) {
61 61
                 dest[0] = cm[block[0]];
62 62
                 dest[1] = cm[block[1]];
... ...
@@ -74,7 +74,7 @@ static void idct_add(uint8_t *dest, int line_size, DCTELEM *block)
74 74
 {
75 75
         int i;
76 76
         uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
77
-        idct_sh4(block);
77
+        ff_idct_sh4(block);
78 78
         for(i=0;i<8;i++) {
79 79
                 dest[0] = cm[dest[0]+block[0]];
80 80
                 dest[1] = cm[dest[1]+block[1]];
... ...
@@ -89,11 +89,11 @@ static void idct_add(uint8_t *dest, int line_size, DCTELEM *block)
89 89
         }
90 90
 }
91 91
 
92
-void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx)
92
+void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx)
93 93
 {
94 94
         const int idct_algo= avctx->idct_algo;
95 95
         const int high_bit_depth = avctx->bits_per_raw_sample > 8;
96
-        dsputil_init_align(c,avctx);
96
+        ff_dsputil_init_align(c,avctx);
97 97
 
98 98
         if (!high_bit_depth)
99 99
         c->clear_blocks = clear_blocks_sh4;
... ...
@@ -101,7 +101,7 @@ void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx)
101 101
             (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SH4)) {
102 102
                 c->idct_put = idct_put;
103 103
                 c->idct_add = idct_add;
104
-               c->idct     = idct_sh4;
104
+                c->idct     = ff_idct_sh4;
105 105
                 c->idct_permutation_type= FF_NO_IDCT_PERM;
106 106
         }
107 107
 }
... ...
@@ -22,7 +22,7 @@
22 22
 #include "libavcodec/avcodec.h"
23 23
 #include "libavcodec/dsputil.h"
24 24
 
25
-void idct_sh4(DCTELEM *block);
26
-void dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
25
+void ff_idct_sh4(DCTELEM *block);
26
+void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
27 27
 
28 28
 #endif /* AVCODEC_SH4_DSPUTIL_SH4_H */
... ...
@@ -89,7 +89,7 @@ static const float odd_table[] __attribute__ ((aligned(8))) = {
89 89
 
90 90
 //optimized
91 91
 
92
-void idct_sh4(DCTELEM *block)
92
+void ff_idct_sh4(DCTELEM *block)
93 93
 {
94 94
         DEFREG;
95 95
 
... ...
@@ -272,9 +272,9 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
272 272
     *recodes = huff.values;
273 273
 
274 274
     if(vlc[0].table)
275
-        free_vlc(&vlc[0]);
275
+        ff_free_vlc(&vlc[0]);
276 276
     if(vlc[1].table)
277
-        free_vlc(&vlc[1]);
277
+        ff_free_vlc(&vlc[1]);
278 278
     av_free(tmp1.bits);
279 279
     av_free(tmp1.lengths);
280 280
     av_free(tmp1.values);
... ...
@@ -728,7 +728,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
728 728
 
729 729
     for(i = 0; i < 4; i++) {
730 730
         if(vlc[i].table)
731
-            free_vlc(&vlc[i]);
731
+            ff_free_vlc(&vlc[i]);
732 732
         av_free(h[i].bits);
733 733
         av_free(h[i].lengths);
734 734
         av_free(h[i].values);
... ...
@@ -99,7 +99,7 @@ static void init_qexp(void){
99 99
     double v=128;
100 100
 
101 101
     for(i=0; i<QROOT; i++){
102
-        qexp[i]= lrintf(v);
102
+        ff_qexp[i]= lrintf(v);
103 103
         v *= pow(2, 1.0 / QROOT);
104 104
     }
105 105
 }
... ...
@@ -390,7 +390,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
390 390
     s->avctx= avctx;
391 391
     s->max_ref_frames=1; //just make sure its not an invalid value in case of no initial keyframe
392 392
 
393
-    dsputil_init(&s->dsp, avctx);
393
+    ff_dsputil_init(&s->dsp, avctx);
394 394
     ff_dwt_init(&s->dwt);
395 395
 
396 396
 #define mcf(dx,dy)\
... ...
@@ -443,7 +443,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
443 443
 
444 444
     for(i=0; i<MAX_REF_FRAMES; i++)
445 445
         for(j=0; j<MAX_REF_FRAMES; j++)
446
-            scale_mv_ref[i][j] = 256*(i+1)/(j+1);
446
+            ff_scale_mv_ref[i][j] = 256*(i+1)/(j+1);
447 447
 
448 448
     s->avctx->get_buffer(s->avctx, &s->mconly_picture);
449 449
     s->scratchbuf = av_malloc(s->mconly_picture.linesize[0]*7*MB_SIZE);
... ...
@@ -165,13 +165,9 @@ typedef struct SnowContext{
165 165
 }SnowContext;
166 166
 
167 167
 /* Tables */
168
-extern const uint8_t * const obmc_tab[4];
169
-#ifdef __sgi
170
-// Avoid a name clash on SGI IRIX
171
-#undef qexp
172
-#endif
173
-extern uint8_t qexp[QROOT];
174
-extern int scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES];
168
+extern const uint8_t * const ff_obmc_tab[4];
169
+extern uint8_t ff_qexp[QROOT];
170
+extern int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES];
175 171
 
176 172
 /* C bits used by mmx/sse2/altivec */
177 173
 
... ...
@@ -256,7 +252,7 @@ static inline void pred_mv(SnowContext *s, int *mx, int *my, int ref,
256 256
         *mx = mid_pred(left->mx, top->mx, tr->mx);
257 257
         *my = mid_pred(left->my, top->my, tr->my);
258 258
     }else{
259
-        const int *scale = scale_mv_ref[ref];
259
+        const int *scale = ff_scale_mv_ref[ref];
260 260
         *mx = mid_pred((left->mx * scale[left->ref] + 128) >>8,
261 261
                        (top ->mx * scale[top ->ref] + 128) >>8,
262 262
                        (tr  ->mx * scale[tr  ->ref] + 128) >>8);
... ...
@@ -405,7 +401,7 @@ static av_always_inline void predict_slice(SnowContext *s, IDWTELEM *buf, int pl
405 405
     int x, y, mb_x;
406 406
     int block_size = MB_SIZE >> s->block_max_depth;
407 407
     int block_w    = plane_index ? block_size/2 : block_size;
408
-    const uint8_t *obmc  = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
408
+    const uint8_t *obmc  = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth];
409 409
     const int obmc_stride= plane_index ? block_size : 2*block_size;
410 410
     int ref_stride= s->current_picture.linesize[plane_index];
411 411
     uint8_t *dst8= s->current_picture.data[plane_index];
... ...
@@ -496,7 +492,7 @@ static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3
496 496
 
497 497
 /* bitstream functions */
498 498
 
499
-extern const int8_t quant3bA[256];
499
+extern const int8_t ff_quant3bA[256];
500 500
 
501 501
 #define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0
502 502
 
... ...
@@ -642,7 +638,7 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
642 642
                 v=get_rac(&s->c, &b->state[0][context]);
643 643
                 if(v){
644 644
                     v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
645
-                    v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l&0xFF] + 3*quant3bA[t&0xFF]]);
645
+                    v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]);
646 646
 
647 647
                     xc->x=x;
648 648
                     (xc++)->coeff= v;
... ...
@@ -101,7 +101,7 @@ static const uint8_t obmc4[16]={
101 101
 //error:0.000000
102 102
 };
103 103
 
104
-const int8_t quant3bA[256]={
104
+const int8_t ff_quant3bA[256]={
105 105
  0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
106 106
  1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
107 107
  1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
... ...
@@ -120,13 +120,13 @@ const int8_t quant3bA[256]={
120 120
  1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
121 121
 };
122 122
 
123
-const uint8_t * const obmc_tab[4]= {
123
+const uint8_t * const ff_obmc_tab[4]= {
124 124
     obmc32, obmc16, obmc8, obmc4
125 125
 };
126 126
 
127 127
 /* runtime generated tables */
128
-uint8_t qexp[QROOT];
129
-int scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES];
128
+uint8_t ff_qexp[QROOT];
129
+int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES];
130 130
 
131 131
 
132 132
 #endif /* AVCODEC_SNOW_H */
... ...
@@ -42,7 +42,7 @@ static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer
42 42
     int x, y, mb_x;
43 43
     int block_size = MB_SIZE >> s->block_max_depth;
44 44
     int block_w    = plane_index ? block_size/2 : block_size;
45
-    const uint8_t *obmc  = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
45
+    const uint8_t *obmc  = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth];
46 46
     int obmc_stride= plane_index ? block_size : 2*block_size;
47 47
     int ref_stride= s->current_picture.linesize[plane_index];
48 48
     uint8_t *dst8= s->current_picture.data[plane_index];
... ...
@@ -95,7 +95,7 @@ static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, sli
95 95
     const int w= b->width;
96 96
     int y;
97 97
     const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
98
-    int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
98
+    int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
99 99
     int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
100 100
     int new_index = 0;
101 101
 
... ...
@@ -184,7 +184,7 @@ static void decode_q_branch(SnowContext *s, int level, int x, int y){
184 184
 static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, IDWTELEM *src, int stride, int start_y, int end_y){
185 185
     const int w= b->width;
186 186
     const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
187
-    const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
187
+    const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
188 188
     const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
189 189
     int x,y;
190 190
 
... ...
@@ -199,7 +199,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
199 199
     s->m.me.map       = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
200 200
     s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
201 201
     s->m.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t));
202
-    h263_encode_init(&s->m); //mv_penalty
202
+    ff_h263_encode_init(&s->m); //mv_penalty
203 203
 
204 204
     s->max_ref_frames = FFMAX(FFMIN(avctx->refs, MAX_REF_FRAMES), 1);
205 205
 
... ...
@@ -575,7 +575,7 @@ static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){
575 575
     Plane *p= &s->plane[plane_index];
576 576
     const int block_size = MB_SIZE >> s->block_max_depth;
577 577
     const int block_w    = plane_index ? block_size/2 : block_size;
578
-    const uint8_t *obmc  = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
578
+    const uint8_t *obmc  = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth];
579 579
     const int obmc_stride= plane_index ? block_size : 2*block_size;
580 580
     const int ref_stride= s->current_picture.linesize[plane_index];
581 581
     uint8_t *src= s-> input_picture.data[plane_index];
... ...
@@ -766,7 +766,7 @@ static int get_4block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index){
766 766
     Plane *p= &s->plane[plane_index];
767 767
     const int block_size = MB_SIZE >> s->block_max_depth;
768 768
     const int block_w    = plane_index ? block_size/2 : block_size;
769
-    const uint8_t *obmc  = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth];
769
+    const uint8_t *obmc  = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth];
770 770
     const int obmc_stride= plane_index ? block_size : 2*block_size;
771 771
     const int ref_stride= s->current_picture.linesize[plane_index];
772 772
     uint8_t *dst= s->current_picture.data[plane_index];
... ...
@@ -939,7 +939,7 @@ static int encode_subband_c0run(SnowContext *s, SubBand *b, IDWTELEM *src, IDWTE
939 939
                     int t2= 2*FFABS(t) + (t<0);
940 940
 
941 941
                     put_symbol2(&s->c, b->state[context + 2], FFABS(v)-1, context-4);
942
-                    put_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l2&0xFF] + 3*quant3bA[t2&0xFF]], v<0);
942
+                    put_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l2&0xFF] + 3*ff_quant3bA[t2&0xFF]], v<0);
943 943
                 }
944 944
             }
945 945
         }
... ...
@@ -1090,7 +1090,7 @@ static void iterative_me(SnowContext *s){
1090 1090
                 //FIXME precalculate
1091 1091
                 {
1092 1092
                     int x, y;
1093
-                    memcpy(obmc_edged, obmc_tab[s->block_max_depth], b_w*b_w*4);
1093
+                    memcpy(obmc_edged, ff_obmc_tab[s->block_max_depth], b_w*b_w*4);
1094 1094
                     if(mb_x==0)
1095 1095
                         for(y=0; y<b_w*2; y++)
1096 1096
                             memset(obmc_edged[y], obmc_edged[y][0] + obmc_edged[y][b_w-1], b_w);
... ...
@@ -1286,7 +1286,7 @@ static void quantize(SnowContext *s, SubBand *b, IDWTELEM *dst, DWTELEM *src, in
1286 1286
     const int w= b->width;
1287 1287
     const int h= b->height;
1288 1288
     const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
1289
-    const int qmul= qexp[qlog&(QROOT-1)]<<((qlog>>QSHIFT) + ENCODER_EXTRA_BITS);
1289
+    const int qmul= ff_qexp[qlog&(QROOT-1)]<<((qlog>>QSHIFT) + ENCODER_EXTRA_BITS);
1290 1290
     int x,y, thres1, thres2;
1291 1291
 
1292 1292
     if(s->qlog == LOSSLESS_QLOG){
... ...
@@ -1347,7 +1347,7 @@ static void dequantize(SnowContext *s, SubBand *b, IDWTELEM *src, int stride){
1347 1347
     const int w= b->width;
1348 1348
     const int h= b->height;
1349 1349
     const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
1350
-    const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
1350
+    const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
1351 1351
     const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
1352 1352
     int x,y;
1353 1353
 
... ...
@@ -1538,7 +1538,7 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
1538 1538
             const int h= b->height;
1539 1539
             const int stride= b->stride;
1540 1540
             const int qlog= av_clip(2*QROOT + b->qlog, 0, QROOT*16);
1541
-            const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
1541
+            const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
1542 1542
             const int qdiv= (1<<16)/qmul;
1543 1543
             int x, y;
1544 1544
             //FIXME this is ugly
... ...
@@ -3949,7 +3949,7 @@ static int vis_level(void)
3949 3949
 }
3950 3950
 
3951 3951
 /* libavcodec initialization code */
3952
-void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx)
3952
+void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx)
3953 3953
 {
3954 3954
   /* VIS-specific optimizations */
3955 3955
   int accel = vis_level ();
... ...
@@ -43,7 +43,7 @@
43 43
 #undef NDEBUG
44 44
 #include <assert.h>
45 45
 
46
-extern const uint8_t mvtab[33][2];
46
+extern const uint8_t ff_mvtab[33][2];
47 47
 
48 48
 static VLC svq1_block_type;
49 49
 static VLC svq1_motion_component;
... ...
@@ -670,7 +670,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
670 670
      || avctx->skip_frame >= AVDISCARD_ALL)
671 671
       return buf_size;
672 672
 
673
-  if(MPV_frame_start(s, avctx) < 0)
673
+  if(ff_MPV_frame_start(s, avctx) < 0)
674 674
       return -1;
675 675
 
676 676
   pmv = av_malloc((FFALIGN(s->width, 16)/8 + 3) * sizeof(*pmv));
... ...
@@ -738,7 +738,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
738 738
   *pict = *(AVFrame*)&s->current_picture;
739 739
 
740 740
 
741
-  MPV_frame_end(s);
741
+  ff_MPV_frame_end(s);
742 742
 
743 743
   *data_size=sizeof(AVFrame);
744 744
   result = buf_size;
... ...
@@ -753,7 +753,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx)
753 753
     int i;
754 754
     int offset = 0;
755 755
 
756
-    MPV_decode_defaults(s);
756
+    ff_MPV_decode_defaults(s);
757 757
 
758 758
     s->avctx = avctx;
759 759
     s->width = (avctx->width+3)&~3;
... ...
@@ -762,15 +762,15 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx)
762 762
     avctx->pix_fmt = PIX_FMT_YUV410P;
763 763
     avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames
764 764
     s->flags= avctx->flags;
765
-    if (MPV_common_init(s) < 0) return -1;
765
+    if (ff_MPV_common_init(s) < 0) return -1;
766 766
 
767 767
     INIT_VLC_STATIC(&svq1_block_type, 2, 4,
768 768
         &ff_svq1_block_type_vlc[0][1], 2, 1,
769 769
         &ff_svq1_block_type_vlc[0][0], 2, 1, 6);
770 770
 
771 771
     INIT_VLC_STATIC(&svq1_motion_component, 7, 33,
772
-        &mvtab[0][1], 2, 1,
773
-        &mvtab[0][0], 2, 1, 176);
772
+        &ff_mvtab[0][1], 2, 1,
773
+        &ff_mvtab[0][0], 2, 1, 176);
774 774
 
775 775
     for (i = 0; i < 6; i++) {
776 776
         static const uint8_t sizes[2][6] = {{14, 10, 14, 18, 16, 18}, {10, 10, 14, 14, 14, 16}};
... ...
@@ -804,7 +804,7 @@ static av_cold int svq1_decode_end(AVCodecContext *avctx)
804 804
 {
805 805
     MpegEncContext *s = avctx->priv_data;
806 806
 
807
-    MPV_common_end(s);
807
+    ff_MPV_common_end(s);
808 808
     return 0;
809 809
 }
810 810
 
... ...
@@ -402,7 +402,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane
402 402
                 int mx, my, pred_x, pred_y, dxy;
403 403
                 int16_t *motion_ptr;
404 404
 
405
-                motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y);
405
+                motion_ptr= ff_h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y);
406 406
                 if(s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTER){
407 407
                     for(i=0; i<6; i++)
408 408
                         init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7*32);
... ...
@@ -472,7 +472,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
472 472
 {
473 473
     SVQ1Context * const s = avctx->priv_data;
474 474
 
475
-    dsputil_init(&s->dsp, avctx);
475
+    ff_dsputil_init(&s->dsp, avctx);
476 476
     avctx->coded_frame= (AVFrame*)&s->picture;
477 477
 
478 478
     s->frame_width = avctx->width;
... ...
@@ -492,7 +492,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
492 492
     s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t));
493 493
     s->mb_type        = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int16_t));
494 494
     s->dummy          = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int32_t));
495
-    h263_encode_init(&s->m); //mv_penalty
495
+    ff_h263_encode_init(&s->m); //mv_penalty
496 496
 
497 497
     return 0;
498 498
 }
... ...
@@ -931,7 +931,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
931 931
         s->width  = avctx->width;
932 932
         s->height = avctx->height;
933 933
 
934
-        if (MPV_common_init(s) < 0)
934
+        if (ff_MPV_common_init(s) < 0)
935 935
             return -1;
936 936
 
937 937
         h->b_stride = 4*s->mb_width;
... ...
@@ -1099,7 +1099,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
1099 1099
         return -1;
1100 1100
     }
1101 1101
 
1102
-    MPV_frame_end(s);
1102
+    ff_MPV_frame_end(s);
1103 1103
 
1104 1104
     if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
1105 1105
         *(AVFrame *) data = *(AVFrame *) &s->current_picture;
... ...
@@ -1123,7 +1123,7 @@ static int svq3_decode_end(AVCodecContext *avctx)
1123 1123
 
1124 1124
     ff_h264_free_context(h);
1125 1125
 
1126
-    MPV_common_end(s);
1126
+    ff_MPV_common_end(s);
1127 1127
 
1128 1128
     av_freep(&svq3->buf);
1129 1129
     svq3->buf_size = 0;
... ...
@@ -190,7 +190,7 @@ static void tm2_free_codes(TM2Codes *code)
190 190
 {
191 191
     av_free(code->recode);
192 192
     if(code->vlc.table)
193
-        free_vlc(&code->vlc);
193
+        ff_free_vlc(&code->vlc);
194 194
 }
195 195
 
196 196
 static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code)
... ...
@@ -823,7 +823,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
823 823
     avctx->pix_fmt = PIX_FMT_BGR24;
824 824
     avcodec_get_frame_defaults(&l->pic);
825 825
 
826
-    dsputil_init(&l->dsp, avctx);
826
+    ff_dsputil_init(&l->dsp, avctx);
827 827
 
828 828
     l->last = av_malloc(4 * sizeof(int) * (avctx->width >> 2));
829 829
     l->clast = av_malloc(4 * sizeof(int) * (avctx->width >> 2));
... ...
@@ -68,7 +68,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
68 68
 
69 69
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
70 70
 
71
-    dsputil_init(&c->dsp, avctx);
71
+    ff_dsputil_init(&c->dsp, avctx);
72 72
 
73 73
     avcodec_get_frame_defaults(&c->frame);
74 74
     avctx->coded_frame = &c->frame;
... ...
@@ -1153,7 +1153,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
1153 1153
         return -1;
1154 1154
     }
1155 1155
 
1156
-    dsputil_init(&tctx->dsp, avctx);
1156
+    ff_dsputil_init(&tctx->dsp, avctx);
1157 1157
     if ((ret = init_mdct_win(tctx))) {
1158 1158
         av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n");
1159 1159
         twin_decode_close(avctx);
... ...
@@ -115,7 +115,7 @@ static void avcodec_init(void)
115 115
         return;
116 116
     initialized = 1;
117 117
 
118
-    dsputil_static_init();
118
+    ff_dsputil_static_init();
119 119
 }
120 120
 
121 121
 static av_always_inline int codec_is_encoder(AVCodec *codec)
... ...
@@ -103,10 +103,10 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
103 103
         code += 0x80000000u >> (he[i].len - 1);
104 104
     }
105 105
 
106
-    return init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1,
107
-                           bits,  sizeof(*bits),  sizeof(*bits),
108
-                           codes, sizeof(*codes), sizeof(*codes),
109
-                           syms,  sizeof(*syms),  sizeof(*syms), 0);
106
+    return ff_init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1,
107
+                              bits,  sizeof(*bits),  sizeof(*bits),
108
+                              codes, sizeof(*codes), sizeof(*codes),
109
+                              syms,  sizeof(*syms),  sizeof(*syms), 0);
110 110
 }
111 111
 
112 112
 static int decode_plane(UtvideoContext *c, int plane_no,
... ...
@@ -207,11 +207,11 @@ static int decode_plane(UtvideoContext *c, int plane_no,
207 207
                    get_bits_left(&gb));
208 208
     }
209 209
 
210
-    free_vlc(&vlc);
210
+    ff_free_vlc(&vlc);
211 211
 
212 212
     return 0;
213 213
 fail:
214
-    free_vlc(&vlc);
214
+    ff_free_vlc(&vlc);
215 215
     return AVERROR_INVALIDDATA;
216 216
 }
217 217
 
... ...
@@ -503,7 +503,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
503 503
 
504 504
     c->avctx = avctx;
505 505
 
506
-    dsputil_init(&c->dsp, avctx);
506
+    ff_dsputil_init(&c->dsp, avctx);
507 507
 
508 508
     if (avctx->extradata_size < 16) {
509 509
         av_log(avctx, AV_LOG_ERROR, "Insufficient extradata size %d, should be at least 16\n",
... ...
@@ -190,7 +190,7 @@ static av_cold int vble_decode_init(AVCodecContext *avctx)
190 190
 
191 191
     /* Stash for later use */
192 192
     ctx->avctx = avctx;
193
-    dsputil_init(&ctx->dsp, avctx);
193
+    ff_dsputil_init(&ctx->dsp, avctx);
194 194
 
195 195
     avctx->pix_fmt = PIX_FMT_YUV420P;
196 196
     avctx->bits_per_raw_sample = 8;
... ...
@@ -291,7 +291,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb);
291 291
  * @param gb GetBit context initialized from Codec context extra_data
292 292
  * @return Status
293 293
  */
294
-int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
294
+int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
295 295
 {
296 296
     av_log(avctx, AV_LOG_DEBUG, "Header: %0X\n", show_bits(gb, 32));
297 297
     v->profile = get_bits(gb, 2);
... ...
@@ -304,8 +304,8 @@ int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitConte
304 304
         v->zz_4x8 = ff_vc1_adv_progressive_4x8_zz;
305 305
         return decode_sequence_header_adv(v, gb);
306 306
     } else {
307
-        v->zz_8x4 = wmv2_scantableA;
308
-        v->zz_4x8 = wmv2_scantableB;
307
+        v->zz_8x4 = ff_wmv2_scantableA;
308
+        v->zz_4x8 = ff_wmv2_scantableB;
309 309
         v->res_y411   = get_bits1(gb);
310 310
         v->res_sprite = get_bits1(gb);
311 311
         if (v->res_y411) {
... ...
@@ -525,7 +525,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
525 525
     return 0;
526 526
 }
527 527
 
528
-int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
528
+int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
529 529
 {
530 530
     int i;
531 531
 
... ...
@@ -574,7 +574,7 @@ int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *
574 574
     return 0;
575 575
 }
576 576
 
577
-int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
577
+int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
578 578
 {
579 579
     int pqindex, lowquant, status;
580 580
 
... ...
@@ -817,7 +817,7 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
817 817
         lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6);  \
818 818
     }
819 819
 
820
-int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
820
+int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
821 821
 {
822 822
     int pqindex, lowquant;
823 823
     int status;
... ...
@@ -441,11 +441,11 @@ static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, ui
441 441
  * @param gb GetBit context initialized from Codec context extra_data
442 442
  * @return Status
443 443
  */
444
-int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb);
444
+int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb);
445 445
 
446
-int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb);
446
+int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb);
447 447
 
448
-int vc1_parse_frame_header    (VC1Context *v, GetBitContext *gb);
449
-int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb);
448
+int ff_vc1_parse_frame_header    (VC1Context *v, GetBitContext *gb);
449
+int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb);
450 450
 
451 451
 #endif /* AVCODEC_VC1_H */
... ...
@@ -57,16 +57,16 @@ static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx,
57 57
         if(size <= 0) continue;
58 58
         switch(AV_RB32(start)){
59 59
         case VC1_CODE_SEQHDR:
60
-            vc1_decode_sequence_header(avctx, &vpc->v, &gb);
60
+            ff_vc1_decode_sequence_header(avctx, &vpc->v, &gb);
61 61
             break;
62 62
         case VC1_CODE_ENTRYPOINT:
63
-            vc1_decode_entry_point(avctx, &vpc->v, &gb);
63
+            ff_vc1_decode_entry_point(avctx, &vpc->v, &gb);
64 64
             break;
65 65
         case VC1_CODE_FRAME:
66 66
             if(vpc->v.profile < PROFILE_ADVANCED)
67
-                vc1_parse_frame_header    (&vpc->v, &gb);
67
+                ff_vc1_parse_frame_header    (&vpc->v, &gb);
68 68
             else
69
-                vc1_parse_frame_header_adv(&vpc->v, &gb);
69
+                ff_vc1_parse_frame_header_adv(&vpc->v, &gb);
70 70
 
71 71
             /* keep AV_PICTURE_TYPE_BI internal to VC1 */
72 72
             if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI)
... ...
@@ -645,7 +645,7 @@ const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = {
645 645
   }
646 646
 };
647 647
 
648
-const uint8_t wmv3_dc_scale_table[32] = {
648
+const uint8_t ff_wmv3_dc_scale_table[32] = {
649 649
      0,  2,  4,  8,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 13, 13,
650 650
     14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21
651 651
 };
... ...
@@ -1094,7 +1094,7 @@ const int32_t ff_vc1_dqscale[63] = {
1094 1094
 };
1095 1095
 
1096 1096
 /* P Interlaced field picture MV predictor scaling values (Table 114) */
1097
-const uint16_t vc1_field_mvpred_scales[2][7][4] = {
1097
+const uint16_t ff_vc1_field_mvpred_scales[2][7][4] = {
1098 1098
 // Refdist:
1099 1099
 //      0       1       2       3 or greater
1100 1100
   { // current field is first
... ...
@@ -1118,7 +1118,7 @@ const uint16_t vc1_field_mvpred_scales[2][7][4] = {
1118 1118
 };
1119 1119
 
1120 1120
 /* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */
1121
-const uint16_t vc1_b_field_mvpred_scales[7][4] = {
1121
+const uint16_t ff_vc1_b_field_mvpred_scales[7][4] = {
1122 1122
     // BRFD:
1123 1123
     //  0       1       2       3 or greater
1124 1124
     { 171,    205,    219,    228 },   // SCALESAME
... ...
@@ -126,7 +126,7 @@ extern const uint8_t ff_vc1_4mv_block_pattern_bits[4][16];
126 126
 extern const uint8_t ff_vc1_2mv_block_pattern_codes[4][4];
127 127
 extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4];
128 128
 
129
-extern const uint8_t wmv3_dc_scale_table[32];
129
+extern const uint8_t ff_wmv3_dc_scale_table[32];
130 130
 
131 131
 /* P-Picture CBPCY VLC tables */
132 132
 extern const uint16_t ff_vc1_cbpcy_p_codes[4][64];
... ...
@@ -197,7 +197,7 @@ extern const int8_t ff_vc1_intra_vert_8x8_zz [64];
197 197
 extern const int32_t ff_vc1_dqscale[63];
198 198
 
199 199
 /* P Interlaced field picture MV predictor scaling values (Table 114) */
200
-extern const uint16_t vc1_field_mvpred_scales[2][7][4];
200
+extern const uint16_t ff_vc1_field_mvpred_scales[2][7][4];
201 201
 /* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */
202
-extern const uint16_t vc1_b_field_mvpred_scales[7][4];
202
+extern const uint16_t ff_vc1_b_field_mvpred_scales[7][4];
203 203
 #endif /* AVCODEC_VC1DATA_H */
... ...
@@ -1308,10 +1308,10 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di
1308 1308
         refdist = dir ? v->brfd : v->frfd;
1309 1309
     if (refdist > 3)
1310 1310
         refdist = 3;
1311
-    scalesame1    = vc1_field_mvpred_scales[table_index][1][refdist];
1312
-    scalesame2    = vc1_field_mvpred_scales[table_index][2][refdist];
1313
-    scalezone1_x  = vc1_field_mvpred_scales[table_index][3][refdist];
1314
-    zone1offset_x = vc1_field_mvpred_scales[table_index][5][refdist];
1311
+    scalesame1    = ff_vc1_field_mvpred_scales[table_index][1][refdist];
1312
+    scalesame2    = ff_vc1_field_mvpred_scales[table_index][2][refdist];
1313
+    scalezone1_x  = ff_vc1_field_mvpred_scales[table_index][3][refdist];
1314
+    zone1offset_x = ff_vc1_field_mvpred_scales[table_index][5][refdist];
1315 1315
 
1316 1316
     if (FFABS(n) > 255)
1317 1317
         scaledvalue = n;
... ...
@@ -1341,10 +1341,10 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */,
1341 1341
         refdist = dir ? v->brfd : v->frfd;
1342 1342
     if (refdist > 3)
1343 1343
         refdist = 3;
1344
-    scalesame1    = vc1_field_mvpred_scales[table_index][1][refdist];
1345
-    scalesame2    = vc1_field_mvpred_scales[table_index][2][refdist];
1346
-    scalezone1_y  = vc1_field_mvpred_scales[table_index][4][refdist];
1347
-    zone1offset_y = vc1_field_mvpred_scales[table_index][6][refdist];
1344
+    scalesame1    = ff_vc1_field_mvpred_scales[table_index][1][refdist];
1345
+    scalesame2    = ff_vc1_field_mvpred_scales[table_index][2][refdist];
1346
+    scalezone1_y  = ff_vc1_field_mvpred_scales[table_index][4][refdist];
1347
+    zone1offset_y = ff_vc1_field_mvpred_scales[table_index][6][refdist];
1348 1348
 
1349 1349
     if (FFABS(n) > 63)
1350 1350
         scaledvalue = n;
... ...
@@ -1372,10 +1372,10 @@ static av_always_inline int scaleforopp_x(VC1Context *v, int n /* MV */)
1372 1372
     int scaledvalue;
1373 1373
 
1374 1374
     brfd = FFMIN(v->brfd, 3);
1375
-    scalezone1_x  = vc1_b_field_mvpred_scales[3][brfd];
1376
-    zone1offset_x = vc1_b_field_mvpred_scales[5][brfd];
1377
-    scaleopp1     = vc1_b_field_mvpred_scales[1][brfd];
1378
-    scaleopp2     = vc1_b_field_mvpred_scales[2][brfd];
1375
+    scalezone1_x  = ff_vc1_b_field_mvpred_scales[3][brfd];
1376
+    zone1offset_x = ff_vc1_b_field_mvpred_scales[5][brfd];
1377
+    scaleopp1     = ff_vc1_b_field_mvpred_scales[1][brfd];
1378
+    scaleopp2     = ff_vc1_b_field_mvpred_scales[2][brfd];
1379 1379
 
1380 1380
     if (FFABS(n) > 255)
1381 1381
         scaledvalue = n;
... ...
@@ -1399,10 +1399,10 @@ static av_always_inline int scaleforopp_y(VC1Context *v, int n /* MV */, int dir
1399 1399
     int scaledvalue;
1400 1400
 
1401 1401
     brfd = FFMIN(v->brfd, 3);
1402
-    scalezone1_y  = vc1_b_field_mvpred_scales[4][brfd];
1403
-    zone1offset_y = vc1_b_field_mvpred_scales[6][brfd];
1404
-    scaleopp1     = vc1_b_field_mvpred_scales[1][brfd];
1405
-    scaleopp2     = vc1_b_field_mvpred_scales[2][brfd];
1402
+    scalezone1_y  = ff_vc1_b_field_mvpred_scales[4][brfd];
1403
+    zone1offset_y = ff_vc1_b_field_mvpred_scales[6][brfd];
1404
+    scaleopp1     = ff_vc1_b_field_mvpred_scales[1][brfd];
1405
+    scaleopp2     = ff_vc1_b_field_mvpred_scales[2][brfd];
1406 1406
 
1407 1407
     if (FFABS(n) > 63)
1408 1408
         scaledvalue = n;
... ...
@@ -1438,7 +1438,7 @@ static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */,
1438 1438
         return n;
1439 1439
     }
1440 1440
     brfd      = FFMIN(v->brfd, 3);
1441
-    scalesame = vc1_b_field_mvpred_scales[0][brfd];
1441
+    scalesame = ff_vc1_b_field_mvpred_scales[0][brfd];
1442 1442
 
1443 1443
     n = (n * scalesame >> 8) << hpel;
1444 1444
     return n;
... ...
@@ -1462,7 +1462,7 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */,
1462 1462
         refdist = FFMIN(v->refdist, 3);
1463 1463
     else
1464 1464
         refdist = dir ? v->brfd : v->frfd;
1465
-    scaleopp = vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist];
1465
+    scaleopp = ff_vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist];
1466 1466
 
1467 1467
     n = (n * scaleopp >> 8) << hpel;
1468 1468
     return n;
... ...
@@ -5281,7 +5281,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
5281 5281
 
5282 5282
         init_get_bits(&gb, avctx->extradata, avctx->extradata_size*8);
5283 5283
 
5284
-        if (vc1_decode_sequence_header(avctx, v, &gb) < 0)
5284
+        if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0)
5285 5285
           return -1;
5286 5286
 
5287 5287
         count = avctx->extradata_size*8 - get_bits_count(&gb);
... ...
@@ -5316,14 +5316,14 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
5316 5316
             init_get_bits(&gb, buf2, buf2_size * 8);
5317 5317
             switch (AV_RB32(start)) {
5318 5318
             case VC1_CODE_SEQHDR:
5319
-                if (vc1_decode_sequence_header(avctx, v, &gb) < 0) {
5319
+                if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0) {
5320 5320
                     av_free(buf2);
5321 5321
                     return -1;
5322 5322
                 }
5323 5323
                 seq_initialized = 1;
5324 5324
                 break;
5325 5325
             case VC1_CODE_ENTRYPOINT:
5326
-                if (vc1_decode_entry_point(avctx, v, &gb) < 0) {
5326
+                if (ff_vc1_decode_entry_point(avctx, v, &gb) < 0) {
5327 5327
                     av_free(buf2);
5328 5328
                     return -1;
5329 5329
                 }
... ...
@@ -5351,16 +5351,16 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
5351 5351
     if (v->profile == PROFILE_ADVANCED || v->res_fasttx) {
5352 5352
         for (i = 0; i < 64; i++) {
5353 5353
 #define transpose(x) ((x >> 3) | ((x & 7) << 3))
5354
-            v->zz_8x8[0][i] = transpose(wmv1_scantable[0][i]);
5355
-            v->zz_8x8[1][i] = transpose(wmv1_scantable[1][i]);
5356
-            v->zz_8x8[2][i] = transpose(wmv1_scantable[2][i]);
5357
-            v->zz_8x8[3][i] = transpose(wmv1_scantable[3][i]);
5354
+            v->zz_8x8[0][i] = transpose(ff_wmv1_scantable[0][i]);
5355
+            v->zz_8x8[1][i] = transpose(ff_wmv1_scantable[1][i]);
5356
+            v->zz_8x8[2][i] = transpose(ff_wmv1_scantable[2][i]);
5357
+            v->zz_8x8[3][i] = transpose(ff_wmv1_scantable[3][i]);
5358 5358
             v->zzi_8x8[i] = transpose(ff_vc1_adv_interlaced_8x8_zz[i]);
5359 5359
         }
5360 5360
         v->left_blk_sh = 0;
5361 5361
         v->top_blk_sh  = 3;
5362 5362
     } else {
5363
-        memcpy(v->zz_8x8, wmv1_scantable, 4*64);
5363
+        memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64);
5364 5364
         v->left_blk_sh = 3;
5365 5365
         v->top_blk_sh  = 0;
5366 5366
     }
... ...
@@ -5396,7 +5396,7 @@ static av_cold int vc1_decode_end(AVCodecContext *avctx)
5396 5396
         av_freep(&v->sr_rows[i >> 1][i & 1]);
5397 5397
     av_freep(&v->hrd_rate);
5398 5398
     av_freep(&v->hrd_buffer);
5399
-    MPV_common_end(&v->s);
5399
+    ff_MPV_common_end(&v->s);
5400 5400
     av_freep(&v->mv_type_mb_plane);
5401 5401
     av_freep(&v->direct_mb_plane);
5402 5402
     av_freep(&v->forward_mb_plane);
... ...
@@ -5504,7 +5504,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
5504 5504
                 case VC1_CODE_ENTRYPOINT: /* it should be before frame data */
5505 5505
                     buf_size2 = vc1_unescape_buffer(start + 4, size, buf2);
5506 5506
                     init_get_bits(&s->gb, buf2, buf_size2 * 8);
5507
-                    vc1_decode_entry_point(avctx, v, &s->gb);
5507
+                    ff_vc1_decode_entry_point(avctx, v, &s->gb);
5508 5508
                     break;
5509 5509
                 case VC1_CODE_SLICE: {
5510 5510
                     int buf_size3;
... ...
@@ -5603,11 +5603,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
5603 5603
     // do parse frame header
5604 5604
     v->pic_header_flag = 0;
5605 5605
     if (v->profile < PROFILE_ADVANCED) {
5606
-        if (vc1_parse_frame_header(v, &s->gb) == -1) {
5606
+        if (ff_vc1_parse_frame_header(v, &s->gb) == -1) {
5607 5607
             goto err;
5608 5608
         }
5609 5609
     } else {
5610
-        if (vc1_parse_frame_header_adv(v, &s->gb) == -1) {
5610
+        if (ff_vc1_parse_frame_header_adv(v, &s->gb) == -1) {
5611 5611
             goto err;
5612 5612
         }
5613 5613
     }
... ...
@@ -5651,7 +5651,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
5651 5651
             s->next_p_frame_damaged = 0;
5652 5652
     }
5653 5653
 
5654
-    if (MPV_frame_start(s, avctx) < 0) {
5654
+    if (ff_MPV_frame_start(s, avctx) < 0) {
5655 5655
         goto err;
5656 5656
     }
5657 5657
 
... ...
@@ -5702,10 +5702,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
5702 5702
             if (i) {
5703 5703
                 v->pic_header_flag = 0;
5704 5704
                 if (v->field_mode && i == n_slices1 + 2)
5705
-                    vc1_parse_frame_header_adv(v, &s->gb);
5705
+                    ff_vc1_parse_frame_header_adv(v, &s->gb);
5706 5706
                 else if (get_bits1(&s->gb)) {
5707 5707
                     v->pic_header_flag = 1;
5708
-                    vc1_parse_frame_header_adv(v, &s->gb);
5708
+                    ff_vc1_parse_frame_header_adv(v, &s->gb);
5709 5709
                 }
5710 5710
             }
5711 5711
             s->start_mb_y = (i == 0) ? 0 : FFMAX(0, slices[i-1].mby_start % mb_height);
... ...
@@ -5737,7 +5737,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
5737 5737
         ff_er_frame_end(s);
5738 5738
     }
5739 5739
 
5740
-    MPV_frame_end(s);
5740
+    ff_MPV_frame_end(s);
5741 5741
 
5742 5742
     if (avctx->codec_id == CODEC_ID_WMV3IMAGE || avctx->codec_id == CODEC_ID_VC1IMAGE) {
5743 5743
 image:
... ...
@@ -21,7 +21,7 @@
21 21
 #define AVCODEC_VERSION_H
22 22
 
23 23
 #define LIBAVCODEC_VERSION_MAJOR 54
24
-#define LIBAVCODEC_VERSION_MINOR  2
24
+#define LIBAVCODEC_VERSION_MINOR  3
25 25
 #define LIBAVCODEC_VERSION_MICRO 100
26 26
 
27 27
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
... ...
@@ -42,7 +42,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);
42 42
 void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
43 43
                                   uint16_t *y_list, int *flag,
44 44
                                   int multiplier, float * out, int samples);
45
-void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
45
+void ff_vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
46 46
 
47 47
 #define ilog(i) av_log2(2*(i))
48 48
 
... ...
@@ -207,7 +207,7 @@ static void vorbis_free(vorbis_context *vc)
207 207
 
208 208
     for (i = 0; i < vc->codebook_count; ++i) {
209 209
         av_free(vc->codebooks[i].codevectors);
210
-        free_vlc(&vc->codebooks[i].vlc);
210
+        ff_free_vlc(&vc->codebooks[i].vlc);
211 211
     }
212 212
     av_freep(&vc->codebooks);
213 213
 
... ...
@@ -990,7 +990,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext)
990 990
     int hdr_type, ret;
991 991
 
992 992
     vc->avccontext = avccontext;
993
-    dsputil_init(&vc->dsp, avccontext);
993
+    ff_dsputil_init(&vc->dsp, avccontext);
994 994
     ff_fmt_convert_init(&vc->fmt_conv, avccontext);
995 995
 
996 996
     if (avccontext->request_sample_fmt == AV_SAMPLE_FMT_FLT) {
... ...
@@ -1459,7 +1459,7 @@ static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
1459 1459
     }
1460 1460
 }
1461 1461
 
1462
-void vorbis_inverse_coupling(float *mag, float *ang, int blocksize)
1462
+void ff_vorbis_inverse_coupling(float *mag, float *ang, int blocksize)
1463 1463
 {
1464 1464
     int i;
1465 1465
     for (i = 0;  i < blocksize;  i++) {
... ...
@@ -292,17 +292,17 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
292 292
         return 0;
293 293
 
294 294
     for (i = 0; i < 16; i++) {
295
-        free_vlc(&s->dc_vlc[i]);
296
-        free_vlc(&s->ac_vlc_1[i]);
297
-        free_vlc(&s->ac_vlc_2[i]);
298
-        free_vlc(&s->ac_vlc_3[i]);
299
-        free_vlc(&s->ac_vlc_4[i]);
295
+        ff_free_vlc(&s->dc_vlc[i]);
296
+        ff_free_vlc(&s->ac_vlc_1[i]);
297
+        ff_free_vlc(&s->ac_vlc_2[i]);
298
+        ff_free_vlc(&s->ac_vlc_3[i]);
299
+        ff_free_vlc(&s->ac_vlc_4[i]);
300 300
     }
301 301
 
302
-    free_vlc(&s->superblock_run_length_vlc);
303
-    free_vlc(&s->fragment_run_length_vlc);
304
-    free_vlc(&s->mode_code_vlc);
305
-    free_vlc(&s->motion_vector_vlc);
302
+    ff_free_vlc(&s->superblock_run_length_vlc);
303
+    ff_free_vlc(&s->fragment_run_length_vlc);
304
+    ff_free_vlc(&s->mode_code_vlc);
305
+    ff_free_vlc(&s->motion_vector_vlc);
306 306
 
307 307
     /* release all frames */
308 308
     vp3_decode_flush(avctx);
... ...
@@ -1671,7 +1671,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
1671 1671
     avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
1672 1672
     if(avctx->idct_algo==FF_IDCT_AUTO)
1673 1673
         avctx->idct_algo=FF_IDCT_VP3;
1674
-    dsputil_init(&s->dsp, avctx);
1674
+    ff_dsputil_init(&s->dsp, avctx);
1675 1675
 
1676 1676
     ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
1677 1677
 
... ...
@@ -83,7 +83,7 @@ static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
83 83
             int sign = vp56_rac_get_prob(c, model->vector_sig[comp]);
84 84
             di  = vp56_rac_get_prob(c, model->vector_pdi[comp][0]);
85 85
             di |= vp56_rac_get_prob(c, model->vector_pdi[comp][1]) << 1;
86
-            delta = vp56_rac_get_tree(c, vp56_pva_tree,
86
+            delta = vp56_rac_get_tree(c, ff_vp56_pva_tree,
87 87
                                       model->vector_pdv[comp]);
88 88
             delta = di | (delta << 2);
89 89
             delta = (delta ^ -sign) + sign;
... ...
@@ -180,7 +180,7 @@ static void vp5_parse_coeff(VP56Context *s)
180 180
 
181 181
         if (b > 3) pt = 1;
182 182
 
183
-        ctx = 6*s->coeff_ctx[vp56_b6to4[b]][0]
183
+        ctx = 6*s->coeff_ctx[ff_vp56_b6to4[b]][0]
184 184
               + s->above_blocks[s->above_block_idx[b]].not_null_dc;
185 185
         model1 = model->coeff_dccv[pt];
186 186
         model2 = model->coeff_dcct[pt][ctx];
... ...
@@ -190,26 +190,26 @@ static void vp5_parse_coeff(VP56Context *s)
190 190
             if (vp56_rac_get_prob(c, model2[0])) {
191 191
                 if (vp56_rac_get_prob(c, model2[2])) {
192 192
                     if (vp56_rac_get_prob(c, model2[3])) {
193
-                        s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 4;
194
-                        idx = vp56_rac_get_tree(c, vp56_pc_tree, model1);
193
+                        s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 4;
194
+                        idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
195 195
                         sign = vp56_rac_get(c);
196
-                        coeff = vp56_coeff_bias[idx+5];
197
-                        for (i=vp56_coeff_bit_length[idx]; i>=0; i--)
198
-                            coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;
196
+                        coeff = ff_vp56_coeff_bias[idx+5];
197
+                        for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
198
+                            coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
199 199
                     } else {
200 200
                         if (vp56_rac_get_prob(c, model2[4])) {
201 201
                             coeff = 3 + vp56_rac_get_prob(c, model1[5]);
202
-                            s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 3;
202
+                            s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 3;
203 203
                         } else {
204 204
                             coeff = 2;
205
-                            s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 2;
205
+                            s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 2;
206 206
                         }
207 207
                         sign = vp56_rac_get(c);
208 208
                     }
209 209
                     ct = 2;
210 210
                 } else {
211 211
                     ct = 1;
212
-                    s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 1;
212
+                    s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 1;
213 213
                     sign = vp56_rac_get(c);
214 214
                     coeff = 1;
215 215
                 }
... ...
@@ -221,24 +221,24 @@ static void vp5_parse_coeff(VP56Context *s)
221 221
                 if (ct && !vp56_rac_get_prob(c, model2[1]))
222 222
                     break;
223 223
                 ct = 0;
224
-                s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 0;
224
+                s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 0;
225 225
             }
226 226
             coeff_idx++;
227 227
             if (coeff_idx >= 64)
228 228
                 break;
229 229
 
230 230
             cg = vp5_coeff_groups[coeff_idx];
231
-            ctx = s->coeff_ctx[vp56_b6to4[b]][coeff_idx];
231
+            ctx = s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx];
232 232
             model1 = model->coeff_ract[pt][ct][cg];
233 233
             model2 = cg > 2 ? model1 : model->coeff_acct[pt][ct][cg][ctx];
234 234
         }
235 235
 
236
-        ctx_last = FFMIN(s->coeff_ctx_last[vp56_b6to4[b]], 24);
237
-        s->coeff_ctx_last[vp56_b6to4[b]] = coeff_idx;
236
+        ctx_last = FFMIN(s->coeff_ctx_last[ff_vp56_b6to4[b]], 24);
237
+        s->coeff_ctx_last[ff_vp56_b6to4[b]] = coeff_idx;
238 238
         if (coeff_idx < ctx_last)
239 239
             for (i=coeff_idx; i<=ctx_last; i++)
240
-                s->coeff_ctx[vp56_b6to4[b]][i] = 5;
241
-        s->above_blocks[s->above_block_idx[b]].not_null_dc = s->coeff_ctx[vp56_b6to4[b]][0];
240
+                s->coeff_ctx[ff_vp56_b6to4[b]][i] = 5;
241
+        s->above_blocks[s->above_block_idx[b]].not_null_dc = s->coeff_ctx[ff_vp56_b6to4[b]][0];
242 242
     }
243 243
 }
244 244
 
... ...
@@ -253,7 +253,7 @@ static void vp5_default_models_init(VP56Context *s)
253 253
         model->vector_pdi[i][0] = 0x55;
254 254
         model->vector_pdi[i][1] = 0x80;
255 255
     }
256
-    memcpy(model->mb_types_stats, vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
256
+    memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
257 257
     memset(model->vector_pdv, 0x80, sizeof(model->vector_pdv));
258 258
 }
259 259
 
... ...
@@ -268,7 +268,7 @@ static void vp56_add_predictors_dc(VP56Context *s, VP56Frame ref_frame)
268 268
 
269 269
     for (b=0; b<6; b++) {
270 270
         VP56RefDc *ab = &s->above_blocks[s->above_block_idx[b]];
271
-        VP56RefDc *lb = &s->left_block[vp56_b6to4[b]];
271
+        VP56RefDc *lb = &s->left_block[ff_vp56_b6to4[b]];
272 272
         int count = 0;
273 273
         int dc = 0;
274 274
         int i;
... ...
@@ -288,12 +288,12 @@ static void vp56_add_predictors_dc(VP56Context *s, VP56Frame ref_frame)
288 288
                     count++;
289 289
                 }
290 290
         if (count == 0)
291
-            dc = s->prev_dc[vp56_b2p[b]][ref_frame];
291
+            dc = s->prev_dc[ff_vp56_b2p[b]][ref_frame];
292 292
         else if (count == 2)
293 293
             dc /= 2;
294 294
 
295 295
         s->block_coeff[b][idx] += dc;
296
-        s->prev_dc[vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx];
296
+        s->prev_dc[ff_vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx];
297 297
         ab->dc_coeff = s->block_coeff[b][idx];
298 298
         ab->ref_frame = ref_frame;
299 299
         lb->dc_coeff = s->block_coeff[b][idx];
... ...
@@ -410,7 +410,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
410 410
     switch (mb_type) {
411 411
         case VP56_MB_INTRA:
412 412
             for (b=0; b<b_max; b++) {
413
-                plane = vp56_b2p[b+ab];
413
+                plane = ff_vp56_b2p[b+ab];
414 414
                 s->dsp.idct_put(frame_current->data[plane] + s->block_offset[b],
415 415
                                 s->stride[plane], s->block_coeff[b]);
416 416
             }
... ...
@@ -419,7 +419,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
419 419
         case VP56_MB_INTER_NOVEC_PF:
420 420
         case VP56_MB_INTER_NOVEC_GF:
421 421
             for (b=0; b<b_max; b++) {
422
-                plane = vp56_b2p[b+ab];
422
+                plane = ff_vp56_b2p[b+ab];
423 423
                 off = s->block_offset[b];
424 424
                 s->dsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
425 425
                                             frame_ref->data[plane] + off,
... ...
@@ -439,7 +439,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
439 439
             for (b=0; b<b_max; b++) {
440 440
                 int x_off = b==1 || b==3 ? 8 : 0;
441 441
                 int y_off = b==2 || b==3 ? 8 : 0;
442
-                plane = vp56_b2p[b+ab];
442
+                plane = ff_vp56_b2p[b+ab];
443 443
                 vp56_mc(s, b, plane, frame_ref->data[plane], s->stride[plane],
444 444
                         16*col+x_off, 16*row+y_off);
445 445
                 s->dsp.idct_add(frame_current->data[plane] + s->block_offset[b],
... ...
@@ -668,7 +668,7 @@ av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
668 668
 
669 669
     if (avctx->idct_algo == FF_IDCT_AUTO)
670 670
         avctx->idct_algo = FF_IDCT_VP3;
671
-    dsputil_init(&s->dsp, avctx);
671
+    ff_dsputil_init(&s->dsp, avctx);
672 672
     ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
673 673
     ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);
674 674
 
... ...
@@ -25,10 +25,10 @@
25 25
 
26 26
 #include "vp56data.h"
27 27
 
28
-const uint8_t vp56_b2p[]   = { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3 };
29
-const uint8_t vp56_b6to4[] = { 0, 0, 1, 1, 2, 3 };
28
+const uint8_t ff_vp56_b2p[]   = { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3 };
29
+const uint8_t ff_vp56_b6to4[] = { 0, 0, 1, 1, 2, 3 };
30 30
 
31
-const uint8_t vp56_coeff_parse_table[6][11] = {
31
+const uint8_t ff_vp56_coeff_parse_table[6][11] = {
32 32
     { 159,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
33 33
     { 145, 165,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
34 34
     { 140, 148, 173,   0,   0,   0,   0,   0,   0,   0,   0 },
... ...
@@ -37,7 +37,7 @@ const uint8_t vp56_coeff_parse_table[6][11] = {
37 37
     { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254 },
38 38
 };
39 39
 
40
-const uint8_t vp56_def_mb_types_stats[3][10][2] = {
40
+const uint8_t ff_vp56_def_mb_types_stats[3][10][2] = {
41 41
     { {  69, 42 }, {   1,  2 }, {  1,   7 }, {  44, 42 }, {  6, 22 },
42 42
       {   1,  3 }, {   0,  2 }, {  1,   5 }, {   0,  1 }, {  0,  0 }, },
43 43
     { { 229,  8 }, {   1,  1 }, {  0,   8 }, {   0,  0 }, {  0,  0 },
... ...
@@ -46,7 +46,7 @@ const uint8_t vp56_def_mb_types_stats[3][10][2] = {
46 46
       {   1,  2 }, {   0,  1 }, {  0,   1 }, {   1,  1 }, {  0,  0 }, },
47 47
 };
48 48
 
49
-const VP56Tree vp56_pva_tree[] = {
49
+const VP56Tree ff_vp56_pva_tree[] = {
50 50
     { 8, 0},
51 51
     { 4, 1},
52 52
     { 2, 2}, {-0}, {-1},
... ...
@@ -56,7 +56,7 @@ const VP56Tree vp56_pva_tree[] = {
56 56
     { 2, 6}, {-6}, {-7},
57 57
 };
58 58
 
59
-const VP56Tree vp56_pc_tree[] = {
59
+const VP56Tree ff_vp56_pc_tree[] = {
60 60
     { 4, 6},
61 61
     { 2, 7}, {-0}, {-1},
62 62
     { 4, 8},
... ...
@@ -64,5 +64,5 @@ const VP56Tree vp56_pc_tree[] = {
64 64
     { 2,10}, {-4}, {-5},
65 65
 };
66 66
 
67
-const uint8_t vp56_coeff_bias[] = { 0, 1, 2, 3, 4, 5, 7, 11, 19, 35, 67 };
68
-const uint8_t vp56_coeff_bit_length[] = { 0, 1, 2, 3, 4, 10 };
67
+const uint8_t ff_vp56_coeff_bias[] = { 0, 1, 2, 3, 4, 5, 7, 11, 19, 35, 67 };
68
+const uint8_t ff_vp56_coeff_bit_length[] = { 0, 1, 2, 3, 4, 10 };
... ...
@@ -56,14 +56,14 @@ typedef struct {
56 56
   int8_t prob_idx;
57 57
 } VP56Tree;
58 58
 
59
-extern const uint8_t vp56_b2p[];
60
-extern const uint8_t vp56_b6to4[];
61
-extern const uint8_t vp56_coeff_parse_table[6][11];
62
-extern const uint8_t vp56_def_mb_types_stats[3][10][2];
63
-extern const VP56Tree vp56_pva_tree[];
64
-extern const VP56Tree vp56_pc_tree[];
65
-extern const uint8_t vp56_coeff_bias[];
66
-extern const uint8_t vp56_coeff_bit_length[];
59
+extern const uint8_t ff_vp56_b2p[];
60
+extern const uint8_t ff_vp56_b6to4[];
61
+extern const uint8_t ff_vp56_coeff_parse_table[6][11];
62
+extern const uint8_t ff_vp56_def_mb_types_stats[3][10][2];
63
+extern const VP56Tree ff_vp56_pva_tree[];
64
+extern const VP56Tree ff_vp56_pc_tree[];
65
+extern const uint8_t ff_vp56_coeff_bias[];
66
+extern const uint8_t ff_vp56_coeff_bit_length[];
67 67
 
68 68
 static const VP56Frame vp56_reference_frame[] = {
69 69
     VP56_FRAME_PREVIOUS,  /* VP56_MB_INTER_NOVEC_PF */
... ...
@@ -178,7 +178,7 @@ static void vp6_default_models_init(VP56Context *s)
178 178
     model->vector_sig[0] = 0x80;
179 179
     model->vector_sig[1] = 0x80;
180 180
 
181
-    memcpy(model->mb_types_stats, vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
181
+    memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats));
182 182
     memcpy(model->vector_fdv, vp6_def_fdv_vector_model, sizeof(model->vector_fdv));
183 183
     memcpy(model->vector_pdv, vp6_def_pdv_vector_model, sizeof(model->vector_pdv));
184 184
     memcpy(model->coeff_runv, vp6_def_runv_coeff_model, sizeof(model->coeff_runv));
... ...
@@ -233,7 +233,7 @@ static int vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
233 233
         nodes[map[2*i+1]].count = b + !b;
234 234
     }
235 235
 
236
-    free_vlc(vlc);
236
+    ff_free_vlc(vlc);
237 237
     /* then build the huffman tree according to probabilities */
238 238
     return ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,
239 239
                               FF_HUFFMAN_FLAG_HNODE_FIRST);
... ...
@@ -332,7 +332,7 @@ static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
332 332
             else
333 333
                 delta |= 8;
334 334
         } else {
335
-            delta = vp56_rac_get_tree(c, vp56_pva_tree,
335
+            delta = vp56_rac_get_tree(c, ff_vp56_pva_tree,
336 336
                                       model->vector_pdv[comp]);
337 337
         }
338 338
 
... ...
@@ -400,7 +400,7 @@ static void vp6_parse_coeff_huffman(VP56Context *s)
400 400
                         s->nb_null[1][pt] = vp6_get_nb_null(s);
401 401
                     break;
402 402
                 } else {
403
-                    int coeff2 = vp56_coeff_bias[coeff];
403
+                    int coeff2 = ff_vp56_coeff_bias[coeff];
404 404
                     if (coeff > 4)
405 405
                         coeff2 += get_bits(&s->gb, coeff <= 9 ? coeff - 4 : 11);
406 406
                     ct = 1 + (coeff2 > 1);
... ...
@@ -437,7 +437,7 @@ static void vp6_parse_coeff(VP56Context *s)
437 437
 
438 438
         if (b > 3) pt = 1;
439 439
 
440
-        ctx = s->left_block[vp56_b6to4[b]].not_null_dc
440
+        ctx = s->left_block[ff_vp56_b6to4[b]].not_null_dc
441 441
               + s->above_blocks[s->above_block_idx[b]].not_null_dc;
442 442
         model1 = model->coeff_dccv[pt];
443 443
         model2 = model->coeff_dcct[pt][ctx];
... ...
@@ -448,10 +448,10 @@ static void vp6_parse_coeff(VP56Context *s)
448 448
                 /* parse a coeff */
449 449
                 if (vp56_rac_get_prob(c, model2[2])) {
450 450
                     if (vp56_rac_get_prob(c, model2[3])) {
451
-                        idx = vp56_rac_get_tree(c, vp56_pc_tree, model1);
452
-                        coeff = vp56_coeff_bias[idx+5];
453
-                        for (i=vp56_coeff_bit_length[idx]; i>=0; i--)
454
-                            coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i;
451
+                        idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1);
452
+                        coeff = ff_vp56_coeff_bias[idx+5];
453
+                        for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--)
454
+                            coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i;
455 455
                     } else {
456 456
                         if (vp56_rac_get_prob(c, model2[4]))
457 457
                             coeff = 3 + vp56_rac_get_prob(c, model1[5]);
... ...
@@ -491,7 +491,7 @@ static void vp6_parse_coeff(VP56Context *s)
491 491
             model1 = model2 = model->coeff_ract[pt][ct][cg];
492 492
         }
493 493
 
494
-        s->left_block[vp56_b6to4[b]].not_null_dc =
494
+        s->left_block[ff_vp56_b6to4[b]].not_null_dc =
495 495
         s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0];
496 496
     }
497 497
 }
... ...
@@ -611,11 +611,11 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx)
611 611
     ff_vp56_free(avctx);
612 612
 
613 613
     for (pt=0; pt<2; pt++) {
614
-        free_vlc(&s->dccv_vlc[pt]);
615
-        free_vlc(&s->runv_vlc[pt]);
614
+        ff_free_vlc(&s->dccv_vlc[pt]);
615
+        ff_free_vlc(&s->runv_vlc[pt]);
616 616
         for (ct=0; ct<3; ct++)
617 617
             for (cg=0; cg<6; cg++)
618
-                free_vlc(&s->ract_vlc[pt][ct][cg]);
618
+                ff_free_vlc(&s->ract_vlc[pt][ct][cg]);
619 619
     }
620 620
     return 0;
621 621
 }
... ...
@@ -1788,7 +1788,7 @@ static av_cold int vp8_decode_init(AVCodecContext *avctx)
1788 1788
     s->avctx = avctx;
1789 1789
     avctx->pix_fmt = PIX_FMT_YUV420P;
1790 1790
 
1791
-    dsputil_init(&s->dsp, avctx);
1791
+    ff_dsputil_init(&s->dsp, avctx);
1792 1792
     ff_h264_pred_init(&s->hpc, CODEC_ID_VP8, 8, 1);
1793 1793
     ff_vp8dsp_init(&s->vp8dsp);
1794 1794
 
... ...
@@ -126,7 +126,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
126 126
     s->bit_rate    = avctx->bit_rate;
127 127
     s->block_align = avctx->block_align;
128 128
 
129
-    dsputil_init(&s->dsp, avctx);
129
+    ff_dsputil_init(&s->dsp, avctx);
130 130
     ff_fmt_convert_init(&s->fmt_conv, avctx);
131 131
 
132 132
     if (avctx->codec->id == CODEC_ID_WMAV1) {
... ...
@@ -417,13 +417,13 @@ int ff_wma_end(AVCodecContext *avctx)
417 417
         ff_mdct_end(&s->mdct_ctx[i]);
418 418
 
419 419
     if (s->use_exp_vlc) {
420
-        free_vlc(&s->exp_vlc);
420
+        ff_free_vlc(&s->exp_vlc);
421 421
     }
422 422
     if (s->use_noise_coding) {
423
-        free_vlc(&s->hgain_vlc);
423
+        ff_free_vlc(&s->hgain_vlc);
424 424
     }
425 425
     for (i = 0; i < 2; i++) {
426
-        free_vlc(&s->coef_vlc[i]);
426
+        ff_free_vlc(&s->coef_vlc[i]);
427 427
         av_free(s->run_table[i]);
428 428
         av_free(s->level_table[i]);
429 429
         av_free(s->int_table[i]);
... ...
@@ -281,7 +281,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
281 281
     int num_possible_block_sizes;
282 282
 
283 283
     s->avctx = avctx;
284
-    dsputil_init(&s->dsp, avctx);
284
+    ff_dsputil_init(&s->dsp, avctx);
285 285
     ff_fmt_convert_init(&s->fmt_conv, avctx);
286 286
     init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
287 287
 
... ...
@@ -28,8 +28,8 @@
28 28
 av_cold void ff_wmv2_common_init(Wmv2Context * w){
29 29
     MpegEncContext * const s= &w->s;
30 30
 
31
-    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], wmv2_scantableA);
32
-    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], wmv2_scantableB);
31
+    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], ff_wmv2_scantableA);
32
+    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], ff_wmv2_scantableB);
33 33
 }
34 34
 
35 35
 static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){
... ...
@@ -55,7 +55,7 @@ static int encode_ext_header(Wmv2Context *w){
55 55
 static av_cold int wmv2_encode_init(AVCodecContext *avctx){
56 56
     Wmv2Context * const w= avctx->priv_data;
57 57
 
58
-    if(MPV_encode_init(avctx) < 0)
58
+    if(ff_MPV_encode_init(avctx) < 0)
59 59
         return -1;
60 60
 
61 61
     ff_wmv2_common_init(w);
... ...
@@ -167,11 +167,11 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
167 167
         }
168 168
 
169 169
         put_bits(&s->pb,
170
-                 wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
171
-                 wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
170
+                 ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
171
+                 ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
172 172
 
173 173
         /* motion vector */
174
-        h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
174
+        ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
175 175
         ff_msmpeg4_encode_motion(s, motion_x - pred_x,
176 176
                               motion_y - pred_y);
177 177
     } else {
... ...
@@ -196,13 +196,13 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
196 196
                      ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
197 197
         } else {
198 198
             put_bits(&s->pb,
199
-                     wmv2_inter_table[w->cbp_table_index][cbp][1],
200
-                     wmv2_inter_table[w->cbp_table_index][cbp][0]);
199
+                     ff_wmv2_inter_table[w->cbp_table_index][cbp][1],
200
+                     ff_wmv2_inter_table[w->cbp_table_index][cbp][0]);
201 201
         }
202 202
         put_bits(&s->pb, 1, 0);         /* no AC prediction yet */
203 203
         if(s->inter_intra_pred){
204 204
             s->h263_aic_dir=0;
205
-            put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]);
205
+            put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]);
206 206
         }
207 207
     }
208 208
 
... ...
@@ -217,8 +217,8 @@ AVCodec ff_wmv2_encoder = {
217 217
     .id             = CODEC_ID_WMV2,
218 218
     .priv_data_size = sizeof(Wmv2Context),
219 219
     .init           = wmv2_encode_init,
220
-    .encode         = MPV_encode_picture,
221
-    .close          = MPV_encode_end,
220
+    .encode         = ff_MPV_encode_picture,
221
+    .close          = ff_MPV_encode_end,
222 222
     .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
223 223
     .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
224 224
 };
... ...
@@ -2415,7 +2415,7 @@ extern void ff_butterflies_float_interleave_sse(float *dst, const float *src0,
2415 2415
 extern void ff_butterflies_float_interleave_avx(float *dst, const float *src0,
2416 2416
                                                 const float *src1, int len);
2417 2417
 
2418
-void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
2418
+void ff_dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
2419 2419
 {
2420 2420
     int mm_flags = av_get_cpu_flags();
2421 2421
     const int high_bit_depth = avctx->bits_per_raw_sample > 8;
... ...
@@ -2926,5 +2926,5 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
2926 2926
     }
2927 2927
 
2928 2928
     if (CONFIG_ENCODERS)
2929
-        dsputilenc_init_mmx(c, avctx);
2929
+        ff_dsputilenc_init_mmx(c, avctx);
2930 2930
 }
... ...
@@ -184,8 +184,8 @@ static inline void transpose4x4(uint8_t *dst, uint8_t *src, x86_reg dst_stride,
184 184
     "pcmpeqd %%" #regd ", %%" #regd " \n\t" \
185 185
     "psrlw $15, %%" #regd ::)
186 186
 
187
-void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);
188
-void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
187
+void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);
188
+void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
189 189
 
190 190
 void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
191 191
 void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
... ...
@@ -1095,7 +1095,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si
1095 1095
 #endif //HAVE_SSSE3
1096 1096
 
1097 1097
 
1098
-void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
1098
+void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
1099 1099
 {
1100 1100
     int mm_flags = av_get_cpu_flags();
1101 1101
     int bit_depth = avctx->bits_per_raw_sample;
... ...
@@ -1192,5 +1192,5 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx)
1192 1192
         }
1193 1193
     }
1194 1194
 
1195
-    dsputil_init_pix_mmx(c, avctx);
1195
+    ff_dsputil_init_pix_mmx(c, avctx);
1196 1196
 }
... ...
@@ -422,7 +422,7 @@ static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride,
422 422
 PIX_SAD(mmx)
423 423
 PIX_SAD(mmx2)
424 424
 
425
-void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
425
+void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
426 426
 {
427 427
     int mm_flags = av_get_cpu_flags();
428 428
 
... ...
@@ -29,7 +29,7 @@
29 29
 #include "libavcodec/mpegvideo.h"
30 30
 #include "dsputil_mmx.h"
31 31
 
32
-extern uint16_t inv_zigzag_direct16[64];
32
+extern uint16_t ff_inv_zigzag_direct16[64];
33 33
 
34 34
 
35 35
 static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
... ...
@@ -626,7 +626,7 @@ static void  denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){
626 626
 #include "mpegvideo_mmx_template.c"
627 627
 #endif
628 628
 
629
-void MPV_common_init_mmx(MpegEncContext *s)
629
+void ff_MPV_common_init_mmx(MpegEncContext *s)
630 630
 {
631 631
     int mm_flags = av_get_cpu_flags();
632 632
 
... ...
@@ -171,7 +171,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
171 171
             "movzb %%al, %%"REG_a"              \n\t" // last_non_zero_p1
172 172
             : "+a" (last_non_zero_p1)
173 173
             : "r" (block+64), "r" (qmat), "r" (bias),
174
-              "r" (inv_zigzag_direct16+64), "r" (temp_block+64)
174
+              "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64)
175 175
               XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
176 176
                                 "%xmm4", "%xmm5", "%xmm6", "%xmm7")
177 177
         );
... ...
@@ -205,7 +205,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
205 205
             "movzb %%al, %%"REG_a"              \n\t" // last_non_zero_p1
206 206
             : "+a" (last_non_zero_p1)
207 207
             : "r" (block+64), "r" (qmat+64), "r" (bias+64),
208
-              "r" (inv_zigzag_direct16+64), "r" (temp_block+64)
208
+              "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64)
209 209
               XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3",
210 210
                                 "%xmm4", "%xmm5", "%xmm6", "%xmm7")
211 211
         );
... ...
@@ -99,7 +99,7 @@ AVInputFormat ff_aea_demuxer = {
99 99
     .read_probe     = aea_read_probe,
100 100
     .read_header    = aea_read_header,
101 101
     .read_packet    = aea_read_packet,
102
-    .read_seek      = pcm_read_seek,
102
+    .read_seek      = ff_pcm_read_seek,
103 103
     .flags= AVFMT_GENERIC_INDEX,
104 104
     .extensions = "aea",
105 105
 };
... ...
@@ -325,6 +325,6 @@ AVInputFormat ff_aiff_demuxer = {
325 325
     .read_probe     = aiff_probe,
326 326
     .read_header    = aiff_read_header,
327 327
     .read_packet    = aiff_read_packet,
328
-    .read_seek      = pcm_read_seek,
328
+    .read_seek      = ff_pcm_read_seek,
329 329
     .codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0},
330 330
 };
... ...
@@ -197,7 +197,7 @@ AVInputFormat ff_au_demuxer = {
197 197
     .read_probe     = au_probe,
198 198
     .read_header    = au_read_header,
199 199
     .read_packet    = au_read_packet,
200
-    .read_seek      = pcm_read_seek,
200
+    .read_seek      = ff_pcm_read_seek,
201 201
     .codec_tag= (const AVCodecTag* const []){codec_au_tags, 0},
202 202
 };
203 203
 #endif
... ...
@@ -1412,7 +1412,7 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
1412 1412
 
1413 1413
         /* Feed the DV video stream version of the timestamp to the */
1414 1414
         /* DV demux so it can synthesize correct timestamps.        */
1415
-        dv_offset_reset(avi->dv_demux, timestamp);
1415
+        ff_dv_offset_reset(avi->dv_demux, timestamp);
1416 1416
 
1417 1417
         avi->stream_index= -1;
1418 1418
         return 0;
... ...
@@ -124,7 +124,7 @@ static int avs_read_audio_packet(AVFormatContext * s, AVPacket * pkt)
124 124
     int ret, size;
125 125
 
126 126
     size = avio_tell(s->pb);
127
-    ret = voc_get_packet(s, pkt, avs->st_audio, avs->remaining_audio_size);
127
+    ret = ff_voc_get_packet(s, pkt, avs->st_audio, avs->remaining_audio_size);
128 128
     size = avio_tell(s->pb) - size;
129 129
     avs->remaining_audio_size -= size;
130 130
 
... ...
@@ -123,7 +123,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
123 123
                 c93->audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
124 124
             }
125 125
             avio_skip(pb, 26); /* VOC header */
126
-            ret = voc_get_packet(s, pkt, c93->audio, datasize - 26);
126
+            ret = ff_voc_get_packet(s, pkt, c93->audio, datasize - 26);
127 127
             if (ret > 0) {
128 128
                 pkt->stream_index = 1;
129 129
                 pkt->flags |= AV_PKT_FLAG_KEY;
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 /* This is our own gmtime_r. It differs from its POSIX counterpart in a
28 28
    couple of places, though. */
29
-struct tm *brktimegm(time_t secs, struct tm *tm)
29
+struct tm *ff_brktimegm(time_t secs, struct tm *tm)
30 30
 {
31 31
     int days, y, ny, m;
32 32
     int md[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
... ...
@@ -424,7 +424,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
424 424
     return offset + s->data_offset;
425 425
 }
426 426
 
427
-void dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
427
+void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
428 428
 {
429 429
     c->frames= frame_offset;
430 430
     if (c->ach)
... ...
@@ -552,7 +552,7 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
552 552
     if (avio_seek(s->pb, offset, SEEK_SET) < 0)
553 553
         return -1;
554 554
 
555
-    dv_offset_reset(c, offset / c->sys->frame_size);
555
+    ff_dv_offset_reset(c, offset / c->sys->frame_size);
556 556
     return 0;
557 557
 }
558 558
 
... ...
@@ -34,7 +34,7 @@ typedef struct DVDemuxContext DVDemuxContext;
34 34
 DVDemuxContext* avpriv_dv_init_demux(AVFormatContext* s);
35 35
 int avpriv_dv_get_packet(DVDemuxContext*, AVPacket *);
36 36
 int avpriv_dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int, int64_t);
37
-void dv_offset_reset(DVDemuxContext *c, int64_t frame_offset);
37
+void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset);
38 38
 
39 39
 typedef struct DVMuxContext DVMuxContext;
40 40
 
... ...
@@ -130,7 +130,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
130 130
     case dv_video_recdate:  /* VAUX recording date */
131 131
         ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
132 132
                                             c->sys->time_base.den, AV_ROUND_DOWN);
133
-        brktimegm(ct, &tc);
133
+        ff_brktimegm(ct, &tc);
134 134
         buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
135 135
                        /* 0xff is very likely to be "unknown" */
136 136
         buf[2] = (3 << 6) | /* reserved -- always 1 */
... ...
@@ -146,7 +146,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
146 146
     case dv_video_rectime:  /* VAUX recording time */
147 147
         ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
148 148
                                                        c->sys->time_base.den, AV_ROUND_DOWN);
149
-        brktimegm(ct, &tc);
149
+        ff_brktimegm(ct, &tc);
150 150
         buf[1] = (3 << 6) | /* reserved -- always 1 */
151 151
                  0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
152 152
         buf[2] = (1 << 7) | /* reserved -- always 1 */
... ...
@@ -52,7 +52,7 @@ do {\
52 52
 } while(0)
53 53
 #endif
54 54
 
55
-struct tm *brktimegm(time_t secs, struct tm *tm);
55
+struct tm *ff_brktimegm(time_t secs, struct tm *tm);
56 56
 
57 57
 char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase);
58 58
 
... ...
@@ -66,7 +66,7 @@ const AVCodecTag ff_mp4_obj_type[] = {
66 66
     { CODEC_ID_NONE      ,    0 },
67 67
 };
68 68
 
69
-const AVCodecTag codec_movvideo_tags[] = {
69
+const AVCodecTag ff_codec_movvideo_tags[] = {
70 70
 /*  { CODEC_ID_, MKTAG('I', 'V', '5', '0') }, *//* Indeo 5.0 */
71 71
 
72 72
     { CODEC_ID_RAWVIDEO, MKTAG('r', 'a', 'w', ' ') }, /* Uncompressed RGB */
... ...
@@ -230,7 +230,7 @@ const AVCodecTag codec_movvideo_tags[] = {
230 230
     { CODEC_ID_NONE, 0 },
231 231
 };
232 232
 
233
-const AVCodecTag codec_movaudio_tags[] = {
233
+const AVCodecTag ff_codec_movaudio_tags[] = {
234 234
     { CODEC_ID_AAC,             MKTAG('m', 'p', '4', 'a') },
235 235
     { CODEC_ID_AC3,             MKTAG('a', 'c', '-', '3') }, /* ETSI TS 102 366 Annex F */
236 236
     { CODEC_ID_AC3,             MKTAG('s', 'a', 'c', '3') }, /* Nero Recode */
... ...
@@ -30,8 +30,8 @@
30 30
 
31 31
 /* isom.c */
32 32
 extern const AVCodecTag ff_mp4_obj_type[];
33
-extern const AVCodecTag codec_movvideo_tags[];
34
-extern const AVCodecTag codec_movaudio_tags[];
33
+extern const AVCodecTag ff_codec_movvideo_tags[];
34
+extern const AVCodecTag ff_codec_movaudio_tags[];
35 35
 extern const AVCodecTag ff_codec_movsubtitle_tags[];
36 36
 
37 37
 int ff_mov_iso639_to_lang(const char lang[4], int mp4);
... ...
@@ -1474,7 +1474,7 @@ static int matroska_read_header(AVFormatContext *s)
1474 1474
                    && (track->codec_priv.size >= 86)
1475 1475
                    && (track->codec_priv.data != NULL)) {
1476 1476
             fourcc = AV_RL32(track->codec_priv.data);
1477
-            codec_id = ff_codec_get_id(codec_movvideo_tags, fourcc);
1477
+            codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
1478 1478
         } else if (codec_id == CODEC_ID_PCM_S16BE) {
1479 1479
             switch (track->audio.bitdepth) {
1480 1480
             case  8:  codec_id = CODEC_ID_PCM_U8;     break;
... ...
@@ -480,7 +480,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecCo
480 480
     } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
481 481
         if (qt_id) {
482 482
             if (!codec->codec_tag)
483
-                codec->codec_tag = ff_codec_get_tag(codec_movvideo_tags, codec->codec_id);
483
+                codec->codec_tag = ff_codec_get_tag(ff_codec_movvideo_tags, codec->codec_id);
484 484
             if (codec->extradata_size)
485 485
                 avio_write(dyn_cp, codec->extradata, codec->extradata_size);
486 486
         } else {
... ...
@@ -586,7 +586,7 @@ static int mkv_write_tracks(AVFormatContext *s)
586 586
                     put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
587 587
 
588 588
                 if (!native_id &&
589
-                      ff_codec_get_tag(codec_movvideo_tags, codec->codec_id) &&
589
+                      ff_codec_get_tag(ff_codec_movvideo_tags, codec->codec_id) &&
590 590
                     (!ff_codec_get_tag(ff_codec_bmp_tags,   codec->codec_id)
591 591
                      || codec->codec_id == CODEC_ID_SVQ1
592 592
                      || codec->codec_id == CODEC_ID_SVQ3
... ...
@@ -297,7 +297,7 @@ AVInputFormat ff_mmf_demuxer = {
297 297
     .read_probe     = mmf_probe,
298 298
     .read_header    = mmf_read_header,
299 299
     .read_packet    = mmf_read_packet,
300
-    .read_seek      = pcm_read_seek,
300
+    .read_seek      = ff_pcm_read_seek,
301 301
 };
302 302
 #endif
303 303
 #if CONFIG_MMF_MUXER
... ...
@@ -1170,7 +1170,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
1170 1170
 
1171 1171
         if (st->codec->codec_tag &&
1172 1172
             st->codec->codec_tag != format &&
1173
-            (c->fc->video_codec_id ? ff_codec_get_id(codec_movvideo_tags, format) != c->fc->video_codec_id
1173
+            (c->fc->video_codec_id ? ff_codec_get_id(ff_codec_movvideo_tags, format) != c->fc->video_codec_id
1174 1174
                                    : st->codec->codec_tag != MKTAG('j','p','e','g'))
1175 1175
            ){
1176 1176
             /* Multiple fourcc, we skip JPEG. This is not correct, we should
... ...
@@ -1187,7 +1187,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
1187 1187
         sc->dref_id= dref_id;
1188 1188
 
1189 1189
         st->codec->codec_tag = format;
1190
-        id = ff_codec_get_id(codec_movaudio_tags, format);
1190
+        id = ff_codec_get_id(ff_codec_movaudio_tags, format);
1191 1191
         if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8)))
1192 1192
             id = ff_codec_get_id(ff_codec_wav_tags, av_bswap32(format)&0xFFFF);
1193 1193
 
... ...
@@ -1195,7 +1195,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
1195 1195
             st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
1196 1196
         } else if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO && /* do not overwrite codec type */
1197 1197
                    format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */
1198
-            id = ff_codec_get_id(codec_movvideo_tags, format);
1198
+            id = ff_codec_get_id(ff_codec_movvideo_tags, format);
1199 1199
             if (id <= 0)
1200 1200
                 id = ff_codec_get_id(ff_codec_bmp_tags, format);
1201 1201
             if (id > 0)
... ...
@@ -863,7 +863,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
863 863
         else if (track->enc->codec_id == CODEC_ID_RAWVIDEO)
864 864
             tag = mov_get_rawvideo_codec_tag(s, track);
865 865
         else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
866
-            tag = ff_codec_get_tag(codec_movvideo_tags, track->enc->codec_id);
866
+            tag = ff_codec_get_tag(ff_codec_movvideo_tags, track->enc->codec_id);
867 867
             if (!tag) { // if no mac fcc found, try with Microsoft tags
868 868
                 tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id);
869 869
                 if (tag)
... ...
@@ -871,7 +871,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
871 871
                            "the file may be unplayable!\n");
872 872
             }
873 873
         } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) {
874
-            tag = ff_codec_get_tag(codec_movaudio_tags, track->enc->codec_id);
874
+            tag = ff_codec_get_tag(ff_codec_movaudio_tags, track->enc->codec_id);
875 875
             if (!tag) { // if no mac fcc found, try with Microsoft tags
876 876
                 int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id);
877 877
                 if (ms_tag) {
... ...
@@ -3310,7 +3310,7 @@ AVOutputFormat ff_mov_muxer = {
3310 3310
     .write_packet      = ff_mov_write_packet,
3311 3311
     .write_trailer     = mov_write_trailer,
3312 3312
     .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH,
3313
-    .codec_tag = (const AVCodecTag* const []){codec_movvideo_tags, codec_movaudio_tags, 0},
3313
+    .codec_tag = (const AVCodecTag* const []){ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0},
3314 3314
     .priv_class = &mov_muxer_class,
3315 3315
 };
3316 3316
 #endif
... ...
@@ -415,7 +415,7 @@ static int oma_read_seek(struct AVFormatContext *s, int stream_index, int64_t ti
415 415
 {
416 416
     OMAContext *oc = s->priv_data;
417 417
 
418
-    pcm_read_seek(s, stream_index, timestamp, flags);
418
+    ff_pcm_read_seek(s, stream_index, timestamp, flags);
419 419
 
420 420
     if (oc->encrypted) {
421 421
         /* readjust IV for CBC */
... ...
@@ -23,8 +23,8 @@
23 23
 #include "avformat.h"
24 24
 #include "pcm.h"
25 25
 
26
-int pcm_read_seek(AVFormatContext *s,
27
-                  int stream_index, int64_t timestamp, int flags)
26
+int ff_pcm_read_seek(AVFormatContext *s,
27
+                     int stream_index, int64_t timestamp, int flags)
28 28
 {
29 29
     AVStream *st;
30 30
     int block_align, byte_rate;
... ...
@@ -24,7 +24,7 @@
24 24
 
25 25
 #include "avformat.h"
26 26
 
27
-int pcm_read_seek(AVFormatContext *s,
28
-                  int stream_index, int64_t timestamp, int flags);
27
+int ff_pcm_read_seek(AVFormatContext *s,
28
+                     int stream_index, int64_t timestamp, int flags);
29 29
 
30 30
 #endif /* AVFORMAT_PCM_H */
... ...
@@ -67,7 +67,7 @@ AVInputFormat ff_pcm_ ## name_ ## _demuxer = {              \
67 67
     .priv_data_size = sizeof(RawAudioDemuxerContext),       \
68 68
     .read_header    = ff_raw_read_header,                   \
69 69
     .read_packet    = raw_read_packet,                      \
70
-    .read_seek      = pcm_read_seek,                        \
70
+    .read_seek      = ff_pcm_read_seek,                     \
71 71
     .flags          = AVFMT_GENERIC_INDEX,                  \
72 72
     .extensions     = ext,                                  \
73 73
     .raw_codec_id   = codec,                                \
... ...
@@ -94,6 +94,6 @@ AVInputFormat ff_rso_demuxer = {
94 94
     .extensions     =   "rso",
95 95
     .read_header    =   rso_read_header,
96 96
     .read_packet    =   rso_read_packet,
97
-    .read_seek      =   pcm_read_seek,
97
+    .read_seek      =   ff_pcm_read_seek,
98 98
     .codec_tag      =   (const AVCodecTag* const []){ff_codec_rso_tags, 0},
99 99
 };
... ...
@@ -388,7 +388,7 @@ static int rtsp_read_close(AVFormatContext *s)
388 388
     return 0;
389 389
 }
390 390
 
391
-const AVClass rtsp_demuxer_class = {
391
+static const AVClass rtsp_demuxer_class = {
392 392
     .class_name     = "RTSP demuxer",
393 393
     .item_name      = av_default_item_name,
394 394
     .option         = ff_rtsp_options,
... ...
@@ -147,5 +147,5 @@ AVInputFormat ff_sol_demuxer = {
147 147
     .read_probe     = sol_probe,
148 148
     .read_header    = sol_read_header,
149 149
     .read_packet    = sol_read_packet,
150
-    .read_seek      = pcm_read_seek,
150
+    .read_seek      = ff_pcm_read_seek,
151 151
 };
... ...
@@ -150,5 +150,5 @@ AVInputFormat ff_sox_demuxer = {
150 150
     .read_probe     = sox_probe,
151 151
     .read_header    = sox_read_header,
152 152
     .read_packet    = sox_read_packet,
153
-    .read_seek      = pcm_read_seek,
153
+    .read_seek      = ff_pcm_read_seek,
154 154
 };
... ...
@@ -45,7 +45,7 @@ typedef enum voc_type {
45 45
 extern const unsigned char ff_voc_magic[21];
46 46
 extern const AVCodecTag ff_voc_codec_tags[];
47 47
 
48
-int voc_get_packet(AVFormatContext *s, AVPacket *pkt,
49
-                   AVStream *st, int max_size);
48
+int ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt,
49
+                      AVStream *st, int max_size);
50 50
 
51 51
 #endif /* AVFORMAT_VOC_H */
... ...
@@ -62,7 +62,7 @@ static int voc_read_header(AVFormatContext *s)
62 62
 }
63 63
 
64 64
 int
65
-voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
65
+ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
66 66
 {
67 67
     VocDecContext *voc = s->priv_data;
68 68
     AVCodecContext *dec = st->codec;
... ...
@@ -153,7 +153,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
153 153
 
154 154
 static int voc_read_packet(AVFormatContext *s, AVPacket *pkt)
155 155
 {
156
-    return voc_get_packet(s, pkt, s->streams[0], 0);
156
+    return ff_voc_get_packet(s, pkt, s->streams[0], 0);
157 157
 }
158 158
 
159 159
 AVInputFormat ff_voc_demuxer = {
... ...
@@ -676,7 +676,7 @@ static int wav_read_seek(AVFormatContext *s,
676 676
     default:
677 677
         break;
678 678
     }
679
-    return pcm_read_seek(s, stream_index, timestamp, flags);
679
+    return ff_pcm_read_seek(s, stream_index, timestamp, flags);
680 680
 }
681 681
 
682 682
 #define OFFSET(x) offsetof(WAVContext, x)