diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-16 03:49:16 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-16 04:34:37 +0400 |
commit | 6cb2085278bdd3ee83d5ed528d98c78756ee7277 (patch) | |
tree | da57b6491e07c2deb9cf57e3cd595323d118c244 /libavcodec | |
parent | 8812c97b98321f82763b7c9c1363c7c1f6cace8f (diff) | |
parent | 210f72845c11fbab7b913a4f18ffd67e99d2dd4f (diff) |
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>
Diffstat (limited to 'libavcodec')
171 files changed, 1940 insertions, 1027 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index f886e3e7a5..8758c6de4a 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -925,7 +925,7 @@ static av_cold void common_init(AVCodecContext *avctx) { FourXContext * const f = avctx->priv_data; - dsputil_init(&f->dsp, avctx); + ff_dsputil_init(&f->dsp, avctx); f->avctx = avctx; } @@ -969,7 +969,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&f->cfrm[i].data); f->cfrm[i].allocated_size = 0; } - free_vlc(&f->pre_vlc); + ff_free_vlc(&f->pre_vlc); if (f->current_picture.data[0]) avctx->release_buffer(avctx, &f->current_picture); if (f->last_picture.data[0]) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 2701696070..183b6c1ebb 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -333,6 +333,7 @@ OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o OBJS-$(CONFIG_PRORES_ANATOLIY_ENCODER) += proresenc_anatoliy.o +OBJS-$(CONFIG_PRORES_KOSTYA_ENCODER) += proresenc_kostya.o proresdata.o proresdsp.o OBJS-$(CONFIG_PTX_DECODER) += ptx.o OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o celp_math.o \ celp_filters.o acelp_vectors.o \ diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index a206a47acc..d77b46fa21 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -825,7 +825,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) ff_aac_sbr_init(); - dsputil_init(&ac->dsp, avctx); + ff_dsputil_init(&ac->dsp, avctx); ff_fmt_convert_init(&ac->fmt_conv, avctx); ac->random_state = 0x1f2e3d4c; diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 11538856ab..14be58f885 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -669,7 +669,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s) { int ret = 0; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); // window init ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024); diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 01e08ec0c5..be17efb24d 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -167,7 +167,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) ff_mdct_init(&s->imdct_256, 8, 1, 1.0); ff_mdct_init(&s->imdct_512, 9, 1, 1.0); ff_kbd_window_init(s->window, 5.0, 256); - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT); ff_fmt_convert_init(&s->fmt_conv, avctx); av_lfg_init(&s->dith_state, 0); diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index a5d335091d..d49873a6f6 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -2467,7 +2467,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx) if (!avctx->coded_frame) goto init_fail; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT); dprint_options(s); diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index aea38eea85..2b5c14c3ac 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -182,6 +182,7 @@ void avcodec_register_all(void) REGISTER_ENCDEC (PPM, ppm); REGISTER_ENCDEC (PRORES, prores); REGISTER_ENCODER (PRORES_ANATOLIY, prores_anatoliy); + REGISTER_ENCODER (PRORES_KOSTYA, prores_kostya); REGISTER_DECODER (PRORES_LGPL, prores_lgpl); REGISTER_DECODER (PTX, ptx); REGISTER_DECODER (QDRAW, qdraw); diff --git a/libavcodec/alpha/dsputil_alpha.c b/libavcodec/alpha/dsputil_alpha.c index d8f999dfdc..db2464b02f 100644 --- a/libavcodec/alpha/dsputil_alpha.c +++ b/libavcodec/alpha/dsputil_alpha.c @@ -268,7 +268,7 @@ static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels, put_pixels_axp_asm(block + 8, pixels + 8, line_size, h); } -void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; diff --git a/libavcodec/alpha/mpegvideo_alpha.c b/libavcodec/alpha/mpegvideo_alpha.c index de32545ade..28eca072c0 100644 --- a/libavcodec/alpha/mpegvideo_alpha.c +++ b/libavcodec/alpha/mpegvideo_alpha.c @@ -103,7 +103,7 @@ static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block, dct_unquantize_h263_axp(block, n_coeffs, qscale, (qscale - 1) | 1); } -void MPV_common_init_axp(MpegEncContext *s) +void ff_MPV_common_init_axp(MpegEncContext *s) { s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_axp; s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_axp; diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 6ce48de7de..84ed4cf403 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1724,7 +1724,7 @@ static av_cold int decode_init(AVCodecContext *avctx) } } - dsputil_init(&ctx->dsp, avctx); + ff_dsputil_init(&ctx->dsp, avctx); avcodec_get_frame_defaults(&ctx->frame); avctx->coded_frame = &ctx->frame; diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 1cd7d1e66d..4a69571ba4 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -231,7 +231,7 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) filter_alloc_fail); } - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; avcodec_get_frame_defaults(&s->frame); diff --git a/libavcodec/arm/dsputil_init_arm.c b/libavcodec/arm/dsputil_init_arm.c index ccbe1ed296..58577dde9a 100644 --- a/libavcodec/arm/dsputil_init_arm.c +++ b/libavcodec/arm/dsputil_init_arm.c @@ -73,7 +73,7 @@ static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block) ff_add_pixels_clamped(block, dest, line_size); } -void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; diff --git a/libavcodec/arm/mpegvideo_arm.c b/libavcodec/arm/mpegvideo_arm.c index 6cb1bc8582..b2b254e2d3 100644 --- a/libavcodec/arm/mpegvideo_arm.c +++ b/libavcodec/arm/mpegvideo_arm.c @@ -38,17 +38,17 @@ void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, DCTELEM *block, void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block, int n, int qscale); -void MPV_common_init_arm(MpegEncContext *s) +void ff_MPV_common_init_arm(MpegEncContext *s) { /* IWMMXT support is a superset of armv5te, so * allow optimized functions for armv5te unless * a better iwmmxt function exists */ #if HAVE_ARMV5TE - MPV_common_init_armv5te(s); + ff_MPV_common_init_armv5te(s); #endif #if HAVE_IWMMXT - MPV_common_init_iwmmxt(s); + ff_MPV_common_init_iwmmxt(s); #endif if (HAVE_NEON) { diff --git a/libavcodec/arm/mpegvideo_arm.h b/libavcodec/arm/mpegvideo_arm.h index 3549bb244b..e9de979300 100644 --- a/libavcodec/arm/mpegvideo_arm.h +++ b/libavcodec/arm/mpegvideo_arm.h @@ -21,7 +21,7 @@ #include "libavcodec/mpegvideo.h" -void MPV_common_init_iwmmxt(MpegEncContext *s); -void MPV_common_init_armv5te(MpegEncContext *s); +void ff_MPV_common_init_iwmmxt(MpegEncContext *s); +void ff_MPV_common_init_armv5te(MpegEncContext *s); #endif /* AVCODEC_ARM_MPEGVIDEO_H */ diff --git a/libavcodec/arm/mpegvideo_armv5te.c b/libavcodec/arm/mpegvideo_armv5te.c index 1d383cae1e..dcde4661bb 100644 --- a/libavcodec/arm/mpegvideo_armv5te.c +++ b/libavcodec/arm/mpegvideo_armv5te.c @@ -94,7 +94,7 @@ static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s, ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1); } -void MPV_common_init_armv5te(MpegEncContext *s) +void ff_MPV_common_init_armv5te(MpegEncContext *s) { s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te; s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te; diff --git a/libavcodec/arm/mpegvideo_iwmmxt.c b/libavcodec/arm/mpegvideo_iwmmxt.c index bb47c0d321..c85e6dc8b1 100644 --- a/libavcodec/arm/mpegvideo_iwmmxt.c +++ b/libavcodec/arm/mpegvideo_iwmmxt.c @@ -93,7 +93,7 @@ static void dct_unquantize_h263_intra_iwmmxt(MpegEncContext *s, block_orig[0] = level; } -void MPV_common_init_iwmmxt(MpegEncContext *s) +void ff_MPV_common_init_iwmmxt(MpegEncContext *s) { if (!(mm_flags & AV_CPU_FLAG_IWMMXT)) return; diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 0845959d37..563c92c335 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -519,7 +519,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, static av_cold void common_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; - dsputil_init(&a->dsp, avctx); + ff_dsputil_init(&a->dsp, avctx); a->mb_width = (avctx->width + 15) / 16; a->mb_height = (avctx->height + 15) / 16; diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c index 1049df6281..39f23d8559 100644 --- a/libavcodec/atrac.c +++ b/libavcodec/atrac.c @@ -48,7 +48,7 @@ static const float qmf_48tap_half[24] = { * Generate common tables */ -void atrac_generate_tables(void) +void ff_atrac_generate_tables(void) { int i; float s; @@ -79,7 +79,7 @@ void atrac_generate_tables(void) */ -void atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp) +void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp) { int i, j; float *p1, *p3; diff --git a/libavcodec/atrac.h b/libavcodec/atrac.h index e126935e12..8607b0102d 100644 --- a/libavcodec/atrac.h +++ b/libavcodec/atrac.h @@ -30,7 +30,7 @@ extern float ff_atrac_sf_table[64]; -void atrac_generate_tables(void); -void atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp); +void ff_atrac_generate_tables(void); +void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp); #endif /* AVCODEC_ATRAC_H */ diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index c796235c80..282e7bcdbb 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -262,14 +262,14 @@ static void at1_subband_synthesis(AT1Ctx *q, AT1SUCtx* su, float *pOut) float iqmf_temp[512 + 46]; /* combine low and middle bands */ - atrac_iqmf(q->bands[0], q->bands[1], 128, temp, su->fst_qmf_delay, iqmf_temp); + ff_atrac_iqmf(q->bands[0], q->bands[1], 128, temp, su->fst_qmf_delay, iqmf_temp); /* delay the signal of the high band by 23 samples */ memcpy( su->last_qmf_delay, &su->last_qmf_delay[256], sizeof(float) * 23); memcpy(&su->last_qmf_delay[23], q->bands[2], sizeof(float) * 256); /* combine (low + middle) and high bands */ - atrac_iqmf(temp, su->last_qmf_delay, 256, pOut, su->snd_qmf_delay, iqmf_temp); + ff_atrac_iqmf(temp, su->last_qmf_delay, 256, pOut, su->snd_qmf_delay, iqmf_temp); } @@ -378,9 +378,9 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx) ff_init_ff_sine_windows(5); - atrac_generate_tables(); + ff_atrac_generate_tables(); - dsputil_init(&q->dsp, avctx); + ff_dsputil_init(&q->dsp, avctx); ff_fmt_convert_init(&q->fmt_conv, avctx); q->bands[0] = q->low; diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index efaadc93fc..e72df12d62 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -814,9 +814,9 @@ static int decodeFrame(ATRAC3Context *q, const uint8_t* databuf, p2= p1+256; p3= p2+256; p4= p3+256; - atrac_iqmf (p1, p2, 256, p1, q->pUnits[i].delayBuf1, q->tempBuf); - atrac_iqmf (p4, p3, 256, p3, q->pUnits[i].delayBuf2, q->tempBuf); - atrac_iqmf (p1, p3, 512, p1, q->pUnits[i].delayBuf3, q->tempBuf); + ff_atrac_iqmf (p1, p2, 256, p1, q->pUnits[i].delayBuf1, q->tempBuf); + ff_atrac_iqmf (p4, p3, 256, p3, q->pUnits[i].delayBuf2, q->tempBuf); + ff_atrac_iqmf (p1, p3, 512, p1, q->pUnits[i].delayBuf3, q->tempBuf); } return 0; @@ -1016,7 +1016,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) return ret; } - atrac_generate_tables(); + ff_atrac_generate_tables(); /* Generate gain tables. */ for (i=0 ; i<16 ; i++) @@ -1039,7 +1039,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) q->matrix_coeff_index_next[i] = 3; } - dsputil_init(&dsp, avctx); + ff_dsputil_init(&dsp, avctx); ff_fmt_convert_init(&q->fmt_conv, avctx); q->pUnits = av_mallocz(sizeof(channel_unit)*q->channels); diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c index 2132d08cdb..434d2a7190 100644 --- a/libavcodec/bfin/dsputil_bfin.c +++ b/libavcodec/bfin/dsputil_bfin.c @@ -195,7 +195,7 @@ static int bfin_pix_abs8_xy2 (void *c, uint8_t *blk1, uint8_t *blk2, int line_si */ -void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx ) +void ff_dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx ) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; diff --git a/libavcodec/bfin/mpegvideo_bfin.c b/libavcodec/bfin/mpegvideo_bfin.c index 2f819271f6..f7f3d729de 100644 --- a/libavcodec/bfin/mpegvideo_bfin.c +++ b/libavcodec/bfin/mpegvideo_bfin.c @@ -146,7 +146,7 @@ static int dct_quantize_bfin (MpegEncContext *s, return last_non_zero; } -void MPV_common_init_bfin (MpegEncContext *s) +void ff_MPV_common_init_bfin (MpegEncContext *s) { /* s->dct_quantize= dct_quantize_bfin; */ } diff --git a/libavcodec/bink.c b/libavcodec/bink.c index ff8bc8ad07..c501688ae8 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1298,7 +1298,7 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; avctx->idct_algo = FF_IDCT_BINK; - dsputil_init(&c->dsp, avctx); + ff_dsputil_init(&c->dsp, avctx); ff_binkdsp_init(&c->bdsp); init_bundles(c); diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 9f51c7a856..fdd06b9a97 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -79,7 +79,7 @@ static av_cold int decode_init(AVCodecContext *avctx) int i; int frame_len_bits; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_fmt_convert_init(&s->fmt_conv, avctx); /* determine frame length */ diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index e1336438a0..aad5ffa2fb 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -253,9 +253,9 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables. 'use_static' should be set to 1 for tables, which should be freed - with av_free_static(), 0 if free_vlc() will be used. + with av_free_static(), 0 if ff_free_vlc() will be used. */ -int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, 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, } -void free_vlc(VLC *vlc) +void ff_free_vlc(VLC *vlc) { av_freep(&vlc->table); } diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index adaf797cde..26bc65cb75 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -671,7 +671,7 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) { AVSContext *h = avctx->priv_data; MpegEncContext * const s = &h->s; - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); ff_cavsdsp_init(&h->cdsp, avctx); s->avctx = avctx; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 16e5474d84..fb0ec841ce 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -470,7 +470,7 @@ static int decode_pic(AVSContext *h) { if (!s->context_initialized) { s->avctx->idct_algo = FF_IDCT_CAVS; - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct); } diff --git a/libavcodec/cook.c b/libavcodec/cook.c index e161b1a1bc..3968aae2f5 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -321,11 +321,11 @@ static av_cold int cook_decode_close(AVCodecContext *avctx) /* Free the VLC tables. */ for (i = 0; i < 13; i++) - free_vlc(&q->envelope_quant_index[i]); + ff_free_vlc(&q->envelope_quant_index[i]); for (i = 0; i < 7; i++) - free_vlc(&q->sqvh[i]); + ff_free_vlc(&q->sqvh[i]); for (i = 0; i < q->num_subpackets; i++) - free_vlc(&q->subpacket[i].ccpl); + ff_free_vlc(&q->subpacket[i].ccpl); av_log(avctx, AV_LOG_DEBUG, "Memory deallocated.\n"); diff --git a/libavcodec/dca.c b/libavcodec/dca.c index cf61a16bb9..4ac291f8af 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -1926,7 +1926,7 @@ static av_cold int dca_decode_init(AVCodecContext *avctx) s->avctx = avctx; dca_init_vlcs(); - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_mdct_init(&s->imdct, 6, 1, 1.0); ff_synth_filter_init(&s->synth); ff_dcadsp_init(&s->dcadsp); diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index c683ac9837..847cc68b2a 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -85,7 +85,7 @@ static int cpu_flags; static const struct algo fdct_tab[] = { { "REF-DBL", ff_ref_fdct, NO_PERM }, { "FAAN", ff_faandct, FAAN_SCALE }, - { "IJG-AAN-INT", fdct_ifast, SCALE_PERM }, + { "IJG-AAN-INT", ff_fdct_ifast, SCALE_PERM }, { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM }, #if HAVE_MMX @@ -124,7 +124,7 @@ static void ff_prores_idct_put_10_sse2_wrap(uint16_t *dst){ static const struct algo idct_tab[] = { { "FAANI", ff_faanidct, NO_PERM }, { "REF-DBL", ff_ref_idct, NO_PERM }, - { "INT", j_rev_dct, MMX_PERM }, + { "INT", ff_j_rev_dct, MMX_PERM }, { "SIMPLE-C", ff_simple_idct_8, NO_PERM }, #if HAVE_MMX diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 79f27e5162..a318d3987f 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -84,9 +84,9 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid) } ctx->cid_table = &ff_dnxhd_cid_table[index]; - free_vlc(&ctx->ac_vlc); - free_vlc(&ctx->dc_vlc); - free_vlc(&ctx->run_vlc); + ff_free_vlc(&ctx->ac_vlc); + ff_free_vlc(&ctx->dc_vlc); + ff_free_vlc(&ctx->run_vlc); init_vlc(&ctx->ac_vlc, DNXHD_VLC_BITS, 257, 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 ctx->avctx->pix_fmt = PIX_FMT_YUV422P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { - dsputil_init(&ctx->dsp, ctx->avctx); + ff_dsputil_init(&ctx->dsp, ctx->avctx); ctx->bit_depth = 10; ctx->decode_dct_block = dnxhd_decode_dct_block_10; } @@ -140,7 +140,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si ctx->avctx->pix_fmt = PIX_FMT_YUV422P; ctx->avctx->bits_per_raw_sample = 8; if (ctx->bit_depth != 8) { - dsputil_init(&ctx->dsp, ctx->avctx); + ff_dsputil_init(&ctx->dsp, ctx->avctx); ctx->bit_depth = 8; ctx->decode_dct_block = dnxhd_decode_dct_block_8; } @@ -414,9 +414,9 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) if (ctx->picture.data[0]) ff_thread_release_buffer(avctx, &ctx->picture); - free_vlc(&ctx->ac_vlc); - free_vlc(&ctx->dc_vlc); - free_vlc(&ctx->run_vlc); + ff_free_vlc(&ctx->ac_vlc); + ff_free_vlc(&ctx->dc_vlc); + ff_free_vlc(&ctx->run_vlc); return 0; } diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 576fe67151..ce8980110b 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -267,10 +267,10 @@ static int dnxhd_encode_init(AVCodecContext *avctx) avctx->bits_per_raw_sample = ctx->cid_table->bit_depth; - dsputil_init(&ctx->m.dsp, avctx); + ff_dsputil_init(&ctx->m.dsp, avctx); ff_dct_common_init(&ctx->m); if (!ctx->m.dct_quantize) - ctx->m.dct_quantize = dct_quantize_c; + ctx->m.dct_quantize = ff_dct_quantize_c; if (ctx->cid_table->bit_depth == 10) { ctx->m.dct_quantize = dnxhd_10bit_dct_quantize; diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index dfa526a5cb..9821703d37 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -83,7 +83,7 @@ const uint8_t ff_zigzag248_direct[64] = { }; /* not permutated inverse zigzag_direct + 1 for MMX quantizer */ -DECLARE_ALIGNED(16, uint16_t, inv_zigzag_direct16)[64]; +DECLARE_ALIGNED(16, uint16_t, ff_inv_zigzag_direct16)[64]; const uint8_t ff_alternate_horizontal_scan[64] = { 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) } static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block) { - j_rev_dct (block); + ff_j_rev_dct (block); ff_put_pixels_clamped_c(block, dest, line_size); } static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block) { - j_rev_dct (block); + ff_j_rev_dct (block); ff_add_pixels_clamped_c(block, dest, line_size); } static void ff_jref_idct4_put(uint8_t *dest, int line_size, DCTELEM *block) { - j_rev_dct4 (block); + ff_j_rev_dct4 (block); put_pixels_clamped4_c(block, dest, line_size); } static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block) { - j_rev_dct4 (block); + ff_j_rev_dct4 (block); add_pixels_clamped4_c(block, dest, line_size); } static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block) { - j_rev_dct2 (block); + ff_j_rev_dct2 (block); put_pixels_clamped2_c(block, dest, line_size); } static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block) { - j_rev_dct2 (block); + ff_j_rev_dct2 (block); add_pixels_clamped2_c(block, dest, line_size); } @@ -2793,7 +2793,7 @@ static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block) static void just_return(void *mem av_unused, int stride av_unused, int h av_unused) { return; } /* init static data */ -av_cold void dsputil_static_init(void) +av_cold void ff_dsputil_static_init(void) { int i; @@ -2807,7 +2807,7 @@ av_cold void dsputil_static_init(void) ff_squareTbl[i] = (i - 256) * (i - 256); } - for(i=0; i<64; i++) inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1; + for(i=0; i<64; i++) ff_inv_zigzag_direct16[ff_zigzag_direct[i]]= i+1; } int ff_check_alignment(void){ @@ -2830,7 +2830,7 @@ int ff_check_alignment(void){ return 0; } -av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) +av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) { int i; @@ -2842,8 +2842,8 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->fdct248 = ff_fdct248_islow_10; } else { if(avctx->dct_algo==FF_DCT_FASTINT) { - c->fdct = fdct_ifast; - c->fdct248 = fdct_ifast248; + c->fdct = ff_fdct_ifast; + c->fdct248 = ff_fdct_ifast248; } else if(avctx->dct_algo==FF_DCT_FAAN) { c->fdct = ff_faandct; @@ -2859,17 +2859,17 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) if(avctx->lowres==1){ c->idct_put= ff_jref_idct4_put; c->idct_add= ff_jref_idct4_add; - c->idct = j_rev_dct4; + c->idct = ff_j_rev_dct4; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(avctx->lowres==2){ c->idct_put= ff_jref_idct2_put; c->idct_add= ff_jref_idct2_add; - c->idct = j_rev_dct2; + c->idct = ff_j_rev_dct2; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(avctx->lowres==3){ c->idct_put= ff_jref_idct1_put; c->idct_add= ff_jref_idct1_add; - c->idct = j_rev_dct1; + c->idct = ff_j_rev_dct1; c->idct_permutation_type= FF_NO_IDCT_PERM; }else{ if (avctx->bits_per_raw_sample == 10) { @@ -2881,7 +2881,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) if(avctx->idct_algo==FF_IDCT_INT){ c->idct_put= ff_jref_idct_put; c->idct_add= ff_jref_idct_add; - c->idct = j_rev_dct; + c->idct = ff_j_rev_dct; c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM; }else if((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER ) && avctx->idct_algo==FF_IDCT_VP3){ @@ -3062,7 +3062,7 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->add_8x8basis= add_8x8basis_c; #if CONFIG_VORBIS_DECODER - c->vorbis_inverse_coupling = vorbis_inverse_coupling; + c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling; #endif #if CONFIG_AC3_DECODER c->ac3_downmix = ff_ac3_downmix_c; @@ -3182,14 +3182,14 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) } - if (HAVE_MMX) dsputil_init_mmx (c, avctx); - if (ARCH_ARM) dsputil_init_arm (c, avctx); - if (HAVE_VIS) dsputil_init_vis (c, avctx); - if (ARCH_ALPHA) dsputil_init_alpha (c, avctx); - if (ARCH_PPC) dsputil_init_ppc (c, avctx); - if (HAVE_MMI) dsputil_init_mmi (c, avctx); - if (ARCH_SH4) dsputil_init_sh4 (c, avctx); - if (ARCH_BFIN) dsputil_init_bfin (c, avctx); + if (HAVE_MMX) ff_dsputil_init_mmx (c, avctx); + if (ARCH_ARM) ff_dsputil_init_arm (c, avctx); + if (HAVE_VIS) ff_dsputil_init_vis (c, avctx); + if (ARCH_ALPHA) ff_dsputil_init_alpha (c, avctx); + if (ARCH_PPC) ff_dsputil_init_ppc (c, avctx); + if (HAVE_MMI) ff_dsputil_init_mmi (c, avctx); + if (ARCH_SH4) ff_dsputil_init_sh4 (c, avctx); + if (ARCH_BFIN) ff_dsputil_init_bfin (c, avctx); for(i=0; i<64; i++){ if(!c->put_2tap_qpel_pixels_tab[0][i]) @@ -3201,3 +3201,8 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) ff_init_scantable_permutation(c->idct_permutation, c->idct_permutation_type); } + +av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) +{ + ff_dsputil_init(c, avctx); +} diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 3584a49a04..47bafd2ac6 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -38,17 +38,17 @@ /* dct code */ typedef short DCTELEM; -void fdct_ifast (DCTELEM *data); -void fdct_ifast248 (DCTELEM *data); +void ff_fdct_ifast (DCTELEM *data); +void ff_fdct_ifast248 (DCTELEM *data); void ff_jpeg_fdct_islow_8(DCTELEM *data); void ff_jpeg_fdct_islow_10(DCTELEM *data); void ff_fdct248_islow_8(DCTELEM *data); void ff_fdct248_islow_10(DCTELEM *data); -void j_rev_dct (DCTELEM *data); -void j_rev_dct4 (DCTELEM *data); -void j_rev_dct2 (DCTELEM *data); -void j_rev_dct1 (DCTELEM *data); +void ff_j_rev_dct (DCTELEM *data); +void ff_j_rev_dct4 (DCTELEM *data); +void ff_j_rev_dct2 (DCTELEM *data); +void ff_j_rev_dct1 (DCTELEM *data); void ff_wmv2_idct_c(DCTELEM *data); void ff_fdct_mmx(DCTELEM *block); @@ -581,8 +581,9 @@ typedef struct DSPContext { op_fill_func fill_block_tab[2]; } DSPContext; -void dsputil_static_init(void); -void dsputil_init(DSPContext* p, AVCodecContext *avctx); +void ff_dsputil_static_init(void); +void ff_dsputil_init(DSPContext* p, AVCodecContext *avctx); +attribute_deprecated void dsputil_init(DSPContext* c, AVCodecContext *avctx); int ff_check_alignment(void); @@ -641,14 +642,14 @@ static inline int get_penalty_factor(int lambda, int lambda2, int type){ } } -void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_dwt(DSPContext *c); void ff_intrax8dsp_init(DSPContext* c, AVCodecContext *avctx); diff --git a/libavcodec/dv.c b/libavcodec/dv.c index abfa5cd358..da445a7699 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -313,13 +313,13 @@ static av_cold int dvvideo_init(AVCodecContext *avctx) dv_rl_vlc[i].level = level; dv_rl_vlc[i].run = run; } - free_vlc(&dv_vlc); + ff_free_vlc(&dv_vlc); dv_vlc_map_tableinit(); } /* Generic DSP setup */ - dsputil_init(&dsp, avctx); + ff_dsputil_init(&dsp, avctx); ff_set_cmp(&dsp, dsp.ildct_cmp, avctx->ildct_cmp); s->get_pixels = dsp.get_pixels; s->ildct_cmp = dsp.ildct_cmp[5]; diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 40fdb37670..b411ce4d6b 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -65,7 +65,7 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->pix_fmt = PIX_FMT_YUV420P; if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_EA; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); ff_mpeg12_init_vlcs(); return 0; diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index da9ff3bba0..9bf15f464a 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -50,7 +50,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){ s->avctx = avctx; if(avctx->idct_algo==FF_IDCT_AUTO) avctx->idct_algo=FF_IDCT_EA; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct); avctx->time_base = (AVRational){1, 15}; avctx->pix_fmt = PIX_FMT_YUV420P; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 2d6cff58d4..5b7ff39e4a 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -48,7 +48,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx) s->avctx = avctx; if(avctx->idct_algo==FF_IDCT_AUTO) avctx->idct_algo=FF_IDCT_EA; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); s->qscale = 1; avctx->time_base = (AVRational){1, 15}; diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index d55c0006ef..2391e57f90 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -69,7 +69,7 @@ static void decode_mb(MpegEncContext *s, int ref) ff_h264_hl_decode_mb(h); } else { assert(ref == 0); - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); } } diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c index c157b984d3..7e75e5dae4 100644 --- a/libavcodec/faxcompr.c +++ b/libavcodec/faxcompr.c @@ -110,11 +110,11 @@ av_cold void ff_ccitt_unpack_init(void) ccitt_vlc[1].table = code_table2; ccitt_vlc[1].table_allocated = 648; for(i = 0; i < 2; i++){ - init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, - ccitt_codes_lens[i], 1, 1, - ccitt_codes_bits[i], 1, 1, - ccitt_syms, 2, 2, - INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_sparse(&ccitt_vlc[i], 9, CCITT_SYMS, + ccitt_codes_lens[i], 1, 1, + ccitt_codes_bits[i], 1, 1, + ccitt_syms, 2, 2, + INIT_VLC_USE_NEW_STATIC); } INIT_VLC_STATIC(&ccitt_group3_2d_vlc, 9, 11, ccitt_group3_2d_lens, 1, 1, diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 0ab22a984c..1535c5e462 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -674,7 +674,7 @@ static av_cold int common_init(AVCodecContext *avctx){ avcodec_get_frame_defaults(&s->picture); - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); s->width = avctx->width; s->height= avctx->height; diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index ee373d0975..2b131a9802 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -89,9 +89,9 @@ AVCodec ff_flv_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_FLV1, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), }; diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index a7d5a73e41..da976c857d 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -67,7 +67,7 @@ static av_cold int decode_init(AVCodecContext *avctx) s->avctx = avctx; s->tmpbuf = NULL; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); return 0; } @@ -114,13 +114,13 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, if(j) dst[i] += dst[i - stride]; else if(Uoff) dst[i] += 0x80; if (get_bits_left(&gb) < 0) { - free_vlc(&vlc); + ff_free_vlc(&vlc); return AVERROR_INVALIDDATA; } } dst += stride; } - free_vlc(&vlc); + ff_free_vlc(&vlc); return 0; } diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 648c958cb0..d310fe0976 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -360,19 +360,19 @@ static inline void align_get_bits(GetBitContext *s) bits, bits_wrap, bits_size, \ codes, codes_wrap, codes_size, \ flags) \ - init_vlc_sparse(vlc, nb_bits, nb_codes, \ - bits, bits_wrap, bits_size, \ - codes, codes_wrap, codes_size, \ - NULL, 0, 0, flags) + ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \ + bits, bits_wrap, bits_size, \ + codes, codes_wrap, codes_size, \ + NULL, 0, 0, flags) -int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, +int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags); #define INIT_VLC_LE 2 #define INIT_VLC_USE_NEW_STATIC 4 -void free_vlc(VLC *vlc); +void ff_free_vlc(VLC *vlc); #define INIT_VLC_STATIC(vlc, bits, a,b,c,d,e,f,g, static_size) do { \ static VLC_TYPE table[static_size][2]; \ diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index ff3d05c514..3c634cc9d4 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -66,7 +66,7 @@ static av_cold void h261_decode_init_vlc(H261Context *h){ INIT_VLC_STATIC(&h261_cbp_vlc, H261_CBP_VLC_BITS, 63, &h261_cbp_tab[0][1], 2, 1, &h261_cbp_tab[0][0], 2, 1, 512); - init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store); + ff_init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store); INIT_VLC_RL(h261_rl_tcoeff, 552); } } @@ -76,7 +76,7 @@ static av_cold int h261_decode_init(AVCodecContext *avctx){ MpegEncContext * const s = &h->s; // set defaults - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); s->avctx = avctx; s->width = s->avctx->coded_width; @@ -221,7 +221,7 @@ static int h261_decode_mb_skipped(H261Context *h, int mba1, int mba2 ) s->mb_skipped = 1; h->mtype &= ~MB_TYPE_H261_FIL; - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); } return 0; @@ -349,7 +349,7 @@ intra: s->block_last_index[i]= -1; } - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); return SLICE_OK; } @@ -565,7 +565,7 @@ retry: init_get_bits(&s->gb, buf, buf_size*8); if(!s->context_initialized){ - if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix + if (ff_MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix return -1; } @@ -588,7 +588,7 @@ retry: if (s->width != avctx->coded_width || s->height != avctx->coded_height){ ParseContext pc= s->parse_context; //FIXME move this demuxing hack to libavformat s->parse_context.buffer=0; - MPV_common_end(s); + ff_MPV_common_end(s); s->parse_context= pc; } if (!s->context_initialized) { @@ -606,7 +606,7 @@ retry: || avctx->skip_frame >= AVDISCARD_ALL) return get_consumed_bytes(s, buf_size); - if(MPV_frame_start(s, avctx) < 0) + if(ff_MPV_frame_start(s, avctx) < 0) return -1; ff_er_frame_start(s); @@ -620,7 +620,7 @@ retry: break; h261_decode_gob(h); } - MPV_frame_end(s); + ff_MPV_frame_end(s); assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type); assert(s->current_picture.f.pict_type == s->pict_type); @@ -637,7 +637,7 @@ static av_cold int h261_decode_end(AVCodecContext *avctx) H261Context *h= avctx->priv_data; MpegEncContext *s = &h->s; - MPV_common_end(s); + ff_MPV_common_end(s); return 0; } diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 4385aee11b..820677b2d2 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -240,7 +240,7 @@ void ff_h261_encode_init(MpegEncContext *s){ if (!done) { done = 1; - init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store); + ff_init_rl(&h261_rl_tcoeff, ff_h261_rl_table_store); } s->min_qcoeff= -127; @@ -326,9 +326,9 @@ AVCodec ff_h261_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H261, .priv_data_size = sizeof(H261Context), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("H.261"), }; diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 7c93e9bbe4..5b77106d7d 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -98,7 +98,7 @@ void ff_h263_update_motion_val(MpegEncContext * s){ } } -int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr) +int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr) { int x, y, wrap, a, c, pred_dc; int16_t *dc_val; @@ -226,7 +226,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ } } -void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n) +void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n) { int x, y, wrap, a, c, pred_dc, scale, i; int16_t *dc_val, *ac_val, *ac_val1; @@ -313,8 +313,8 @@ void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n) ac_val1[8 + i] = block[s->dsp.idct_permutation[i ]]; } -int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir, - int *px, int *py) +int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir, + int *px, int *py) { int wrap; int16_t *A, *B, *C, (*mot_val)[2]; diff --git a/libavcodec/h263.h b/libavcodec/h263.h index 0c11514786..ed9da5352b 100644 --- a/libavcodec/h263.h +++ b/libavcodec/h263.h @@ -38,16 +38,16 @@ extern const AVRational ff_h263_pixel_aspect[16]; extern const uint8_t ff_h263_cbpy_tab[16][2]; -extern const uint8_t cbpc_b_tab[4][2]; +extern const uint8_t ff_cbpc_b_tab[4][2]; -extern const uint8_t mvtab[33][2]; +extern const uint8_t ff_mvtab[33][2]; extern const uint8_t ff_h263_intra_MCBPC_code[9]; extern const uint8_t ff_h263_intra_MCBPC_bits[9]; extern const uint8_t ff_h263_inter_MCBPC_code[28]; extern const uint8_t ff_h263_inter_MCBPC_bits[28]; -extern const uint8_t h263_mbtype_b_tab[15][2]; +extern const uint8_t ff_h263_mbtype_b_tab[15][2]; extern VLC ff_h263_intra_MCBPC_vlc; extern VLC ff_h263_inter_MCBPC_vlc; @@ -55,41 +55,41 @@ extern VLC ff_h263_cbpy_vlc; extern RLTable ff_h263_rl_inter; -extern RLTable rl_intra_aic; +extern RLTable ff_rl_intra_aic; -extern const uint16_t h263_format[8][2]; -extern const uint8_t modified_quant_tab[2][32]; +extern const uint16_t ff_h263_format[8][2]; +extern const uint8_t ff_modified_quant_tab[2][32]; extern const uint16_t ff_mba_max[6]; extern const uint8_t ff_mba_length[7]; extern uint8_t ff_h263_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; -int h263_decode_motion(MpegEncContext * s, int pred, int f_code); +int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code); av_const int ff_h263_aspect_to_info(AVRational aspect); int ff_h263_decode_init(AVCodecContext *avctx); int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt); int ff_h263_decode_end(AVCodecContext *avctx); -void h263_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], - int motion_x, int motion_y); -void h263_encode_picture_header(MpegEncContext *s, int picture_number); -void h263_encode_gob_header(MpegEncContext * s, int mb_line); -int16_t *h263_pred_motion(MpegEncContext * s, int block, int dir, - int *px, int *py); -void h263_encode_init(MpegEncContext *s); -void h263_decode_init_vlc(MpegEncContext *s); -int h263_decode_picture_header(MpegEncContext *s); +void ff_h263_encode_mb(MpegEncContext *s, + DCTELEM block[6][64], + int motion_x, int motion_y); +void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); +int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir, + int *px, int *py); +void ff_h263_encode_init(MpegEncContext *s); +void ff_h263_decode_init_vlc(MpegEncContext *s); +int ff_h263_decode_picture_header(MpegEncContext *s); int ff_h263_decode_gob_header(MpegEncContext *s); void ff_h263_update_motion_val(MpegEncContext * s); void ff_h263_loop_filter(MpegEncContext * s); int ff_h263_decode_mba(MpegEncContext *s); void ff_h263_encode_mba(MpegEncContext *s); void ff_init_qscale_tab(MpegEncContext *s); -int h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr); -void h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n); +int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr); +void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n); /** @@ -119,7 +119,7 @@ static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code int l, bit_size, code; if (val == 0) { - return mvtab[0][1]; + return ff_mvtab[0][1]; } else { bit_size = f_code - 1; /* modulo encoding */ @@ -128,7 +128,7 @@ static inline int h263_get_motion_length(MpegEncContext * s, int val, int f_code val--; code = (val >> bit_size) + 1; - return mvtab[code][1] + 1 + bit_size; + return ff_mvtab[code][1] + 1 + bit_size; } } diff --git a/libavcodec/h263data.h b/libavcodec/h263data.h index 907eae2a65..e245e2f635 100644 --- a/libavcodec/h263data.h +++ b/libavcodec/h263data.h @@ -57,7 +57,7 @@ const uint8_t ff_h263_inter_MCBPC_bits[28] = { 11, 13, 13, 13,/* inter4Q*/ }; -const uint8_t h263_mbtype_b_tab[15][2] = { +const uint8_t ff_h263_mbtype_b_tab[15][2] = { {1, 1}, {3, 3}, {1, 5}, @@ -75,7 +75,7 @@ const uint8_t h263_mbtype_b_tab[15][2] = { {1, 8}, }; -const uint8_t cbpc_b_tab[4][2] = { +const uint8_t ff_cbpc_b_tab[4][2] = { {0, 1}, {2, 2}, {7, 3}, @@ -88,7 +88,7 @@ const uint8_t ff_h263_cbpy_tab[16][2] = {2,5}, {3,6}, {5,4}, {10,4}, {4,4}, {8,4}, {6,4}, {3,2} }; -const uint8_t mvtab[33][2] = +const uint8_t ff_mvtab[33][2] = { {1,1}, {1,2}, {1,3}, {1,4}, {3,6}, {5,7}, {4,7}, {3,7}, {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] = }; /* third non intra table */ -const uint16_t inter_vlc[103][2] = { +const uint16_t ff_inter_vlc[103][2] = { { 0x2, 2 },{ 0xf, 4 },{ 0x15, 6 },{ 0x17, 7 }, { 0x1f, 8 },{ 0x25, 9 },{ 0x24, 9 },{ 0x21, 10 }, { 0x20, 10 },{ 0x7, 11 },{ 0x6, 11 },{ 0x20, 11 }, @@ -127,7 +127,7 @@ const uint16_t inter_vlc[103][2] = { { 0x5e, 12 },{ 0x5f, 12 },{ 0x3, 7 }, }; -const int8_t inter_level[102] = { +const int8_t ff_inter_level[102] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, @@ -143,7 +143,7 @@ const int8_t inter_level[102] = { 1, 1, 1, 1, 1, 1, }; -const int8_t inter_run[102] = { +const int8_t ff_inter_run[102] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, @@ -162,9 +162,9 @@ const int8_t inter_run[102] = { RLTable ff_h263_rl_inter = { 102, 58, - inter_vlc, - inter_run, - inter_level, + ff_inter_vlc, + ff_inter_run, + ff_inter_level, }; static const uint16_t intra_vlc_aic[103][2] = { @@ -228,7 +228,7 @@ static const int8_t intra_level_aic[102] = { 1, 1, 1, 1, 1, 1, }; -RLTable rl_intra_aic = { +RLTable ff_rl_intra_aic = { 102, 58, intra_vlc_aic, @@ -236,7 +236,7 @@ RLTable rl_intra_aic = { intra_level_aic, }; -const uint16_t h263_format[8][2] = { +const uint16_t ff_h263_format[8][2] = { { 0, 0 }, { 128, 96 }, { 176, 144 }, @@ -250,7 +250,7 @@ const uint8_t ff_aic_dc_scale_table[32]={ 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 }; -const uint8_t modified_quant_tab[2][32]={ +const uint8_t ff_modified_quant_tab[2][32]={ // 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 { 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 diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 621f7ad9f2..ac2aeaf424 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -56,7 +56,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) s->workaround_bugs= avctx->workaround_bugs; // set defaults - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); s->quant_precision=5; s->decode_mb= ff_h263_decode_mb; s->low_delay= 1; @@ -112,10 +112,10 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) /* for h263, we allocate the images after having read the header */ if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4) - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; - h263_decode_init_vlc(s); + ff_h263_decode_init_vlc(s); return 0; } @@ -124,7 +124,7 @@ av_cold int ff_h263_decode_end(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; - MPV_common_end(s); + ff_MPV_common_end(s); return 0; } @@ -222,7 +222,7 @@ static int decode_slice(MpegEncContext *s){ if(ret<0){ const int xy= s->mb_x + s->mb_y*s->mb_stride; if(ret==SLICE_END){ - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); if(s->loop_filter) ff_h263_loop_filter(s); @@ -234,7 +234,7 @@ static int decode_slice(MpegEncContext *s){ if(++s->mb_x >= s->mb_width){ s->mb_x=0; ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size); - MPV_report_decode_progress(s); + ff_MPV_report_decode_progress(s); s->mb_y++; } return 0; @@ -249,13 +249,13 @@ static int decode_slice(MpegEncContext *s){ return -1; } - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); if(s->loop_filter) ff_h263_loop_filter(s); } ff_draw_horiz_band(s, s->mb_y*mb_size, mb_size); - MPV_report_decode_progress(s); + ff_MPV_report_decode_progress(s); s->mb_x= 0; } @@ -404,7 +404,7 @@ retry: s->bitstream_buffer_size=0; if (!s->context_initialized) { - if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix + if (ff_MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix return -1; } @@ -421,7 +421,7 @@ retry: if (CONFIG_WMV2_DECODER && s->msmpeg4_version==5) { ret= ff_wmv2_decode_picture_header(s); } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) { - ret = msmpeg4_decode_picture_header(s); + ret = ff_msmpeg4_decode_picture_header(s); } else if (CONFIG_MPEG4_DECODER && s->h263_pred) { if(s->avctx->extradata_size && s->picture_number==0){ GetBitContext gb; @@ -435,7 +435,7 @@ retry: } else if (CONFIG_FLV_DECODER && s->h263_flv) { ret = ff_flv_decode_picture_header(s); } else { - ret = h263_decode_picture_header(s); + ret = ff_h263_decode_picture_header(s); } if(ret==FRAME_SKIPPED) return get_consumed_bytes(s, buf_size); @@ -591,7 +591,7 @@ retry: } s->parse_context.buffer=0; - MPV_common_end(s); + ff_MPV_common_end(s); s->parse_context= pc; } if (!s->context_initialized) { @@ -632,7 +632,7 @@ retry: s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; } - if(MPV_frame_start(s, avctx) < 0) + if(ff_MPV_frame_start(s, avctx) < 0) return -1; if (!s->divx_packed) ff_thread_finish_setup(avctx); @@ -650,7 +650,7 @@ retry: ff_er_frame_start(s); //the second part of the wmv2 header contains the MB skip bits which are stored in current_picture->mb_type - //which is not available before MPV_frame_start() + //which is not available before ff_MPV_frame_start() if (CONFIG_WMV2_DECODER && s->msmpeg4_version==5){ ret = ff_wmv2_decode_secondary_picture_header(s); if(ret<0) return ret; @@ -681,7 +681,7 @@ retry: } if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type==AV_PICTURE_TYPE_I) - if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){ + if(!CONFIG_MSMPEG4_DECODER || ff_msmpeg4_decode_ext_header(s, buf_size) < 0){ s->error_status_table[s->mb_num-1]= ER_MB_ERROR; } @@ -722,7 +722,7 @@ intrax8_decoded: return -1; } - MPV_frame_end(s); + ff_MPV_frame_end(s); assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type); assert(s->current_picture.f.pict_type == s->pict_type); diff --git a/libavcodec/h264.c b/libavcodec/h264.c index b9057ad122..3b74e25636 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1051,7 +1051,7 @@ static av_cold void common_init(H264Context *h){ s->unrestricted_mv=1; s->dsp.dct_bits = 16; - dsputil_init(&s->dsp, s->avctx); // needed so that idct permutation is known early + ff_dsputil_init(&s->dsp, s->avctx); // needed so that idct permutation is known early memset(h->pps.scaling_matrix4, 16, 6*16*sizeof(uint8_t)); memset(h->pps.scaling_matrix8, 16, 2*64*sizeof(uint8_t)); @@ -1117,7 +1117,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){ MpegEncContext * const s = &h->s; int i; - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); s->avctx = avctx; common_init(h); @@ -1303,11 +1303,11 @@ int ff_h264_frame_start(H264Context *h){ int i; const int pixel_shift = h->pixel_shift; - if(MPV_frame_start(s, s->avctx) < 0) + if(ff_MPV_frame_start(s, s->avctx) < 0) return -1; ff_er_frame_start(s); /* - * MPV_frame_start uses pict_type to derive key_frame. + * ff_MPV_frame_start uses pict_type to derive key_frame. * This is incorrect for H.264; IDR markings must be used. * Zero here; IDR markings per slice in frame or fields are ORed in later. * See decode_nal_units(). @@ -1342,7 +1342,7 @@ int ff_h264_frame_start(H264Context *h){ // We mark the current picture as non-reference after allocating it, so // that if we break out due to an error it can be released automatically - // in the next MPV_frame_start(). + // in the next ff_MPV_frame_start(). // SVQ3 as well as most other codecs have only last/next/current and thus // get released even with set reference, besides SVQ3 and others do not // mark frames as reference later "naturally". @@ -2549,7 +2549,7 @@ static int field_end(H264Context *h, int in_setup){ if (!FIELD_PICTURE) ff_er_frame_end(s); - MPV_frame_end(s); + ff_MPV_frame_end(s); h->current_slice=0; @@ -2612,7 +2612,7 @@ int ff_h264_get_profile(SPS *sps) /** * Decode a slice header. - * This will also call MPV_common_init() and frame_start() as needed. + * This will also call ff_MPV_common_init() and frame_start() as needed. * * @param h h264context * @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){ } free_tables(h, 0); flush_dpb(s->avctx); - MPV_common_end(s); + ff_MPV_common_end(s); h->list_count = 0; } if (!s->context_initialized) { @@ -2745,7 +2745,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma, h->sps.chroma_format_idc); ff_h264_pred_init(&h->hpc, s->codec_id, h->sps.bit_depth_luma, h->sps.chroma_format_idc); s->dsp.dct_bits = h->sps.bit_depth_luma > 8 ? 32 : 16; - dsputil_init(&s->dsp, s->avctx); + ff_dsputil_init(&s->dsp, s->avctx); } else { av_log(s->avctx, AV_LOG_ERROR, "Unsupported bit depth: %d chroma_idc: %d\n", h->sps.bit_depth_luma, h->sps.chroma_format_idc); @@ -2816,8 +2816,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt); - if (MPV_common_init(s) < 0) { - av_log(h->s.avctx, AV_LOG_ERROR, "MPV_common_init() failed.\n"); + if (ff_MPV_common_init(s) < 0) { + av_log(h->s.avctx, AV_LOG_ERROR, "ff_MPV_common_init() failed.\n"); return -1; } s->first_field = 0; @@ -4169,7 +4169,7 @@ av_cold int ff_h264_decode_end(AVCodecContext *avctx) ff_h264_remove_all_refs(h); ff_h264_free_context(h); - MPV_common_end(s); + ff_MPV_common_end(s); // memset(h, 0, sizeof(H264Context)); diff --git a/libavcodec/huffman.c b/libavcodec/huffman.c index fd9fa95f07..cd1d0d754e 100644 --- a/libavcodec/huffman.c +++ b/libavcodec/huffman.c @@ -61,7 +61,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags) int pos = 0; get_tree_codes(bits, lens, xlat, nodes, head, 0, 0, &pos, no_zero_count); - return init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); + return ff_init_vlc_sparse(vlc, 9, pos, lens, 2, 2, bits, 4, 4, xlat, 1, 1, 0); } diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 574daacc0b..c46e93f03a 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -322,8 +322,8 @@ static void generate_joint_tables(HYuvContext *s){ i++; } } - free_vlc(&s->vlc[3+p]); - init_vlc_sparse(&s->vlc[3+p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0); + ff_free_vlc(&s->vlc[3+p]); + ff_init_vlc_sparse(&s->vlc[3+p], VLC_BITS, i, len, 1, 1, bits, 2, 2, symbols, 2, 2, 0); } }else{ uint8_t (*map)[4] = (uint8_t(*)[4])s->pix_bgr_map; @@ -363,7 +363,7 @@ static void generate_joint_tables(HYuvContext *s){ } } } - free_vlc(&s->vlc[3]); + ff_free_vlc(&s->vlc[3]); init_vlc(&s->vlc[3], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0); } } @@ -380,7 +380,7 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){ if(generate_bits_table(s->bits[i], s->len[i])<0){ return -1; } - free_vlc(&s->vlc[i]); + ff_free_vlc(&s->vlc[i]); init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0); } @@ -412,7 +412,7 @@ static int read_old_huffman_tables(HYuvContext *s){ memcpy(s->len[2] , s->len [1], 256*sizeof(uint8_t)); for(i=0; i<3; i++){ - free_vlc(&s->vlc[i]); + ff_free_vlc(&s->vlc[i]); init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0); } @@ -443,7 +443,7 @@ static av_cold int common_init(AVCodecContext *avctx){ s->avctx= avctx; s->flags= avctx->flags; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); s->width= avctx->width; s->height= avctx->height; @@ -1253,7 +1253,7 @@ static av_cold int decode_end(AVCodecContext *avctx) av_freep(&s->bitstream_buffer); for(i=0; i<6; i++){ - free_vlc(&s->vlc[i]); + ff_free_vlc(&s->vlc[i]); } return 0; diff --git a/libavcodec/imc.c b/libavcodec/imc.c index d3b8bf5a12..d107dd99fe 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -166,7 +166,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx) av_log(avctx, AV_LOG_INFO, "FFT init failed\n"); return ret; } - dsputil_init(&q->dsp, avctx); + ff_dsputil_init(&q->dsp, avctx); avctx->sample_fmt = AV_SAMPLE_FMT_FLT; avctx->channel_layout = AV_CH_LAYOUT_MONO; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index fc38f5e9cb..dce75fe116 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -995,7 +995,7 @@ static av_cold int decode_init(AVCodecContext *avctx) build_requant_tab(); - dsputil_init(&ctx->dsp, avctx); + ff_dsputil_init(&ctx->dsp, avctx); return allocate_frame_buffers(ctx, avctx); } diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 8842f221cf..9b9805ff51 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -816,7 +816,7 @@ static av_cold int decode_close(AVCodecContext *avctx) ff_ivi_free_buffers(&ctx->planes[0]); if (ctx->mb_vlc.cust_tab.table) - free_vlc(&ctx->mb_vlc.cust_tab); + ff_free_vlc(&ctx->mb_vlc.cust_tab); if (ctx->frame.data[0]) avctx->release_buffer(avctx, &ctx->frame); diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c index c97c1d7a1f..2b3be962c6 100644 --- a/libavcodec/intelh263dec.c +++ b/libavcodec/intelh263dec.c @@ -65,8 +65,8 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s) s->pb_frame = get_bits1(&s->gb); if (format < 6) { - s->width = h263_format[format][0]; - s->height = h263_format[format][1]; + s->width = ff_h263_format[format][0]; + s->height = ff_h263_format[format][1]; s->avctx->sample_aspect_ratio.num = 12; s->avctx->sample_aspect_ratio.den = 11; } else { diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 68aa966208..1e16c06145 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -1017,7 +1017,7 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) s->is_16bpp = avctx->bits_per_coded_sample == 16; avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); avcodec_get_frame_defaults(&s->second_last_frame); avcodec_get_frame_defaults(&s->last_frame); diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index b50fbfcd1a..60d809aaf3 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -696,9 +696,9 @@ av_cold void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s assert(s->mb_width>0); w->prediction_table=av_mallocz(s->mb_width*2*2);//two rows, 2 blocks per cannon mb - ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], wmv1_scantable[0]); - ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], wmv1_scantable[2]); - ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], wmv1_scantable[3]); + ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], ff_wmv1_scantable[0]); + ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], ff_wmv1_scantable[2]); + ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], ff_wmv1_scantable[3]); } /** @@ -721,7 +721,7 @@ av_cold void ff_intrax8_common_end(IntraX8Context * w) * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1. * @param quant_offset offset away from zero */ -//FIXME extern uint8_t wmv3_dc_scale_table[32]; +//FIXME extern uint8_t ff_wmv3_dc_scale_table[32]; int ff_intrax8_decode_picture(IntraX8Context * const w, int dquant, int quant_offset){ MpegEncContext * const s= w->s; int mb_xy; diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index f058c9b848..e92af33eaf 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -103,7 +103,7 @@ static VLC cbpc_b_vlc; /* init vlcs */ /* XXX: find a better solution to handle static init */ -void h263_decode_init_vlc(MpegEncContext *s) +void ff_h263_decode_init_vlc(MpegEncContext *s) { static int done = 0; @@ -120,18 +120,18 @@ void h263_decode_init_vlc(MpegEncContext *s) &ff_h263_cbpy_tab[0][1], 2, 1, &ff_h263_cbpy_tab[0][0], 2, 1, 64); INIT_VLC_STATIC(&mv_vlc, MV_VLC_BITS, 33, - &mvtab[0][1], 2, 1, - &mvtab[0][0], 2, 1, 538); - init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]); - init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]); + &ff_mvtab[0][1], 2, 1, + &ff_mvtab[0][0], 2, 1, 538); + ff_init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]); + ff_init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]); INIT_VLC_RL(ff_h263_rl_inter, 554); - INIT_VLC_RL(rl_intra_aic, 554); + INIT_VLC_RL(ff_rl_intra_aic, 554); INIT_VLC_STATIC(&h263_mbtype_b_vlc, H263_MBTYPE_B_VLC_BITS, 15, - &h263_mbtype_b_tab[0][1], 2, 1, - &h263_mbtype_b_tab[0][0], 2, 1, 80); + &ff_h263_mbtype_b_tab[0][1], 2, 1, + &ff_h263_mbtype_b_tab[0][0], 2, 1, 80); INIT_VLC_STATIC(&cbpc_b_vlc, CBPC_B_VLC_BITS, 4, - &cbpc_b_tab[0][1], 2, 1, - &cbpc_b_tab[0][0], 2, 1, 8); + &ff_cbpc_b_tab[0][1], 2, 1, + &ff_cbpc_b_tab[0][0], 2, 1, 8); } } @@ -240,7 +240,7 @@ int ff_h263_resync(MpegEncContext *s){ if(show_bits(&s->gb, 16)==0){ pos= get_bits_count(&s->gb); if(CONFIG_MPEG4_DECODER && s->codec_id==CODEC_ID_MPEG4) - ret= mpeg4_decode_video_packet_header(s); + ret= ff_mpeg4_decode_video_packet_header(s); else ret= h263_decode_gob_header(s); if(ret>=0) @@ -257,7 +257,7 @@ int ff_h263_resync(MpegEncContext *s){ pos= get_bits_count(&s->gb); if(CONFIG_MPEG4_DECODER && s->codec_id==CODEC_ID_MPEG4) - ret= mpeg4_decode_video_packet_header(s); + ret= ff_mpeg4_decode_video_packet_header(s); else ret= h263_decode_gob_header(s); if(ret>=0) @@ -271,7 +271,7 @@ int ff_h263_resync(MpegEncContext *s){ return -1; } -int h263_decode_motion(MpegEncContext * s, int pred, int f_code) +int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code) { int code, val, sign, shift; code = get_vlc2(&s->gb, mv_vlc.table, MV_VLC_BITS, 2); @@ -381,16 +381,16 @@ static void preview_obmc(MpegEncContext *s){ if ((cbpc & 16) == 0) { s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 motion prediction */ - mot_val= h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + mot_val= ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); if (s->umvplus) mx = h263p_decode_umotion(s, pred_x); else - mx = h263_decode_motion(s, pred_x, 1); + mx = ff_h263_decode_motion(s, pred_x, 1); if (s->umvplus) my = h263p_decode_umotion(s, pred_y); else - my = h263_decode_motion(s, pred_y, 1); + my = ff_h263_decode_motion(s, pred_y, 1); mot_val[0 ]= mot_val[2 ]= mot_val[0+stride]= mot_val[2+stride]= mx; @@ -399,16 +399,16 @@ static void preview_obmc(MpegEncContext *s){ } else { s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; for(i=0;i<4;i++) { - mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y); + mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); if (s->umvplus) mx = h263p_decode_umotion(s, pred_x); else - mx = h263_decode_motion(s, pred_x, 1); + mx = ff_h263_decode_motion(s, pred_x, 1); if (s->umvplus) my = h263p_decode_umotion(s, pred_y); else - my = h263_decode_motion(s, pred_y, 1); + my = ff_h263_decode_motion(s, pred_y, 1); if (s->umvplus && (mx - pred_x) == 1 && (my - pred_y) == 1) skip_bits1(&s->gb); /* Bit stuffing to prevent PSC */ mot_val[0] = mx; @@ -432,7 +432,7 @@ static void h263_decode_dquant(MpegEncContext *s){ if(s->modified_quant){ if(get_bits1(&s->gb)) - s->qscale= modified_quant_tab[get_bits1(&s->gb)][ s->qscale ]; + s->qscale= ff_modified_quant_tab[get_bits1(&s->gb)][ s->qscale ]; else s->qscale= get_bits(&s->gb, 5); }else @@ -450,7 +450,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, scan_table = s->intra_scantable.permutated; if (s->h263_aic && s->mb_intra) { - rl = &rl_intra_aic; + rl = &ff_rl_intra_aic; i = 0; if (s->ac_pred) { if (s->h263_aic_dir) @@ -467,7 +467,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, component = (n <= 3 ? 0 : n - 4 + 1); level = s->last_dc[component]; if (s->rv10_first_dc_coded[component]) { - diff = rv_decode_dc(s, n); + diff = ff_rv_decode_dc(s, n); if (diff == 0xffff) return -1; level += diff; @@ -539,7 +539,7 @@ retry: if (i >= 64){ if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){ //Looks like a hack but no, it's the way it is supposed to work ... - rl = &rl_intra_aic; + rl = &ff_rl_intra_aic; i = 0; s->gb= gb; s->dsp.clear_block(block); @@ -556,7 +556,7 @@ retry: } not_coded: if (s->mb_intra && s->h263_aic) { - h263_pred_acdc(s, block, n); + ff_h263_pred_acdc(s, block, n); i = 63; } s->block_last_index[n] = i; @@ -655,11 +655,11 @@ int ff_h263_decode_mb(MpegEncContext *s, s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 motion prediction */ s->mv_type = MV_TYPE_16X16; - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); if (s->umvplus) mx = h263p_decode_umotion(s, pred_x); else - mx = h263_decode_motion(s, pred_x, 1); + mx = ff_h263_decode_motion(s, pred_x, 1); if (mx >= 0xffff) return -1; @@ -667,7 +667,7 @@ int ff_h263_decode_mb(MpegEncContext *s, if (s->umvplus) my = h263p_decode_umotion(s, pred_y); else - my = h263_decode_motion(s, pred_y, 1); + my = ff_h263_decode_motion(s, pred_y, 1); if (my >= 0xffff) return -1; @@ -680,18 +680,18 @@ int ff_h263_decode_mb(MpegEncContext *s, s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; s->mv_type = MV_TYPE_8X8; for(i=0;i<4;i++) { - mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y); + mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); if (s->umvplus) mx = h263p_decode_umotion(s, pred_x); else - mx = h263_decode_motion(s, pred_x, 1); + mx = ff_h263_decode_motion(s, pred_x, 1); if (mx >= 0xffff) return -1; if (s->umvplus) my = h263p_decode_umotion(s, pred_y); else - my = h263_decode_motion(s, pred_y, 1); + my = ff_h263_decode_motion(s, pred_y, 1); if (my >= 0xffff) return -1; s->mv[0][i][0] = mx; @@ -763,11 +763,11 @@ int ff_h263_decode_mb(MpegEncContext *s, //FIXME UMV if(USES_LIST(mb_type, 0)){ - int16_t *mot_val= h263_pred_motion(s, 0, 0, &mx, &my); + int16_t *mot_val= ff_h263_pred_motion(s, 0, 0, &mx, &my); s->mv_dir = MV_DIR_FORWARD; - mx = h263_decode_motion(s, mx, 1); - my = h263_decode_motion(s, my, 1); + mx = ff_h263_decode_motion(s, mx, 1); + my = ff_h263_decode_motion(s, my, 1); s->mv[0][0][0] = mx; s->mv[0][0][1] = my; @@ -776,11 +776,11 @@ int ff_h263_decode_mb(MpegEncContext *s, } if(USES_LIST(mb_type, 1)){ - int16_t *mot_val= h263_pred_motion(s, 0, 1, &mx, &my); + int16_t *mot_val= ff_h263_pred_motion(s, 0, 1, &mx, &my); s->mv_dir |= MV_DIR_BACKWARD; - mx = h263_decode_motion(s, mx, 1); - my = h263_decode_motion(s, my, 1); + mx = ff_h263_decode_motion(s, mx, 1); + my = ff_h263_decode_motion(s, my, 1); s->mv[1][0][0] = mx; s->mv[1][0][1] = my; @@ -831,8 +831,8 @@ intra: } while(pb_mv_count--){ - h263_decode_motion(s, 0, 1); - h263_decode_motion(s, 0, 1); + ff_h263_decode_motion(s, 0, 1); + ff_h263_decode_motion(s, 0, 1); } /* decode each block */ @@ -866,7 +866,7 @@ end: } /* most is hardcoded. should extend to handle all h263 streams */ -int h263_decode_picture_header(MpegEncContext *s) +int ff_h263_decode_picture_header(MpegEncContext *s) { int format, width, height, i; uint32_t startcode; @@ -918,8 +918,8 @@ int h263_decode_picture_header(MpegEncContext *s) if (format != 7 && format != 6) { s->h263_plus = 0; /* H.263v1 */ - width = h263_format[format][0]; - height = h263_format[format][1]; + width = ff_h263_format[format][0]; + height = ff_h263_format[format][1]; if (!width) return -1; @@ -1026,8 +1026,8 @@ int h263_decode_picture_header(MpegEncContext *s) s->avctx->sample_aspect_ratio= ff_h263_pixel_aspect[s->aspect_ratio_info]; } } else { - width = h263_format[format][0]; - height = h263_format[format][1]; + width = ff_h263_format[format][0]; + height = ff_h263_format[format][1]; s->avctx->sample_aspect_ratio= (AVRational){12,11}; } if ((width == 0) || (height == 0)) diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index 9d41376ca7..103adb5faa 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -102,7 +102,7 @@ av_const int ff_h263_aspect_to_info(AVRational aspect){ return FF_ASPECT_EXTENDED; } -void h263_encode_picture_header(MpegEncContext * s, int picture_number) +void ff_h263_encode_picture_header(MpegEncContext * s, int picture_number) { int format, coded_frame_rate, coded_frame_rate_base, i, temp_ref; int best_clock_code=1; @@ -141,7 +141,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number) put_bits(&s->pb, 1, 0); /* camera off */ put_bits(&s->pb, 1, 0); /* freeze picture release off */ - format = ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), s->width, s->height); + format = ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format), s->width, s->height); if (!s->h263_plus) { /* H.263v1 */ put_bits(&s->pb, 3, format); @@ -247,7 +247,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number) /** * Encode a group of blocks header. */ -void h263_encode_gob_header(MpegEncContext * s, int mb_line) +void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line) { put_bits(&s->pb, 17, 1); /* GBSC */ @@ -333,7 +333,7 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) } else { i = 0; if (s->h263_aic && s->mb_intra) - rl = &rl_intra_aic; + rl = &ff_rl_intra_aic; if(s->alt_inter_vlc && !s->mb_intra){ int aic_vlc_bits=0; @@ -353,14 +353,14 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) if(level<0) level= -level; code = get_rl_index(rl, last, run, level); - aic_code = get_rl_index(&rl_intra_aic, last, run, level); + aic_code = get_rl_index(&ff_rl_intra_aic, last, run, level); inter_vlc_bits += rl->table_vlc[code][1]+1; - aic_vlc_bits += rl_intra_aic.table_vlc[aic_code][1]+1; + aic_vlc_bits += ff_rl_intra_aic.table_vlc[aic_code][1]+1; if (code == rl->n) { inter_vlc_bits += 1+6+8-1; } - if (aic_code == rl_intra_aic.n) { + if (aic_code == ff_rl_intra_aic.n) { aic_vlc_bits += 1+6+8-1; wrong_pos += run + 1; }else @@ -370,7 +370,7 @@ static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) } i = 0; if(aic_vlc_bits < inter_vlc_bits && wrong_pos > 63) - rl = &rl_intra_aic; + rl = &ff_rl_intra_aic; } } @@ -454,9 +454,9 @@ static void h263p_encode_umotion(MpegEncContext * s, int val) } } -void h263_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], - int motion_x, int motion_y) +void ff_h263_encode_mb(MpegEncContext * s, + DCTELEM block[6][64], + int motion_x, int motion_y) { int cbpc, cbpy, i, cbp, pred_x, pred_y; int16_t pred_dc; @@ -500,7 +500,7 @@ void h263_encode_mb(MpegEncContext * s, } /* motion vectors: 16x16 mode */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); if (!s->umvplus) { ff_h263_encode_motion_vector(s, motion_x - pred_x, @@ -527,7 +527,7 @@ void h263_encode_mb(MpegEncContext * s, for(i=0; i<4; i++){ /* motion vectors: 8x8 mode*/ - h263_pred_motion(s, i, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); motion_x = s->current_picture.f.motion_val[0][s->block_index[i]][0]; motion_y = s->current_picture.f.motion_val[0][s->block_index[i]][1]; @@ -561,7 +561,7 @@ void h263_encode_mb(MpegEncContext * s, if(i<4) scale= s->y_dc_scale; else scale= s->c_dc_scale; - pred_dc = h263_pred_dc(s, i, &dc_ptr[i]); + pred_dc = ff_h263_pred_dc(s, i, &dc_ptr[i]); level -= pred_dc; /* Quant */ if (level >= 0) @@ -662,7 +662,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code) if (val == 0) { /* zero vector */ code = 0; - put_bits(&s->pb, mvtab[code][1], mvtab[code][0]); + put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]); } else { bit_size = f_code - 1; range = 1 << bit_size; @@ -676,7 +676,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code) code = (val >> bit_size) + 1; bits = val & (range - 1); - put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign); + put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign); if (bit_size > 0) { put_bits(&s->pb, bit_size, bits); } @@ -692,7 +692,7 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s) for(mv=-MAX_MV; mv<=MAX_MV; mv++){ int len; - if(mv==0) len= mvtab[0][1]; + if(mv==0) len= ff_mvtab[0][1]; else{ int val, bit_size, code; @@ -704,9 +704,9 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s) val--; code = (val >> bit_size) + 1; if(code<33){ - len= mvtab[code][1] + 1 + bit_size; + len= ff_mvtab[code][1] + 1 + bit_size; }else{ - len= mvtab[32][1] + av_log2(code>>5) + 2 + bit_size; + len= ff_mvtab[32][1] + av_log2(code>>5) + 2 + bit_size; } } @@ -768,17 +768,17 @@ static void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_t } } -void h263_encode_init(MpegEncContext *s) +void ff_h263_encode_init(MpegEncContext *s) { static int done = 0; if (!done) { done = 1; - init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]); - init_rl(&rl_intra_aic, ff_h263_static_rl_table_store[1]); + ff_init_rl(&ff_h263_rl_inter, ff_h263_static_rl_table_store[0]); + ff_init_rl(&ff_rl_intra_aic, ff_h263_static_rl_table_store[1]); - init_uni_h263_rl_tab(&rl_intra_aic, NULL, uni_h263_intra_aic_rl_len); + init_uni_h263_rl_tab(&ff_rl_intra_aic, NULL, uni_h263_intra_aic_rl_len); init_uni_h263_rl_tab(&ff_h263_rl_inter , NULL, uni_h263_inter_rl_len); init_mv_penalty_and_fcode(s); diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index c75769ec31..c593ee942f 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -132,7 +132,7 @@ int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, ff_ivi_huff_desc_copy(&huff_tab->cust_desc, &new_huff); if (huff_tab->cust_tab.table) - free_vlc(&huff_tab->cust_tab); + ff_free_vlc(&huff_tab->cust_tab); result = ff_ivi_create_huff_from_desc(&huff_tab->cust_desc, &huff_tab->cust_tab, 0); if (result) { @@ -237,7 +237,7 @@ void av_cold ff_ivi_free_buffers(IVIPlaneDesc *planes) av_freep(&planes[p].bands[b].bufs[2]); if (planes[p].bands[b].blk_vlc.cust_tab.table) - free_vlc(&planes[p].bands[b].blk_vlc.cust_tab); + ff_free_vlc(&planes[p].bands[b].blk_vlc.cust_tab); for (t = 0; t < planes[p].bands[b].num_tiles; t++) av_freep(&planes[p].bands[b].tiles[t].mbs); av_freep(&planes[p].bands[b].tiles); diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c index b8dc407f7b..3e30e5d535 100644 --- a/libavcodec/jfdctfst.c +++ b/libavcodec/jfdctfst.c @@ -205,7 +205,7 @@ static av_always_inline void row_fdct(DCTELEM * data){ */ GLOBAL(void) -fdct_ifast (DCTELEM * data) +ff_fdct_ifast (DCTELEM * data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; @@ -271,7 +271,7 @@ fdct_ifast (DCTELEM * data) */ GLOBAL(void) -fdct_ifast248 (DCTELEM * data) +ff_fdct_ifast248 (DCTELEM * data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; diff --git a/libavcodec/jrevdct.c b/libavcodec/jrevdct.c index 5ed96da2ca..395eb8c638 100644 --- a/libavcodec/jrevdct.c +++ b/libavcodec/jrevdct.c @@ -207,7 +207,7 @@ ones here or successive P-frames will drift too much with Reference frame coding * Perform the inverse DCT on one block of coefficients. */ -void j_rev_dct(DCTBLOCK data) +void ff_j_rev_dct(DCTBLOCK data) { int32_t tmp0, tmp1, tmp2, tmp3; int32_t tmp10, tmp11, tmp12, tmp13; @@ -945,7 +945,7 @@ void j_rev_dct(DCTBLOCK data) #define DCTSIZE 4 #define DCTSTRIDE 8 -void j_rev_dct4(DCTBLOCK data) +void ff_j_rev_dct4(DCTBLOCK data) { int32_t tmp0, tmp1, tmp2, tmp3; int32_t tmp10, tmp11, tmp12, tmp13; @@ -1132,7 +1132,7 @@ void j_rev_dct4(DCTBLOCK data) } } -void j_rev_dct2(DCTBLOCK data){ +void ff_j_rev_dct2(DCTBLOCK data){ int d00, d01, d10, d11; data[0] += 4; @@ -1147,7 +1147,7 @@ void j_rev_dct2(DCTBLOCK data){ data[1+1*DCTSTRIDE]= (d01 - d11)>>3; } -void j_rev_dct1(DCTBLOCK data){ +void ff_j_rev_dct1(DCTBLOCK data){ data[0] = (data[0] + 4)>>3; } diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index 223cef1fa7..aea2cc1bed 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -41,7 +41,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { JvContext *s = avctx->priv_data; avctx->pix_fmt = PIX_FMT_PAL8; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); return 0; } diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index c72de2dcfa..e632f1a580 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -383,7 +383,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, if (lag_read_prob_header(&rac, &gb) < 0) return -1; - lag_rac_init(&rac, &gb, length - stride); + ff_lag_rac_init(&rac, &gb, length - stride); for (i = 0; i < height; i++) read += lag_decode_line(l, &rac, dst + (i * stride), width, @@ -572,7 +572,7 @@ static av_cold int lag_decode_init(AVCodecContext *avctx) LagarithContext *l = avctx->priv_data; l->avctx = avctx; - dsputil_init(&l->dsp, avctx); + ff_dsputil_init(&l->dsp, avctx); return 0; } diff --git a/libavcodec/lagarithrac.c b/libavcodec/lagarithrac.c index 56c1d0bcc0..a3035a24d4 100644 --- a/libavcodec/lagarithrac.c +++ b/libavcodec/lagarithrac.c @@ -30,7 +30,7 @@ #include "get_bits.h" #include "lagarithrac.h" -void lag_rac_init(lag_rac *l, GetBitContext *gb, int length) +void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length) { int i, j; diff --git a/libavcodec/lagarithrac.h b/libavcodec/lagarithrac.h index 8c78538f21..d8d38f2054 100644 --- a/libavcodec/lagarithrac.h +++ b/libavcodec/lagarithrac.h @@ -51,7 +51,7 @@ typedef struct lag_rac { uint8_t range_hash[256]; /**< Hash table mapping upper byte to approximate symbol. */ } lag_rac; -void lag_rac_init(lag_rac *l, GetBitContext *gb, int length); +void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length); /* TODO: Optimize */ static inline void lag_rac_refill(lag_rac *l) diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c index 4d81b5fc90..1514b018ad 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -199,8 +199,8 @@ AVCodec ff_ljpeg_encoder = { //FIXME avoid MPV_* lossless JPEG should not need t .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_LJPEG, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, + .init = ff_MPV_encode_init, .encode = encode_picture_lossless, - .close = MPV_encode_end, + .close = ff_MPV_encode_end, .long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"), }; diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 2828417bcd..9a417ee45b 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -214,7 +214,7 @@ static int decode_frame(AVCodecContext *avctx, static av_cold void mdec_common_init(AVCodecContext *avctx){ MDECContext * const a = avctx->priv_data; - dsputil_init(&a->dsp, avctx); + ff_dsputil_init(&a->dsp, avctx); a->mb_width = (avctx->coded_width + 15) / 16; a->mb_height = (avctx->coded_height + 15) / 16; diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 652dd1bb5d..51ae5be8bc 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -121,7 +121,7 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "error initializing vlc table\n"); return -1; } - dsputil_init(&ctx->dsp, avctx); + ff_dsputil_init(&ctx->dsp, avctx); ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, col_zag); return 0; @@ -411,7 +411,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) for(i = 0; i < 16; i++) if(ctx->buf_ptrs[i].data[0]) ff_thread_release_buffer(avctx, &ctx->buf_ptrs[i]); - free_vlc(&ctx->vlc); + ff_free_vlc(&ctx->vlc); return 0; } diff --git a/libavcodec/mips/dsputil_mmi.c b/libavcodec/mips/dsputil_mmi.c index 71a147fba4..a1e1f6b49f 100644 --- a/libavcodec/mips/dsputil_mmi.c +++ b/libavcodec/mips/dsputil_mmi.c @@ -135,7 +135,7 @@ static void put_pixels16_mmi(uint8_t *block, const uint8_t *pixels, int line_siz } -void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx) { const int idct_algo= avctx->idct_algo; const int high_bit_depth = avctx->bits_per_raw_sample > 8; diff --git a/libavcodec/mips/mpegvideo_mmi.c b/libavcodec/mips/mpegvideo_mmi.c index 8c8d3a7932..2870892712 100644 --- a/libavcodec/mips/mpegvideo_mmi.c +++ b/libavcodec/mips/mpegvideo_mmi.c @@ -80,7 +80,7 @@ static void dct_unquantize_h263_mmi(MpegEncContext *s, } -void MPV_common_init_mmi(MpegEncContext *s) +void ff_MPV_common_init_mmi(MpegEncContext *s) { s->dct_unquantize_h263_intra = s->dct_unquantize_h263_inter = dct_unquantize_h263_mmi; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index fcdcc21caf..954fce1e40 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -63,8 +63,8 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table, if (is_ac) huff_sym[0] = 16 * 256; - return init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1, - huff_code, 2, 2, huff_sym, 2, 2, use_static); + return ff_init_vlc_sparse(vlc, 9, nb_codes, huff_size, 1, 1, + huff_code, 2, 2, huff_sym, 2, 2, use_static); } static void build_basic_mjpeg_vlc(MJpegDecodeContext *s) @@ -92,7 +92,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&s->picture); s->avctx = avctx; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct); s->buffer_size = 0; s->buffer = NULL; @@ -193,7 +193,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) len -= n; /* build VLC and flush previous vlc if present */ - free_vlc(&s->vlcs[class][index]); + ff_free_vlc(&s->vlcs[class][index]); av_log(s->avctx, AV_LOG_DEBUG, "class=%d index=%d nb_codes=%d\n", class, index, code_max + 1); if (build_vlc(&s->vlcs[class][index], bits_table, val_table, @@ -201,7 +201,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) return -1; if (class > 0) { - free_vlc(&s->vlcs[2][index]); + ff_free_vlc(&s->vlcs[2][index]); if (build_vlc(&s->vlcs[2][index], bits_table, val_table, code_max + 1, 0, 0) < 0) return -1; @@ -1767,7 +1767,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) - free_vlc(&s->vlcs[i][j]); + ff_free_vlc(&s->vlcs[i][j]); } for (i = 0; i < MAX_COMPONENTS; i++) { av_freep(&s->blocks[i]); diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index bddcc0d041..f68d269c03 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -469,7 +469,7 @@ static int amv_encode_picture(AVCodecContext *avctx, pic->data[i] += (pic->linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 )); pic->linesize[i] *= -1; } - return MPV_encode_picture(avctx,buf, buf_size, pic); + return ff_MPV_encode_picture(avctx,buf, buf_size, pic); } AVCodec ff_mjpeg_encoder = { @@ -477,9 +477,9 @@ AVCodec ff_mjpeg_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MJPEG, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), }; @@ -489,9 +489,9 @@ AVCodec ff_amv_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_AMV, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, + .init = ff_MPV_encode_init, .encode = amv_encode_picture, - .close = MPV_encode_end, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), }; diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 47aee286ff..9909a71e38 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -241,7 +241,7 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx) m->avctx = avctx; for (substr = 0; substr < MAX_SUBSTREAMS; substr++) m->substream[substr].lossless_check_data = 0xffffffff; - dsputil_init(&m->dsp, avctx); + ff_dsputil_init(&m->dsp, avctx); avcodec_get_frame_defaults(&m->frame); avctx->coded_frame = &m->frame; diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c index f187183c12..ce1a1b0631 100644 --- a/libavcodec/motion-test.c +++ b/libavcodec/motion-test.c @@ -144,11 +144,11 @@ int main(int argc, char **argv) ctx = avcodec_alloc_context3(NULL); ctx->dsp_mask = AV_CPU_FLAG_FORCE; - dsputil_init(&cctx, ctx); + ff_dsputil_init(&cctx, ctx); for (c = 0; c < flags_size; c++) { int x; ctx->dsp_mask = AV_CPU_FLAG_FORCE | flags[c]; - dsputil_init(&mmxctx, ctx); + ff_dsputil_init(&mmxctx, ctx); for (x = 0; x < 2; x++) { printf("%s for %dx%d pixels\n", c ? "mmx2" : "mmx", diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index f23a8799b1..c80125dcc7 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -57,7 +57,7 @@ static av_cold int mp_decode_init(AVCodecContext *avctx) motionpixels_tableinit(); mp->avctx = avctx; - dsputil_init(&mp->dsp, avctx); + ff_dsputil_init(&mp->dsp, avctx); mp->changes_map = av_mallocz(avctx->width * h4); mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1; mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel)); @@ -287,7 +287,7 @@ static int mp_decode_frame(AVCodecContext *avctx, 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)) goto end; mp_decode_frame_helper(mp, &gb); - free_vlc(&mp->vlc); + ff_free_vlc(&mp->vlc); end: *data_size = sizeof(AVFrame); diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 5693c4ddb2..e90c934912 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -74,7 +74,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) } memset(c->oldDSCF, 0, sizeof(c->oldDSCF)); av_lfg_init(&c->rnd, 0xDEADBEEF); - dsputil_init(&c->dsp, avctx); + ff_dsputil_init(&c->dsp, avctx); ff_mpadsp_init(&c->mpadsp); c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4); ff_mpc_init(); diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index a4750ad961..66498a7365 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -118,7 +118,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) } memset(c->oldDSCF, 0, sizeof(c->oldDSCF)); av_lfg_init(&c->rnd, 0xDEADBEEF); - dsputil_init(&c->dsp, avctx); + ff_dsputil_init(&c->dsp, avctx); ff_mpadsp_init(&c->mpadsp); ff_mpc_init(); @@ -184,13 +184,13 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) q3_vlc[0].table = q3_0_table; q3_vlc[0].table_allocated = 512; - init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE, + ff_init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE, mpc8_q3_bits, 1, 1, mpc8_q3_codes, 1, 1, mpc8_q3_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); q3_vlc[1].table = q3_1_table; q3_vlc[1].table_allocated = 516; - init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE, + ff_init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE, mpc8_q4_bits, 1, 1, mpc8_q4_codes, 1, 1, mpc8_q4_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 28c17e6eb3..a4e4661d18 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -697,8 +697,8 @@ av_cold void ff_mpeg12_init_vlcs(void) INIT_VLC_STATIC(&mb_btype_vlc, MB_BTYPE_VLC_BITS, 11, &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1, 64); - init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]); - init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]); + ff_init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]); + ff_init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]); INIT_2D_VLC_RL(ff_rl_mpeg1, 680); INIT_2D_VLC_RL(ff_rl_mpeg2, 674); @@ -1126,7 +1126,7 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx) for (i = 0; i < 64; i++) s2->dsp.idct_permutation[i]=i; - MPV_decode_defaults(s2); + ff_MPV_decode_defaults(s2); s->mpeg_enc_ctx.avctx = avctx; s->mpeg_enc_ctx.flags = avctx->flags; @@ -1258,7 +1258,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (s1->mpeg_enc_ctx_allocated) { ParseContext pc = s->parse_context; s->parse_context.buffer = 0; - MPV_common_end(s); + ff_MPV_common_end(s); s->parse_context = pc; } @@ -1336,7 +1336,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) * if DCT permutation is changed. */ memcpy(old_permutation, s->dsp.idct_permutation, 64 * sizeof(uint8_t)); - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -2; 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) /* start frame decoding */ if (s->first_field || s->picture_structure == PICT_FRAME) { - if (MPV_frame_start(s, avctx) < 0) + if (ff_MPV_frame_start(s, avctx) < 0) return -1; ff_er_frame_start(s); @@ -1790,13 +1790,13 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, s->dest[1] +=(16 >> lowres) >> s->chroma_x_shift; s->dest[2] +=(16 >> lowres) >> s->chroma_x_shift; - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); if (++s->mb_x >= s->mb_width) { const int mb_size = 16 >> s->avctx->lowres; ff_draw_horiz_band(s, mb_size*(s->mb_y >> field_pic), mb_size); - MPV_report_decode_progress(s); + ff_MPV_report_decode_progress(s); s->mb_x = 0; s->mb_y += 1 << field_pic; @@ -1949,7 +1949,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) ff_er_frame_end(s); - MPV_frame_end(s); + ff_MPV_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { *pict = *(AVFrame*)s->current_picture_ptr; @@ -2060,7 +2060,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx) /* start new MPEG-1 context decoding */ s->out_format = FMT_MPEG1; if (s1->mpeg_enc_ctx_allocated) { - MPV_common_end(s); + ff_MPV_common_end(s); } s->width = avctx->coded_width; s->height = avctx->coded_height; @@ -2074,7 +2074,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx) if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_SIMPLE; - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; s1->mpeg_enc_ctx_allocated = 1; @@ -2541,7 +2541,7 @@ static int mpeg_decode_end(AVCodecContext *avctx) Mpeg1Context *s = avctx->priv_data; if (s->mpeg_enc_ctx_allocated) - MPV_common_end(&s->mpeg_enc_ctx); + ff_MPV_common_end(&s->mpeg_enc_ctx); return 0; } diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 7a692342a8..35570eda69 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -132,7 +132,7 @@ static av_cold int encode_init(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; - if(MPV_encode_init(avctx) < 0) + if(ff_MPV_encode_init(avctx) < 0) return -1; if(find_frame_rate_index(s) < 0){ @@ -341,7 +341,7 @@ void ff_mpeg1_encode_slice_header(MpegEncContext *s){ put_bits(&s->pb, 1, 0); /* slice extra information */ } -void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) +void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) { mpeg1_encode_sequence_header(s); @@ -666,7 +666,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, } } -void mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y) +void ff_mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y) { if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); else mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8); @@ -725,8 +725,8 @@ void ff_mpeg1_encode_init(MpegEncContext *s) int i; done=1; - init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]); - init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]); + ff_init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]); + ff_init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]); for(i=0; i<64; i++) { @@ -966,8 +966,8 @@ AVCodec ff_mpeg1video_encoder = { .id = CODEC_ID_MPEG1VIDEO, .priv_data_size = sizeof(MpegEncContext), .init = encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .supported_framerates= avpriv_frame_rate_tab+1, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY, @@ -981,8 +981,8 @@ AVCodec ff_mpeg2video_encoder = { .id = CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(MpegEncContext), .init = encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .supported_framerates= avpriv_frame_rate_tab+1, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, diff --git a/libavcodec/mpeg4data.h b/libavcodec/mpeg4data.h index 1f4e578ca1..1ac5840e03 100644 --- a/libavcodec/mpeg4data.h +++ b/libavcodec/mpeg4data.h @@ -211,7 +211,7 @@ static const int8_t inter_rvlc_level[169]={ 1, 1, }; -RLTable rvlc_rl_inter = { +RLTable ff_rvlc_rl_inter = { 169, 103, inter_rvlc, @@ -315,7 +315,7 @@ static const int8_t intra_rvlc_level[169]={ 1, 1, }; -RLTable rvlc_rl_intra = { +RLTable ff_rvlc_rl_intra = { 169, 103, intra_rvlc, @@ -323,13 +323,13 @@ RLTable rvlc_rl_intra = { intra_rvlc_level, }; -const uint16_t sprite_trajectory_tab[15][2] = { +const uint16_t ff_sprite_trajectory_tab[15][2] = { {0x00, 2}, {0x02, 3}, {0x03, 3}, {0x04, 3}, {0x05, 3}, {0x06, 3}, {0x0E, 4}, {0x1E, 5}, {0x3E, 6}, {0x7E, 7}, {0xFE, 8}, {0x1FE, 9},{0x3FE, 10},{0x7FE, 11},{0xFFE, 12}, }; -const uint8_t mb_type_b_tab[4][2] = { +const uint8_t ff_mb_type_b_tab[4][2] = { {1, 1}, {1, 2}, {1, 3}, {1, 4}, }; @@ -369,7 +369,7 @@ const uint16_t ff_mpeg4_resync_prefix[8]={ 0x7F00, 0x7E00, 0x7C00, 0x7800, 0x7000, 0x6000, 0x4000, 0x0000 }; -const uint8_t mpeg4_dc_threshold[8]={ +const uint8_t ff_mpeg4_dc_threshold[8]={ 99, 13, 15, 17, 19, 21, 23, 0 }; diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index 274ded9a1a..95e6e9e893 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -66,11 +66,11 @@ extern const uint16_t ff_mpeg4_intra_vlc[103][2]; extern RLTable ff_mpeg4_rl_intra; /* Note this is identical to the intra rvlc except that it is reordered. */ -extern RLTable rvlc_rl_inter; -extern RLTable rvlc_rl_intra; +extern RLTable ff_rvlc_rl_inter; +extern RLTable ff_rvlc_rl_intra; -extern const uint16_t sprite_trajectory_tab[15][2]; -extern const uint8_t mb_type_b_tab[4][2]; +extern const uint16_t ff_sprite_trajectory_tab[15][2]; +extern const uint8_t ff_mb_type_b_tab[4][2]; /* these matrixes will be permuted for the idct */ 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]; extern const uint8_t ff_mpeg4_c_dc_scale_table[32]; extern const uint16_t ff_mpeg4_resync_prefix[8]; -extern const uint8_t mpeg4_dc_threshold[8]; +extern const uint8_t ff_mpeg4_dc_threshold[8]; -void mpeg4_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], - int motion_x, int motion_y); -void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, - int dir); +void ff_mpeg4_encode_mb(MpegEncContext *s, + DCTELEM block[6][64], + int motion_x, int motion_y); +void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, + int dir); void ff_set_mpeg4_time(MpegEncContext * s); -void mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb); void ff_mpeg4_encode_video_packet_header(MpegEncContext *s); @@ -99,7 +99,7 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s); void ff_clean_mpeg4_qscales(MpegEncContext *s); int ff_mpeg4_decode_partitions(MpegEncContext *s); int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s); -int mpeg4_decode_video_packet_header(MpegEncContext *s); +int ff_mpeg4_decode_video_packet_header(MpegEncContext *s); void ff_mpeg4_init_direct_mv(MpegEncContext *s); /** diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 4312689393..a12ad99348 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -53,8 +53,8 @@ static const int mb_type_b_map[4]= { * @param n block index (0-3 are luma, 4-5 are chroma) * @param dir the ac prediction direction */ -void mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, - int dir) +void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, + int dir) { int i; int16_t *ac_val, *ac_val1; @@ -358,7 +358,7 @@ static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb) * Decode the next video packet. * @return <0 if something went wrong */ -int mpeg4_decode_video_packet_header(MpegEncContext *s) +int ff_mpeg4_decode_video_packet_header(MpegEncContext *s) { int mb_num_bits= av_log2(s->mb_num - 1) + 1; int header_extension=0, mb_num, len; @@ -654,13 +654,13 @@ try_again: if ((cbpc & 16) == 0) { /* 16x16 motion prediction */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); if(!s->mcsel){ - mx = h263_decode_motion(s, pred_x, s->f_code); + mx = ff_h263_decode_motion(s, pred_x, s->f_code); if (mx >= 0xffff) return -1; - my = h263_decode_motion(s, pred_y, s->f_code); + my = ff_h263_decode_motion(s, pred_y, s->f_code); if (my >= 0xffff) return -1; s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; @@ -678,12 +678,12 @@ try_again: int i; s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; for(i=0;i<4;i++) { - int16_t *mot_val= h263_pred_motion(s, i, 0, &pred_x, &pred_y); - mx = h263_decode_motion(s, pred_x, s->f_code); + int16_t *mot_val= ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); + mx = ff_h263_decode_motion(s, pred_x, s->f_code); if (mx >= 0xffff) return -1; - my = h263_decode_motion(s, pred_y, s->f_code); + my = ff_h263_decode_motion(s, pred_y, s->f_code); if (my >= 0xffff) return -1; mot_val[0] = mx; @@ -878,8 +878,8 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, goto not_coded; if(rvlc){ - rl = &rvlc_rl_intra; - rl_vlc = rvlc_rl_intra.rl_vlc[0]; + rl = &ff_rvlc_rl_intra; + rl_vlc = ff_rvlc_rl_intra.rl_vlc[0]; }else{ rl = &ff_mpeg4_rl_intra; rl_vlc = ff_mpeg4_rl_intra.rl_vlc[0]; @@ -900,7 +900,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, s->block_last_index[n] = i; return 0; } - if(rvlc) rl = &rvlc_rl_inter; + if(rvlc) rl = &ff_rvlc_rl_inter; else rl = &ff_h263_rl_inter; scan_table = s->intra_scantable.permutated; @@ -909,7 +909,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, qmul=1; qadd=0; if(rvlc){ - rl_vlc = rvlc_rl_inter.rl_vlc[0]; + rl_vlc = ff_rvlc_rl_inter.rl_vlc[0]; }else{ rl_vlc = ff_h263_rl_inter.rl_vlc[0]; } @@ -917,7 +917,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, qmul = s->qscale << 1; qadd = (s->qscale - 1) | 1; if(rvlc){ - rl_vlc = rvlc_rl_inter.rl_vlc[s->qscale]; + rl_vlc = ff_rvlc_rl_inter.rl_vlc[s->qscale]; }else{ rl_vlc = ff_h263_rl_inter.rl_vlc[s->qscale]; } @@ -1076,7 +1076,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, i -= i>>31; //if(i == -1) i=0; } - mpeg4_pred_ac(s, block, n, dc_pred_dir); + ff_mpeg4_pred_ac(s, block, n, dc_pred_dir); if (s->ac_pred) { i = 63; /* XXX: not optimal */ } @@ -1248,14 +1248,14 @@ static int mpeg4_decode_mb(MpegEncContext *s, s->field_select[0][0]= get_bits1(&s->gb); s->field_select[0][1]= get_bits1(&s->gb); - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); for(i=0; i<2; i++){ - mx = h263_decode_motion(s, pred_x, s->f_code); + mx = ff_h263_decode_motion(s, pred_x, s->f_code); if (mx >= 0xffff) return -1; - my = h263_decode_motion(s, pred_y/2, s->f_code); + my = ff_h263_decode_motion(s, pred_y/2, s->f_code); if (my >= 0xffff) return -1; @@ -1266,13 +1266,13 @@ static int mpeg4_decode_mb(MpegEncContext *s, s->current_picture.f.mb_type[xy] = MB_TYPE_16x16 | MB_TYPE_L0; /* 16x16 motion prediction */ s->mv_type = MV_TYPE_16X16; - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); - mx = h263_decode_motion(s, pred_x, s->f_code); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + mx = ff_h263_decode_motion(s, pred_x, s->f_code); if (mx >= 0xffff) return -1; - my = h263_decode_motion(s, pred_y, s->f_code); + my = ff_h263_decode_motion(s, pred_y, s->f_code); if (my >= 0xffff) return -1; @@ -1283,12 +1283,12 @@ static int mpeg4_decode_mb(MpegEncContext *s, s->current_picture.f.mb_type[xy] = MB_TYPE_8x8 | MB_TYPE_L0; s->mv_type = MV_TYPE_8X8; for(i=0;i<4;i++) { - mot_val = h263_pred_motion(s, i, 0, &pred_x, &pred_y); - mx = h263_decode_motion(s, pred_x, s->f_code); + mot_val = ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); + mx = ff_h263_decode_motion(s, pred_x, s->f_code); if (mx >= 0xffff) return -1; - my = h263_decode_motion(s, pred_y, s->f_code); + my = ff_h263_decode_motion(s, pred_y, s->f_code); if (my >= 0xffff) return -1; s->mv[0][i][0] = mx; @@ -1384,8 +1384,8 @@ static int mpeg4_decode_mb(MpegEncContext *s, if(USES_LIST(mb_type, 0)){ s->mv_dir = MV_DIR_FORWARD; - mx = h263_decode_motion(s, s->last_mv[0][0][0], s->f_code); - my = h263_decode_motion(s, s->last_mv[0][0][1], s->f_code); + mx = ff_h263_decode_motion(s, s->last_mv[0][0][0], s->f_code); + my = ff_h263_decode_motion(s, s->last_mv[0][0][1], s->f_code); s->last_mv[0][1][0]= s->last_mv[0][0][0]= s->mv[0][0][0] = mx; s->last_mv[0][1][1]= s->last_mv[0][0][1]= s->mv[0][0][1] = my; } @@ -1393,8 +1393,8 @@ static int mpeg4_decode_mb(MpegEncContext *s, if(USES_LIST(mb_type, 1)){ s->mv_dir |= MV_DIR_BACKWARD; - mx = h263_decode_motion(s, s->last_mv[1][0][0], s->b_code); - my = h263_decode_motion(s, s->last_mv[1][0][1], s->b_code); + mx = ff_h263_decode_motion(s, s->last_mv[1][0][0], s->b_code); + my = ff_h263_decode_motion(s, s->last_mv[1][0][1], s->b_code); s->last_mv[1][1][0]= s->last_mv[1][0][0]= s->mv[1][0][0] = mx; s->last_mv[1][1][1]= s->last_mv[1][0][1]= s->mv[1][0][1] = my; } @@ -1405,8 +1405,8 @@ static int mpeg4_decode_mb(MpegEncContext *s, s->mv_dir = MV_DIR_FORWARD; for(i=0; i<2; i++){ - mx = h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code); - my = h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code); + mx = ff_h263_decode_motion(s, s->last_mv[0][i][0] , s->f_code); + my = ff_h263_decode_motion(s, s->last_mv[0][i][1]/2, s->f_code); s->last_mv[0][i][0]= s->mv[0][i][0] = mx; s->last_mv[0][i][1]= (s->mv[0][i][1] = my)*2; } @@ -1416,8 +1416,8 @@ static int mpeg4_decode_mb(MpegEncContext *s, s->mv_dir |= MV_DIR_BACKWARD; for(i=0; i<2; i++){ - mx = h263_decode_motion(s, s->last_mv[1][i][0] , s->b_code); - my = h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code); + mx = ff_h263_decode_motion(s, s->last_mv[1][i][0] , s->b_code); + my = ff_h263_decode_motion(s, s->last_mv[1][i][1]/2, s->b_code); s->last_mv[1][i][0]= s->mv[1][i][0] = mx; s->last_mv[1][i][1]= (s->mv[1][i][1] = my)*2; } @@ -1429,8 +1429,8 @@ static int mpeg4_decode_mb(MpegEncContext *s, if(IS_SKIP(mb_type)) mx=my=0; else{ - mx = h263_decode_motion(s, 0, 1); - my = h263_decode_motion(s, 0, 1); + mx = ff_h263_decode_motion(s, 0, 1); + my = ff_h263_decode_motion(s, 0, 1); } s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; @@ -2035,7 +2035,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ if(s->pict_type == AV_PICTURE_TYPE_B) skip_bits_long(gb, s->cplx_estimation_trash_b); - s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ]; + s->intra_dc_threshold= ff_mpeg4_dc_threshold[ get_bits(gb, 3) ]; if(!s->progressive_sequence){ s->top_field_first= get_bits1(gb); s->alternate_scan= get_bits1(gb); @@ -2237,12 +2237,12 @@ static av_cold int decode_init(AVCodecContext *avctx) if (!done) { done = 1; - init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); - init_rl(&rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]); - init_rl(&rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]); + ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); + ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]); + ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]); INIT_VLC_RL(ff_mpeg4_rl_intra, 554); - INIT_VLC_RL(rvlc_rl_inter, 1072); - INIT_VLC_RL(rvlc_rl_intra, 1072); + INIT_VLC_RL(ff_rvlc_rl_inter, 1072); + INIT_VLC_RL(ff_rvlc_rl_intra, 1072); INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */, &ff_mpeg4_DCtab_lum[0][1], 2, 1, &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512); @@ -2250,11 +2250,11 @@ static av_cold int decode_init(AVCodecContext *avctx) &ff_mpeg4_DCtab_chrom[0][1], 2, 1, &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512); INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15, - &sprite_trajectory_tab[0][1], 4, 2, - &sprite_trajectory_tab[0][0], 4, 2, 128); + &ff_sprite_trajectory_tab[0][1], 4, 2, + &ff_sprite_trajectory_tab[0][0], 4, 2, 128); INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4, - &mb_type_b_tab[0][1], 2, 1, - &mb_type_b_tab[0][0], 2, 1, 16); + &ff_mb_type_b_tab[0][1], 2, 1, + &ff_mb_type_b_tab[0][0], 2, 1, 16); } s->h263_pred = 1; diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 02fdf3eaca..b8a86d9dbf 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -468,9 +468,9 @@ static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64], //FIXME this is duplicated to h263.c static const int dquant_code[5]= {1,0,9,2,3}; -void mpeg4_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], - int motion_x, int motion_y) +void ff_mpeg4_encode_mb(MpegEncContext * s, + DCTELEM block[6][64], + int motion_x, int motion_y) { int cbpc, cbpy, pred_x, pred_y; PutBitContext * const pb2 = s->data_partitioning ? &s->pb2 : &s->pb; @@ -705,7 +705,7 @@ void mpeg4_encode_mb(MpegEncContext * s, } /* motion vectors: 16x16 mode */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); ff_h263_encode_motion_vector(s, motion_x - pred_x, motion_y - pred_y, s->f_code); @@ -729,7 +729,7 @@ void mpeg4_encode_mb(MpegEncContext * s, } /* motion vectors: 16x8 interlaced mode */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); pred_y /=2; put_bits(&s->pb, 1, s->field_select[0][0]); @@ -757,7 +757,7 @@ void mpeg4_encode_mb(MpegEncContext * s, for(i=0; i<4; i++){ /* motion vectors: 8x8 mode*/ - h263_pred_motion(s, i, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, i, 0, &pred_x, &pred_y); ff_h263_encode_motion_vector(s, s->current_picture.f.motion_val[0][ s->block_index[i] ][0] - pred_x, 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 } /* write mpeg4 VOP header */ -void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) +void ff_mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) { int time_incr; int time_div, time_mod; @@ -1232,7 +1232,7 @@ static av_cold int encode_init(AVCodecContext *avctx) int ret; static int done = 0; - if((ret=MPV_encode_init(avctx)) < 0) + if((ret=ff_MPV_encode_init(avctx)) < 0) return ret; if (!done) { @@ -1240,7 +1240,7 @@ static av_cold int encode_init(AVCodecContext *avctx) init_uni_dc_tab(); - init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); + ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len); 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 = { .id = CODEC_ID_MPEG4, .priv_data_size = sizeof(MpegEncContext), .init = encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index a3f1e62160..efe4cae762 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -176,7 +176,7 @@ const uint8_t *avpriv_mpv_find_start_code(const uint8_t *restrict p, /* init common dct for both encoder and decoder */ av_cold int ff_dct_common_init(MpegEncContext *s) { - dsputil_init(&s->dsp, s->avctx); + ff_dsputil_init(&s->dsp, s->avctx); s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c; s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c; @@ -188,17 +188,17 @@ av_cold int ff_dct_common_init(MpegEncContext *s) s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; #if HAVE_MMX - MPV_common_init_mmx(s); + ff_MPV_common_init_mmx(s); #elif ARCH_ALPHA - MPV_common_init_axp(s); + ff_MPV_common_init_axp(s); #elif HAVE_MMI - MPV_common_init_mmi(s); + ff_MPV_common_init_mmi(s); #elif ARCH_ARM - MPV_common_init_arm(s); + ff_MPV_common_init_arm(s); #elif HAVE_ALTIVEC - MPV_common_init_altivec(s); + ff_MPV_common_init_altivec(s); #elif ARCH_BFIN - MPV_common_init_bfin(s); + ff_MPV_common_init_bfin(s); #endif /* load & permutate scantables @@ -458,7 +458,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base) return 0; fail: - return -1; // free() through MPV_common_end() + return -1; // free() through ff_MPV_common_end() } static void free_duplicate_context(MpegEncContext *s) @@ -544,7 +544,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, if (s1->context_initialized){ s->picture_range_start += MAX_PICTURE_COUNT; s->picture_range_end += MAX_PICTURE_COUNT; - MPV_common_init(s); + ff_MPV_common_init(s); } } @@ -618,7 +618,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, * The changed fields will not depend upon the * prior state of the MpegEncContext. */ -void MPV_common_defaults(MpegEncContext *s) +void ff_MPV_common_defaults(MpegEncContext *s) { s->y_dc_scale_table = s->c_dc_scale_table = ff_mpeg1_dc_scale_table; @@ -647,16 +647,16 @@ void MPV_common_defaults(MpegEncContext *s) * the changed fields will not depend upon * the prior state of the MpegEncContext. */ -void MPV_decode_defaults(MpegEncContext *s) +void ff_MPV_decode_defaults(MpegEncContext *s) { - MPV_common_defaults(s); + ff_MPV_common_defaults(s); } /** * init common structure for both encoder and decoder. * this assumes that some variables like width/height are already set */ -av_cold int MPV_common_init(MpegEncContext *s) +av_cold int ff_MPV_common_init(MpegEncContext *s) { int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; int nb_slices = (HAVE_THREADS && @@ -862,12 +862,12 @@ av_cold int MPV_common_init(MpegEncContext *s) return 0; fail: - MPV_common_end(s); + ff_MPV_common_end(s); return -1; } /* init common structure for both encoder and decoder */ -void MPV_common_end(MpegEncContext *s) +void ff_MPV_common_end(MpegEncContext *s) { int i, j, k; @@ -956,8 +956,8 @@ void MPV_common_end(MpegEncContext *s) avcodec_default_free_buffers(s->avctx); } -void init_rl(RLTable *rl, - uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) +void ff_init_rl(RLTable *rl, + uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) { int8_t max_level[MAX_RUN + 1], max_run[MAX_LEVEL + 1]; uint8_t index_run[MAX_RUN + 1]; @@ -1008,7 +1008,7 @@ void init_rl(RLTable *rl, } } -void init_vlc_rl(RLTable *rl) +void ff_init_vlc_rl(RLTable *rl) { int i, q; @@ -1125,7 +1125,7 @@ static void update_noise_reduction(MpegEncContext *s) * generic function for encode/decode called after coding/decoding * the header and before a frame is coded/decoded. */ -int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) +int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) { int i; Picture *pic; @@ -1328,7 +1328,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) /* generic function for encode/decode called after a * frame has been coded/decoded. */ -void MPV_frame_end(MpegEncContext *s) +void ff_MPV_frame_end(MpegEncContext *s) { int i; /* redraw edges for the frame if decoding didn't complete */ @@ -2156,7 +2156,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, /** * find the lowest MB row referenced in the MVs */ -int MPV_lowest_referenced_row(MpegEncContext *s, int dir) +int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir) { int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample; int my, off, i, mvs; @@ -2346,10 +2346,10 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], if(HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_FRAME) { if (s->mv_dir & MV_DIR_FORWARD) { - ff_thread_await_progress((AVFrame*)s->last_picture_ptr, MPV_lowest_referenced_row(s, 0), 0); + ff_thread_await_progress((AVFrame*)s->last_picture_ptr, ff_MPV_lowest_referenced_row(s, 0), 0); } if (s->mv_dir & MV_DIR_BACKWARD) { - ff_thread_await_progress((AVFrame*)s->next_picture_ptr, MPV_lowest_referenced_row(s, 1), 0); + ff_thread_await_progress((AVFrame*)s->next_picture_ptr, ff_MPV_lowest_referenced_row(s, 1), 0); } } @@ -2500,7 +2500,7 @@ skip_idct: } } -void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ +void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ #if !CONFIG_SMALL if(s->out_format == FMT_MPEG1) { if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1); @@ -2864,7 +2864,7 @@ void ff_set_qscale(MpegEncContext * s, int qscale) s->c_dc_scale= s->c_dc_scale_table[ s->chroma_qscale ]; } -void MPV_report_decode_progress(MpegEncContext *s) +void ff_MPV_report_decode_progress(MpegEncContext *s) { if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->error_occurred) ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index eb785cd84f..cbe50ceb87 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -694,21 +694,21 @@ typedef struct MpegEncContext { &new_ctx->picture[pic - old_ctx->picture] : pic - (Picture*)old_ctx + (Picture*)new_ctx)\ : NULL) -void MPV_decode_defaults(MpegEncContext *s); -int MPV_common_init(MpegEncContext *s); -void MPV_common_end(MpegEncContext *s); -void MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]); -int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); -void MPV_frame_end(MpegEncContext *s); -int MPV_encode_init(AVCodecContext *avctx); -int MPV_encode_end(AVCodecContext *avctx); -int MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data); -void MPV_common_init_mmx(MpegEncContext *s); -void MPV_common_init_axp(MpegEncContext *s); -void MPV_common_init_mmi(MpegEncContext *s); -void MPV_common_init_arm(MpegEncContext *s); -void MPV_common_init_altivec(MpegEncContext *s); -void MPV_common_init_bfin(MpegEncContext *s); +void ff_MPV_decode_defaults(MpegEncContext *s); +int ff_MPV_common_init(MpegEncContext *s); +void ff_MPV_common_end(MpegEncContext *s); +void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]); +int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); +void ff_MPV_frame_end(MpegEncContext *s); +int ff_MPV_encode_init(AVCodecContext *avctx); +int ff_MPV_encode_end(AVCodecContext *avctx); +int ff_MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data); +void ff_MPV_common_init_mmx(MpegEncContext *s); +void ff_MPV_common_init_axp(MpegEncContext *s); +void ff_MPV_common_init_mmi(MpegEncContext *s); +void ff_MPV_common_init_arm(MpegEncContext *s); +void ff_MPV_common_init_altivec(MpegEncContext *s); +void ff_MPV_common_init_bfin(MpegEncContext *s); void ff_clean_intra_table_entries(MpegEncContext *s); void ff_draw_horiz_band(MpegEncContext *s, int y, int h); void ff_mpeg_flush(AVCodecContext *avctx); @@ -718,8 +718,8 @@ void ff_release_unused_pictures(MpegEncContext *s, int remove_current); int ff_find_unused_picture(MpegEncContext *s, int shared); void ff_denoise_dct(MpegEncContext *s, DCTELEM *block); void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src); -int MPV_lowest_referenced_row(MpegEncContext *s, int dir); -void MPV_report_decode_progress(MpegEncContext *s); +int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir); +void ff_MPV_report_decode_progress(MpegEncContext *s); int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); const uint8_t *avpriv_mpv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state); 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, extern const uint8_t ff_mpeg1_dc_scale_table[128]; extern const uint8_t * const ff_mpeg2_dc_scale_table[4]; -void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); -void mpeg1_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], - int motion_x, int motion_y); +void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_mpeg1_encode_mb(MpegEncContext *s, + DCTELEM block[6][64], + int motion_x, int motion_y); void ff_mpeg1_encode_init(MpegEncContext *s); void ff_mpeg1_encode_slice_header(MpegEncContext *s); void ff_mpeg1_clean_buffers(MpegEncContext *s); @@ -821,19 +821,19 @@ int ff_h261_get_picture_format(int width, int height); /* rv10.c */ -void rv10_encode_picture_header(MpegEncContext *s, int picture_number); -int rv_decode_dc(MpegEncContext *s, int n); -void rv20_encode_picture_header(MpegEncContext *s, int picture_number); +void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number); +int ff_rv_decode_dc(MpegEncContext *s, int n); +void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number); /* msmpeg4.c */ -void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number); -void msmpeg4_encode_ext_header(MpegEncContext * s); -void msmpeg4_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], - int motion_x, int motion_y); -int msmpeg4_decode_picture_header(MpegEncContext * s); -int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size); +void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number); +void ff_msmpeg4_encode_ext_header(MpegEncContext * s); +void ff_msmpeg4_encode_mb(MpegEncContext * s, + DCTELEM block[6][64], + int motion_x, int motion_y); +int ff_msmpeg4_decode_picture_header(MpegEncContext * s); +int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size); int ff_msmpeg4_decode_init(AVCodecContext *avctx); void ff_msmpeg4_encode_init(MpegEncContext *s); int ff_wmv2_decode_picture_header(MpegEncContext * s); diff --git a/libavcodec/mpegvideo_common.h b/libavcodec/mpegvideo_common.h index 2b2e34ffa9..2ef83abb8f 100644 --- a/libavcodec/mpegvideo_common.h +++ b/libavcodec/mpegvideo_common.h @@ -39,19 +39,13 @@ #include "faandct.h" #include <limits.h> -int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); - -/** - * Allocate a Picture. - * The pixels are allocated/set by calling get_buffer() if shared = 0. - */ -int alloc_picture(MpegEncContext *s, Picture *pic, int shared); +int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); /** * Set the given MpegEncContext to common defaults (same for encoding and decoding). * The changed fields will not depend upon the prior state of the MpegEncContext. */ -void MPV_common_defaults(MpegEncContext *s); +void ff_MPV_common_defaults(MpegEncContext *s); static inline void gmc1_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index a3ec5c18a1..65fb660a26 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -90,7 +90,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) / (qscale * quant_matrix[j])); } - } else if (dsp->fdct == fdct_ifast + } else if (dsp->fdct == ff_fdct_ifast #ifndef FAAN_POSTSCALE || dsp->fdct == ff_faandct #endif @@ -132,7 +132,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], for (i = intra; i < 64; i++) { int64_t max = 8191; - if (dsp->fdct == fdct_ifast + if (dsp->fdct == ff_fdct_ifast #ifndef FAAN_POSTSCALE || dsp->fdct == ff_faandct #endif @@ -264,7 +264,7 @@ static void update_duplicate_context_after_me(MpegEncContext *dst, static void MPV_encode_defaults(MpegEncContext *s) { int i; - MPV_common_defaults(s); + ff_MPV_common_defaults(s); for (i = -16; i < 16; i++) { default_fcode_tab[i + MAX_MV] = 1; @@ -274,7 +274,7 @@ static void MPV_encode_defaults(MpegEncContext *s) } /* init video encoder */ -av_cold int MPV_encode_init(AVCodecContext *avctx) +av_cold int ff_MPV_encode_init(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; int i; @@ -665,7 +665,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) case CODEC_ID_H263: if (!CONFIG_H263_ENCODER) return -1; - if (ff_match_2uint16(h263_format, FF_ARRAY_ELEMS(h263_format), + if (ff_match_2uint16(ff_h263_format, FF_ARRAY_ELEMS(ff_h263_format), s->width, s->height) == 8) { av_log(avctx, AV_LOG_ERROR, "The specified picture size of %dx%d is not valid for " @@ -771,11 +771,11 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) s->alternate_scan); /* init */ - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; if (!s->dct_quantize) - s->dct_quantize = dct_quantize_c; + s->dct_quantize = ff_dct_quantize_c; if (!s->denoise_dct) s->denoise_dct = denoise_dct_c; s->fast_dct_quantize = s->dct_quantize; @@ -793,7 +793,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) if (CONFIG_H261_ENCODER && s->out_format == FMT_H261) ff_h261_encode_init(s); if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) - h263_encode_init(s); + ff_h263_encode_init(s); if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version) ff_msmpeg4_encode_init(s); if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) @@ -838,13 +838,13 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) return 0; } -av_cold int MPV_encode_end(AVCodecContext *avctx) +av_cold int ff_MPV_encode_end(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; ff_rate_control_uninit(s); - MPV_common_end(s); + ff_MPV_common_end(s); if ((CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER) && s->out_format == FMT_MJPEG) ff_mjpeg_encode_close(s); @@ -1384,8 +1384,8 @@ no_output_pic: return 0; } -int MPV_encode_picture(AVCodecContext *avctx, - unsigned char *buf, int buf_size, void *data) +int ff_MPV_encode_picture(AVCodecContext *avctx, + unsigned char *buf, int buf_size, void *data) { MpegEncContext *s = avctx->priv_data; AVFrame *pic_arg = data; @@ -1417,7 +1417,7 @@ int MPV_encode_picture(AVCodecContext *avctx, //emms_c(); //printf("qs:%f %f %d\n", s->new_picture.quality, // s->current_picture.quality, s->qscale); - MPV_frame_start(s, avctx); + ff_MPV_frame_start(s, avctx); vbv_retry: if (encode_picture(s, s->picture_number) < 0) return -1; @@ -1432,7 +1432,7 @@ vbv_retry: avctx->p_count = s->mb_num - s->i_count - s->skip_count; avctx->skip_count = s->skip_count; - MPV_frame_end(s); + ff_MPV_frame_end(s); if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG) ff_mjpeg_encode_picture_trailer(s); @@ -1987,7 +1987,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, } // non c quantize code returns incorrect block_last_index FIXME - if (s->alternate_scan && s->dct_quantize != dct_quantize_c) { + if (s->alternate_scan && s->dct_quantize != ff_dct_quantize_c) { for (i = 0; i < mb_block_count; i++) { int j; if (s->block_last_index[i] > 0) { @@ -2005,17 +2005,17 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) - mpeg1_encode_mb(s, s->block, motion_x, motion_y); + ff_mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MPEG4: if (CONFIG_MPEG4_ENCODER) - mpeg4_encode_mb(s, s->block, motion_x, motion_y); + ff_mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MSMPEG4V2: case CODEC_ID_MSMPEG4V3: case CODEC_ID_WMV1: if (CONFIG_MSMPEG4_ENCODER) - msmpeg4_encode_mb(s, s->block, motion_x, motion_y); + ff_msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_WMV2: if (CONFIG_WMV2_ENCODER) @@ -2031,7 +2031,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, case CODEC_ID_RV10: case CODEC_ID_RV20: if (CONFIG_H263_ENCODER) - h263_encode_mb(s, s->block, motion_x, motion_y); + ff_h263_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MJPEG: case CODEC_ID_AMV: @@ -2149,7 +2149,7 @@ static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegE } if(s->avctx->mb_decision == FF_MB_DECISION_RD){ - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); score *= s->lambda2; score += sse_mb(s) << FF_LAMBDA_SHIFT; @@ -2467,7 +2467,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ case CODEC_ID_H263: case CODEC_ID_H263P: if (CONFIG_H263_ENCODER) - h263_encode_gob_header(s, mb_y); + ff_h263_encode_gob_header(s, mb_y); break; } @@ -2760,7 +2760,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ } if(s->avctx->mb_decision == FF_MB_DECISION_BITS) - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); } else { int motion_x = 0, motion_y = 0; s->mv_type=MV_TYPE_16X16; @@ -2880,7 +2880,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B) ff_h263_update_motion_val(s); - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); } /* 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){ //not beautiful here but we must write it before flushing so it has to be here if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I) - msmpeg4_encode_ext_header(s); + ff_msmpeg4_encode_ext_header(s); write_slice_end(s); @@ -3233,21 +3233,21 @@ static int encode_picture(MpegEncContext *s, int picture_number) if (CONFIG_WMV2_ENCODER && s->codec_id == CODEC_ID_WMV2) ff_wmv2_encode_picture_header(s, picture_number); else if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version) - msmpeg4_encode_picture_header(s, picture_number); + ff_msmpeg4_encode_picture_header(s, picture_number); else if (CONFIG_MPEG4_ENCODER && s->h263_pred) - mpeg4_encode_picture_header(s, picture_number); + ff_mpeg4_encode_picture_header(s, picture_number); else if (CONFIG_RV10_ENCODER && s->codec_id == CODEC_ID_RV10) - rv10_encode_picture_header(s, picture_number); + ff_rv10_encode_picture_header(s, picture_number); else if (CONFIG_RV20_ENCODER && s->codec_id == CODEC_ID_RV20) - rv20_encode_picture_header(s, picture_number); + ff_rv20_encode_picture_header(s, picture_number); else if (CONFIG_FLV_ENCODER && s->codec_id == CODEC_ID_FLV1) ff_flv_encode_picture_header(s, picture_number); else if (CONFIG_H263_ENCODER) - h263_encode_picture_header(s, picture_number); + ff_h263_encode_picture_header(s, picture_number); break; case FMT_MPEG1: if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) - mpeg1_encode_picture_header(s, picture_number); + ff_mpeg1_encode_picture_header(s, picture_number); break; case FMT_H264: break; @@ -3413,7 +3413,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, int dct_coeff= FFABS(block[ scantable[i] ]); int best_score=256*256*256*120; - if ( s->dsp.fdct == fdct_ifast + if ( s->dsp.fdct == ff_fdct_ifast #ifndef FAAN_POSTSCALE || s->dsp.fdct == ff_faandct #endif @@ -3983,7 +3983,7 @@ STOP_TIMER("iterative search") return last_non_zero; } -int dct_quantize_c(MpegEncContext *s, +int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow) { @@ -4083,9 +4083,9 @@ AVCodec ff_h263_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H263, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), .priv_class = &h263_class, @@ -4110,9 +4110,9 @@ AVCodec ff_h263p_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H263P, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .capabilities = CODEC_CAP_SLICE_THREADS, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"), @@ -4124,9 +4124,9 @@ AVCodec ff_msmpeg4v2_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MSMPEG4V2, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), }; @@ -4136,9 +4136,9 @@ AVCodec ff_msmpeg4v3_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MSMPEG4V3, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), }; @@ -4148,9 +4148,9 @@ AVCodec ff_wmv1_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_WMV1, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"), }; diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 9185fbee80..65604dbe6b 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -60,7 +60,7 @@ static uint32_t v2_dc_lum_table[512][2]; static uint32_t v2_dc_chroma_table[512][2]; /* vc1 externs */ -extern const uint8_t wmv3_dc_scale_table[32]; +extern const uint8_t ff_wmv3_dc_scale_table[32]; #include "msmpeg4data.h" @@ -138,8 +138,8 @@ static av_cold void common_init(MpegEncContext * s) break; case 3: if(s->workaround_bugs){ - s->y_dc_scale_table= old_ff_y_dc_scale_table; - s->c_dc_scale_table= wmv1_c_dc_scale_table; + s->y_dc_scale_table= ff_old_ff_y_dc_scale_table; + s->c_dc_scale_table= ff_wmv1_c_dc_scale_table; } else{ s->y_dc_scale_table= ff_mpeg4_y_dc_scale_table; s->c_dc_scale_table= ff_mpeg4_c_dc_scale_table; @@ -147,13 +147,13 @@ static av_cold void common_init(MpegEncContext * s) break; case 4: case 5: - s->y_dc_scale_table= wmv1_y_dc_scale_table; - s->c_dc_scale_table= wmv1_c_dc_scale_table; + s->y_dc_scale_table= ff_wmv1_y_dc_scale_table; + s->c_dc_scale_table= ff_wmv1_c_dc_scale_table; break; #if CONFIG_VC1_DECODER case 6: - s->y_dc_scale_table= wmv3_dc_scale_table; - s->c_dc_scale_table= wmv3_dc_scale_table; + s->y_dc_scale_table= ff_wmv3_dc_scale_table; + s->c_dc_scale_table= ff_wmv3_dc_scale_table; break; #endif @@ -161,10 +161,10 @@ static av_cold void common_init(MpegEncContext * s) if(s->msmpeg4_version>=4){ - ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , wmv1_scantable[1]); - ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, wmv1_scantable[2]); - ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, wmv1_scantable[3]); - ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , wmv1_scantable[0]); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , ff_wmv1_scantable[1]); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, ff_wmv1_scantable[2]); + ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_wmv1_scantable[3]); + ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , ff_wmv1_scantable[0]); } //Note the default tables are set in common_init in mpegvideo.c @@ -259,10 +259,10 @@ av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) if (!init_done) { /* init various encoding tables */ init_done = 1; - init_mv_table(&mv_tables[0]); - init_mv_table(&mv_tables[1]); + init_mv_table(&ff_mv_tables[0]); + init_mv_table(&ff_mv_tables[1]); for(i=0;i<NB_RL_TABLES;i++) - init_rl(&rl_table[i], static_rl_table_store[i]); + ff_init_rl(&ff_rl_table[i], static_rl_table_store[i]); for(i=0; i<NB_RL_TABLES; i++){ int level; @@ -271,7 +271,7 @@ av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) for(run=0; run<=MAX_RUN; run++){ int last; for(last=0; last<2; last++){ - rl_length[i][level][run][last]= get_size_of_code(s, &rl_table[ i], last, run, level, 0); + rl_length[i][level][run][last]= get_size_of_code(s, &ff_rl_table[ i], last, run, level, 0); } } } @@ -347,7 +347,7 @@ static void find_best_tables(MpegEncContext * s) } /* write MSMPEG4 compatible frame header */ -void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) +void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) { find_best_tables(s); @@ -373,7 +373,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height); if(s->msmpeg4_version==4){ - msmpeg4_encode_ext_header(s); + ff_msmpeg4_encode_ext_header(s); if(s->bit_rate>MBAC_BITRATE) put_bits(&s->pb, 1, s->per_mb_rl_table); } @@ -406,7 +406,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) s->esc3_run_length= 0; } -void msmpeg4_encode_ext_header(MpegEncContext * s) +void ff_msmpeg4_encode_ext_header(MpegEncContext * s) { put_bits(&s->pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29 @@ -474,7 +474,7 @@ void ff_msmpeg4_encode_motion(MpegEncContext * s, (unsigned)my >= 64) av_log(s->avctx, AV_LOG_ERROR, "error mx=%d my=%d\n", mx, my); #endif - mv = &mv_tables[s->mv_table_index]; + mv = &ff_mv_tables[s->mv_table_index]; code = mv->table_mv_index[(mx << 6) | my]; put_bits(&s->pb, @@ -507,7 +507,7 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) if (val == 0) { /* zero vector */ code = 0; - put_bits(&s->pb, mvtab[code][1], mvtab[code][0]); + put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]); } else { bit_size = s->f_code - 1; range = 1 << bit_size; @@ -526,16 +526,16 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) code = (val >> bit_size) + 1; bits = val & (range - 1); - put_bits(&s->pb, mvtab[code][1] + 1, (mvtab[code][0] << 1) | sign); + put_bits(&s->pb, ff_mvtab[code][1] + 1, (ff_mvtab[code][0] << 1) | sign); if (bit_size > 0) { put_bits(&s->pb, bit_size, bits); } } } -void msmpeg4_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], - int motion_x, int motion_y) +void ff_msmpeg4_encode_mb(MpegEncContext * s, + DCTELEM block[6][64], + int motion_x, int motion_y) { int cbp, coded_cbp, i; int pred_x, pred_y; @@ -564,8 +564,8 @@ void msmpeg4_encode_mb(MpegEncContext * s, if(s->msmpeg4_version<=2){ put_bits(&s->pb, - v2_mb_type[cbp&3][1], - v2_mb_type[cbp&3][0]); + ff_v2_mb_type[cbp&3][1], + ff_v2_mb_type[cbp&3][0]); if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C; else coded_cbp= cbp; @@ -575,18 +575,18 @@ void msmpeg4_encode_mb(MpegEncContext * s, s->misc_bits += get_bits_diff(s); - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); msmpeg4v2_encode_motion(s, motion_x - pred_x); msmpeg4v2_encode_motion(s, motion_y - pred_y); }else{ put_bits(&s->pb, - table_mb_non_intra[cbp + 64][1], - table_mb_non_intra[cbp + 64][0]); + ff_table_mb_non_intra[cbp + 64][1], + ff_table_mb_non_intra[cbp + 64][0]); s->misc_bits += get_bits_diff(s); /* motion vector */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); ff_msmpeg4_encode_motion(s, motion_x - pred_x, motion_y - pred_y); } @@ -617,13 +617,13 @@ void msmpeg4_encode_mb(MpegEncContext * s, if(s->msmpeg4_version<=2){ if (s->pict_type == AV_PICTURE_TYPE_I) { put_bits(&s->pb, - v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]); + ff_v2_intra_cbpc[cbp&3][1], ff_v2_intra_cbpc[cbp&3][0]); } else { if (s->use_skip_mb_code) put_bits(&s->pb, 1, 0); /* mb coded */ put_bits(&s->pb, - v2_mb_type[(cbp&3) + 4][1], - v2_mb_type[(cbp&3) + 4][0]); + ff_v2_mb_type[(cbp&3) + 4][1], + ff_v2_mb_type[(cbp&3) + 4][0]); } put_bits(&s->pb, 1, 0); /* no AC prediction yet */ put_bits(&s->pb, @@ -637,13 +637,13 @@ void msmpeg4_encode_mb(MpegEncContext * s, if (s->use_skip_mb_code) put_bits(&s->pb, 1, 0); /* mb coded */ put_bits(&s->pb, - table_mb_non_intra[cbp][1], - table_mb_non_intra[cbp][0]); + ff_table_mb_non_intra[cbp][1], + ff_table_mb_non_intra[cbp][0]); } put_bits(&s->pb, 1, 0); /* no AC prediction yet */ if(s->inter_intra_pred){ s->h263_aic_dir=0; - put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]); + put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]); } } s->misc_bits += get_bits_diff(s); @@ -927,15 +927,15 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n) msmpeg4_encode_dc(s, block[0], n, &dc_pred_dir); i = 1; if (n < 4) { - rl = &rl_table[s->rl_table_index]; + rl = &ff_rl_table[s->rl_table_index]; } else { - rl = &rl_table[3 + s->rl_chroma_table_index]; + rl = &ff_rl_table[3 + s->rl_chroma_table_index]; } run_diff = s->msmpeg4_version>=4; scantable= s->intra_scantable.permutated; } else { i = 0; - rl = &rl_table[3 + s->rl_table_index]; + rl = &ff_rl_table[3 + s->rl_table_index]; if(s->msmpeg4_version<=2) run_diff = 0; else @@ -1134,7 +1134,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) cbp|= cbpy<<2; if(s->msmpeg4_version==1 || (cbp&3) != 3) cbp^= 0x3C; - h263_pred_motion(s, 0, 0, &mx, &my); + ff_h263_pred_motion(s, 0, 0, &mx, &my); mx= msmpeg4v2_decode_motion(s, mx, 1); my= msmpeg4v2_decode_motion(s, my, 1); @@ -1220,7 +1220,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) s->rl_table_index = decode012(&s->gb); s->rl_chroma_table_index = s->rl_table_index; } - h263_pred_motion(s, 0, 0, &mx, &my); + ff_h263_pred_motion(s, 0, 0, &mx, &my); if (ff_msmpeg4_decode_motion(s, &mx, &my) < 0) return -1; s->mv_dir = MV_DIR_FORWARD; @@ -1271,20 +1271,20 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx) done = 1; for(i=0;i<NB_RL_TABLES;i++) { - init_rl(&rl_table[i], static_rl_table_store[i]); + ff_init_rl(&ff_rl_table[i], static_rl_table_store[i]); } - INIT_VLC_RL(rl_table[0], 642); - INIT_VLC_RL(rl_table[1], 1104); - INIT_VLC_RL(rl_table[2], 554); - INIT_VLC_RL(rl_table[3], 940); - INIT_VLC_RL(rl_table[4], 962); - INIT_VLC_RL(rl_table[5], 554); - - mv = &mv_tables[0]; + INIT_VLC_RL(ff_rl_table[0], 642); + INIT_VLC_RL(ff_rl_table[1], 1104); + INIT_VLC_RL(ff_rl_table[2], 554); + INIT_VLC_RL(ff_rl_table[3], 940); + INIT_VLC_RL(ff_rl_table[4], 962); + INIT_VLC_RL(ff_rl_table[5], 554); + + mv = &ff_mv_tables[0]; INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, mv->n + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 3714); - mv = &mv_tables[1]; + mv = &ff_mv_tables[1]; INIT_VLC_STATIC(&mv->vlc, MV_VLC_BITS, mv->n + 1, mv->table_mv_bits, 1, 1, mv->table_mv_code, 2, 2, 2694); @@ -1310,35 +1310,35 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx) &v2_dc_chroma_table[0][0], 8, 4, 1506); INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, - &v2_intra_cbpc[0][1], 2, 1, - &v2_intra_cbpc[0][0], 2, 1, 8); + &ff_v2_intra_cbpc[0][1], 2, 1, + &ff_v2_intra_cbpc[0][0], 2, 1, 8); INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, - &v2_mb_type[0][1], 2, 1, - &v2_mb_type[0][0], 2, 1, 128); + &ff_v2_mb_type[0][1], 2, 1, + &ff_v2_mb_type[0][0], 2, 1, 128); INIT_VLC_STATIC(&v2_mv_vlc, V2_MV_VLC_BITS, 33, - &mvtab[0][1], 2, 1, - &mvtab[0][0], 2, 1, 538); + &ff_mvtab[0][1], 2, 1, + &ff_mvtab[0][0], 2, 1, 538); INIT_VLC_STATIC(&ff_mb_non_intra_vlc[0], MB_NON_INTRA_VLC_BITS, 128, - &wmv2_inter_table[0][0][1], 8, 4, - &wmv2_inter_table[0][0][0], 8, 4, 1636); + &ff_wmv2_inter_table[0][0][1], 8, 4, + &ff_wmv2_inter_table[0][0][0], 8, 4, 1636); INIT_VLC_STATIC(&ff_mb_non_intra_vlc[1], MB_NON_INTRA_VLC_BITS, 128, - &wmv2_inter_table[1][0][1], 8, 4, - &wmv2_inter_table[1][0][0], 8, 4, 2648); + &ff_wmv2_inter_table[1][0][1], 8, 4, + &ff_wmv2_inter_table[1][0][0], 8, 4, 2648); INIT_VLC_STATIC(&ff_mb_non_intra_vlc[2], MB_NON_INTRA_VLC_BITS, 128, - &wmv2_inter_table[2][0][1], 8, 4, - &wmv2_inter_table[2][0][0], 8, 4, 1532); + &ff_wmv2_inter_table[2][0][1], 8, 4, + &ff_wmv2_inter_table[2][0][0], 8, 4, 1532); INIT_VLC_STATIC(&ff_mb_non_intra_vlc[3], MB_NON_INTRA_VLC_BITS, 128, - &wmv2_inter_table[3][0][1], 8, 4, - &wmv2_inter_table[3][0][0], 8, 4, 2488); + &ff_wmv2_inter_table[3][0][1], 8, 4, + &ff_wmv2_inter_table[3][0][0], 8, 4, 2488); INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64, &ff_msmp4_mb_i_table[0][1], 4, 2, &ff_msmp4_mb_i_table[0][0], 4, 2, 536); INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, - &table_inter_intra[0][1], 2, 1, - &table_inter_intra[0][0], 2, 1, 8); + &ff_table_inter_intra[0][1], 2, 1, + &ff_table_inter_intra[0][0], 2, 1, 8); } switch(s->msmpeg4_version){ @@ -1363,7 +1363,7 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx) return 0; } -int msmpeg4_decode_picture_header(MpegEncContext * s) +int ff_msmpeg4_decode_picture_header(MpegEncContext * s) { int code; @@ -1430,7 +1430,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s) s->dc_table_index = get_bits1(&s->gb); break; case 4: - msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8); + ff_msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8); if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb); else s->per_mb_rl_table= 0; @@ -1517,7 +1517,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s) return 0; } -int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) +int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) { int left= buf_size*8 - get_bits_count(&s->gb); int length= s->msmpeg4_version>=3 ? 17 : 16; @@ -1627,13 +1627,13 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, else return -1; } if (n < 4) { - rl = &rl_table[s->rl_table_index]; + rl = &ff_rl_table[s->rl_table_index]; if(level > 256*s->y_dc_scale){ av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ L qscale: %d//\n", s->qscale); if(!s->inter_intra_pred) return -1; } } else { - rl = &rl_table[3 + s->rl_chroma_table_index]; + rl = &ff_rl_table[3 + s->rl_chroma_table_index]; if(level > 256*s->c_dc_scale){ av_log(s->avctx, AV_LOG_ERROR, "dc overflow+ C qscale: %d//\n", s->qscale); if(!s->inter_intra_pred) return -1; @@ -1659,7 +1659,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, qmul = s->qscale << 1; qadd = (s->qscale - 1) | 1; i = -1; - rl = &rl_table[3 + s->rl_table_index]; + rl = &ff_rl_table[3 + s->rl_table_index]; if(s->msmpeg4_version==2) run_diff = 0; @@ -1829,7 +1829,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, } not_coded: if (s->mb_intra) { - mpeg4_pred_ac(s, block, n, dc_pred_dir); + ff_mpeg4_pred_ac(s, block, n, dc_pred_dir); if (s->ac_pred) { i = 63; /* XXX: not optimal */ } @@ -1846,7 +1846,7 @@ int ff_msmpeg4_decode_motion(MpegEncContext * s, MVTable *mv; int code, mx, my; - mv = &mv_tables[s->mv_table_index]; + mv = &ff_mv_tables[s->mv_table_index]; code = get_vlc2(&s->gb, mv->vlc.table, MV_VLC_BITS, 2); if (code < 0){ diff --git a/libavcodec/msmpeg4data.c b/libavcodec/msmpeg4data.c index c071516365..266ea2ec5d 100644 --- a/libavcodec/msmpeg4data.c +++ b/libavcodec/msmpeg4data.c @@ -54,7 +54,7 @@ const uint16_t ff_msmp4_mb_i_table[64][2] = { }; /* non intra picture macroblock coded block pattern + mb type */ -const uint32_t table_mb_non_intra[128][2] = { +const uint32_t ff_table_mb_non_intra[128][2] = { { 0x40, 7 },{ 0x13c9, 13 },{ 0x9fd, 12 },{ 0x1fc, 15 }, { 0x9fc, 12 },{ 0xa83, 18 },{ 0x12d34, 17 },{ 0x83bc, 16 }, { 0x83a, 12 },{ 0x7f8, 17 },{ 0x3fd, 16 },{ 0x3ff, 16 }, @@ -592,15 +592,15 @@ static const int8_t table4_run[168] = { 29, 30, 31, 32, 33, 34, 35, 36, }; -extern const uint16_t inter_vlc[103][2]; -extern const int8_t inter_level[102]; -extern const int8_t inter_run[102]; +extern const uint16_t ff_inter_vlc[103][2]; +extern const int8_t ff_inter_level[102]; +extern const int8_t ff_inter_run[102]; extern const uint16_t ff_mpeg4_intra_vlc[103][2]; extern const int8_t ff_mpeg4_intra_level[102]; extern const int8_t ff_mpeg4_intra_run[102]; -RLTable rl_table[NB_RL_TABLES] = { +RLTable ff_rl_table[NB_RL_TABLES] = { /* intra luminance tables */ /* low motion */ { @@ -647,9 +647,9 @@ RLTable rl_table[NB_RL_TABLES] = { { 102, 58, - inter_vlc, - inter_run, - inter_level, + ff_inter_vlc, + ff_inter_run, + ff_inter_level, }, }; @@ -1784,7 +1784,7 @@ static const uint8_t table1_mvy[1099] = { 34, 28, 21, }; -MVTable mv_tables[2] = { +MVTable ff_mv_tables[2] = { { 1099, table0_mv_code, @@ -1801,30 +1801,30 @@ MVTable mv_tables[2] = { } }; -const uint8_t v2_mb_type[8][2] = { +const uint8_t ff_v2_mb_type[8][2] = { {1, 1}, {0 , 2}, {3 , 3}, {9 , 5}, {5, 4}, {0x21, 7}, {0x20, 7}, {0x11, 6}, }; -const uint8_t v2_intra_cbpc[4][2] = { +const uint8_t ff_v2_intra_cbpc[4][2] = { {1, 1}, {0, 3}, {1, 3}, {1, 2}, }; -const uint8_t wmv1_y_dc_scale_table[32]={ +const uint8_t ff_wmv1_y_dc_scale_table[32]={ // 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 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 }; -const uint8_t wmv1_c_dc_scale_table[32]={ +const uint8_t ff_wmv1_c_dc_scale_table[32]={ // 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 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 }; -const uint8_t old_ff_y_dc_scale_table[32]={ +const uint8_t ff_old_ff_y_dc_scale_table[32]={ // 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 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 }; -const uint8_t wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={ +const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={ { 0x00, 0x08, 0x01, 0x02, 0x09, 0x10, 0x18, 0x11, 0x0A, 0x03, 0x04, 0x0B, 0x12, 0x19, 0x20, 0x28, @@ -1867,7 +1867,7 @@ const uint8_t wmv1_scantable[WMV1_SCANTABLE_COUNT][64]={ } }; -const uint8_t table_inter_intra[4][2]={ +const uint8_t ff_table_inter_intra[4][2]={ {0,1} /*Luma-Left Chroma-Left*/, {2,2} /*Luma-Top Chroma-Left*/, {6,3} /*luma-Left Chroma-Top */, @@ -1979,21 +1979,21 @@ static const uint32_t table_mb_non_intra4[128][2] = { {0x000011, 5}, {0x0001AC, 9}, {0x0000F3, 8}, {0x000439, 11}, }; -const uint32_t (* const wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={ +const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]={ table_mb_non_intra2, table_mb_non_intra3, table_mb_non_intra4, - table_mb_non_intra, + ff_table_mb_non_intra, }; -const uint8_t wmv2_scantableA[64]={ +const uint8_t ff_wmv2_scantableA[64]={ 0x00, 0x01, 0x02, 0x08, 0x03, 0x09, 0x0A, 0x10, 0x04, 0x0B, 0x11, 0x18, 0x12, 0x0C, 0x05, 0x13, 0x19, 0x0D, 0x14, 0x1A, 0x1B, 0x06, 0x15, 0x1C, 0x0E, 0x16, 0x1D, 0x07, 0x1E, 0x0F, 0x17, 0x1F, }; -const uint8_t wmv2_scantableB[64]={ +const uint8_t ff_wmv2_scantableB[64]={ 0x00, 0x08, 0x01, 0x10, 0x09, 0x18, 0x11, 0x02, 0x20, 0x0A, 0x19, 0x28, 0x12, 0x30, 0x21, 0x1A, 0x38, 0x29, 0x22, 0x03, 0x31, 0x39, 0x0B, 0x2A, diff --git a/libavcodec/msmpeg4data.h b/libavcodec/msmpeg4data.h index 008265a2ca..c32c09e241 100644 --- a/libavcodec/msmpeg4data.h +++ b/libavcodec/msmpeg4data.h @@ -54,23 +54,23 @@ extern const uint16_t ff_msmp4_mb_i_table[64][2]; #define WMV1_SCANTABLE_COUNT 4 -extern const uint8_t wmv1_scantable[WMV1_SCANTABLE_COUNT][64]; +extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]; #define NB_RL_TABLES 6 -extern RLTable rl_table[NB_RL_TABLES]; +extern RLTable ff_rl_table[NB_RL_TABLES]; -extern const uint8_t wmv1_y_dc_scale_table[32]; -extern const uint8_t wmv1_c_dc_scale_table[32]; -extern const uint8_t old_ff_y_dc_scale_table[32]; +extern const uint8_t ff_wmv1_y_dc_scale_table[32]; +extern const uint8_t ff_wmv1_c_dc_scale_table[32]; +extern const uint8_t ff_old_ff_y_dc_scale_table[32]; -extern MVTable mv_tables[2]; +extern MVTable ff_mv_tables[2]; -extern const uint8_t v2_mb_type[8][2]; -extern const uint8_t v2_intra_cbpc[4][2]; +extern const uint8_t ff_v2_mb_type[8][2]; +extern const uint8_t ff_v2_intra_cbpc[4][2]; -extern const uint32_t table_mb_non_intra[128][2]; -extern const uint8_t table_inter_intra[4][2]; +extern const uint32_t ff_table_mb_non_intra[128][2]; +extern const uint8_t ff_table_inter_intra[4][2]; extern const uint32_t ff_table0_dc_lum[120][2]; extern const uint32_t ff_table1_dc_lum[120][2]; @@ -78,9 +78,9 @@ extern const uint32_t ff_table0_dc_chroma[120][2]; extern const uint32_t ff_table1_dc_chroma[120][2]; #define WMV2_INTER_CBP_TABLE_COUNT 4 -extern const uint32_t (* const wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]; +extern const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]; -extern const uint8_t wmv2_scantableA[64]; -extern const uint8_t wmv2_scantableB[64]; +extern const uint8_t ff_wmv2_scantableA[64]; +extern const uint8_t ff_wmv2_scantableB[64]; #endif /* AVCODEC_MSMPEG4DATA_H */ diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index de26dc6a41..c74d54ec19 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -122,7 +122,7 @@ static av_cold int decode_init(AVCodecContext * avctx) { av_lfg_init(&s->random_state, 0); ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0); - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); if (avctx->request_sample_fmt == AV_SAMPLE_FMT_FLT) { s->scale_bias = 1.0/(32768*8); diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 725270c9fa..5ee1d72bcc 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -148,7 +148,7 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->frame_size = NELLY_SAMPLES; s->avctx = avctx; ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0); - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); /* Generate overlap window */ ff_sine_window_init(ff_sine_128, 128); diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index c82034a96b..50bc4e6447 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -125,10 +125,10 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, int qualit av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); return AVERROR(ENOMEM); } - rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); return 1; } else if (quality != c->quality) - rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); return 0; } @@ -160,7 +160,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ret = get_quant(avctx, c, buf, buf_size); if (ret < 0) return ret; - rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, c->cq); return orig_size; } @@ -238,7 +238,7 @@ retry: } case NUV_RTJPEG_IN_LZO: case NUV_RTJPEG: { - rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size); + ff_rtjpeg_decode_frame_yuv420(&c->rtj, &c->pic, buf, buf_size); break; } case NUV_BLACK: { @@ -272,7 +272,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { c->codec_frameheader = avctx->codec_tag == MKTAG('R', 'J', 'P', 'G'); if (avctx->extradata_size) get_quant(avctx, c, avctx->extradata, avctx->extradata_size); - dsputil_init(&c->dsp, avctx); + ff_dsputil_init(&c->dsp, avctx); if (codec_reinit(avctx, avctx->width, avctx->height, -1) < 0) return 1; return 0; diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 5933bbb38a..69ca8e469d 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -410,7 +410,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx){ avcodec_get_frame_defaults(&s->picture); avctx->coded_frame= &s->picture; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED); if(avctx->pix_fmt == PIX_FMT_MONOBLACK) diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c index 7f36fa9aad..c4c9dbaf9f 100644 --- a/libavcodec/ppc/dsputil_altivec.c +++ b/libavcodec/ppc/dsputil_altivec.c @@ -609,7 +609,7 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) { } /* next one assumes that ((line_size % 16) == 0) */ -void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) +void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) { register vector unsigned char pixelsv1, pixelsv2; register vector unsigned char pixelsv1B, pixelsv2B; @@ -651,7 +651,7 @@ void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, /* next one assumes that ((line_size % 16) == 0) */ #define op_avg(a,b) a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) ) -void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) +void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) { register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv; 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 } } -void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; @@ -1391,10 +1391,10 @@ void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx) if (!high_bit_depth) { c->get_pixels = get_pixels_altivec; c->clear_block = clear_block_altivec; - c->put_pixels_tab[0][0] = put_pixels16_altivec; + c->put_pixels_tab[0][0] = ff_put_pixels16_altivec; /* the two functions do the same thing, so use the same code */ - c->put_no_rnd_pixels_tab[0][0] = put_pixels16_altivec; - c->avg_pixels_tab[0][0] = avg_pixels16_altivec; + c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_altivec; + c->avg_pixels_tab[0][0] = ff_avg_pixels16_altivec; c->avg_pixels_tab[1][0] = avg_pixels8_altivec; c->avg_pixels_tab[1][3] = avg_pixels8_xy2_altivec; c->put_pixels_tab[1][3] = put_pixels8_xy2_altivec; diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h index 4147eec823..6c87782e6d 100644 --- a/libavcodec/ppc/dsputil_altivec.h +++ b/libavcodec/ppc/dsputil_altivec.h @@ -26,24 +26,24 @@ #include <stdint.h> #include "libavcodec/dsputil.h" -void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h); +void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h); +void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void fdct_altivec(int16_t *block); -void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, - int x16, int y16, int rounder); -void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); -void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); +void ff_fdct_altivec(int16_t *block); +void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, + int x16, int y16, int rounder); +void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); +void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); void ff_vp3_idct_altivec(DCTELEM *block); void ff_vp3_idct_put_altivec(uint8_t *dest, int line_size, DCTELEM *block); void ff_vp3_idct_add_altivec(uint8_t *dest, int line_size, DCTELEM *block); -void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx); -void float_init_altivec(DSPContext* c, AVCodecContext *avctx); -void int_init_altivec(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx); +void ff_float_init_altivec(DSPContext* c, AVCodecContext *avctx); +void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx); #endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */ diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index 568f072b54..195aa20906 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -143,7 +143,7 @@ static void prefetch_ppc(void *mem, int stride, int h) } while(--h); } -void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; int mm_flags = av_get_cpu_flags(); @@ -171,27 +171,27 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) } #if HAVE_ALTIVEC - if(CONFIG_H264_DECODER) dsputil_h264_init_ppc(c, avctx); + if(CONFIG_H264_DECODER) ff_dsputil_h264_init_ppc(c, avctx); if (mm_flags & AV_CPU_FLAG_ALTIVEC) { - dsputil_init_altivec(c, avctx); - float_init_altivec(c, avctx); - int_init_altivec(c, avctx); - c->gmc1 = gmc1_altivec; + ff_dsputil_init_altivec(c, avctx); + ff_float_init_altivec(c, avctx); + ff_int_init_altivec(c, avctx); + c->gmc1 = ff_gmc1_altivec; #if CONFIG_ENCODERS if (avctx->bits_per_raw_sample <= 8 && (avctx->dct_algo == FF_DCT_AUTO || avctx->dct_algo == FF_DCT_ALTIVEC)) { - c->fdct = fdct_altivec; + c->fdct = ff_fdct_altivec; } #endif //CONFIG_ENCODERS if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) { if ((avctx->idct_algo == FF_IDCT_AUTO) || (avctx->idct_algo == FF_IDCT_ALTIVEC)) { - c->idct_put = idct_put_altivec; - c->idct_add = idct_add_altivec; + c->idct_put = ff_idct_put_altivec; + c->idct_add = ff_idct_add_altivec; c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; }else if((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER) && avctx->idct_algo==FF_IDCT_VP3){ diff --git a/libavcodec/ppc/fdct_altivec.c b/libavcodec/ppc/fdct_altivec.c index 1cc6f89f4d..608dac4295 100644 --- a/libavcodec/ppc/fdct_altivec.c +++ b/libavcodec/ppc/fdct_altivec.c @@ -195,7 +195,7 @@ static vector float fdctconsts[3] = { /* two dimensional discrete cosine transform */ -void fdct_altivec(int16_t *block) +void ff_fdct_altivec(int16_t *block) { vector signed short *bp; vector float *cp; diff --git a/libavcodec/ppc/float_altivec.c b/libavcodec/ppc/float_altivec.c index ba97cbfd3b..a724a46d5c 100644 --- a/libavcodec/ppc/float_altivec.c +++ b/libavcodec/ppc/float_altivec.c @@ -122,7 +122,7 @@ static void vector_fmul_window_altivec(float *dst, const float *src0, const floa } } -void float_init_altivec(DSPContext* c, AVCodecContext *avctx) +void ff_float_init_altivec(DSPContext* c, AVCodecContext *avctx) { c->vector_fmul = vector_fmul_altivec; c->vector_fmul_reverse = vector_fmul_reverse_altivec; diff --git a/libavcodec/ppc/gmc_altivec.c b/libavcodec/ppc/gmc_altivec.c index 0e93c337f7..f966165436 100644 --- a/libavcodec/ppc/gmc_altivec.c +++ b/libavcodec/ppc/gmc_altivec.c @@ -29,7 +29,7 @@ altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8, to preserve proper dst alignment. */ -void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder) +void ff_gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder) { const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder; const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] = diff --git a/libavcodec/ppc/h264_altivec.c b/libavcodec/ppc/h264_altivec.c index 9b3622a673..4589c4f96d 100644 --- a/libavcodec/ppc/h264_altivec.c +++ b/libavcodec/ppc/h264_altivec.c @@ -72,7 +72,7 @@ #define H264_MC(OPNAME, SIZE, CODETYPE) \ static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, int stride){\ - OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\ + ff_ ## OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\ }\ \ 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, H264_WEIGHT(16) H264_WEIGHT( 8) -void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) { +void ff_dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) { diff --git a/libavcodec/ppc/idct_altivec.c b/libavcodec/ppc/idct_altivec.c index f1c95c1557..dbf234536c 100644 --- a/libavcodec/ppc/idct_altivec.c +++ b/libavcodec/ppc/idct_altivec.c @@ -158,7 +158,7 @@ static const vec_s16 constants[5] = { {19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722} }; -void idct_put_altivec(uint8_t* dest, int stride, int16_t *blk) +void ff_idct_put_altivec(uint8_t* dest, int stride, int16_t *blk) { vec_s16 *block = (vec_s16*)blk; vec_u8 tmp; @@ -180,7 +180,7 @@ void idct_put_altivec(uint8_t* dest, int stride, int16_t *blk) COPY (dest, vx7) } -void idct_add_altivec(uint8_t* dest, int stride, int16_t *blk) +void ff_idct_add_altivec(uint8_t* dest, int stride, int16_t *blk) { vec_s16 *block = (vec_s16*)blk; vec_u8 tmp; diff --git a/libavcodec/ppc/int_altivec.c b/libavcodec/ppc/int_altivec.c index 61c18c8154..1d7aa1840e 100644 --- a/libavcodec/ppc/int_altivec.c +++ b/libavcodec/ppc/int_altivec.c @@ -144,7 +144,7 @@ static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, const int16_t * return ires; } -void int_init_altivec(DSPContext* c, AVCodecContext *avctx) +void ff_int_init_altivec(DSPContext* c, AVCodecContext *avctx) { c->ssd_int8_vs_int16 = ssd_int8_vs_int16_altivec; c->scalarproduct_int16 = scalarproduct_int16_altivec; diff --git a/libavcodec/ppc/mpegvideo_altivec.c b/libavcodec/ppc/mpegvideo_altivec.c index 297e7fefce..333ca601b3 100644 --- a/libavcodec/ppc/mpegvideo_altivec.c +++ b/libavcodec/ppc/mpegvideo_altivec.c @@ -559,7 +559,7 @@ static void dct_unquantize_h263_altivec(MpegEncContext *s, } -void MPV_common_init_altivec(MpegEncContext *s) +void ff_MPV_common_init_altivec(MpegEncContext *s) { if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return; diff --git a/libavcodec/ppc/vp8dsp_altivec.c b/libavcodec/ppc/vp8dsp_altivec.c index 28d23cb9aa..e9defbc67f 100644 --- a/libavcodec/ppc/vp8dsp_altivec.c +++ b/libavcodec/ppc/vp8dsp_altivec.c @@ -268,7 +268,7 @@ EPEL_HV(4, 4,4) static void put_vp8_pixels16_altivec(uint8_t *dst, int stride, uint8_t *src, int s, int h, int mx, int my) { - put_pixels16_altivec(dst, src, stride, h); + ff_put_pixels16_altivec(dst, src, stride, h); } av_cold void ff_vp8dsp_init_altivec(VP8DSPContext *c) diff --git a/libavcodec/proresdata.c b/libavcodec/proresdata.c new file mode 100644 index 0000000000..fcaf32a1af --- /dev/null +++ b/libavcodec/proresdata.c @@ -0,0 +1,72 @@ +/* + * Apple ProRes compatible decoder + * + * Copyright (c) 2010-2011 Maxim Poliakovski + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "proresdata.h" + +const uint8_t ff_prores_progressive_scan[64] = { + 0, 1, 8, 9, 2, 3, 10, 11, + 16, 17, 24, 25, 18, 19, 26, 27, + 4, 5, 12, 20, 13, 6, 7, 14, + 21, 28, 29, 22, 15, 23, 30, 31, + 32, 33, 40, 48, 41, 34, 35, 42, + 49, 56, 57, 50, 43, 36, 37, 44, + 51, 58, 59, 52, 45, 38, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63 +}; + +const uint8_t ff_prores_interlaced_scan[64] = { + 0, 8, 1, 9, 16, 24, 17, 25, + 2, 10, 3, 11, 18, 26, 19, 27, + 32, 40, 33, 34, 41, 48, 56, 49, + 42, 35, 43, 50, 57, 58, 51, 59, + 4, 12, 5, 6, 13, 20, 28, 21, + 14, 7, 15, 22, 29, 36, 44, 37, + 30, 23, 31, 38, 45, 52, 60, 53, + 46, 39, 47, 54, 61, 62, 55, 63 +}; + + +const uint8_t ff_prores_dc_codebook[4] = { + 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 + 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 + 0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1 + 0x70 // rice_order = 3, exp_golomb_order = 4, switch_bits = 0 +}; + +const uint8_t ff_prores_ac_codebook[7] = { + 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 + 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 + 0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0 + 0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1 + 0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1 + 0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2 + 0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2 +}; + +/** + * Lookup tables for adaptive switching between codebooks + * according with previous run/level value. + */ +const uint8_t ff_prores_run_to_cb_index[16] = + { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 }; + +const uint8_t ff_prores_lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 }; diff --git a/libavcodec/proresdata.h b/libavcodec/proresdata.h new file mode 100644 index 0000000000..1e5d05ece6 --- /dev/null +++ b/libavcodec/proresdata.h @@ -0,0 +1,39 @@ +/* + * Apple ProRes compatible decoder + * + * Copyright (c) 2010-2011 Maxim Poliakovski + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_PRORESDATA_H +#define AVCODEC_PRORESDATA_H + +#include <stdint.h> + +#define FRAME_ID MKBETAG('i', 'c', 'p', 'f') + +extern const uint8_t ff_prores_progressive_scan[64]; +extern const uint8_t ff_prores_interlaced_scan[64]; + +#define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0 +extern const uint8_t ff_prores_dc_codebook[4]; +extern const uint8_t ff_prores_ac_codebook[7]; +extern const uint8_t ff_prores_run_to_cb_index[16]; +extern const uint8_t ff_prores_lev_to_cb_index[10]; + +#endif /* AVCODEC_PRORESDATA_H */ diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index 33653de71a..1070193c96 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -34,6 +34,7 @@ #include "libavutil/intmath.h" #include "avcodec.h" +#include "proresdata.h" #include "proresdsp.h" #include "get_bits.h" @@ -42,7 +43,10 @@ typedef struct { int slice_num; int x_pos, y_pos; int slice_width; + int prev_slice_sf; ///< scalefactor of the previous decoded slice DECLARE_ALIGNED(16, DCTELEM, blocks)[8 * 4 * 64]; + DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64]; + DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64]; } ProresThreadData; typedef struct { @@ -56,9 +60,6 @@ typedef struct { uint8_t qmat_luma[64]; ///< dequantization matrix for luma uint8_t qmat_chroma[64]; ///< dequantization matrix for chroma int qmat_changed; ///< 1 - global quantization matrices changed - int prev_slice_sf; ///< scalefactor of the previous decoded slice - DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64]; - DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64]; int total_slices; ///< total number of slices in a picture ProresThreadData *slice_data; int pic_num; @@ -75,29 +76,6 @@ typedef struct { } ProresContext; -static const uint8_t progressive_scan[64] = { - 0, 1, 8, 9, 2, 3, 10, 11, - 16, 17, 24, 25, 18, 19, 26, 27, - 4, 5, 12, 20, 13, 6, 7, 14, - 21, 28, 29, 22, 15, 23, 30, 31, - 32, 33, 40, 48, 41, 34, 35, 42, - 49, 56, 57, 50, 43, 36, 37, 44, - 51, 58, 59, 52, 45, 38, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63 -}; - -static const uint8_t interlaced_scan[64] = { - 0, 8, 1, 9, 16, 24, 17, 25, - 2, 10, 3, 11, 18, 26, 19, 27, - 32, 40, 33, 34, 41, 48, 56, 49, - 42, 35, 43, 50, 57, 58, 51, 59, - 4, 12, 5, 6, 13, 20, 28, 21, - 14, 7, 15, 22, 29, 36, 44, 37, - 30, 23, 31, 38, 45, 52, 60, 53, - 46, 39, 47, 54, 61, 62, 55, 63 -}; - - static av_cold int decode_init(AVCodecContext *avctx) { ProresContext *ctx = avctx->priv_data; @@ -116,7 +94,6 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->scantable_type = -1; // set scantable type to uninitialized memset(ctx->qmat_luma, 4, 64); memset(ctx->qmat_chroma, 4, 64); - ctx->prev_slice_sf = 0; return 0; } @@ -176,10 +153,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, if (ctx->scantable_type != ctx->frame_type) { if (!ctx->frame_type) ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, - progressive_scan); + ff_prores_progressive_scan); else ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, - interlaced_scan); + ff_prores_interlaced_scan); ctx->scantable_type = ctx->frame_type; } @@ -294,9 +271,11 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf, for (i = 0; i < num_slices; i++) { ctx->slice_data[i].index = data_ptr; + ctx->slice_data[i].prev_slice_sf = 0; data_ptr += AV_RB16(index_ptr + i * 2); } ctx->slice_data[i].index = data_ptr; + ctx->slice_data[i].prev_slice_sf = 0; if (data_ptr > buf + data_size) { 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) #define LSB2SIGN(x) (-((x) & 1)) #define TOSIGNED(x) (((x) >> 1) ^ LSB2SIGN(x)) -#define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0 - -static uint8_t dc_codebook[4] = { - 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 - 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 - 0x4D, // rice_order = 2, exp_golomb_order = 3, switch_bits = 1 - 0x70 // rice_order = 3, exp_golomb_order = 4, switch_bits = 0 -}; - - /** * Decode DC coefficients for all blocks in a slice. */ @@ -379,7 +348,7 @@ static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, delta = 3; for (i = 1; i < nblocks; i++, out += 64) { - code = decode_vlc_codeword(gb, dc_codebook[FFMIN(FFABS(delta), 3)]); + code = decode_vlc_codeword(gb, ff_prores_dc_codebook[FFMIN(FFABS(delta), 3)]); sign = -(((delta >> 15) & 1) ^ (code & 1)); delta = (((code + 1) >> 1) ^ sign) - sign; @@ -389,26 +358,6 @@ static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, } -static uint8_t ac_codebook[7] = { - 0x04, // rice_order = 0, exp_golomb_order = 1, switch_bits = 0 - 0x28, // rice_order = 1, exp_golomb_order = 2, switch_bits = 0 - 0x4C, // rice_order = 2, exp_golomb_order = 3, switch_bits = 0 - 0x05, // rice_order = 0, exp_golomb_order = 1, switch_bits = 1 - 0x29, // rice_order = 1, exp_golomb_order = 2, switch_bits = 1 - 0x06, // rice_order = 0, exp_golomb_order = 1, switch_bits = 2 - 0x0A, // rice_order = 0, exp_golomb_order = 2, switch_bits = 2 -}; - -/** - * Lookup tables for adaptive switching between codebooks - * according with previous run/level value. - */ -static uint8_t run_to_cb_index[16] = - { 5, 5, 3, 3, 0, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 2 }; - -static uint8_t lev_to_cb_index[10] = { 0, 6, 3, 5, 0, 1, 1, 1, 1, 2 }; - - /** * Decode AC coefficients for all blocks in a slice. */ @@ -428,20 +377,20 @@ static inline void decode_ac_coeffs(GetBitContext *gb, DCTELEM *out, block_mask = blocks_per_slice - 1; for (pos = blocks_per_slice - 1; pos < max_coeffs;) { - run_cb_index = run_to_cb_index[FFMIN(run, 15)]; - lev_cb_index = lev_to_cb_index[FFMIN(level, 9)]; + run_cb_index = ff_prores_run_to_cb_index[FFMIN(run, 15)]; + lev_cb_index = ff_prores_lev_to_cb_index[FFMIN(level, 9)]; bits_left = get_bits_left(gb); if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left))) return; - run = decode_vlc_codeword(gb, ac_codebook[run_cb_index]); + run = decode_vlc_codeword(gb, ff_prores_ac_codebook[run_cb_index]); bits_left = get_bits_left(gb); if (bits_left <= 0 || (bits_left <= 8 && !show_bits(gb, bits_left))) return; - level = decode_vlc_codeword(gb, ac_codebook[lev_cb_index]) + 1; + level = decode_vlc_codeword(gb, ff_prores_ac_codebook[lev_cb_index]) + 1; pos += run + 1; if (pos >= max_coeffs) @@ -561,11 +510,11 @@ static int decode_slice(AVCodecContext *avctx, void *tdata) /* scale quantization matrixes according with slice's scale factor */ /* TODO: this can be SIMD-optimized a lot */ - if (ctx->qmat_changed || sf != ctx->prev_slice_sf) { - ctx->prev_slice_sf = sf; + if (ctx->qmat_changed || sf != td->prev_slice_sf) { + td->prev_slice_sf = sf; for (i = 0; i < 64; i++) { - ctx->qmat_luma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_luma[i] * sf; - ctx->qmat_chroma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_chroma[i] * sf; + td->qmat_luma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_luma[i] * sf; + td->qmat_chroma_scaled[ctx->dsp.idct_permutation[i]] = ctx->qmat_chroma[i] * sf; } } @@ -574,7 +523,7 @@ static int decode_slice(AVCodecContext *avctx, void *tdata) (uint16_t*) (y_data + (mb_y_pos << 4) * y_linesize + (mb_x_pos << 5)), y_linesize, mbs_per_slice, 4, slice_width_factor + 2, - ctx->qmat_luma_scaled); + td->qmat_luma_scaled); /* decode U chroma plane */ 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) (mb_x_pos << ctx->mb_chroma_factor)), u_linesize, mbs_per_slice, ctx->num_chroma_blocks, slice_width_factor + ctx->chroma_factor - 1, - ctx->qmat_chroma_scaled); + td->qmat_chroma_scaled); /* decode V chroma plane */ 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) (mb_x_pos << ctx->mb_chroma_factor)), v_linesize, mbs_per_slice, ctx->num_chroma_blocks, slice_width_factor + ctx->chroma_factor - 1, - ctx->qmat_chroma_scaled); + td->qmat_chroma_scaled); return 0; } @@ -628,7 +577,6 @@ static int decode_picture(ProresContext *ctx, int pic_num, } -#define FRAME_ID MKBETAG('i', 'c', 'p', 'f') #define MOVE_DATA_PTR(nbytes) buf += (nbytes); buf_size -= (nbytes) static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c index 739ee2b3ec..2195b93e2d 100644 --- a/libavcodec/proresdsp.c +++ b/libavcodec/proresdsp.c @@ -51,13 +51,30 @@ static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const put_pixels(out, linesize >> 1, block); } +static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block) +{ + int x, y; + const uint16_t *tsrc = src; + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) + block[y * 8 + x] = tsrc[x]; + tsrc += linesize >> 1; + } + ff_jpeg_fdct_islow_10(block); +} + void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) { dsp->idct_put = prores_idct_put_c; dsp->idct_permutation_type = FF_NO_IDCT_PERM; + dsp->fdct = prores_fdct_c; + dsp->dct_permutation_type = FF_NO_IDCT_PERM; if (HAVE_MMX) ff_proresdsp_x86_init(dsp, avctx); ff_init_scantable_permutation(dsp->idct_permutation, dsp->idct_permutation_type); + ff_init_scantable_permutation(dsp->dct_permutation, + dsp->dct_permutation_type); } diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h index 7e81b0870c..57e8fb2408 100644 --- a/libavcodec/proresdsp.h +++ b/libavcodec/proresdsp.h @@ -30,7 +30,10 @@ typedef struct { int idct_permutation_type; uint8_t idct_permutation[64]; + int dct_permutation_type; + uint8_t dct_permutation[64]; void (* idct_put) (uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat); + void (* fdct) (const uint16_t *src, int linesize, DCTELEM *block); } ProresDSPContext; void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c new file mode 100644 index 0000000000..293735515b --- /dev/null +++ b/libavcodec/proresenc_kostya.c @@ -0,0 +1,836 @@ +/* + * Apple ProRes encoder + * + * Copyright (c) 2012 Konstantin Shishkov + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/opt.h" +#include "avcodec.h" +#include "put_bits.h" +#include "bytestream.h" +#include "internal.h" +#include "proresdsp.h" +#include "proresdata.h" + +#define CFACTOR_Y422 2 +#define CFACTOR_Y444 3 + +#define MAX_MBS_PER_SLICE 8 + +#define MAX_PLANES 3 // should be increased to 4 when there's PIX_FMT_YUV444AP10 + +enum { + PRORES_PROFILE_PROXY = 0, + PRORES_PROFILE_LT, + PRORES_PROFILE_STANDARD, + PRORES_PROFILE_HQ, +}; + +#define NUM_MB_LIMITS 4 +static const int prores_mb_limits[NUM_MB_LIMITS] = { + 1620, // up to 720x576 + 2700, // up to 960x720 + 6075, // up to 1440x1080 + 9216, // up to 2048x1152 +}; + +static const struct prores_profile { + const char *full_name; + uint32_t tag; + int min_quant; + int max_quant; + int br_tab[NUM_MB_LIMITS]; + uint8_t quant[64]; +} prores_profile_info[4] = { + { + .full_name = "proxy", + .tag = MKTAG('a', 'p', 'c', 'o'), + .min_quant = 4, + .max_quant = 8, + .br_tab = { 300, 242, 220, 194 }, + .quant = { + 4, 7, 9, 11, 13, 14, 15, 63, + 7, 7, 11, 12, 14, 15, 63, 63, + 9, 11, 13, 14, 15, 63, 63, 63, + 11, 11, 13, 14, 63, 63, 63, 63, + 11, 13, 14, 63, 63, 63, 63, 63, + 13, 14, 63, 63, 63, 63, 63, 63, + 13, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, + }, + }, + { + .full_name = "LT", + .tag = MKTAG('a', 'p', 'c', 's'), + .min_quant = 1, + .max_quant = 9, + .br_tab = { 720, 560, 490, 440 }, + .quant = { + 4, 5, 6, 7, 9, 11, 13, 15, + 5, 5, 7, 8, 11, 13, 15, 17, + 6, 7, 9, 11, 13, 15, 15, 17, + 7, 7, 9, 11, 13, 15, 17, 19, + 7, 9, 11, 13, 14, 16, 19, 23, + 9, 11, 13, 14, 16, 19, 23, 29, + 9, 11, 13, 15, 17, 21, 28, 35, + 11, 13, 16, 17, 21, 28, 35, 41, + }, + }, + { + .full_name = "standard", + .tag = MKTAG('a', 'p', 'c', 'n'), + .min_quant = 1, + .max_quant = 6, + .br_tab = { 1050, 808, 710, 632 }, + .quant = { + 4, 4, 5, 5, 6, 7, 7, 9, + 4, 4, 5, 6, 7, 7, 9, 9, + 5, 5, 6, 7, 7, 9, 9, 10, + 5, 5, 6, 7, 7, 9, 9, 10, + 5, 6, 7, 7, 8, 9, 10, 12, + 6, 7, 7, 8, 9, 10, 12, 15, + 6, 7, 7, 9, 10, 11, 14, 17, + 7, 7, 9, 10, 11, 14, 17, 21, + }, + }, + { + .full_name = "high quality", + .tag = MKTAG('a', 'p', 'c', 'h'), + .min_quant = 1, + .max_quant = 6, + .br_tab = { 1566, 1216, 1070, 950 }, + .quant = { + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 5, + 4, 4, 4, 4, 4, 4, 5, 5, + 4, 4, 4, 4, 4, 5, 5, 6, + 4, 4, 4, 4, 5, 5, 6, 7, + 4, 4, 4, 4, 5, 6, 7, 7, + }, + } +// for 4444 profile bitrate numbers are { 2350, 1828, 1600, 1425 } +}; + +#define TRELLIS_WIDTH 16 +#define SCORE_LIMIT INT_MAX / 2 + +struct TrellisNode { + int prev_node; + int quant; + int bits; + int score; +}; + +typedef struct ProresContext { + AVClass *class; + DECLARE_ALIGNED(16, DCTELEM, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; + DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16]; + int16_t quants[16][64]; + + ProresDSPContext dsp; + ScanTable scantable; + + int mb_width, mb_height; + int mbs_per_slice; + int num_chroma_blocks, chroma_factor; + int slices_width; + int num_slices; + int num_planes; + int bits_per_mb; + + int profile; + const struct prores_profile *profile_info; + + struct TrellisNode *nodes; + int *slice_q; +} ProresContext; + +static void get_slice_data(ProresContext *ctx, const uint16_t *src, + int linesize, int x, int y, int w, int h, + DCTELEM *blocks, + int mbs_per_slice, int blocks_per_mb) +{ + const uint16_t *esrc; + const int mb_width = 4 * blocks_per_mb; + int elinesize; + int i, j, k; + + for (i = 0; i < mbs_per_slice; i++, src += mb_width) { + if (x >= w) { + memset(blocks, 0, 64 * (mbs_per_slice - i) * blocks_per_mb + * sizeof(*blocks)); + return; + } + if (x + mb_width <= w && y + 16 <= h) { + esrc = src; + elinesize = linesize; + } else { + int bw, bh, pix; + const int estride = 16 / sizeof(*ctx->emu_buf); + + esrc = ctx->emu_buf; + elinesize = 16; + + bw = FFMIN(w - x, mb_width); + bh = FFMIN(h - y, 16); + + for (j = 0; j < bh; j++) { + memcpy(ctx->emu_buf + j * estride, src + j * linesize, + bw * sizeof(*src)); + pix = ctx->emu_buf[j * estride + bw - 1]; + for (k = bw; k < mb_width; k++) + ctx->emu_buf[j * estride + k] = pix; + } + for (; j < 16; j++) + memcpy(ctx->emu_buf + j * estride, + ctx->emu_buf + (bh - 1) * estride, + mb_width * sizeof(*ctx->emu_buf)); + } + ctx->dsp.fdct(esrc, elinesize, blocks); + blocks += 64; + if (blocks_per_mb > 2) { + ctx->dsp.fdct(src + 8, linesize, blocks); + blocks += 64; + } + ctx->dsp.fdct(src + linesize * 4, linesize, blocks); + blocks += 64; + if (blocks_per_mb > 2) { + ctx->dsp.fdct(src + linesize * 4 + 8, linesize, blocks); + blocks += 64; + } + + x += mb_width; + } +} + +/** + * Write an unsigned rice/exp golomb codeword. + */ +static inline void encode_vlc_codeword(PutBitContext *pb, uint8_t codebook, int val) +{ + unsigned int rice_order, exp_order, switch_bits, switch_val; + int exponent; + + /* number of prefix bits to switch between Rice and expGolomb */ + switch_bits = (codebook & 3) + 1; + rice_order = codebook >> 5; /* rice code order */ + exp_order = (codebook >> 2) & 7; /* exp golomb code order */ + + switch_val = switch_bits << rice_order; + + if (val >= switch_val) { + val -= switch_val - (1 << exp_order); + exponent = av_log2(val); + + put_bits(pb, exponent - exp_order + switch_bits, 0); + put_bits(pb, 1, 1); + put_bits(pb, exponent, val); + } else { + exponent = val >> rice_order; + + if (exponent) + put_bits(pb, exponent, 0); + put_bits(pb, 1, 1); + if (rice_order) + put_sbits(pb, rice_order, val); + } +} + +#define GET_SIGN(x) ((x) >> 31) +#define MAKE_CODE(x) (((x) << 1) ^ GET_SIGN(x)) + +static void encode_dcs(PutBitContext *pb, DCTELEM *blocks, + int blocks_per_slice, int scale) +{ + int i; + int codebook = 3, code, dc, prev_dc, delta, sign, new_sign; + + prev_dc = (blocks[0] - 0x4000) / scale; + encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc)); + codebook = 3; + blocks += 64; + + for (i = 1; i < blocks_per_slice; i++, blocks += 64) { + dc = (blocks[0] - 0x4000) / scale; + delta = dc - prev_dc; + new_sign = GET_SIGN(delta); + delta = (delta ^ sign) - sign; + code = MAKE_CODE(delta); + encode_vlc_codeword(pb, ff_prores_dc_codebook[codebook], code); + codebook = (code + (code & 1)) >> 1; + codebook = FFMIN(codebook, 3); + sign = new_sign; + prev_dc = dc; + } +} + +static void encode_acs(PutBitContext *pb, DCTELEM *blocks, + int blocks_per_slice, + int plane_size_factor, + const uint8_t *scan, const int16_t *qmat) +{ + int idx, i; + int run, level, run_cb, lev_cb; + int max_coeffs, abs_level; + + max_coeffs = blocks_per_slice << 6; + run_cb = ff_prores_run_to_cb_index[4]; + lev_cb = ff_prores_lev_to_cb_index[2]; + run = 0; + + for (i = 1; i < 64; i++) { + for (idx = scan[i]; idx < max_coeffs; idx += 64) { + level = blocks[idx] / qmat[scan[i]]; + if (level) { + abs_level = FFABS(level); + encode_vlc_codeword(pb, ff_prores_ac_codebook[run_cb], run); + encode_vlc_codeword(pb, ff_prores_ac_codebook[lev_cb], + abs_level - 1); + put_sbits(pb, 1, GET_SIGN(level)); + + run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)]; + lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)]; + run = 0; + } else { + run++; + } + } + } +} + +static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb, + const uint16_t *src, int linesize, + int mbs_per_slice, DCTELEM *blocks, + int blocks_per_mb, int plane_size_factor, + const int16_t *qmat) +{ + int blocks_per_slice, saved_pos; + + saved_pos = put_bits_count(pb); + blocks_per_slice = mbs_per_slice * blocks_per_mb; + + encode_dcs(pb, blocks, blocks_per_slice, qmat[0]); + encode_acs(pb, blocks, blocks_per_slice, plane_size_factor, + ctx->scantable.permutated, qmat); + flush_put_bits(pb); + + return (put_bits_count(pb) - saved_pos) >> 3; +} + +static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, + PutBitContext *pb, + int sizes[4], int x, int y, int quant, + int mbs_per_slice) +{ + ProresContext *ctx = avctx->priv_data; + int i, xp, yp; + int total_size = 0; + const uint16_t *src; + int slice_width_factor = av_log2(mbs_per_slice); + int num_cblocks, pwidth; + int plane_factor, is_chroma; + + for (i = 0; i < ctx->num_planes; i++) { + is_chroma = (i == 1 || i == 2); + plane_factor = slice_width_factor + 2; + if (is_chroma) + plane_factor += ctx->chroma_factor - 3; + if (!is_chroma || ctx->chroma_factor == CFACTOR_Y444) { + xp = x << 4; + yp = y << 4; + num_cblocks = 4; + pwidth = avctx->width; + } else { + xp = x << 3; + yp = y << 4; + num_cblocks = 2; + pwidth = avctx->width >> 1; + } + src = (const uint16_t*)(pic->data[i] + yp * pic->linesize[i]) + xp; + + get_slice_data(ctx, src, pic->linesize[i], xp, yp, + pwidth, avctx->height, ctx->blocks[0], + mbs_per_slice, num_cblocks); + sizes[i] = encode_slice_plane(ctx, pb, src, pic->linesize[i], + mbs_per_slice, ctx->blocks[0], + num_cblocks, plane_factor, + ctx->quants[quant]); + total_size += sizes[i]; + } + return total_size; +} + +static inline int estimate_vlc(uint8_t codebook, int val) +{ + unsigned int rice_order, exp_order, switch_bits, switch_val; + int exponent; + + /* number of prefix bits to switch between Rice and expGolomb */ + switch_bits = (codebook & 3) + 1; + rice_order = codebook >> 5; /* rice code order */ + exp_order = (codebook >> 2) & 7; /* exp golomb code order */ + + switch_val = switch_bits << rice_order; + + if (val >= switch_val) { + val -= switch_val - (1 << exp_order); + exponent = av_log2(val); + + return exponent * 2 - exp_order + switch_bits + 1; + } else { + return (val >> rice_order) + rice_order + 1; + } +} + +static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice, + int scale) +{ + int i; + int codebook = 3, code, dc, prev_dc, delta, sign, new_sign; + int bits; + + prev_dc = (blocks[0] - 0x4000) / scale; + bits = estimate_vlc(FIRST_DC_CB, MAKE_CODE(prev_dc)); + codebook = 3; + blocks += 64; + *error += FFABS(blocks[0] - 0x4000) % scale; + + for (i = 1; i < blocks_per_slice; i++, blocks += 64) { + dc = (blocks[0] - 0x4000) / scale; + *error += FFABS(blocks[0] - 0x4000) % scale; + delta = dc - prev_dc; + new_sign = GET_SIGN(delta); + delta = (delta ^ sign) - sign; + code = MAKE_CODE(delta); + bits += estimate_vlc(ff_prores_dc_codebook[codebook], code); + codebook = (code + (code & 1)) >> 1; + codebook = FFMIN(codebook, 3); + sign = new_sign; + prev_dc = dc; + } + + return bits; +} + +static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice, + int plane_size_factor, + const uint8_t *scan, const int16_t *qmat) +{ + int idx, i; + int run, level, run_cb, lev_cb; + int max_coeffs, abs_level; + int bits = 0; + + max_coeffs = blocks_per_slice << 6; + run_cb = ff_prores_run_to_cb_index[4]; + lev_cb = ff_prores_lev_to_cb_index[2]; + run = 0; + + for (i = 1; i < 64; i++) { + for (idx = scan[i]; idx < max_coeffs; idx += 64) { + level = blocks[idx] / qmat[scan[i]]; + *error += FFABS(blocks[idx]) % qmat[scan[i]]; + if (level) { + abs_level = FFABS(level); + bits += estimate_vlc(ff_prores_ac_codebook[run_cb], run); + bits += estimate_vlc(ff_prores_ac_codebook[lev_cb], + abs_level - 1) + 1; + + run_cb = ff_prores_run_to_cb_index[FFMIN(run, 15)]; + lev_cb = ff_prores_lev_to_cb_index[FFMIN(abs_level, 9)]; + run = 0; + } else { + run++; + } + } + } + + return bits; +} + +static int estimate_slice_plane(ProresContext *ctx, int *error, int plane, + const uint16_t *src, int linesize, + int mbs_per_slice, + int blocks_per_mb, int plane_size_factor, + const int16_t *qmat) +{ + int blocks_per_slice; + int bits; + + blocks_per_slice = mbs_per_slice * blocks_per_mb; + + bits = estimate_dcs(error, ctx->blocks[plane], blocks_per_slice, qmat[0]); + bits += estimate_acs(error, ctx->blocks[plane], blocks_per_slice, + plane_size_factor, ctx->scantable.permutated, qmat); + + return FFALIGN(bits, 8); +} + +static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic, + int trellis_node, int x, int y, int mbs_per_slice) +{ + ProresContext *ctx = avctx->priv_data; + int i, q, pq, xp, yp; + const uint16_t *src; + int slice_width_factor = av_log2(mbs_per_slice); + int num_cblocks[MAX_PLANES], pwidth; + int plane_factor[MAX_PLANES], is_chroma[MAX_PLANES]; + const int min_quant = ctx->profile_info->min_quant; + const int max_quant = ctx->profile_info->max_quant; + int error, bits, bits_limit; + int mbs, prev, cur, new_score; + int slice_bits[TRELLIS_WIDTH], slice_score[TRELLIS_WIDTH]; + + mbs = x + mbs_per_slice; + + for (i = 0; i < ctx->num_planes; i++) { + is_chroma[i] = (i == 1 || i == 2); + plane_factor[i] = slice_width_factor + 2; + if (is_chroma[i]) + plane_factor[i] += ctx->chroma_factor - 3; + if (!is_chroma[i] || ctx->chroma_factor == CFACTOR_Y444) { + xp = x << 4; + yp = y << 4; + num_cblocks[i] = 4; + pwidth = avctx->width; + } else { + xp = x << 3; + yp = y << 4; + num_cblocks[i] = 2; + pwidth = avctx->width >> 1; + } + src = (const uint16_t*)(pic->data[i] + yp * pic->linesize[i]) + xp; + + get_slice_data(ctx, src, pic->linesize[i], xp, yp, + pwidth, avctx->height, ctx->blocks[i], + mbs_per_slice, num_cblocks[i]); + } + + for (q = min_quant; q <= max_quant; q++) { + ctx->nodes[trellis_node + q].prev_node = -1; + ctx->nodes[trellis_node + q].quant = q; + } + + // todo: maybe perform coarser quantising to fit into frame size when needed + for (q = min_quant; q <= max_quant; q++) { + bits = 0; + error = 0; + for (i = 0; i < ctx->num_planes; i++) { + bits += estimate_slice_plane(ctx, &error, i, + src, pic->linesize[i], + mbs_per_slice, + num_cblocks[i], plane_factor[i], + ctx->quants[q]); + } + if (bits > 65000 * 8) { + error = SCORE_LIMIT; + break; + } + slice_bits[q] = bits; + slice_score[q] = error; + } + + bits_limit = mbs * ctx->bits_per_mb; + for (pq = min_quant; pq <= max_quant; pq++) { + prev = trellis_node - TRELLIS_WIDTH + pq; + + for (q = min_quant; q <= max_quant; q++) { + cur = trellis_node + q; + + bits = ctx->nodes[prev].bits + slice_bits[q]; + error = slice_score[q]; + if (bits > bits_limit) + error = SCORE_LIMIT; + + if (ctx->nodes[prev].score < SCORE_LIMIT && error < SCORE_LIMIT) + new_score = ctx->nodes[prev].score + error; + else + new_score = SCORE_LIMIT; + if (ctx->nodes[cur].prev_node == -1 || + ctx->nodes[cur].score >= new_score) { + + ctx->nodes[cur].bits = bits; + ctx->nodes[cur].score = new_score; + ctx->nodes[cur].prev_node = prev; + } + } + } + + error = ctx->nodes[trellis_node + min_quant].score; + pq = trellis_node + min_quant; + for (q = min_quant + 1; q <= max_quant; q++) { + if (ctx->nodes[trellis_node + q].score <= error) { + error = ctx->nodes[trellis_node + q].score; + pq = trellis_node + q; + } + } + + return pq; +} + +static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *pic, int *got_packet) +{ + ProresContext *ctx = avctx->priv_data; + uint8_t *orig_buf, *buf, *slice_hdr, *slice_sizes, *tmp; + uint8_t *picture_size_pos; + PutBitContext pb; + int x, y, i, mb, q = 0; + int sizes[4] = { 0 }; + int slice_hdr_size = 2 + 2 * (ctx->num_planes - 1); + int frame_size, picture_size, slice_size; + int mbs_per_slice = ctx->mbs_per_slice; + int pkt_size, ret; + + *avctx->coded_frame = *pic; + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; + avctx->coded_frame->key_frame = 1; + + pkt_size = ctx->mb_width * ctx->mb_height * 64 * 3 * 12 + + ctx->num_slices * 2 + 200 + FF_MIN_BUFFER_SIZE; + + if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) { + av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n"); + return ret; + } + + orig_buf = pkt->data; + + // frame atom + orig_buf += 4; // frame size + bytestream_put_be32 (&orig_buf, FRAME_ID); // frame container ID + buf = orig_buf; + + // frame header + tmp = buf; + buf += 2; // frame header size will be stored here + bytestream_put_be16 (&buf, 0); // version 1 + bytestream_put_buffer(&buf, "Lavc", 4); // creator + bytestream_put_be16 (&buf, avctx->width); + bytestream_put_be16 (&buf, avctx->height); + bytestream_put_byte (&buf, ctx->chroma_factor << 6); // frame flags + bytestream_put_byte (&buf, 0); // reserved + bytestream_put_byte (&buf, 0); // primaries + bytestream_put_byte (&buf, 0); // transfer function + bytestream_put_byte (&buf, 6); // colour matrix - ITU-R BT.601-4 + bytestream_put_byte (&buf, 0x40); // source format and alpha information + bytestream_put_byte (&buf, 0); // reserved + bytestream_put_byte (&buf, 0x03); // matrix flags - both matrices are present + // luma quantisation matrix + for (i = 0; i < 64; i++) + bytestream_put_byte(&buf, ctx->profile_info->quant[i]); + // chroma quantisation matrix + for (i = 0; i < 64; i++) + bytestream_put_byte(&buf, ctx->profile_info->quant[i]); + bytestream_put_be16 (&tmp, buf - orig_buf); // write back frame header size + + // picture header + picture_size_pos = buf + 1; + bytestream_put_byte (&buf, 0x40); // picture header size (in bits) + buf += 4; // picture data size will be stored here + bytestream_put_be16 (&buf, ctx->num_slices); // total number of slices + bytestream_put_byte (&buf, av_log2(ctx->mbs_per_slice) << 4); // slice width and height in MBs + + // seek table - will be filled during slice encoding + slice_sizes = buf; + buf += ctx->num_slices * 2; + + // slices + for (y = 0; y < ctx->mb_height; y++) { + mbs_per_slice = ctx->mbs_per_slice; + for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) { + while (ctx->mb_width - x < mbs_per_slice) + mbs_per_slice >>= 1; + q = find_slice_quant(avctx, pic, (mb + 1) * TRELLIS_WIDTH, x, y, + mbs_per_slice); + } + + for (x = ctx->slices_width - 1; x >= 0; x--) { + ctx->slice_q[x] = ctx->nodes[q].quant; + q = ctx->nodes[q].prev_node; + } + + mbs_per_slice = ctx->mbs_per_slice; + for (x = mb = 0; x < ctx->mb_width; x += mbs_per_slice, mb++) { + q = ctx->slice_q[mb]; + + while (ctx->mb_width - x < mbs_per_slice) + mbs_per_slice >>= 1; + + bytestream_put_byte(&buf, slice_hdr_size << 3); + slice_hdr = buf; + buf += slice_hdr_size - 1; + init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8); + encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice); + + bytestream_put_byte(&slice_hdr, q); + slice_size = slice_hdr_size + sizes[ctx->num_planes - 1]; + for (i = 0; i < ctx->num_planes - 1; i++) { + bytestream_put_be16(&slice_hdr, sizes[i]); + slice_size += sizes[i]; + } + bytestream_put_be16(&slice_sizes, slice_size); + buf += slice_size - slice_hdr_size; + } + } + + orig_buf -= 8; + frame_size = buf - orig_buf; + picture_size = buf - picture_size_pos - 6; + bytestream_put_be32(&orig_buf, frame_size); + bytestream_put_be32(&picture_size_pos, picture_size); + + pkt->size = frame_size; + pkt->flags |= AV_PKT_FLAG_KEY; + *got_packet = 1; + + return 0; +} + +static av_cold int encode_close(AVCodecContext *avctx) +{ + ProresContext *ctx = avctx->priv_data; + + if (avctx->coded_frame->data[0]) + avctx->release_buffer(avctx, avctx->coded_frame); + + av_freep(&avctx->coded_frame); + + av_freep(&ctx->nodes); + av_freep(&ctx->slice_q); + + return 0; +} + +static av_cold int encode_init(AVCodecContext *avctx) +{ + ProresContext *ctx = avctx->priv_data; + int mps; + int i, j; + int min_quant, max_quant; + + avctx->bits_per_raw_sample = 10; + avctx->coded_frame = avcodec_alloc_frame(); + if (!avctx->coded_frame) + return AVERROR(ENOMEM); + + ff_proresdsp_init(&ctx->dsp, avctx); + ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable, + ff_prores_progressive_scan); + + mps = ctx->mbs_per_slice; + if (mps & (mps - 1)) { + av_log(avctx, AV_LOG_ERROR, + "there should be an integer power of two MBs per slice\n"); + return AVERROR(EINVAL); + } + + ctx->chroma_factor = avctx->pix_fmt == PIX_FMT_YUV422P10 + ? CFACTOR_Y422 + : CFACTOR_Y444; + ctx->profile_info = prores_profile_info + ctx->profile; + ctx->num_planes = 3; + + ctx->mb_width = FFALIGN(avctx->width, 16) >> 4; + ctx->mb_height = FFALIGN(avctx->height, 16) >> 4; + ctx->slices_width = ctx->mb_width / mps; + ctx->slices_width += av_popcount(ctx->mb_width - ctx->slices_width * mps); + ctx->num_slices = ctx->mb_height * ctx->slices_width; + + for (i = 0; i < NUM_MB_LIMITS - 1; i++) + if (prores_mb_limits[i] >= ctx->mb_width * ctx->mb_height) + break; + ctx->bits_per_mb = ctx->profile_info->br_tab[i]; + + min_quant = ctx->profile_info->min_quant; + max_quant = ctx->profile_info->max_quant; + for (i = min_quant; i <= max_quant; i++) { + for (j = 0; j < 64; j++) + ctx->quants[i][j] = ctx->profile_info->quant[j] * i; + } + + avctx->codec_tag = ctx->profile_info->tag; + + av_log(avctx, AV_LOG_DEBUG, "profile %d, %d slices, %d bits per MB\n", + ctx->profile, ctx->num_slices, ctx->bits_per_mb); + + ctx->nodes = av_malloc((ctx->slices_width + 1) * TRELLIS_WIDTH + * sizeof(*ctx->nodes)); + if (!ctx->nodes) { + encode_close(avctx); + return AVERROR(ENOMEM); + } + for (i = min_quant; i <= max_quant; i++) { + ctx->nodes[i].prev_node = -1; + ctx->nodes[i].bits = 0; + ctx->nodes[i].score = 0; + } + + ctx->slice_q = av_malloc(ctx->slices_width * sizeof(*ctx->slice_q)); + if (!ctx->slice_q) { + encode_close(avctx); + return AVERROR(ENOMEM); + } + + return 0; +} + +#define OFFSET(x) offsetof(ProresContext, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM + +static const AVOption options[] = { + { "mbs_per_slice", "macroblocks per slice", OFFSET(mbs_per_slice), + AV_OPT_TYPE_INT, { 8 }, 1, MAX_MBS_PER_SLICE, VE }, + { "profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, + { PRORES_PROFILE_STANDARD }, + PRORES_PROFILE_PROXY, PRORES_PROFILE_HQ, VE, "profile" }, + { "proxy", NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_PROXY }, + 0, 0, VE, "profile" }, + { "lt", NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_LT }, + 0, 0, VE, "profile" }, + { "standard", NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_STANDARD }, + 0, 0, VE, "profile" }, + { "hq", NULL, 0, AV_OPT_TYPE_CONST, { PRORES_PROFILE_HQ }, + 0, 0, VE, "profile" }, + { NULL } +}; + +static const AVClass proresenc_class = { + .class_name = "ProRes encoder", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +AVCodec ff_prores_kostya_encoder = { + .name = "prores_kostya", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_PRORES, + .priv_data_size = sizeof(ProresContext), + .init = encode_init, + .close = encode_close, + .encode2 = encode_frame, + .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), + .pix_fmts = (const enum PixelFormat[]) { + PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, PIX_FMT_NONE + }, + .priv_class = &proresenc_class, +}; diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 26b576d804..e2b6f39026 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -62,7 +62,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx) { RA288Context *ractx = avctx->priv_data; avctx->sample_fmt = AV_SAMPLE_FMT_FLT; - dsputil_init(&ractx->dsp, avctx); + ff_dsputil_init(&ractx->dsp, avctx); avcodec_get_frame_defaults(&ractx->frame); avctx->coded_frame = &ractx->frame; diff --git a/libavcodec/rl.h b/libavcodec/rl.h index b2445890e6..c80283db7f 100644 --- a/libavcodec/rl.h +++ b/libavcodec/rl.h @@ -53,8 +53,8 @@ typedef struct RLTable { * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] which will hold * the level and run tables, if this is NULL av_malloc() will be used */ -void init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); -void init_vlc_rl(RLTable *rl); +void ff_init_rl(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); +void ff_init_vlc_rl(RLTable *rl); #define INIT_VLC_RL(rl, static_size)\ {\ @@ -68,7 +68,7 @@ void init_vlc_rl(RLTable *rl); for(q=0; q<32; q++)\ rl.rl_vlc[q]= rl_vlc_table[q];\ \ - init_vlc_rl(&rl);\ + ff_init_vlc_rl(&rl);\ }\ } diff --git a/libavcodec/rtjpeg.c b/libavcodec/rtjpeg.c index e03282b412..7797a655c1 100644 --- a/libavcodec/rtjpeg.c +++ b/libavcodec/rtjpeg.c @@ -97,15 +97,15 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc /** * @brief decode one rtjpeg YUV420 frame - * @param c context, must be initialized via rtjpeg_decode_init + * @param c context, must be initialized via ff_rtjpeg_decode_init * @param f AVFrame to place decoded frame into. If parts of the frame * are not coded they are left unchanged, so consider initializing it * @param buf buffer containing input data * @param buf_size length of input data in bytes * @return number of bytes consumed from the input buffer */ -int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, - const uint8_t *buf, int buf_size) { +int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, + const uint8_t *buf, int buf_size) { GetBitContext gb; int w = c->w / 16, h = c->h / 16; int x, y; @@ -154,9 +154,9 @@ int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, * @param lquant luma quantization table to use * @param cquant chroma quantization table to use */ -void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, - int width, int height, - const uint32_t *lquant, const uint32_t *cquant) { +void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, + int width, int height, + const uint32_t *lquant, const uint32_t *cquant) { int i; c->dsp = dsp; for (i = 0; i < 64; i++) { diff --git a/libavcodec/rtjpeg.h b/libavcodec/rtjpeg.h index 4bcb9f70ca..e127a19202 100644 --- a/libavcodec/rtjpeg.h +++ b/libavcodec/rtjpeg.h @@ -34,10 +34,10 @@ typedef struct { DECLARE_ALIGNED(16, DCTELEM, block)[64]; } RTJpegContext; -void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, +void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, int width, int height, const uint32_t *lquant, const uint32_t *cquant); -int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, +int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, const uint8_t *buf, int buf_size); #endif /* AVCODEC_RTJPEG_H */ diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index d97ed12272..dd8715b300 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -186,7 +186,7 @@ static const uint8_t rv_chrom_bits[256] = static VLC rv_dc_lum, rv_dc_chrom; -int rv_decode_dc(MpegEncContext *s, int n) +int ff_rv_decode_dc(MpegEncContext *s, int n) { int code; @@ -368,11 +368,11 @@ static int rv20_decode_picture_header(MpegEncContext *s) av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h); if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0) return -1; - MPV_common_end(s); + ff_MPV_common_end(s); avcodec_set_dimensions(s->avctx, new_w, new_h); s->width = new_w; s->height = new_h; - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; } @@ -444,7 +444,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) return -1; } - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); s->avctx= avctx; s->out_format = FMT_H263; @@ -484,10 +484,10 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) avctx->pix_fmt = PIX_FMT_YUV420P; - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; - h263_decode_init_vlc(s); + ff_h263_decode_init_vlc(s); /* init rv vlc */ if (!done) { @@ -507,7 +507,7 @@ static av_cold int rv10_decode_end(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; - MPV_common_end(s); + ff_MPV_common_end(s); return 0; } @@ -542,10 +542,10 @@ static int rv10_decode_packet(AVCodecContext *avctx, if ((s->mb_x == 0 && s->mb_y == 0) || s->current_picture_ptr==NULL) { if(s->current_picture_ptr){ //FIXME write parser so we always have complete frames? ff_er_frame_end(s); - MPV_frame_end(s); + ff_MPV_frame_end(s); s->mb_x= s->mb_y = s->resync_mb_x = s->resync_mb_y= 0; } - if(MPV_frame_start(s, avctx) < 0) + if(ff_MPV_frame_start(s, avctx) < 0) return -1; ff_er_frame_start(s); } else { @@ -613,7 +613,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, } if(s->pict_type != AV_PICTURE_TYPE_B) ff_h263_update_motion_val(s); - MPV_decode_mb(s, s->block); + ff_MPV_decode_mb(s, s->block); if(s->loop_filter) ff_h263_loop_filter(s); @@ -693,7 +693,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, if(s->current_picture_ptr != NULL && s->mb_y>=s->mb_height){ ff_er_frame_end(s); - MPV_frame_end(s); + ff_MPV_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { *pict= *(AVFrame*)s->current_picture_ptr; diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index 8dd74e844e..81f4b94933 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -28,7 +28,7 @@ #include "mpegvideo.h" #include "put_bits.h" -void rv10_encode_picture_header(MpegEncContext *s, int picture_number) +void ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number) { int full_frame= 0; @@ -61,9 +61,9 @@ AVCodec ff_rv10_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_RV10, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("RealVideo 1.0"), }; diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index af7ef6bb72..56036db2bb 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -29,7 +29,7 @@ #include "h263.h" #include "put_bits.h" -void rv20_encode_picture_header(MpegEncContext *s, int picture_number){ +void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number){ put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ? put_bits(&s->pb, 1, 0); /* unknown bit */ put_bits(&s->pb, 5, s->qscale); @@ -62,9 +62,9 @@ AVCodec ff_rv20_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_RV20, .priv_data_size = sizeof(MpegEncContext), - .init = MPV_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .init = ff_MPV_encode_init, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("RealVideo 2.0"), }; diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 52483e6e8b..69273874c2 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -131,10 +131,10 @@ static void rv34_gen_vlc(const uint8_t *bits, int size, VLC *vlc, const uint8_t vlc->table = &table_data[table_offs[num]]; vlc->table_allocated = table_offs[num + 1] - table_offs[num]; - init_vlc_sparse(vlc, FFMIN(maxbits, 9), realsize, - bits2, 1, 1, - cw, 2, 2, - syms, 2, 2, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_sparse(vlc, FFMIN(maxbits, 9), realsize, + bits2, 1, 1, + cw, 2, 2, + syms, 2, 2, INIT_VLC_USE_NEW_STATIC); } /** @@ -1427,17 +1427,17 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int av_log(s->avctx, AV_LOG_WARNING, "Changing dimensions to %dx%d\n", r->si.width, r->si.height); - MPV_common_end(s); + ff_MPV_common_end(s); s->width = r->si.width; s->height = r->si.height; avcodec_set_dimensions(s->avctx, s->width, s->height); - if ((err = MPV_common_init(s)) < 0) + if ((err = ff_MPV_common_init(s)) < 0) return err; if ((err = rv34_decoder_realloc(r)) < 0) return err; } s->pict_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I; - if(MPV_frame_start(s, s->avctx) < 0) + if(ff_MPV_frame_start(s, s->avctx) < 0) return -1; ff_er_frame_start(s); if (!r->tmp_b_block_base) { @@ -1545,7 +1545,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) MpegEncContext *s = &r->s; int ret; - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); s->avctx = avctx; s->out_format = FMT_H263; s->codec_id = avctx->codec_id; @@ -1560,7 +1560,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) avctx->has_b_frames = 1; s->low_delay = 0; - if ((ret = MPV_common_init(s)) < 0) + if ((ret = ff_MPV_common_init(s)) < 0) return ret; ff_h264_pred_init(&r->h, CODEC_ID_RV40, 8, 1); @@ -1592,7 +1592,7 @@ int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx) if (avctx->internal->is_copy) { r->tmp_b_block_base = NULL; - if ((err = MPV_common_init(&r->s)) < 0) + if ((err = ff_MPV_common_init(&r->s)) < 0) return err; if ((err = rv34_decoder_alloc(r)) < 0) return err; @@ -1610,10 +1610,10 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte return 0; if (s->height != s1->height || s->width != s1->width) { - MPV_common_end(s); + ff_MPV_common_end(s); s->height = s1->height; s->width = s1->width; - if ((err = MPV_common_init(s)) < 0) + if ((err = ff_MPV_common_init(s)) < 0) return err; if ((err = rv34_decoder_realloc(r)) < 0) return err; @@ -1629,7 +1629,7 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte memset(&r->si, 0, sizeof(r->si)); /* necessary since it is it the condition checked for in decode_slice - * to call MPV_frame_start. cmp. comment at the end of decode_frame */ + * to call ff_MPV_frame_start. cmp. comment at the end of decode_frame */ s->current_picture_ptr = NULL; return 0; @@ -1741,7 +1741,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, if(r->loop_filter) r->loop_filter(r, s->mb_height - 1); ff_er_frame_end(s); - MPV_frame_end(s); + ff_MPV_frame_end(s); if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) 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) { RV34DecContext *r = avctx->priv_data; - MPV_common_end(&r->s); + ff_MPV_common_end(&r->s); rv34_decoder_free(r); return 0; diff --git a/libavcodec/rv34data.h b/libavcodec/rv34data.h index 8be26a3943..4b2701fee6 100644 --- a/libavcodec/rv34data.h +++ b/libavcodec/rv34data.h @@ -101,7 +101,7 @@ static const uint8_t rv34_quant_to_vlc_set[2][31] = { /** * table for obtaining the quantizer difference - * @todo Use with modified_quant_tab from h263data.h. + * @todo Use with ff_modified_quant_tab from h263data.h. */ static const uint8_t rv34_dquant_tab[2][32]={ // 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 diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index a0fa678ada..8ba9224840 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -80,18 +80,18 @@ static av_cold void rv40_init_tables(void) for(i = 0; i < NUM_PTYPE_VLCS; i++){ ptype_vlc[i].table = &ptype_table[i << PTYPE_VLC_BITS]; ptype_vlc[i].table_allocated = 1 << PTYPE_VLC_BITS; - init_vlc_sparse(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE, - ptype_vlc_bits[i], 1, 1, - ptype_vlc_codes[i], 1, 1, - ptype_vlc_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_sparse(&ptype_vlc[i], PTYPE_VLC_BITS, PTYPE_VLC_SIZE, + ptype_vlc_bits[i], 1, 1, + ptype_vlc_codes[i], 1, 1, + ptype_vlc_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); } for(i = 0; i < NUM_BTYPE_VLCS; i++){ btype_vlc[i].table = &btype_table[i << BTYPE_VLC_BITS]; btype_vlc[i].table_allocated = 1 << BTYPE_VLC_BITS; - init_vlc_sparse(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE, - btype_vlc_bits[i], 1, 1, - btype_vlc_codes[i], 1, 1, - btype_vlc_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); + ff_init_vlc_sparse(&btype_vlc[i], BTYPE_VLC_BITS, BTYPE_VLC_SIZE, + btype_vlc_bits[i], 1, 1, + btype_vlc_codes[i], 1, 1, + btype_vlc_syms, 1, 1, INIT_VLC_USE_NEW_STATIC); } } diff --git a/libavcodec/sh4/dsputil_align.c b/libavcodec/sh4/dsputil_align.c index e91893683f..a545e55096 100644 --- a/libavcodec/sh4/dsputil_align.c +++ b/libavcodec/sh4/dsputil_align.c @@ -331,7 +331,7 @@ DEFFUNC(avg,no_rnd,xy,16,OP_XY,PACK) #endif -void dsputil_init_align(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; diff --git a/libavcodec/sh4/dsputil_sh4.c b/libavcodec/sh4/dsputil_sh4.c index 905e8b15e0..7deab41d62 100644 --- a/libavcodec/sh4/dsputil_sh4.c +++ b/libavcodec/sh4/dsputil_sh4.c @@ -56,7 +56,7 @@ static void idct_put(uint8_t *dest, int line_size, DCTELEM *block) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; - idct_sh4(block); + ff_idct_sh4(block); for(i=0;i<8;i++) { dest[0] = cm[block[0]]; dest[1] = cm[block[1]]; @@ -74,7 +74,7 @@ static void idct_add(uint8_t *dest, int line_size, DCTELEM *block) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; - idct_sh4(block); + ff_idct_sh4(block); for(i=0;i<8;i++) { dest[0] = cm[dest[0]+block[0]]; dest[1] = cm[dest[1]+block[1]]; @@ -89,11 +89,11 @@ static void idct_add(uint8_t *dest, int line_size, DCTELEM *block) } } -void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx) { const int idct_algo= avctx->idct_algo; const int high_bit_depth = avctx->bits_per_raw_sample > 8; - dsputil_init_align(c,avctx); + ff_dsputil_init_align(c,avctx); if (!high_bit_depth) c->clear_blocks = clear_blocks_sh4; @@ -101,7 +101,7 @@ void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx) (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_SH4)) { c->idct_put = idct_put; c->idct_add = idct_add; - c->idct = idct_sh4; + c->idct = ff_idct_sh4; c->idct_permutation_type= FF_NO_IDCT_PERM; } } diff --git a/libavcodec/sh4/dsputil_sh4.h b/libavcodec/sh4/dsputil_sh4.h index 2e554e7370..f2cb11e378 100644 --- a/libavcodec/sh4/dsputil_sh4.h +++ b/libavcodec/sh4/dsputil_sh4.h @@ -22,7 +22,7 @@ #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" -void idct_sh4(DCTELEM *block); -void dsputil_init_align(DSPContext* c, AVCodecContext *avctx); +void ff_idct_sh4(DCTELEM *block); +void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx); #endif /* AVCODEC_SH4_DSPUTIL_SH4_H */ diff --git a/libavcodec/sh4/idct_sh4.c b/libavcodec/sh4/idct_sh4.c index 13a85b030e..e54c330857 100644 --- a/libavcodec/sh4/idct_sh4.c +++ b/libavcodec/sh4/idct_sh4.c @@ -89,7 +89,7 @@ static const float odd_table[] __attribute__ ((aligned(8))) = { //optimized -void idct_sh4(DCTELEM *block) +void ff_idct_sh4(DCTELEM *block) { DEFREG; diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 593d409cb1..3c979ebbfa 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -272,9 +272,9 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int *recodes = huff.values; if(vlc[0].table) - free_vlc(&vlc[0]); + ff_free_vlc(&vlc[0]); if(vlc[1].table) - free_vlc(&vlc[1]); + ff_free_vlc(&vlc[1]); av_free(tmp1.bits); av_free(tmp1.lengths); av_free(tmp1.values); @@ -728,7 +728,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, for(i = 0; i < 4; i++) { if(vlc[i].table) - free_vlc(&vlc[i]); + ff_free_vlc(&vlc[i]); av_free(h[i].bits); av_free(h[i].lengths); av_free(h[i].values); diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 88620dd28c..e63a4c34f3 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -99,7 +99,7 @@ static void init_qexp(void){ double v=128; for(i=0; i<QROOT; i++){ - qexp[i]= lrintf(v); + ff_qexp[i]= lrintf(v); v *= pow(2, 1.0 / QROOT); } } @@ -390,7 +390,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ s->avctx= avctx; s->max_ref_frames=1; //just make sure its not an invalid value in case of no initial keyframe - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_dwt_init(&s->dwt); #define mcf(dx,dy)\ @@ -443,7 +443,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ for(i=0; i<MAX_REF_FRAMES; i++) for(j=0; j<MAX_REF_FRAMES; j++) - scale_mv_ref[i][j] = 256*(i+1)/(j+1); + ff_scale_mv_ref[i][j] = 256*(i+1)/(j+1); s->avctx->get_buffer(s->avctx, &s->mconly_picture); s->scratchbuf = av_malloc(s->mconly_picture.linesize[0]*7*MB_SIZE); diff --git a/libavcodec/snow.h b/libavcodec/snow.h index 3a5cdc7175..d2ef1ad17e 100644 --- a/libavcodec/snow.h +++ b/libavcodec/snow.h @@ -165,13 +165,9 @@ typedef struct SnowContext{ }SnowContext; /* Tables */ -extern const uint8_t * const obmc_tab[4]; -#ifdef __sgi -// Avoid a name clash on SGI IRIX -#undef qexp -#endif -extern uint8_t qexp[QROOT]; -extern int scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; +extern const uint8_t * const ff_obmc_tab[4]; +extern uint8_t ff_qexp[QROOT]; +extern int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; /* C bits used by mmx/sse2/altivec */ @@ -256,7 +252,7 @@ static inline void pred_mv(SnowContext *s, int *mx, int *my, int ref, *mx = mid_pred(left->mx, top->mx, tr->mx); *my = mid_pred(left->my, top->my, tr->my); }else{ - const int *scale = scale_mv_ref[ref]; + const int *scale = ff_scale_mv_ref[ref]; *mx = mid_pred((left->mx * scale[left->ref] + 128) >>8, (top ->mx * scale[top ->ref] + 128) >>8, (tr ->mx * scale[tr ->ref] + 128) >>8); @@ -405,7 +401,7 @@ static av_always_inline void predict_slice(SnowContext *s, IDWTELEM *buf, int pl int x, y, mb_x; int block_size = MB_SIZE >> s->block_max_depth; int block_w = plane_index ? block_size/2 : block_size; - const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth]; + const uint8_t *obmc = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth]; const int obmc_stride= plane_index ? block_size : 2*block_size; int ref_stride= s->current_picture.linesize[plane_index]; 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 /* bitstream functions */ -extern const int8_t quant3bA[256]; +extern const int8_t ff_quant3bA[256]; #define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0 @@ -642,7 +638,7 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i v=get_rac(&s->c, &b->state[0][context]); if(v){ v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1); - v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l&0xFF] + 3*quant3bA[t&0xFF]]); + v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]); xc->x=x; (xc++)->coeff= v; diff --git a/libavcodec/snowdata.h b/libavcodec/snowdata.h index 7a88f24763..490fdf8bd6 100644 --- a/libavcodec/snowdata.h +++ b/libavcodec/snowdata.h @@ -101,7 +101,7 @@ static const uint8_t obmc4[16]={ //error:0.000000 }; -const int8_t quant3bA[256]={ +const int8_t ff_quant3bA[256]={ 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 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]={ 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, }; -const uint8_t * const obmc_tab[4]= { +const uint8_t * const ff_obmc_tab[4]= { obmc32, obmc16, obmc8, obmc4 }; /* runtime generated tables */ -uint8_t qexp[QROOT]; -int scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; +uint8_t ff_qexp[QROOT]; +int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; #endif /* AVCODEC_SNOW_H */ diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 9fd25a5335..9d7827d712 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -42,7 +42,7 @@ static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer int x, y, mb_x; int block_size = MB_SIZE >> s->block_max_depth; int block_w = plane_index ? block_size/2 : block_size; - const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth]; + const uint8_t *obmc = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth]; int obmc_stride= plane_index ? block_size : 2*block_size; int ref_stride= s->current_picture.linesize[plane_index]; 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 const int w= b->width; int y; const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16); - int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); + int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; int new_index = 0; @@ -184,7 +184,7 @@ static void decode_q_branch(SnowContext *s, int level, int x, int y){ static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, IDWTELEM *src, int stride, int start_y, int end_y){ const int w= b->width; const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16); - const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); + const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; int x,y; diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 284e755732..4c118fe986 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -199,7 +199,7 @@ static av_cold int encode_init(AVCodecContext *avctx) s->m.me.map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); s->m.obmc_scratchpad= av_mallocz(MB_SIZE*MB_SIZE*12*sizeof(uint32_t)); - h263_encode_init(&s->m); //mv_penalty + ff_h263_encode_init(&s->m); //mv_penalty s->max_ref_frames = FFMAX(FFMIN(avctx->refs, MAX_REF_FRAMES), 1); @@ -575,7 +575,7 @@ static int get_dc(SnowContext *s, int mb_x, int mb_y, int plane_index){ Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; const int block_w = plane_index ? block_size/2 : block_size; - const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth]; + const uint8_t *obmc = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth]; const int obmc_stride= plane_index ? block_size : 2*block_size; const int ref_stride= s->current_picture.linesize[plane_index]; 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){ Plane *p= &s->plane[plane_index]; const int block_size = MB_SIZE >> s->block_max_depth; const int block_w = plane_index ? block_size/2 : block_size; - const uint8_t *obmc = plane_index ? obmc_tab[s->block_max_depth+1] : obmc_tab[s->block_max_depth]; + const uint8_t *obmc = plane_index ? ff_obmc_tab[s->block_max_depth+1] : ff_obmc_tab[s->block_max_depth]; const int obmc_stride= plane_index ? block_size : 2*block_size; const int ref_stride= s->current_picture.linesize[plane_index]; 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 int t2= 2*FFABS(t) + (t<0); put_symbol2(&s->c, b->state[context + 2], FFABS(v)-1, context-4); - put_rac(&s->c, &b->state[0][16 + 1 + 3 + quant3bA[l2&0xFF] + 3*quant3bA[t2&0xFF]], v<0); + put_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l2&0xFF] + 3*ff_quant3bA[t2&0xFF]], v<0); } } } @@ -1090,7 +1090,7 @@ static void iterative_me(SnowContext *s){ //FIXME precalculate { int x, y; - memcpy(obmc_edged, obmc_tab[s->block_max_depth], b_w*b_w*4); + memcpy(obmc_edged, ff_obmc_tab[s->block_max_depth], b_w*b_w*4); if(mb_x==0) for(y=0; y<b_w*2; y++) 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 const int w= b->width; const int h= b->height; const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16); - const int qmul= qexp[qlog&(QROOT-1)]<<((qlog>>QSHIFT) + ENCODER_EXTRA_BITS); + const int qmul= ff_qexp[qlog&(QROOT-1)]<<((qlog>>QSHIFT) + ENCODER_EXTRA_BITS); int x,y, thres1, thres2; if(s->qlog == LOSSLESS_QLOG){ @@ -1347,7 +1347,7 @@ static void dequantize(SnowContext *s, SubBand *b, IDWTELEM *src, int stride){ const int w= b->width; const int h= b->height; const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16); - const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); + const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; int x,y; @@ -1538,7 +1538,7 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) const int h= b->height; const int stride= b->stride; const int qlog= av_clip(2*QROOT + b->qlog, 0, QROOT*16); - const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); + const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); const int qdiv= (1<<16)/qmul; int x, y; //FIXME this is ugly diff --git a/libavcodec/sparc/dsputil_vis.c b/libavcodec/sparc/dsputil_vis.c index 7181299801..9576082535 100644 --- a/libavcodec/sparc/dsputil_vis.c +++ b/libavcodec/sparc/dsputil_vis.c @@ -3949,7 +3949,7 @@ static int vis_level(void) } /* libavcodec initialization code */ -void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx) { /* VIS-specific optimizations */ int accel = vis_level (); diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 83fe07e4c7..cb89b3f619 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -43,7 +43,7 @@ #undef NDEBUG #include <assert.h> -extern const uint8_t mvtab[33][2]; +extern const uint8_t ff_mvtab[33][2]; static VLC svq1_block_type; static VLC svq1_motion_component; @@ -670,7 +670,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, || avctx->skip_frame >= AVDISCARD_ALL) return buf_size; - if(MPV_frame_start(s, avctx) < 0) + if(ff_MPV_frame_start(s, avctx) < 0) return -1; pmv = av_malloc((FFALIGN(s->width, 16)/8 + 3) * sizeof(*pmv)); @@ -738,7 +738,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, *pict = *(AVFrame*)&s->current_picture; - MPV_frame_end(s); + ff_MPV_frame_end(s); *data_size=sizeof(AVFrame); result = buf_size; @@ -753,7 +753,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) int i; int offset = 0; - MPV_decode_defaults(s); + ff_MPV_decode_defaults(s); s->avctx = avctx; s->width = (avctx->width+3)&~3; @@ -762,15 +762,15 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) avctx->pix_fmt = PIX_FMT_YUV410P; avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames s->flags= avctx->flags; - if (MPV_common_init(s) < 0) return -1; + if (ff_MPV_common_init(s) < 0) return -1; INIT_VLC_STATIC(&svq1_block_type, 2, 4, &ff_svq1_block_type_vlc[0][1], 2, 1, &ff_svq1_block_type_vlc[0][0], 2, 1, 6); INIT_VLC_STATIC(&svq1_motion_component, 7, 33, - &mvtab[0][1], 2, 1, - &mvtab[0][0], 2, 1, 176); + &ff_mvtab[0][1], 2, 1, + &ff_mvtab[0][0], 2, 1, 176); for (i = 0; i < 6; i++) { 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) { MpegEncContext *s = avctx->priv_data; - MPV_common_end(s); + ff_MPV_common_end(s); return 0; } diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index feceaee6e8..b7c196707e 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -402,7 +402,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane int mx, my, pred_x, pred_y, dxy; int16_t *motion_ptr; - motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y); + motion_ptr= ff_h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y); if(s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTER){ for(i=0; i<6; i++) 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) { SVQ1Context * const s = avctx->priv_data; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); avctx->coded_frame= (AVFrame*)&s->picture; s->frame_width = avctx->width; @@ -492,7 +492,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) s->m.me.score_map = av_mallocz(ME_MAP_SIZE*sizeof(uint32_t)); s->mb_type = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int16_t)); s->dummy = av_mallocz((s->y_block_width+1)*s->y_block_height*sizeof(int32_t)); - h263_encode_init(&s->m); //mv_penalty + ff_h263_encode_init(&s->m); //mv_penalty return 0; } diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index aec56fd161..4ddde00ddc 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -931,7 +931,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx) s->width = avctx->width; s->height = avctx->height; - if (MPV_common_init(s) < 0) + if (ff_MPV_common_init(s) < 0) return -1; h->b_stride = 4*s->mb_width; @@ -1099,7 +1099,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, return -1; } - MPV_frame_end(s); + ff_MPV_frame_end(s); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { *(AVFrame *) data = *(AVFrame *) &s->current_picture; @@ -1123,7 +1123,7 @@ static int svq3_decode_end(AVCodecContext *avctx) ff_h264_free_context(h); - MPV_common_end(s); + ff_MPV_common_end(s); av_freep(&svq3->buf); svq3->buf_size = 0; diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index e68a68757f..01d9f1ee8a 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -190,7 +190,7 @@ static void tm2_free_codes(TM2Codes *code) { av_free(code->recode); if(code->vlc.table) - free_vlc(&code->vlc); + ff_free_vlc(&code->vlc); } static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code) @@ -823,7 +823,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ avctx->pix_fmt = PIX_FMT_BGR24; avcodec_get_frame_defaults(&l->pic); - dsputil_init(&l->dsp, avctx); + ff_dsputil_init(&l->dsp, avctx); l->last = av_malloc(4 * sizeof(int) * (avctx->width >> 2)); l->clast = av_malloc(4 * sizeof(int) * (avctx->width >> 2)); diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index c2c68abd6f..84ba59219d 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -68,7 +68,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16; - dsputil_init(&c->dsp, avctx); + ff_dsputil_init(&c->dsp, avctx); avcodec_get_frame_defaults(&c->frame); avctx->coded_frame = &c->frame; diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index 6a0bd4d145..88f29d8726 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -1153,7 +1153,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx) return -1; } - dsputil_init(&tctx->dsp, avctx); + ff_dsputil_init(&tctx->dsp, avctx); if ((ret = init_mdct_win(tctx))) { av_log(avctx, AV_LOG_ERROR, "Error initializing MDCT\n"); twin_decode_close(avctx); diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5487cbd43d..de1274cfc8 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -115,7 +115,7 @@ static void avcodec_init(void) return; initialized = 1; - dsputil_static_init(); + ff_dsputil_static_init(); } static av_always_inline int codec_is_encoder(AVCodec *codec) diff --git a/libavcodec/utvideo.c b/libavcodec/utvideo.c index 1938f8c3f1..cadac5c3f3 100644 --- a/libavcodec/utvideo.c +++ b/libavcodec/utvideo.c @@ -103,10 +103,10 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) code += 0x80000000u >> (he[i].len - 1); } - return init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1, - bits, sizeof(*bits), sizeof(*bits), - codes, sizeof(*codes), sizeof(*codes), - syms, sizeof(*syms), sizeof(*syms), 0); + return ff_init_vlc_sparse(vlc, FFMIN(he[last].len, 9), last + 1, + bits, sizeof(*bits), sizeof(*bits), + codes, sizeof(*codes), sizeof(*codes), + syms, sizeof(*syms), sizeof(*syms), 0); } static int decode_plane(UtvideoContext *c, int plane_no, @@ -207,11 +207,11 @@ static int decode_plane(UtvideoContext *c, int plane_no, get_bits_left(&gb)); } - free_vlc(&vlc); + ff_free_vlc(&vlc); return 0; fail: - free_vlc(&vlc); + ff_free_vlc(&vlc); return AVERROR_INVALIDDATA; } @@ -503,7 +503,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->avctx = avctx; - dsputil_init(&c->dsp, avctx); + ff_dsputil_init(&c->dsp, avctx); if (avctx->extradata_size < 16) { av_log(avctx, AV_LOG_ERROR, "Insufficient extradata size %d, should be at least 16\n", diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 57b3599ddb..43c7d55d9c 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -190,7 +190,7 @@ static av_cold int vble_decode_init(AVCodecContext *avctx) /* Stash for later use */ ctx->avctx = avctx; - dsputil_init(&ctx->dsp, avctx); + ff_dsputil_init(&ctx->dsp, avctx); avctx->pix_fmt = PIX_FMT_YUV420P; avctx->bits_per_raw_sample = 8; diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index a012967e3e..93b9b275de 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -291,7 +291,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb); * @param gb GetBit context initialized from Codec context extra_data * @return Status */ -int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb) +int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb) { av_log(avctx, AV_LOG_DEBUG, "Header: %0X\n", show_bits(gb, 32)); v->profile = get_bits(gb, 2); @@ -304,8 +304,8 @@ int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitConte v->zz_4x8 = ff_vc1_adv_progressive_4x8_zz; return decode_sequence_header_adv(v, gb); } else { - v->zz_8x4 = wmv2_scantableA; - v->zz_4x8 = wmv2_scantableB; + v->zz_8x4 = ff_wmv2_scantableA; + v->zz_4x8 = ff_wmv2_scantableB; v->res_y411 = get_bits1(gb); v->res_sprite = get_bits1(gb); if (v->res_y411) { @@ -525,7 +525,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) return 0; } -int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb) +int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb) { int i; @@ -574,7 +574,7 @@ int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext * return 0; } -int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) +int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) { int pqindex, lowquant, status; @@ -817,7 +817,7 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6); \ } -int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) +int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) { int pqindex, lowquant; int status; diff --git a/libavcodec/vc1.h b/libavcodec/vc1.h index 1b39040bef..61b34275b8 100644 --- a/libavcodec/vc1.h +++ b/libavcodec/vc1.h @@ -441,11 +441,11 @@ static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, ui * @param gb GetBit context initialized from Codec context extra_data * @return Status */ -int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); +int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); -int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); +int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); -int vc1_parse_frame_header (VC1Context *v, GetBitContext *gb); -int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb); +int ff_vc1_parse_frame_header (VC1Context *v, GetBitContext *gb); +int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb); #endif /* AVCODEC_VC1_H */ diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c index 6fce12ef46..f133e3a2d7 100644 --- a/libavcodec/vc1_parser.c +++ b/libavcodec/vc1_parser.c @@ -57,16 +57,16 @@ static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx, if(size <= 0) continue; switch(AV_RB32(start)){ case VC1_CODE_SEQHDR: - vc1_decode_sequence_header(avctx, &vpc->v, &gb); + ff_vc1_decode_sequence_header(avctx, &vpc->v, &gb); break; case VC1_CODE_ENTRYPOINT: - vc1_decode_entry_point(avctx, &vpc->v, &gb); + ff_vc1_decode_entry_point(avctx, &vpc->v, &gb); break; case VC1_CODE_FRAME: if(vpc->v.profile < PROFILE_ADVANCED) - vc1_parse_frame_header (&vpc->v, &gb); + ff_vc1_parse_frame_header (&vpc->v, &gb); else - vc1_parse_frame_header_adv(&vpc->v, &gb); + ff_vc1_parse_frame_header_adv(&vpc->v, &gb); /* keep AV_PICTURE_TYPE_BI internal to VC1 */ if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI) diff --git a/libavcodec/vc1data.c b/libavcodec/vc1data.c index 7f979ba109..403b011d4a 100644 --- a/libavcodec/vc1data.c +++ b/libavcodec/vc1data.c @@ -645,7 +645,7 @@ const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = { } }; -const uint8_t wmv3_dc_scale_table[32] = { +const uint8_t ff_wmv3_dc_scale_table[32] = { 0, 2, 4, 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 }; @@ -1094,7 +1094,7 @@ const int32_t ff_vc1_dqscale[63] = { }; /* P Interlaced field picture MV predictor scaling values (Table 114) */ -const uint16_t vc1_field_mvpred_scales[2][7][4] = { +const uint16_t ff_vc1_field_mvpred_scales[2][7][4] = { // Refdist: // 0 1 2 3 or greater { // current field is first @@ -1118,7 +1118,7 @@ const uint16_t vc1_field_mvpred_scales[2][7][4] = { }; /* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */ -const uint16_t vc1_b_field_mvpred_scales[7][4] = { +const uint16_t ff_vc1_b_field_mvpred_scales[7][4] = { // BRFD: // 0 1 2 3 or greater { 171, 205, 219, 228 }, // SCALESAME diff --git a/libavcodec/vc1data.h b/libavcodec/vc1data.h index f11122504b..c9fedc1557 100644 --- a/libavcodec/vc1data.h +++ b/libavcodec/vc1data.h @@ -126,7 +126,7 @@ extern const uint8_t ff_vc1_4mv_block_pattern_bits[4][16]; extern const uint8_t ff_vc1_2mv_block_pattern_codes[4][4]; extern const uint8_t ff_vc1_2mv_block_pattern_bits[4][4]; -extern const uint8_t wmv3_dc_scale_table[32]; +extern const uint8_t ff_wmv3_dc_scale_table[32]; /* P-Picture CBPCY VLC tables */ 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]; extern const int32_t ff_vc1_dqscale[63]; /* P Interlaced field picture MV predictor scaling values (Table 114) */ -extern const uint16_t vc1_field_mvpred_scales[2][7][4]; +extern const uint16_t ff_vc1_field_mvpred_scales[2][7][4]; /* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */ -extern const uint16_t vc1_b_field_mvpred_scales[7][4]; +extern const uint16_t ff_vc1_b_field_mvpred_scales[7][4]; #endif /* AVCODEC_VC1DATA_H */ diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index a3ac2cbbaa..05809d36b0 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1308,10 +1308,10 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di refdist = dir ? v->brfd : v->frfd; if (refdist > 3) refdist = 3; - scalesame1 = vc1_field_mvpred_scales[table_index][1][refdist]; - scalesame2 = vc1_field_mvpred_scales[table_index][2][refdist]; - scalezone1_x = vc1_field_mvpred_scales[table_index][3][refdist]; - zone1offset_x = vc1_field_mvpred_scales[table_index][5][refdist]; + scalesame1 = ff_vc1_field_mvpred_scales[table_index][1][refdist]; + scalesame2 = ff_vc1_field_mvpred_scales[table_index][2][refdist]; + scalezone1_x = ff_vc1_field_mvpred_scales[table_index][3][refdist]; + zone1offset_x = ff_vc1_field_mvpred_scales[table_index][5][refdist]; if (FFABS(n) > 255) scaledvalue = n; @@ -1341,10 +1341,10 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */, refdist = dir ? v->brfd : v->frfd; if (refdist > 3) refdist = 3; - scalesame1 = vc1_field_mvpred_scales[table_index][1][refdist]; - scalesame2 = vc1_field_mvpred_scales[table_index][2][refdist]; - scalezone1_y = vc1_field_mvpred_scales[table_index][4][refdist]; - zone1offset_y = vc1_field_mvpred_scales[table_index][6][refdist]; + scalesame1 = ff_vc1_field_mvpred_scales[table_index][1][refdist]; + scalesame2 = ff_vc1_field_mvpred_scales[table_index][2][refdist]; + scalezone1_y = ff_vc1_field_mvpred_scales[table_index][4][refdist]; + zone1offset_y = ff_vc1_field_mvpred_scales[table_index][6][refdist]; if (FFABS(n) > 63) scaledvalue = n; @@ -1372,10 +1372,10 @@ static av_always_inline int scaleforopp_x(VC1Context *v, int n /* MV */) int scaledvalue; brfd = FFMIN(v->brfd, 3); - scalezone1_x = vc1_b_field_mvpred_scales[3][brfd]; - zone1offset_x = vc1_b_field_mvpred_scales[5][brfd]; - scaleopp1 = vc1_b_field_mvpred_scales[1][brfd]; - scaleopp2 = vc1_b_field_mvpred_scales[2][brfd]; + scalezone1_x = ff_vc1_b_field_mvpred_scales[3][brfd]; + zone1offset_x = ff_vc1_b_field_mvpred_scales[5][brfd]; + scaleopp1 = ff_vc1_b_field_mvpred_scales[1][brfd]; + scaleopp2 = ff_vc1_b_field_mvpred_scales[2][brfd]; if (FFABS(n) > 255) scaledvalue = n; @@ -1399,10 +1399,10 @@ static av_always_inline int scaleforopp_y(VC1Context *v, int n /* MV */, int dir int scaledvalue; brfd = FFMIN(v->brfd, 3); - scalezone1_y = vc1_b_field_mvpred_scales[4][brfd]; - zone1offset_y = vc1_b_field_mvpred_scales[6][brfd]; - scaleopp1 = vc1_b_field_mvpred_scales[1][brfd]; - scaleopp2 = vc1_b_field_mvpred_scales[2][brfd]; + scalezone1_y = ff_vc1_b_field_mvpred_scales[4][brfd]; + zone1offset_y = ff_vc1_b_field_mvpred_scales[6][brfd]; + scaleopp1 = ff_vc1_b_field_mvpred_scales[1][brfd]; + scaleopp2 = ff_vc1_b_field_mvpred_scales[2][brfd]; if (FFABS(n) > 63) scaledvalue = n; @@ -1438,7 +1438,7 @@ static av_always_inline int scaleforsame(VC1Context *v, int i, int n /* MV */, return n; } brfd = FFMIN(v->brfd, 3); - scalesame = vc1_b_field_mvpred_scales[0][brfd]; + scalesame = ff_vc1_b_field_mvpred_scales[0][brfd]; n = (n * scalesame >> 8) << hpel; return n; @@ -1462,7 +1462,7 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */, refdist = FFMIN(v->refdist, 3); else refdist = dir ? v->brfd : v->frfd; - scaleopp = vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist]; + scaleopp = ff_vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist]; n = (n * scaleopp >> 8) << hpel; return n; @@ -5281,7 +5281,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) init_get_bits(&gb, avctx->extradata, avctx->extradata_size*8); - if (vc1_decode_sequence_header(avctx, v, &gb) < 0) + if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0) return -1; count = avctx->extradata_size*8 - get_bits_count(&gb); @@ -5316,14 +5316,14 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) init_get_bits(&gb, buf2, buf2_size * 8); switch (AV_RB32(start)) { case VC1_CODE_SEQHDR: - if (vc1_decode_sequence_header(avctx, v, &gb) < 0) { + if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0) { av_free(buf2); return -1; } seq_initialized = 1; break; case VC1_CODE_ENTRYPOINT: - if (vc1_decode_entry_point(avctx, v, &gb) < 0) { + if (ff_vc1_decode_entry_point(avctx, v, &gb) < 0) { av_free(buf2); return -1; } @@ -5351,16 +5351,16 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (v->profile == PROFILE_ADVANCED || v->res_fasttx) { for (i = 0; i < 64; i++) { #define transpose(x) ((x >> 3) | ((x & 7) << 3)) - v->zz_8x8[0][i] = transpose(wmv1_scantable[0][i]); - v->zz_8x8[1][i] = transpose(wmv1_scantable[1][i]); - v->zz_8x8[2][i] = transpose(wmv1_scantable[2][i]); - v->zz_8x8[3][i] = transpose(wmv1_scantable[3][i]); + v->zz_8x8[0][i] = transpose(ff_wmv1_scantable[0][i]); + v->zz_8x8[1][i] = transpose(ff_wmv1_scantable[1][i]); + v->zz_8x8[2][i] = transpose(ff_wmv1_scantable[2][i]); + v->zz_8x8[3][i] = transpose(ff_wmv1_scantable[3][i]); v->zzi_8x8[i] = transpose(ff_vc1_adv_interlaced_8x8_zz[i]); } v->left_blk_sh = 0; v->top_blk_sh = 3; } else { - memcpy(v->zz_8x8, wmv1_scantable, 4*64); + memcpy(v->zz_8x8, ff_wmv1_scantable, 4*64); v->left_blk_sh = 3; v->top_blk_sh = 0; } @@ -5396,7 +5396,7 @@ static av_cold int vc1_decode_end(AVCodecContext *avctx) av_freep(&v->sr_rows[i >> 1][i & 1]); av_freep(&v->hrd_rate); av_freep(&v->hrd_buffer); - MPV_common_end(&v->s); + ff_MPV_common_end(&v->s); av_freep(&v->mv_type_mb_plane); av_freep(&v->direct_mb_plane); av_freep(&v->forward_mb_plane); @@ -5504,7 +5504,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, case VC1_CODE_ENTRYPOINT: /* it should be before frame data */ buf_size2 = vc1_unescape_buffer(start + 4, size, buf2); init_get_bits(&s->gb, buf2, buf_size2 * 8); - vc1_decode_entry_point(avctx, v, &s->gb); + ff_vc1_decode_entry_point(avctx, v, &s->gb); break; case VC1_CODE_SLICE: { int buf_size3; @@ -5603,11 +5603,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, // do parse frame header v->pic_header_flag = 0; if (v->profile < PROFILE_ADVANCED) { - if (vc1_parse_frame_header(v, &s->gb) == -1) { + if (ff_vc1_parse_frame_header(v, &s->gb) == -1) { goto err; } } else { - if (vc1_parse_frame_header_adv(v, &s->gb) == -1) { + if (ff_vc1_parse_frame_header_adv(v, &s->gb) == -1) { goto err; } } @@ -5651,7 +5651,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, s->next_p_frame_damaged = 0; } - if (MPV_frame_start(s, avctx) < 0) { + if (ff_MPV_frame_start(s, avctx) < 0) { goto err; } @@ -5702,10 +5702,10 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, if (i) { v->pic_header_flag = 0; if (v->field_mode && i == n_slices1 + 2) - vc1_parse_frame_header_adv(v, &s->gb); + ff_vc1_parse_frame_header_adv(v, &s->gb); else if (get_bits1(&s->gb)) { v->pic_header_flag = 1; - vc1_parse_frame_header_adv(v, &s->gb); + ff_vc1_parse_frame_header_adv(v, &s->gb); } } 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, ff_er_frame_end(s); } - MPV_frame_end(s); + ff_MPV_frame_end(s); if (avctx->codec_id == CODEC_ID_WMV3IMAGE || avctx->codec_id == CODEC_ID_VC1IMAGE) { image: diff --git a/libavcodec/version.h b/libavcodec/version.h index 2bf7ed1db3..7694cb74a6 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -21,7 +21,7 @@ #define AVCODEC_VERSION_H #define LIBAVCODEC_VERSION_MAJOR 54 -#define LIBAVCODEC_VERSION_MINOR 2 +#define LIBAVCODEC_VERSION_MINOR 3 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h index cad080ef3a..59afcce766 100644 --- a/libavcodec/vorbis.h +++ b/libavcodec/vorbis.h @@ -42,7 +42,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num); void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, uint16_t *y_list, int *flag, int multiplier, float * out, int samples); -void vorbis_inverse_coupling(float *mag, float *ang, int blocksize); +void ff_vorbis_inverse_coupling(float *mag, float *ang, int blocksize); #define ilog(i) av_log2(2*(i)) diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index f71d606dad..678aec70b5 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -207,7 +207,7 @@ static void vorbis_free(vorbis_context *vc) for (i = 0; i < vc->codebook_count; ++i) { av_free(vc->codebooks[i].codevectors); - free_vlc(&vc->codebooks[i].vlc); + ff_free_vlc(&vc->codebooks[i].vlc); } av_freep(&vc->codebooks); @@ -990,7 +990,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) int hdr_type, ret; vc->avccontext = avccontext; - dsputil_init(&vc->dsp, avccontext); + ff_dsputil_init(&vc->dsp, avccontext); ff_fmt_convert_init(&vc->fmt_conv, avccontext); 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, } } -void vorbis_inverse_coupling(float *mag, float *ang, int blocksize) +void ff_vorbis_inverse_coupling(float *mag, float *ang, int blocksize) { int i; for (i = 0; i < blocksize; i++) { diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index b5daafcefb..3141c25919 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -292,17 +292,17 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx) return 0; for (i = 0; i < 16; i++) { - free_vlc(&s->dc_vlc[i]); - free_vlc(&s->ac_vlc_1[i]); - free_vlc(&s->ac_vlc_2[i]); - free_vlc(&s->ac_vlc_3[i]); - free_vlc(&s->ac_vlc_4[i]); + ff_free_vlc(&s->dc_vlc[i]); + ff_free_vlc(&s->ac_vlc_1[i]); + ff_free_vlc(&s->ac_vlc_2[i]); + ff_free_vlc(&s->ac_vlc_3[i]); + ff_free_vlc(&s->ac_vlc_4[i]); } - free_vlc(&s->superblock_run_length_vlc); - free_vlc(&s->fragment_run_length_vlc); - free_vlc(&s->mode_code_vlc); - free_vlc(&s->motion_vector_vlc); + ff_free_vlc(&s->superblock_run_length_vlc); + ff_free_vlc(&s->fragment_run_length_vlc); + ff_free_vlc(&s->mode_code_vlc); + ff_free_vlc(&s->motion_vector_vlc); /* release all frames */ vp3_decode_flush(avctx); @@ -1671,7 +1671,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) avctx->chroma_sample_location = AVCHROMA_LOC_CENTER; if(avctx->idct_algo==FF_IDCT_AUTO) avctx->idct_algo=FF_IDCT_VP3; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct); diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index 23d0acc631..dc3c833f44 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -83,7 +83,7 @@ static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect) int sign = vp56_rac_get_prob(c, model->vector_sig[comp]); di = vp56_rac_get_prob(c, model->vector_pdi[comp][0]); di |= vp56_rac_get_prob(c, model->vector_pdi[comp][1]) << 1; - delta = vp56_rac_get_tree(c, vp56_pva_tree, + delta = vp56_rac_get_tree(c, ff_vp56_pva_tree, model->vector_pdv[comp]); delta = di | (delta << 2); delta = (delta ^ -sign) + sign; @@ -180,7 +180,7 @@ static void vp5_parse_coeff(VP56Context *s) if (b > 3) pt = 1; - ctx = 6*s->coeff_ctx[vp56_b6to4[b]][0] + ctx = 6*s->coeff_ctx[ff_vp56_b6to4[b]][0] + s->above_blocks[s->above_block_idx[b]].not_null_dc; model1 = model->coeff_dccv[pt]; model2 = model->coeff_dcct[pt][ctx]; @@ -190,26 +190,26 @@ static void vp5_parse_coeff(VP56Context *s) if (vp56_rac_get_prob(c, model2[0])) { if (vp56_rac_get_prob(c, model2[2])) { if (vp56_rac_get_prob(c, model2[3])) { - s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 4; - idx = vp56_rac_get_tree(c, vp56_pc_tree, model1); + s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 4; + idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1); sign = vp56_rac_get(c); - coeff = vp56_coeff_bias[idx+5]; - for (i=vp56_coeff_bit_length[idx]; i>=0; i--) - coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i; + coeff = ff_vp56_coeff_bias[idx+5]; + for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--) + coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i; } else { if (vp56_rac_get_prob(c, model2[4])) { coeff = 3 + vp56_rac_get_prob(c, model1[5]); - s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 3; + s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 3; } else { coeff = 2; - s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 2; + s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 2; } sign = vp56_rac_get(c); } ct = 2; } else { ct = 1; - s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 1; + s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 1; sign = vp56_rac_get(c); coeff = 1; } @@ -221,24 +221,24 @@ static void vp5_parse_coeff(VP56Context *s) if (ct && !vp56_rac_get_prob(c, model2[1])) break; ct = 0; - s->coeff_ctx[vp56_b6to4[b]][coeff_idx] = 0; + s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx] = 0; } coeff_idx++; if (coeff_idx >= 64) break; cg = vp5_coeff_groups[coeff_idx]; - ctx = s->coeff_ctx[vp56_b6to4[b]][coeff_idx]; + ctx = s->coeff_ctx[ff_vp56_b6to4[b]][coeff_idx]; model1 = model->coeff_ract[pt][ct][cg]; model2 = cg > 2 ? model1 : model->coeff_acct[pt][ct][cg][ctx]; } - ctx_last = FFMIN(s->coeff_ctx_last[vp56_b6to4[b]], 24); - s->coeff_ctx_last[vp56_b6to4[b]] = coeff_idx; + ctx_last = FFMIN(s->coeff_ctx_last[ff_vp56_b6to4[b]], 24); + s->coeff_ctx_last[ff_vp56_b6to4[b]] = coeff_idx; if (coeff_idx < ctx_last) for (i=coeff_idx; i<=ctx_last; i++) - s->coeff_ctx[vp56_b6to4[b]][i] = 5; - s->above_blocks[s->above_block_idx[b]].not_null_dc = s->coeff_ctx[vp56_b6to4[b]][0]; + s->coeff_ctx[ff_vp56_b6to4[b]][i] = 5; + s->above_blocks[s->above_block_idx[b]].not_null_dc = s->coeff_ctx[ff_vp56_b6to4[b]][0]; } } @@ -253,7 +253,7 @@ static void vp5_default_models_init(VP56Context *s) model->vector_pdi[i][0] = 0x55; model->vector_pdi[i][1] = 0x80; } - memcpy(model->mb_types_stats, vp56_def_mb_types_stats, sizeof(model->mb_types_stats)); + memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats)); memset(model->vector_pdv, 0x80, sizeof(model->vector_pdv)); } diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index cca3e207b2..63b844e700 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -268,7 +268,7 @@ static void vp56_add_predictors_dc(VP56Context *s, VP56Frame ref_frame) for (b=0; b<6; b++) { VP56RefDc *ab = &s->above_blocks[s->above_block_idx[b]]; - VP56RefDc *lb = &s->left_block[vp56_b6to4[b]]; + VP56RefDc *lb = &s->left_block[ff_vp56_b6to4[b]]; int count = 0; int dc = 0; int i; @@ -288,12 +288,12 @@ static void vp56_add_predictors_dc(VP56Context *s, VP56Frame ref_frame) count++; } if (count == 0) - dc = s->prev_dc[vp56_b2p[b]][ref_frame]; + dc = s->prev_dc[ff_vp56_b2p[b]][ref_frame]; else if (count == 2) dc /= 2; s->block_coeff[b][idx] += dc; - s->prev_dc[vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx]; + s->prev_dc[ff_vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx]; ab->dc_coeff = s->block_coeff[b][idx]; ab->ref_frame = ref_frame; 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) switch (mb_type) { case VP56_MB_INTRA: for (b=0; b<b_max; b++) { - plane = vp56_b2p[b+ab]; + plane = ff_vp56_b2p[b+ab]; s->dsp.idct_put(frame_current->data[plane] + s->block_offset[b], s->stride[plane], s->block_coeff[b]); } @@ -419,7 +419,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha) case VP56_MB_INTER_NOVEC_PF: case VP56_MB_INTER_NOVEC_GF: for (b=0; b<b_max; b++) { - plane = vp56_b2p[b+ab]; + plane = ff_vp56_b2p[b+ab]; off = s->block_offset[b]; s->dsp.put_pixels_tab[1][0](frame_current->data[plane] + off, frame_ref->data[plane] + off, @@ -439,7 +439,7 @@ static void vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha) for (b=0; b<b_max; b++) { int x_off = b==1 || b==3 ? 8 : 0; int y_off = b==2 || b==3 ? 8 : 0; - plane = vp56_b2p[b+ab]; + plane = ff_vp56_b2p[b+ab]; vp56_mc(s, b, plane, frame_ref->data[plane], s->stride[plane], 16*col+x_off, 16*row+y_off); 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) if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_VP3; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id); ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct); diff --git a/libavcodec/vp56data.c b/libavcodec/vp56data.c index a161f885d9..5500fe00ec 100644 --- a/libavcodec/vp56data.c +++ b/libavcodec/vp56data.c @@ -25,10 +25,10 @@ #include "vp56data.h" -const uint8_t vp56_b2p[] = { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3 }; -const uint8_t vp56_b6to4[] = { 0, 0, 1, 1, 2, 3 }; +const uint8_t ff_vp56_b2p[] = { 0, 0, 0, 0, 1, 2, 3, 3, 3, 3 }; +const uint8_t ff_vp56_b6to4[] = { 0, 0, 1, 1, 2, 3 }; -const uint8_t vp56_coeff_parse_table[6][11] = { +const uint8_t ff_vp56_coeff_parse_table[6][11] = { { 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 145, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 140, 148, 173, 0, 0, 0, 0, 0, 0, 0, 0 }, @@ -37,7 +37,7 @@ const uint8_t vp56_coeff_parse_table[6][11] = { { 129, 130, 133, 140, 153, 177, 196, 230, 243, 254, 254 }, }; -const uint8_t vp56_def_mb_types_stats[3][10][2] = { +const uint8_t ff_vp56_def_mb_types_stats[3][10][2] = { { { 69, 42 }, { 1, 2 }, { 1, 7 }, { 44, 42 }, { 6, 22 }, { 1, 3 }, { 0, 2 }, { 1, 5 }, { 0, 1 }, { 0, 0 }, }, { { 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] = { { 1, 2 }, { 0, 1 }, { 0, 1 }, { 1, 1 }, { 0, 0 }, }, }; -const VP56Tree vp56_pva_tree[] = { +const VP56Tree ff_vp56_pva_tree[] = { { 8, 0}, { 4, 1}, { 2, 2}, {-0}, {-1}, @@ -56,7 +56,7 @@ const VP56Tree vp56_pva_tree[] = { { 2, 6}, {-6}, {-7}, }; -const VP56Tree vp56_pc_tree[] = { +const VP56Tree ff_vp56_pc_tree[] = { { 4, 6}, { 2, 7}, {-0}, {-1}, { 4, 8}, @@ -64,5 +64,5 @@ const VP56Tree vp56_pc_tree[] = { { 2,10}, {-4}, {-5}, }; -const uint8_t vp56_coeff_bias[] = { 0, 1, 2, 3, 4, 5, 7, 11, 19, 35, 67 }; -const uint8_t vp56_coeff_bit_length[] = { 0, 1, 2, 3, 4, 10 }; +const uint8_t ff_vp56_coeff_bias[] = { 0, 1, 2, 3, 4, 5, 7, 11, 19, 35, 67 }; +const uint8_t ff_vp56_coeff_bit_length[] = { 0, 1, 2, 3, 4, 10 }; diff --git a/libavcodec/vp56data.h b/libavcodec/vp56data.h index cb9cf95998..d48a89cbe9 100644 --- a/libavcodec/vp56data.h +++ b/libavcodec/vp56data.h @@ -56,14 +56,14 @@ typedef struct { int8_t prob_idx; } VP56Tree; -extern const uint8_t vp56_b2p[]; -extern const uint8_t vp56_b6to4[]; -extern const uint8_t vp56_coeff_parse_table[6][11]; -extern const uint8_t vp56_def_mb_types_stats[3][10][2]; -extern const VP56Tree vp56_pva_tree[]; -extern const VP56Tree vp56_pc_tree[]; -extern const uint8_t vp56_coeff_bias[]; -extern const uint8_t vp56_coeff_bit_length[]; +extern const uint8_t ff_vp56_b2p[]; +extern const uint8_t ff_vp56_b6to4[]; +extern const uint8_t ff_vp56_coeff_parse_table[6][11]; +extern const uint8_t ff_vp56_def_mb_types_stats[3][10][2]; +extern const VP56Tree ff_vp56_pva_tree[]; +extern const VP56Tree ff_vp56_pc_tree[]; +extern const uint8_t ff_vp56_coeff_bias[]; +extern const uint8_t ff_vp56_coeff_bit_length[]; static const VP56Frame vp56_reference_frame[] = { VP56_FRAME_PREVIOUS, /* VP56_MB_INTER_NOVEC_PF */ diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index 84876b7146..b9a9b237b6 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -178,7 +178,7 @@ static void vp6_default_models_init(VP56Context *s) model->vector_sig[0] = 0x80; model->vector_sig[1] = 0x80; - memcpy(model->mb_types_stats, vp56_def_mb_types_stats, sizeof(model->mb_types_stats)); + memcpy(model->mb_types_stats, ff_vp56_def_mb_types_stats, sizeof(model->mb_types_stats)); memcpy(model->vector_fdv, vp6_def_fdv_vector_model, sizeof(model->vector_fdv)); memcpy(model->vector_pdv, vp6_def_pdv_vector_model, sizeof(model->vector_pdv)); 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[], nodes[map[2*i+1]].count = b + !b; } - free_vlc(vlc); + ff_free_vlc(vlc); /* then build the huffman tree according to probabilities */ return ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp, FF_HUFFMAN_FLAG_HNODE_FIRST); @@ -332,7 +332,7 @@ static void vp6_parse_vector_adjustment(VP56Context *s, VP56mv *vect) else delta |= 8; } else { - delta = vp56_rac_get_tree(c, vp56_pva_tree, + delta = vp56_rac_get_tree(c, ff_vp56_pva_tree, model->vector_pdv[comp]); } @@ -400,7 +400,7 @@ static void vp6_parse_coeff_huffman(VP56Context *s) s->nb_null[1][pt] = vp6_get_nb_null(s); break; } else { - int coeff2 = vp56_coeff_bias[coeff]; + int coeff2 = ff_vp56_coeff_bias[coeff]; if (coeff > 4) coeff2 += get_bits(&s->gb, coeff <= 9 ? coeff - 4 : 11); ct = 1 + (coeff2 > 1); @@ -437,7 +437,7 @@ static void vp6_parse_coeff(VP56Context *s) if (b > 3) pt = 1; - ctx = s->left_block[vp56_b6to4[b]].not_null_dc + ctx = s->left_block[ff_vp56_b6to4[b]].not_null_dc + s->above_blocks[s->above_block_idx[b]].not_null_dc; model1 = model->coeff_dccv[pt]; model2 = model->coeff_dcct[pt][ctx]; @@ -448,10 +448,10 @@ static void vp6_parse_coeff(VP56Context *s) /* parse a coeff */ if (vp56_rac_get_prob(c, model2[2])) { if (vp56_rac_get_prob(c, model2[3])) { - idx = vp56_rac_get_tree(c, vp56_pc_tree, model1); - coeff = vp56_coeff_bias[idx+5]; - for (i=vp56_coeff_bit_length[idx]; i>=0; i--) - coeff += vp56_rac_get_prob(c, vp56_coeff_parse_table[idx][i]) << i; + idx = vp56_rac_get_tree(c, ff_vp56_pc_tree, model1); + coeff = ff_vp56_coeff_bias[idx+5]; + for (i=ff_vp56_coeff_bit_length[idx]; i>=0; i--) + coeff += vp56_rac_get_prob(c, ff_vp56_coeff_parse_table[idx][i]) << i; } else { if (vp56_rac_get_prob(c, model2[4])) coeff = 3 + vp56_rac_get_prob(c, model1[5]); @@ -491,7 +491,7 @@ static void vp6_parse_coeff(VP56Context *s) model1 = model2 = model->coeff_ract[pt][ct][cg]; } - s->left_block[vp56_b6to4[b]].not_null_dc = + s->left_block[ff_vp56_b6to4[b]].not_null_dc = s->above_blocks[s->above_block_idx[b]].not_null_dc = !!s->block_coeff[b][0]; } } @@ -611,11 +611,11 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx) ff_vp56_free(avctx); for (pt=0; pt<2; pt++) { - free_vlc(&s->dccv_vlc[pt]); - free_vlc(&s->runv_vlc[pt]); + ff_free_vlc(&s->dccv_vlc[pt]); + ff_free_vlc(&s->runv_vlc[pt]); for (ct=0; ct<3; ct++) for (cg=0; cg<6; cg++) - free_vlc(&s->ract_vlc[pt][ct][cg]); + ff_free_vlc(&s->ract_vlc[pt][ct][cg]); } return 0; } diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 4728393d10..dab26a6a75 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -1788,7 +1788,7 @@ static av_cold int vp8_decode_init(AVCodecContext *avctx) s->avctx = avctx; avctx->pix_fmt = PIX_FMT_YUV420P; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_h264_pred_init(&s->hpc, CODEC_ID_VP8, 8, 1); ff_vp8dsp_init(&s->vp8dsp); diff --git a/libavcodec/wma.c b/libavcodec/wma.c index 562abf3812..a7d5ef2841 100644 --- a/libavcodec/wma.c +++ b/libavcodec/wma.c @@ -126,7 +126,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2) s->bit_rate = avctx->bit_rate; s->block_align = avctx->block_align; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_fmt_convert_init(&s->fmt_conv, avctx); if (avctx->codec->id == CODEC_ID_WMAV1) { @@ -417,13 +417,13 @@ int ff_wma_end(AVCodecContext *avctx) ff_mdct_end(&s->mdct_ctx[i]); if (s->use_exp_vlc) { - free_vlc(&s->exp_vlc); + ff_free_vlc(&s->exp_vlc); } if (s->use_noise_coding) { - free_vlc(&s->hgain_vlc); + ff_free_vlc(&s->hgain_vlc); } for (i = 0; i < 2; i++) { - free_vlc(&s->coef_vlc[i]); + ff_free_vlc(&s->coef_vlc[i]); av_free(s->run_table[i]); av_free(s->level_table[i]); av_free(s->int_table[i]); diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index eccfb55432..1e2f246847 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -281,7 +281,7 @@ static av_cold int decode_init(AVCodecContext *avctx) int num_possible_block_sizes; s->avctx = avctx; - dsputil_init(&s->dsp, avctx); + ff_dsputil_init(&s->dsp, avctx); ff_fmt_convert_init(&s->fmt_conv, avctx); init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE); diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index 32aaa8f6df..621b6beba3 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -28,8 +28,8 @@ av_cold void ff_wmv2_common_init(Wmv2Context * w){ MpegEncContext * const s= &w->s; - ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], wmv2_scantableA); - ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], wmv2_scantableB); + ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], ff_wmv2_scantableA); + ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], ff_wmv2_scantableB); } static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index bc9e4fa0ab..5f4f70a3fd 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -55,7 +55,7 @@ static int encode_ext_header(Wmv2Context *w){ static av_cold int wmv2_encode_init(AVCodecContext *avctx){ Wmv2Context * const w= avctx->priv_data; - if(MPV_encode_init(avctx) < 0) + if(ff_MPV_encode_init(avctx) < 0) return -1; ff_wmv2_common_init(w); @@ -167,11 +167,11 @@ void ff_wmv2_encode_mb(MpegEncContext * s, } put_bits(&s->pb, - wmv2_inter_table[w->cbp_table_index][cbp + 64][1], - wmv2_inter_table[w->cbp_table_index][cbp + 64][0]); + ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][1], + ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][0]); /* motion vector */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); ff_msmpeg4_encode_motion(s, motion_x - pred_x, motion_y - pred_y); } else { @@ -196,13 +196,13 @@ void ff_wmv2_encode_mb(MpegEncContext * s, ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); } else { put_bits(&s->pb, - wmv2_inter_table[w->cbp_table_index][cbp][1], - wmv2_inter_table[w->cbp_table_index][cbp][0]); + ff_wmv2_inter_table[w->cbp_table_index][cbp][1], + ff_wmv2_inter_table[w->cbp_table_index][cbp][0]); } put_bits(&s->pb, 1, 0); /* no AC prediction yet */ if(s->inter_intra_pred){ s->h263_aic_dir=0; - put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]); + put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]); } } @@ -217,8 +217,8 @@ AVCodec ff_wmv2_encoder = { .id = CODEC_ID_WMV2, .priv_data_size = sizeof(Wmv2Context), .init = wmv2_encode_init, - .encode = MPV_encode_picture, - .close = MPV_encode_end, + .encode = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 8"), }; diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 4402995da5..8b976f7800 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -2415,7 +2415,7 @@ extern void ff_butterflies_float_interleave_sse(float *dst, const float *src0, extern void ff_butterflies_float_interleave_avx(float *dst, const float *src0, const float *src1, int len); -void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) { int mm_flags = av_get_cpu_flags(); const int high_bit_depth = avctx->bits_per_raw_sample > 8; @@ -2926,5 +2926,5 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) } if (CONFIG_ENCODERS) - dsputilenc_init_mmx(c, avctx); + ff_dsputilenc_init_mmx(c, avctx); } diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h index 59a9613609..6ba5ea83bc 100644 --- a/libavcodec/x86/dsputil_mmx.h +++ b/libavcodec/x86/dsputil_mmx.h @@ -184,8 +184,8 @@ static inline void transpose4x4(uint8_t *dst, uint8_t *src, x86_reg dst_stride, "pcmpeqd %%" #regd ", %%" #regd " \n\t" \ "psrlw $15, %%" #regd ::) -void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx); -void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); +void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx); +void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index f13c1219da..c0f9111f41 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -1095,7 +1095,7 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int si #endif //HAVE_SSSE3 -void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) +void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) { int mm_flags = av_get_cpu_flags(); int bit_depth = avctx->bits_per_raw_sample; @@ -1192,5 +1192,5 @@ void dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) } } - dsputil_init_pix_mmx(c, avctx); + ff_dsputil_init_pix_mmx(c, avctx); } diff --git a/libavcodec/x86/motion_est_mmx.c b/libavcodec/x86/motion_est_mmx.c index fefef41058..33bb020a5e 100644 --- a/libavcodec/x86/motion_est_mmx.c +++ b/libavcodec/x86/motion_est_mmx.c @@ -422,7 +422,7 @@ static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, uint8_t *blk1, int stride, PIX_SAD(mmx) PIX_SAD(mmx2) -void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx) +void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx) { int mm_flags = av_get_cpu_flags(); diff --git a/libavcodec/x86/mpegvideo_mmx.c b/libavcodec/x86/mpegvideo_mmx.c index 3b8513d3f0..673950593b 100644 --- a/libavcodec/x86/mpegvideo_mmx.c +++ b/libavcodec/x86/mpegvideo_mmx.c @@ -29,7 +29,7 @@ #include "libavcodec/mpegvideo.h" #include "dsputil_mmx.h" -extern uint16_t inv_zigzag_direct16[64]; +extern uint16_t ff_inv_zigzag_direct16[64]; static void dct_unquantize_h263_intra_mmx(MpegEncContext *s, @@ -626,7 +626,7 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ #include "mpegvideo_mmx_template.c" #endif -void MPV_common_init_mmx(MpegEncContext *s) +void ff_MPV_common_init_mmx(MpegEncContext *s) { int mm_flags = av_get_cpu_flags(); diff --git a/libavcodec/x86/mpegvideo_mmx_template.c b/libavcodec/x86/mpegvideo_mmx_template.c index 6569ba41eb..9119476d36 100644 --- a/libavcodec/x86/mpegvideo_mmx_template.c +++ b/libavcodec/x86/mpegvideo_mmx_template.c @@ -171,7 +171,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1 : "+a" (last_non_zero_p1) : "r" (block+64), "r" (qmat), "r" (bias), - "r" (inv_zigzag_direct16+64), "r" (temp_block+64) + "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64) XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7") ); @@ -205,7 +205,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1 : "+a" (last_non_zero_p1) : "r" (block+64), "r" (qmat+64), "r" (bias+64), - "r" (inv_zigzag_direct16+64), "r" (temp_block+64) + "r" (ff_inv_zigzag_direct16+64), "r" (temp_block+64) XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7") ); |