[FFmpeg-cvslog] lavc: Replace av_dlog and tprintf with internal macros

Vittorio Giovara git at videolan.org
Mon Apr 20 04:28:20 CEST 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Mon Mar 16 08:57:36 2015 +0000| [6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25] | committer: Vittorio Giovara

lavc: Replace av_dlog and tprintf with internal macros

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25
---

 libavcodec/aacdec.c                |    8 +--
 libavcodec/ac3enc.c                |   62 ++++++++--------
 libavcodec/alsdec.c                |   36 +++++-----
 libavcodec/audio_frame_queue.c     |    8 +--
 libavcodec/bitstream.c             |   11 +--
 libavcodec/cook.c                  |    8 +--
 libavcodec/dcadec.c                |   10 +--
 libavcodec/dnxhddec.c              |   10 +--
 libavcodec/dnxhdenc.c              |    8 +--
 libavcodec/dvbsub_parser.c         |   15 ++--
 libavcodec/dvbsubdec.c             |   43 ++++++------
 libavcodec/dvdec.c                 |   12 ++--
 libavcodec/dvdsubdec.c             |   16 ++---
 libavcodec/escape130.c             |    2 +-
 libavcodec/ffv1dec.c               |    6 +-
 libavcodec/ffv1enc.c               |    4 +-
 libavcodec/flashsv.c               |    2 +-
 libavcodec/flashsvenc.c            |    4 +-
 libavcodec/flicvideo.c             |    2 +-
 libavcodec/get_bits.h              |    5 --
 libavcodec/gifdec.c                |   12 ++--
 libavcodec/h261dec.c               |    4 +-
 libavcodec/h263dec.c               |    2 +-
 libavcodec/h264.c                  |    2 +-
 libavcodec/h264.h                  |    3 +-
 libavcodec/h264_cabac.c            |   12 ++--
 libavcodec/h264_cavlc.c            |   14 ++--
 libavcodec/h264_loopfilter.c       |   12 ++--
 libavcodec/h264_mvpred.h           |   18 ++---
 libavcodec/h264_refs.c             |    4 +-
 libavcodec/h264_slice.c            |    6 +-
 libavcodec/imc.c                   |    2 +-
 libavcodec/indeo3.c                |    2 +-
 libavcodec/indeo4.c                |    7 +-
 libavcodec/internal.h              |   13 ++++
 libavcodec/interplayvideo.c        |   12 ++--
 libavcodec/ituh263dec.c            |    9 +--
 libavcodec/ivi.c                   |    4 +-
 libavcodec/jpegls.c                |    3 +-
 libavcodec/jpeglsdec.c             |    6 +-
 libavcodec/libmp3lame.c            |    4 +-
 libavcodec/libopencore-amr.c       |    6 +-
 libavcodec/mjpegdec.c              |   10 +--
 libavcodec/motion_est.c            |    5 +-
 libavcodec/mpeg12dec.c             |   48 ++++++-------
 libavcodec/mpegaudiodec_template.c |   20 +++---
 libavcodec/mpegaudiodecheader.c    |   12 ++--
 libavcodec/mpegaudioenc.c          |    8 +--
 libavcodec/mpegvideo.c             |    2 +-
 libavcodec/mpegvideo_enc.c         |    6 +-
 libavcodec/mpegvideo_parser.c      |    2 +-
 libavcodec/msmpeg4dec.c            |   11 +--
 libavcodec/msmpeg4enc.c            |    3 +-
 libavcodec/parser.c                |    9 +--
 libavcodec/pcm-bluray.c            |    6 +-
 libavcodec/pcm-dvd.c               |    4 +-
 libavcodec/pgssubdec.c             |   18 ++---
 libavcodec/pngdec.c                |    6 +-
 libavcodec/ratecontrol.c           |   11 +--
 libavcodec/rv10.c                  |   10 +--
 libavcodec/svq1dec.c               |   14 ++--
 libavcodec/vaapi.c                 |    2 +-
 libavcodec/vaapi_h264.c            |    6 +-
 libavcodec/vaapi_mpeg2.c           |    4 +-
 libavcodec/vaapi_mpeg4.c           |    4 +-
 libavcodec/vaapi_vc1.c             |    4 +-
 libavcodec/vc1.c                   |    2 +-
 libavcodec/vc1dec.c                |    2 +-
 libavcodec/vorbisdec.c             |  136 ++++++++++++++++++------------------
 libavcodec/vp3.c                   |    2 +-
 libavcodec/vqavideo.c              |   12 ++--
 libavcodec/wma.c                   |   21 +++---
 libavcodec/wmadec.c                |   22 +++---
 libavcodec/wmalosslessdec.c        |   14 ++--
 libavcodec/wmaprodec.c             |   32 ++++-----
 libavcodec/wmv2dec.c               |    7 +-
 76 files changed, 463 insertions(+), 441 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 7236a05..ebeda9b 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -862,10 +862,10 @@ static int decode_audio_specific_config(AACContext *ac,
     GetBitContext gb;
     int i, ret;
 
-    av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
+    ff_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
     for (i = 0; i < avctx->extradata_size; i++)
-        av_dlog(avctx, "%02x ", avctx->extradata[i]);
-    av_dlog(avctx, "\n");
+        ff_dlog(avctx, "%02x ", avctx->extradata[i]);
+    ff_dlog(avctx, "\n");
 
     if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
         return ret;
@@ -912,7 +912,7 @@ static int decode_audio_specific_config(AACContext *ac,
         return AVERROR(ENOSYS);
     }
 
-    av_dlog(avctx,
+    ff_dlog(avctx,
             "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
             m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
             m4ac->sample_rate, m4ac->sbr,
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 13666ef..4215c10 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1690,43 +1690,43 @@ static void dprint_options(AC3EncodeContext *s)
     case 16:  av_strlcpy(strbuf, "E-AC-3 (enhanced)",       32); break;
     default: snprintf(strbuf, 32, "ERROR");
     }
-    av_dlog(avctx, "bitstream_id: %s (%d)\n", strbuf, s->bitstream_id);
-    av_dlog(avctx, "sample_fmt: %s\n", av_get_sample_fmt_name(avctx->sample_fmt));
+    ff_dlog(avctx, "bitstream_id: %s (%d)\n", strbuf, s->bitstream_id);
+    ff_dlog(avctx, "sample_fmt: %s\n", av_get_sample_fmt_name(avctx->sample_fmt));
     av_get_channel_layout_string(strbuf, 32, s->channels, avctx->channel_layout);
-    av_dlog(avctx, "channel_layout: %s\n", strbuf);
-    av_dlog(avctx, "sample_rate: %d\n", s->sample_rate);
-    av_dlog(avctx, "bit_rate: %d\n", s->bit_rate);
-    av_dlog(avctx, "blocks/frame: %d (code=%d)\n", s->num_blocks, s->num_blks_code);
+    ff_dlog(avctx, "channel_layout: %s\n", strbuf);
+    ff_dlog(avctx, "sample_rate: %d\n", s->sample_rate);
+    ff_dlog(avctx, "bit_rate: %d\n", s->bit_rate);
+    ff_dlog(avctx, "blocks/frame: %d (code=%d)\n", s->num_blocks, s->num_blks_code);
     if (s->cutoff)
-        av_dlog(avctx, "cutoff: %d\n", s->cutoff);
+        ff_dlog(avctx, "cutoff: %d\n", s->cutoff);
 
-    av_dlog(avctx, "per_frame_metadata: %s\n",
+    ff_dlog(avctx, "per_frame_metadata: %s\n",
             opt->allow_per_frame_metadata?"on":"off");
     if (s->has_center)
-        av_dlog(avctx, "center_mixlev: %0.3f (%d)\n", opt->center_mix_level,
+        ff_dlog(avctx, "center_mixlev: %0.3f (%d)\n", opt->center_mix_level,
                 s->center_mix_level);
     else
-        av_dlog(avctx, "center_mixlev: {not written}\n");
+        ff_dlog(avctx, "center_mixlev: {not written}\n");
     if (s->has_surround)
-        av_dlog(avctx, "surround_mixlev: %0.3f (%d)\n", opt->surround_mix_level,
+        ff_dlog(avctx, "surround_mixlev: %0.3f (%d)\n", opt->surround_mix_level,
                 s->surround_mix_level);
     else
-        av_dlog(avctx, "surround_mixlev: {not written}\n");
+        ff_dlog(avctx, "surround_mixlev: {not written}\n");
     if (opt->audio_production_info) {
-        av_dlog(avctx, "mixing_level: %ddB\n", opt->mixing_level);
+        ff_dlog(avctx, "mixing_level: %ddB\n", opt->mixing_level);
         switch (opt->room_type) {
         case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
         case AC3ENC_OPT_LARGE_ROOM:    av_strlcpy(strbuf, "large", 32);        break;
         case AC3ENC_OPT_SMALL_ROOM:    av_strlcpy(strbuf, "small", 32);        break;
         default: snprintf(strbuf, 32, "ERROR (%d)", opt->room_type);
         }
-        av_dlog(avctx, "room_type: %s\n", strbuf);
+        ff_dlog(avctx, "room_type: %s\n", strbuf);
     } else {
-        av_dlog(avctx, "mixing_level: {not written}\n");
-        av_dlog(avctx, "room_type: {not written}\n");
+        ff_dlog(avctx, "mixing_level: {not written}\n");
+        ff_dlog(avctx, "room_type: {not written}\n");
     }
-    av_dlog(avctx, "copyright: %s\n", opt->copyright?"on":"off");
-    av_dlog(avctx, "dialnorm: %ddB\n", opt->dialogue_level);
+    ff_dlog(avctx, "copyright: %s\n", opt->copyright?"on":"off");
+    ff_dlog(avctx, "dialnorm: %ddB\n", opt->dialogue_level);
     if (s->channel_mode == AC3_CHMODE_STEREO) {
         switch (opt->dolby_surround_mode) {
         case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
@@ -1734,11 +1734,11 @@ static void dprint_options(AC3EncodeContext *s)
         case AC3ENC_OPT_MODE_OFF:      av_strlcpy(strbuf, "off", 32);          break;
         default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_mode);
         }
-        av_dlog(avctx, "dsur_mode: %s\n", strbuf);
+        ff_dlog(avctx, "dsur_mode: %s\n", strbuf);
     } else {
-        av_dlog(avctx, "dsur_mode: {not written}\n");
+        ff_dlog(avctx, "dsur_mode: {not written}\n");
     }
-    av_dlog(avctx, "original: %s\n", opt->original?"on":"off");
+    ff_dlog(avctx, "original: %s\n", opt->original?"on":"off");
 
     if (s->bitstream_id == 6) {
         if (opt->extended_bsi_1) {
@@ -1748,17 +1748,17 @@ static void dprint_options(AC3EncodeContext *s)
             case AC3ENC_OPT_DOWNMIX_LORO:  av_strlcpy(strbuf, "loro", 32);         break;
             default: snprintf(strbuf, 32, "ERROR (%d)", opt->preferred_stereo_downmix);
             }
-            av_dlog(avctx, "dmix_mode: %s\n", strbuf);
-            av_dlog(avctx, "ltrt_cmixlev: %0.3f (%d)\n",
+            ff_dlog(avctx, "dmix_mode: %s\n", strbuf);
+            ff_dlog(avctx, "ltrt_cmixlev: %0.3f (%d)\n",
                     opt->ltrt_center_mix_level, s->ltrt_center_mix_level);
-            av_dlog(avctx, "ltrt_surmixlev: %0.3f (%d)\n",
+            ff_dlog(avctx, "ltrt_surmixlev: %0.3f (%d)\n",
                     opt->ltrt_surround_mix_level, s->ltrt_surround_mix_level);
-            av_dlog(avctx, "loro_cmixlev: %0.3f (%d)\n",
+            ff_dlog(avctx, "loro_cmixlev: %0.3f (%d)\n",
                     opt->loro_center_mix_level, s->loro_center_mix_level);
-            av_dlog(avctx, "loro_surmixlev: %0.3f (%d)\n",
+            ff_dlog(avctx, "loro_surmixlev: %0.3f (%d)\n",
                     opt->loro_surround_mix_level, s->loro_surround_mix_level);
         } else {
-            av_dlog(avctx, "extended bitstream info 1: {not written}\n");
+            ff_dlog(avctx, "extended bitstream info 1: {not written}\n");
         }
         if (opt->extended_bsi_2) {
             switch (opt->dolby_surround_ex_mode) {
@@ -1767,23 +1767,23 @@ static void dprint_options(AC3EncodeContext *s)
             case AC3ENC_OPT_MODE_OFF:      av_strlcpy(strbuf, "off", 32);          break;
             default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_surround_ex_mode);
             }
-            av_dlog(avctx, "dsurex_mode: %s\n", strbuf);
+            ff_dlog(avctx, "dsurex_mode: %s\n", strbuf);
             switch (opt->dolby_headphone_mode) {
             case AC3ENC_OPT_NOT_INDICATED: av_strlcpy(strbuf, "notindicated", 32); break;
             case AC3ENC_OPT_MODE_ON:       av_strlcpy(strbuf, "on", 32);           break;
             case AC3ENC_OPT_MODE_OFF:      av_strlcpy(strbuf, "off", 32);          break;
             default: snprintf(strbuf, 32, "ERROR (%d)", opt->dolby_headphone_mode);
             }
-            av_dlog(avctx, "dheadphone_mode: %s\n", strbuf);
+            ff_dlog(avctx, "dheadphone_mode: %s\n", strbuf);
 
             switch (opt->ad_converter_type) {
             case AC3ENC_OPT_ADCONV_STANDARD: av_strlcpy(strbuf, "standard", 32); break;
             case AC3ENC_OPT_ADCONV_HDCD:     av_strlcpy(strbuf, "hdcd", 32);     break;
             default: snprintf(strbuf, 32, "ERROR (%d)", opt->ad_converter_type);
             }
-            av_dlog(avctx, "ad_conv_type: %s\n", strbuf);
+            ff_dlog(avctx, "ad_conv_type: %s\n", strbuf);
         } else {
-            av_dlog(avctx, "extended bitstream info 2: {not written}\n");
+            ff_dlog(avctx, "extended bitstream info 2: {not written}\n");
         }
     }
 #endif
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 4bb35cc..814a054 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -252,24 +252,24 @@ static av_cold void dprint_specific_config(ALSDecContext *ctx)
     AVCodecContext *avctx    = ctx->avctx;
     ALSSpecificConfig *sconf = &ctx->sconf;
 
-    av_dlog(avctx, "resolution = %i\n",           sconf->resolution);
-    av_dlog(avctx, "floating = %i\n",             sconf->floating);
-    av_dlog(avctx, "frame_length = %i\n",         sconf->frame_length);
-    av_dlog(avctx, "ra_distance = %i\n",          sconf->ra_distance);
-    av_dlog(avctx, "ra_flag = %i\n",              sconf->ra_flag);
-    av_dlog(avctx, "adapt_order = %i\n",          sconf->adapt_order);
-    av_dlog(avctx, "coef_table = %i\n",           sconf->coef_table);
-    av_dlog(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
-    av_dlog(avctx, "max_order = %i\n",            sconf->max_order);
-    av_dlog(avctx, "block_switching = %i\n",      sconf->block_switching);
-    av_dlog(avctx, "bgmc = %i\n",                 sconf->bgmc);
-    av_dlog(avctx, "sb_part = %i\n",              sconf->sb_part);
-    av_dlog(avctx, "joint_stereo = %i\n",         sconf->joint_stereo);
-    av_dlog(avctx, "mc_coding = %i\n",            sconf->mc_coding);
-    av_dlog(avctx, "chan_config = %i\n",          sconf->chan_config);
-    av_dlog(avctx, "chan_sort = %i\n",            sconf->chan_sort);
-    av_dlog(avctx, "RLSLMS = %i\n",               sconf->rlslms);
-    av_dlog(avctx, "chan_config_info = %i\n",     sconf->chan_config_info);
+    ff_dlog(avctx, "resolution = %i\n",           sconf->resolution);
+    ff_dlog(avctx, "floating = %i\n",             sconf->floating);
+    ff_dlog(avctx, "frame_length = %i\n",         sconf->frame_length);
+    ff_dlog(avctx, "ra_distance = %i\n",          sconf->ra_distance);
+    ff_dlog(avctx, "ra_flag = %i\n",              sconf->ra_flag);
+    ff_dlog(avctx, "adapt_order = %i\n",          sconf->adapt_order);
+    ff_dlog(avctx, "coef_table = %i\n",           sconf->coef_table);
+    ff_dlog(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
+    ff_dlog(avctx, "max_order = %i\n",            sconf->max_order);
+    ff_dlog(avctx, "block_switching = %i\n",      sconf->block_switching);
+    ff_dlog(avctx, "bgmc = %i\n",                 sconf->bgmc);
+    ff_dlog(avctx, "sb_part = %i\n",              sconf->sb_part);
+    ff_dlog(avctx, "joint_stereo = %i\n",         sconf->joint_stereo);
+    ff_dlog(avctx, "mc_coding = %i\n",            sconf->mc_coding);
+    ff_dlog(avctx, "chan_config = %i\n",          sconf->chan_config);
+    ff_dlog(avctx, "chan_sort = %i\n",            sconf->chan_sort);
+    ff_dlog(avctx, "RLSLMS = %i\n",               sconf->rlslms);
+    ff_dlog(avctx, "chan_config_info = %i\n",     sconf->chan_config_info);
 #endif
 }
 
diff --git a/libavcodec/audio_frame_queue.c b/libavcodec/audio_frame_queue.c
index 82c16a1..15ffa82 100644
--- a/libavcodec/audio_frame_queue.c
+++ b/libavcodec/audio_frame_queue.c
@@ -56,12 +56,12 @@ void ff_af_queue_close(AudioFrameQueue *afq)
 static void af_queue_log_state(AudioFrameQueue *afq)
 {
     AudioFrame *f;
-    av_dlog(afq->avctx, "remaining delay   = %d\n", afq->remaining_delay);
-    av_dlog(afq->avctx, "remaining samples = %d\n", afq->remaining_samples);
-    av_dlog(afq->avctx, "frames:\n");
+    ff_dlog(afq->avctx, "remaining delay   = %d\n", afq->remaining_delay);
+    ff_dlog(afq->avctx, "remaining samples = %d\n", afq->remaining_samples);
+    ff_dlog(afq->avctx, "frames:\n");
     f = afq->frame_queue;
     while (f) {
-        av_dlog(afq->avctx, "  [ pts=%9"PRId64" duration=%d ]\n",
+        ff_dlog(afq->avctx, "  [ pts=%9"PRId64" duration=%d ]\n",
                 f->pts, f->duration);
         f = f->next;
     }
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index f36997e..93047a2 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -29,6 +29,7 @@
  */
 
 #include "avcodec.h"
+#include "internal.h"
 #include "mathops.h"
 #include "get_bits.h"
 #include "put_bits.h"
@@ -166,7 +167,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
 
     table_size = 1 << table_nb_bits;
     table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
-    av_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
+    ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
     if (table_index < 0)
         return table_index;
     table = &vlc->table[table_index];
@@ -181,7 +182,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
         n      = codes[i].bits;
         code   = codes[i].code;
         symbol = codes[i].symbol;
-        av_dlog(NULL, "i=%d n=%d code=0x%x\n", i, n, code);
+        ff_dlog(NULL, "i=%d n=%d code=0x%x\n", i, n, code);
         if (n <= table_nb_bits) {
             /* no need to add another table */
             j = code >> (32 - table_nb_bits);
@@ -192,7 +193,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
                 inc = 1 << n;
             }
             for (k = 0; k < nb; k++) {
-                av_dlog(NULL, "%4x: code=%d n=%d\n", j, i, n);
+                ff_dlog(NULL, "%4x: code=%d n=%d\n", j, i, n);
                 if (table[j][1] /*bits*/ != 0) {
                     av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
                     return AVERROR_INVALIDDATA;
@@ -222,7 +223,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
             subtable_bits = FFMIN(subtable_bits, table_nb_bits);
             j = (flags & INIT_VLC_LE) ? bitswap_32(code_prefix) >> (32 - table_nb_bits) : code_prefix;
             table[j][1] = -subtable_bits;
-            av_dlog(NULL, "%4x: n=%d (subtable)\n",
+            ff_dlog(NULL, "%4x: n=%d (subtable)\n",
                     j, codes[i].bits + table_nb_bits);
             index = build_table(vlc, subtable_bits, k-i, codes+i, flags);
             if (index < 0)
@@ -285,7 +286,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
         vlc->table_size      = 0;
     }
 
-    av_dlog(NULL, "build table nb_codes=%d\n", nb_codes);
+    ff_dlog(NULL, "build table nb_codes=%d\n", nb_codes);
 
     buf = av_malloc((nb_codes + 1) * sizeof(VLCcode));
     if (!buf)
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 5c55d2b..d122041 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -1013,14 +1013,14 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
 static void dump_cook_context(COOKContext *q)
 {
     //int i=0;
-#define PRINT(a, b) av_dlog(q->avctx, " %s = %d\n", a, b);
-    av_dlog(q->avctx, "COOKextradata\n");
-    av_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion);
+#define PRINT(a, b) ff_dlog(q->avctx, " %s = %d\n", a, b);
+    ff_dlog(q->avctx, "COOKextradata\n");
+    ff_dlog(q->avctx, "cookversion=%x\n", q->subpacket[0].cookversion);
     if (q->subpacket[0].cookversion > STEREO) {
         PRINT("js_subband_start", q->subpacket[0].js_subband_start);
         PRINT("js_vlc_bits", q->subpacket[0].js_vlc_bits);
     }
-    av_dlog(q->avctx, "COOKContext\n");
+    ff_dlog(q->avctx, "COOKContext\n");
     PRINT("nb_channels", q->avctx->channels);
     PRINT("bit_rate", q->avctx->bit_rate);
     PRINT("sample_rate", q->avctx->sample_rate);
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 57198b0..c4dbf50 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -401,7 +401,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
             }
 
             if (s->bitalloc[j][k] > 26) {
-                av_dlog(s->avctx, "bitalloc index [%i][%i] too big (%i)\n",
+                ff_dlog(s->avctx, "bitalloc index [%i][%i] too big (%i)\n",
                         j, k, s->bitalloc[j][k]);
                 return AVERROR_INVALIDDATA;
             }
@@ -1374,14 +1374,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
                     s->downmix_coef[i][1] = ff_dca_default_coeffs[am][i][1];
                 }
             }
-            av_dlog(s->avctx, "Stereo downmix coeffs:\n");
+            ff_dlog(s->avctx, "Stereo downmix coeffs:\n");
             for (i = 0; i < num_core_channels + !!s->lfe; i++) {
-                av_dlog(s->avctx, "L, input channel %d = %f\n", i,
+                ff_dlog(s->avctx, "L, input channel %d = %f\n", i,
                         s->downmix_coef[i][0]);
-                av_dlog(s->avctx, "R, input channel %d = %f\n", i,
+                ff_dlog(s->avctx, "R, input channel %d = %f\n", i,
                         s->downmix_coef[i][1]);
             }
-            av_dlog(s->avctx, "\n");
+            ff_dlog(s->avctx, "\n");
         }
     } else {
         av_log(avctx, AV_LOG_ERROR, "Non standard configuration %d !\n", s->amode);
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index a6bd0fe..3558dee 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -132,7 +132,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     ctx->height = AV_RB16(buf + 0x18);
     ctx->width  = AV_RB16(buf + 0x1a);
 
-    av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
+    ff_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
 
     if (!ctx->bit_depth) {
         ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
@@ -161,7 +161,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     }
 
     cid = AV_RB32(buf + 0x28);
-    av_dlog(ctx->avctx, "compression id %d\n", cid);
+    ff_dlog(ctx->avctx, "compression id %d\n", cid);
 
     if ((ret = dnxhd_init_vlc(ctx, cid)) < 0)
         return ret;
@@ -184,7 +184,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
     ctx->mb_width  = ctx->width >> 4;
     ctx->mb_height = buf[0x16d];
 
-    av_dlog(ctx->avctx,
+    ff_dlog(ctx->avctx,
             "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
 
     if ((ctx->height + 15) >> 4 == ctx->mb_height && frame->interlaced_frame)
@@ -199,7 +199,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
 
     for (i = 0; i < ctx->mb_height; i++) {
         ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i << 2));
-        av_dlog(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
+        ff_dlog(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
         if (buf_size < ctx->mb_scan_index[i] + 0x280) {
             av_log(ctx->avctx, AV_LOG_ERROR,
                    "invalid mb scan index (%d < %d).\n",
@@ -413,7 +413,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data,
     int first_field = 1;
     int ret;
 
-    av_dlog(avctx, "frame size %d\n", buf_size);
+    ff_dlog(avctx, "frame size %d\n", buf_size);
 
 decode_coding_unit:
     if ((ret = dnxhd_decode_header(ctx, picture, buf, buf_size, first_field)) < 0)
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 71eee9f..dd7d8d1 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -814,7 +814,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
             if (bits > ctx->frame_bits)
                 break;
         }
-        // av_dlog(ctx->m.avctx,
+        // ff_dlog(ctx->m.avctx,
         //         "lambda %d, up %u, down %u, bits %d, frame %d\n",
         //         lambda, last_higher, last_lower, bits, ctx->frame_bits);
         if (end) {
@@ -845,7 +845,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
             down_step = 1<<LAMBDA_FRAC_BITS;
         }
     }
-    //av_dlog(ctx->m.avctx, "out lambda %d\n", lambda);
+    //ff_dlog(ctx->m.avctx, "out lambda %d\n", lambda);
     ctx->lambda = lambda;
     return 0;
 }
@@ -874,7 +874,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
             if (bits > ctx->frame_bits)
                 break;
         }
-        // av_dlog(ctx->m.avctx,
+        // ff_dlog(ctx->m.avctx,
         //         "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
         //         ctx->m.avctx->frame_number, qscale, bits, ctx->frame_bits,
         //         last_higher, last_lower);
@@ -906,7 +906,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
                 return AVERROR(EINVAL);
         }
     }
-    //av_dlog(ctx->m.avctx, "out qscale %d\n", qscale);
+    //ff_dlog(ctx->m.avctx, "out qscale %d\n", qscale);
     ctx->qscale = qscale;
     return 0;
 }
diff --git a/libavcodec/dvbsub_parser.c b/libavcodec/dvbsub_parser.c
index 295e03b..2e7d8c2 100644
--- a/libavcodec/dvbsub_parser.c
+++ b/libavcodec/dvbsub_parser.c
@@ -20,6 +20,7 @@
  */
 #include "avcodec.h"
 #include "get_bits.h"
+#include "internal.h"
 
 /* Parser (mostly) copied from dvdsub.c */
 
@@ -51,18 +52,18 @@ static int dvbsub_parse(AVCodecParserContext *s,
     uint8_t *p, *p_end;
     int i, len, buf_pos = 0;
 
-    av_dlog(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
+    ff_dlog(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
             s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
 
     for (i=0; i < buf_size; i++)
     {
-        av_dlog(avctx, "%02x ", buf[i]);
+        ff_dlog(avctx, "%02x ", buf[i]);
         if (i % 16 == 15)
-            av_dlog(avctx, "\n");
+            ff_dlog(avctx, "\n");
     }
 
     if (i % 16 != 0)
-        av_dlog(avctx, "\n");
+        ff_dlog(avctx, "\n");
 
     *poutbuf = NULL;
     *poutbuf_size = 0;
@@ -73,7 +74,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
     {
         if (pc->packet_index != pc->packet_start)
         {
-            av_dlog(avctx, "Discarding %d bytes\n",
+            ff_dlog(avctx, "Discarding %d bytes\n",
                     pc->packet_index - pc->packet_start);
         }
 
@@ -81,7 +82,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
         pc->packet_index = 0;
 
         if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
-            av_dlog(avctx, "Bad packet header\n");
+            ff_dlog(avctx, "Bad packet header\n");
             return -1;
         }
 
@@ -138,7 +139,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
         } else if (*p == 0xff) {
             if (p + 1 < p_end)
             {
-                av_dlog(avctx, "Junk at end of packet\n");
+                ff_dlog(avctx, "Junk at end of packet\n");
             }
             pc->packet_index = p - pc->packet_buf;
             pc->in_packet = 0;
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 1d62b8a..d2b95bc 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -22,6 +22,7 @@
 #include "avcodec.h"
 #include "get_bits.h"
 #include "bytestream.h"
+#include "internal.h"
 #include "libavutil/colorspace.h"
 
 #define DVBSUB_PAGE_SEGMENT     0x10
@@ -735,20 +736,20 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
                          0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
     uint8_t *map_table;
 
-    av_dlog(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
+    ff_dlog(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
             top_bottom ? "bottom" : "top");
 
     for (i = 0; i < buf_size; i++) {
         if (i % 16 == 0)
-            av_dlog(avctx, "0x%8p: ", buf+i);
+            ff_dlog(avctx, "0x%8p: ", buf+i);
 
-        av_dlog(avctx, "%02x ", buf[i]);
+        ff_dlog(avctx, "%02x ", buf[i]);
         if (i % 16 == 15)
-            av_dlog(avctx, "\n");
+            ff_dlog(avctx, "\n");
     }
 
     if (i % 16)
-        av_dlog(avctx, "\n");
+        ff_dlog(avctx, "\n");
 
     if (region == 0)
         return;
@@ -904,16 +905,16 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
     int y, cr, cb, alpha;
     int r, g, b, r_add, g_add, b_add;
 
-    av_dlog(avctx, "DVB clut packet:\n");
+    ff_dlog(avctx, "DVB clut packet:\n");
 
     for (i=0; i < buf_size; i++) {
-        av_dlog(avctx, "%02x ", buf[i]);
+        ff_dlog(avctx, "%02x ", buf[i]);
         if (i % 16 == 15)
-            av_dlog(avctx, "\n");
+            ff_dlog(avctx, "\n");
     }
 
     if (i % 16)
-        av_dlog(avctx, "\n");
+        ff_dlog(avctx, "\n");
 
     clut_id = *buf++;
     buf += 1;
@@ -965,7 +966,7 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
         YUV_TO_RGB1_CCIR(cb, cr);
         YUV_TO_RGB2_CCIR(r, g, b, y);
 
-        av_dlog(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
+        ff_dlog(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
 
         if (depth & 0x80)
             clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
@@ -1046,11 +1047,11 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
             region->bgcolor = (((*buf++) >> 2) & 3);
     }
 
-    av_dlog(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
+    ff_dlog(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
 
     if (fill) {
         memset(region->pbuf, region->bgcolor, region->buf_size);
-        av_dlog(avctx, "Fill region (%d)\n", region->bgcolor);
+        ff_dlog(avctx, "Fill region (%d)\n", region->bgcolor);
     }
 
     delete_region_display_list(ctx, region);
@@ -1117,7 +1118,7 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx,
     ctx->time_out = *buf++;
     page_state = ((*buf++) >> 2) & 3;
 
-    av_dlog(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
+    ff_dlog(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
 
     if (page_state == 2) {
         delete_state(ctx);
@@ -1158,7 +1159,7 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx,
         ctx->display_list = display;
         ctx->display_list_size++;
 
-        av_dlog(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
+        ff_dlog(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
     }
 
     while (tmp_display_list) {
@@ -1421,19 +1422,19 @@ static int dvbsub_decode(AVCodecContext *avctx,
     int segment_length;
     int i;
 
-    av_dlog(avctx, "DVB sub packet:\n");
+    ff_dlog(avctx, "DVB sub packet:\n");
 
     for (i=0; i < buf_size; i++) {
-        av_dlog(avctx, "%02x ", buf[i]);
+        ff_dlog(avctx, "%02x ", buf[i]);
         if (i % 16 == 15)
-            av_dlog(avctx, "\n");
+            ff_dlog(avctx, "\n");
     }
 
     if (i % 16)
-        av_dlog(avctx, "\n");
+        ff_dlog(avctx, "\n");
 
     if (buf_size <= 6 || *buf != 0x0f) {
-        av_dlog(avctx, "incomplete or broken packet");
+        ff_dlog(avctx, "incomplete or broken packet");
         return AVERROR_INVALIDDATA;
     }
 
@@ -1449,7 +1450,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
         p += 2;
 
         if (p_end - p < segment_length) {
-            av_dlog(avctx, "incomplete or broken packet");
+            ff_dlog(avctx, "incomplete or broken packet");
             return -1;
         }
 
@@ -1478,7 +1479,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
                 *data_size = ret;
                 break;
             default:
-                av_dlog(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
+                ff_dlog(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
                         segment_type, page_id, segment_length);
                 break;
             }
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index bdf3eea..92f557f 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -102,7 +102,7 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
 
     /* get the AC coefficients until last_index is reached */
     for (;;) {
-        av_dlog(NULL, "%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16),
+        ff_dlog(NULL, "%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16),
                 re_index);
         /* our own optimized GET_RL_VLC */
         index   = NEG_USR32(re_cache, TEX_VLC_BITS);
@@ -125,7 +125,7 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
         }
         re_index += vlc_len;
 
-        av_dlog(NULL, "run=%d level=%d\n", run, level);
+        ff_dlog(NULL, "run=%d level=%d\n", run, level);
         pos += run;
         if (pos >= 64)
             break;
@@ -222,7 +222,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
             mb->pos               = 0;
             mb->partial_bit_count = 0;
 
-            av_dlog(avctx, "MB block: %d, %d ", mb_index, j);
+            ff_dlog(avctx, "MB block: %d, %d ", mb_index, j);
             dv_decode_ac(&gb, mb, block);
 
             /* write the remaining bits in a new buffer only if the
@@ -235,7 +235,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
         }
 
         /* pass 2: we can do it just after */
-        av_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
+        ff_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
         block = block1;
         mb    = mb1;
         init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));
@@ -256,7 +256,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
     }
 
     /* we need a pass over the whole video segment */
-    av_dlog(avctx, "***pass 3 size=%d\n", put_bits_count(&vs_pb));
+    ff_dlog(avctx, "***pass 3 size=%d\n", put_bits_count(&vs_pb));
     block = &sblock[0][0];
     mb    = mb_data;
     init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));
@@ -265,7 +265,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
     for (mb_index = 0; mb_index < 5; mb_index++) {
         for (j = 0; j < s->sys->bpm; j++) {
             if (mb->pos < 64) {
-                av_dlog(avctx, "start %d:%d\n", mb_index, j);
+                ff_dlog(avctx, "start %d:%d\n", mb_index, j);
                 dv_decode_ac(&gb, mb, block);
             }
             if (mb->pos >= 64 && mb->pos < 127)
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index bc5a3a7..a309e74 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -205,7 +205,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
     while (cmd_pos > 0 && cmd_pos < buf_size - 2 - offset_size) {
         date = AV_RB16(buf + cmd_pos);
         next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2);
-        av_dlog(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
+        ff_dlog(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
                 cmd_pos, next_cmd_pos, date);
         pos = cmd_pos + 2 + offset_size;
         offset1 = -1;
@@ -213,7 +213,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
         x1 = y1 = x2 = y2 = 0;
         while (pos < buf_size) {
             cmd = buf[pos++];
-            av_dlog(NULL, "cmd=%02x\n", cmd);
+            ff_dlog(NULL, "cmd=%02x\n", cmd);
             switch(cmd) {
             case 0x00:
                 /* menu subpicture */
@@ -246,7 +246,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
                 alpha[1] = buf[pos + 1] >> 4;
                 alpha[0] = buf[pos + 1] & 0x0f;
                 pos += 2;
-            av_dlog(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
+            ff_dlog(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
                 break;
             case 0x05:
             case 0x85:
@@ -258,7 +258,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
                 y2 = ((buf[pos + 4] & 0x0f) << 8) | buf[pos + 5];
                 if (cmd & 0x80)
                     is_8bit = 1;
-                av_dlog(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
+                ff_dlog(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
                 pos += 6;
                 break;
             case 0x06:
@@ -266,7 +266,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
                     goto fail;
                 offset1 = AV_RB16(buf + pos);
                 offset2 = AV_RB16(buf + pos + 2);
-                av_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
+                ff_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
                 pos += 4;
                 break;
             case 0x86:
@@ -274,7 +274,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
                     goto fail;
                 offset1 = AV_RB32(buf + pos);
                 offset2 = AV_RB32(buf + pos + 4);
-                av_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
+                ff_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
                 pos += 8;
                 break;
 
@@ -297,7 +297,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
             case 0xff:
                 goto the_end;
             default:
-                av_dlog(NULL, "unrecognised subpicture command 0x%x\n", cmd);
+                ff_dlog(NULL, "unrecognised subpicture command 0x%x\n", cmd);
                 goto the_end;
             }
         }
@@ -495,7 +495,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
         goto no_subtitle;
 
 #if defined(DEBUG)
-    av_dlog(NULL, "start=%d ms end =%d ms\n",
+    ff_dlog(NULL, "start=%d ms end =%d ms\n",
             sub->start_display_time,
             sub->end_display_time);
     ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],
diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c
index bc865a3..22833d6 100644
--- a/libavcodec/escape130.c
+++ b/libavcodec/escape130.c
@@ -331,7 +331,7 @@ static int escape130_decode_frame(AVCodecContext *avctx, void *data,
         new_cr += new_cr_stride;
     }
 
-    av_dlog(avctx, "Frame data: provided %d bytes, used %d bytes\n",
+    ff_dlog(avctx, "Frame data: provided %d bytes, used %d bytes\n",
             buf_size, get_bits_count(&gb) >> 3);
 
     FFSWAP(uint8_t*, s->old_y, s->new_y);
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 4349af5..c46bcf2 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -80,7 +80,7 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state,
     assert(k <= 8);
 
     v = get_sr_golomb(gb, k, 12, bits);
-    av_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",
+    ff_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",
             v, state->bias, state->error_sum, state->drift, state->count, k);
 
 #if 0 // JPEG LS
@@ -155,7 +155,7 @@ static av_always_inline void decode_line(FFV1Context *s, int w,
             } else
                 diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
 
-            av_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
+            ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
                     run_count, run_index, run_mode, x, get_bits_count(&s->gb));
         }
 
@@ -717,7 +717,7 @@ static int read_header(FFV1Context *f)
         return AVERROR(ENOSYS);
     }
 
-    av_dlog(f->avctx, "%d %d %d\n",
+    ff_dlog(f->avctx, "%d %d %d\n",
             f->chroma_h_shift, f->chroma_v_shift, f->avctx->pix_fmt);
     if (f->version < 2) {
         context_count = read_quant_tables(c, f->quant_table);
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index bda5f72..f689bd9 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -160,7 +160,7 @@ static inline void put_vlc_symbol(PutBitContext *pb, VlcState *const state,
     code = v ^ ((2 * state->drift + state->count) >> 31);
 #endif
 
-    av_dlog(NULL, "v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code,
+    ff_dlog(NULL, "v:%d/%d bias:%d error:%d drift:%d count:%d k:%d\n", v, code,
             state->bias, state->error_sum, state->drift, state->count, k);
     set_sr_golomb(pb, code, k, 12, bits);
 
@@ -234,7 +234,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w,
                 }
             }
 
-            av_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
+            ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
                     run_count, run_index, run_mode, x,
                     (int)put_bits_count(&s->pb));
 
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index de7979c..a5b1294 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -347,7 +347,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
             return err;
     }
 
-    av_dlog(avctx, "image: %dx%d block: %dx%d num: %dx%d part: %dx%d\n",
+    ff_dlog(avctx, "image: %dx%d block: %dx%d num: %dx%d part: %dx%d\n",
             s->image_width, s->image_height, s->block_width, s->block_height,
             h_blocks, v_blocks, h_part, v_part);
 
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 71c81bd..971ce1b 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -197,7 +197,7 @@ static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf,
 
                 bytestream_put_be16(&ptr, zsize);
                 buf_pos += zsize + 2;
-                av_dlog(s->avctx, "buf_pos = %d\n", buf_pos);
+                ff_dlog(s->avctx, "buf_pos = %d\n", buf_pos);
             } else {
                 pred_blocks++;
                 bytestream_put_be16(&ptr, 0);
@@ -269,7 +269,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         avctx->coded_frame->pict_type      = AV_PICTURE_TYPE_I;
         avctx->coded_frame->key_frame      = 1;
         s->last_key_frame = avctx->frame_number;
-        av_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
+        ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
     } else {
         avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
         avctx->coded_frame->key_frame = 0;
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 68f45b4..91bd799 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -493,7 +493,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
             /* For some reason, it seems that non-palettized flics do
              * include one of these chunks in their first frame.
              * Why I do not know, it seems rather extraneous. */
-            av_dlog(avctx,
+            ff_dlog(avctx,
                     "Unexpected Palette chunk %d in non-palettized FLC\n",
                     chunk_type);
             bytestream2_skip(&g2, chunk_size - 6);
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 3339c12..ec40653 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -620,11 +620,6 @@ static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
 
 #define get_vlc(s, vlc)             get_vlc_trace(s, (vlc)->table, (vlc)->bits,   3, __FILE__, __PRETTY_FUNCTION__, __LINE__)
 #define get_vlc2(s, tab, bits, max) get_vlc_trace(s,          tab,        bits, max, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#define tprintf(p, ...) av_log(p, AV_LOG_DEBUG, __VA_ARGS__)
-
-#else //TRACE
-#define tprintf(p, ...) { }
 #endif
 
 #endif /* AVCODEC_GET_BITS_H */
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index df5ab78..d91f159 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -74,7 +74,7 @@ static int gif_read_image(GifState *s, AVFrame *frame)
     has_local_palette = flags & 0x80;
     bits_per_pixel = (flags & 0x07) + 1;
 
-    av_dlog(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
+    ff_dlog(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
 
     if (has_local_palette) {
         bytestream2_get_buffer(&s->gb, s->local_palette, 3 * (1 << bits_per_pixel));
@@ -159,7 +159,7 @@ static int gif_read_extension(GifState *s)
     ext_code = bytestream2_get_byte(&s->gb);
     ext_len  = bytestream2_get_byte(&s->gb);
 
-    av_dlog(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
+    ff_dlog(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
 
     switch(ext_code) {
     case 0xf9:
@@ -175,7 +175,7 @@ static int gif_read_extension(GifState *s)
             s->transparent_color_index = -1;
         s->gce_disposal = (gce_flags >> 2) & 0x7;
 
-        av_dlog(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
+        ff_dlog(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
                gce_flags, s->gce_delay,
                s->transparent_color_index, s->gce_disposal);
 
@@ -190,7 +190,7 @@ static int gif_read_extension(GifState *s)
             bytestream2_get_byte(&s->gb);
         ext_len = bytestream2_get_byte(&s->gb);
 
-        av_dlog(s->avctx, "gif: ext_len1=%d\n", ext_len);
+        ff_dlog(s->avctx, "gif: ext_len1=%d\n", ext_len);
     }
     return 0;
 }
@@ -227,7 +227,7 @@ static int gif_read_header1(GifState *s)
     s->background_color_index = bytestream2_get_byte(&s->gb);
     bytestream2_get_byte(&s->gb);                /* ignored */
 
-    av_dlog(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
+    ff_dlog(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
            s->screen_width, s->screen_height, s->bits_per_pixel,
            has_global_palette);
 
@@ -246,7 +246,7 @@ static int gif_parse_next_image(GifState *s, AVFrame *frame)
         int code = bytestream2_get_byte(&s->gb);
         int ret;
 
-        av_dlog(s->avctx, "gif: code=%02x '%c'\n", code, code);
+        ff_dlog(s->avctx, "gif: code=%02x '%c'\n", code, code);
 
         switch (code) {
         case ',':
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 83cee7f..2fddc50 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -571,8 +571,8 @@ static int h261_decode_frame(AVCodecContext *avctx, void *data,
     int ret;
     AVFrame *pict = data;
 
-    av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
-    av_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
+    ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
+    ff_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
     s->flags  = avctx->flags;
     s->flags2 = avctx->flags2;
 
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 31e014a..a04db5c 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -234,7 +234,7 @@ static int decode_slice(MpegEncContext *s)
 
             s->mv_dir  = MV_DIR_FORWARD;
             s->mv_type = MV_TYPE_16X16;
-            av_dlog(s, "%d %d %06X\n",
+            ff_dlog(s, "%d %d %06X\n",
                     ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
             ret = s->decode_mb(s, s->block);
 
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 46c172a..ec8ac40 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -322,7 +322,7 @@ static int decode_rbsp_trailing(H264Context *h, const uint8_t *src)
     int v = *src;
     int r;
 
-    tprintf(h->avctx, "rbsp trailing %X\n", v);
+    ff_tlog(h->avctx, "rbsp trailing %X\n", v);
 
     for (r = 1; r < 9; r++) {
         if (v & 1)
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index a1eccb1..94fc029 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -36,6 +36,7 @@
 #include "h264dsp.h"
 #include "h264pred.h"
 #include "h264qpel.h"
+#include "internal.h"
 #include "mpegutils.h"
 #include "parser.h"
 #include "qpeldsp.h"
@@ -949,7 +950,7 @@ static av_always_inline int pred_intra_mode(const H264Context *h,
     const int top    = sl->intra4x4_pred_mode_cache[index8 - 8];
     const int min    = FFMIN(left, top);
 
-    tprintf(h->avctx, "mode:%d %d min:%d\n", left, top, min);
+    ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min);
 
     if (min < 0)
         return DC_PRED;
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index ecd0034..f4e451d 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1916,7 +1916,7 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
 
     mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride;
 
-    tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, sl->mb_x, sl->mb_y);
+    ff_tlog(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, sl->mb_x, sl->mb_y);
     if (sl->slice_type_nos != AV_PICTURE_TYPE_I) {
         int skip;
         /* a skipped mb needs the aff flag from the following mb */
@@ -2071,7 +2071,7 @@ decode_intra_mb:
                     int pred = pred_intra_mode(h, sl, i);
                     sl->intra4x4_pred_mode_cache[scan8[i]] = decode_cabac_mb_intra4x4_pred_mode(sl, pred);
 
-                    av_dlog(h->avctx, "i4x4 pred=%d mode=%d\n", pred,
+                    ff_dlog(h->avctx, "i4x4 pred=%d mode=%d\n", pred,
                             h->intra4x4_pred_mode_cache[scan8[i]]);
                 }
             }
@@ -2161,7 +2161,7 @@ decode_intra_mb:
                         uint8_t (* mvd_cache)[2]= &sl->mvd_cache[list][ scan8[index] ];
                         pred_motion(h, sl, index, block_width, list, sl->ref_cache[list][ scan8[index] ], &mx, &my);
                         DECODE_CABAC_MB_MVD(sl, list, index)
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                        ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                         if(IS_SUB_8X8(sub_mb_type)){
                             mv_cache[ 1 ][0]=
@@ -2225,7 +2225,7 @@ decode_intra_mb:
                     int mx,my,mpx,mpy;
                     pred_motion(h, sl, 0, 4, list, sl->ref_cache[list][ scan8[0] ], &mx, &my);
                     DECODE_CABAC_MB_MVD(sl, list, 0)
-                    tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                    ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                     fill_rectangle(sl->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack8to16(mpx,mpy), 2);
                     fill_rectangle(sl->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
@@ -2256,7 +2256,7 @@ decode_intra_mb:
                         int mx,my,mpx,mpy;
                         pred_16x8_motion(h, sl, 8*i, list, sl->ref_cache[list][scan8[0] + 16*i], &mx, &my);
                         DECODE_CABAC_MB_MVD(sl, list, 8*i)
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                        ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                         fill_rectangle(sl->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack8to16(mpx,mpy), 2);
                         fill_rectangle(sl->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4);
@@ -2292,7 +2292,7 @@ decode_intra_mb:
                         pred_8x16_motion(h, sl, i*4, list, sl->ref_cache[list][ scan8[0] + 2*i ], &mx, &my);
                         DECODE_CABAC_MB_MVD(sl, list, 4*i)
 
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                        ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
                         fill_rectangle(sl->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack8to16(mpx,mpy), 2);
                         fill_rectangle(sl->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4);
                     }else{
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index 0a7dca2..7445788 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -292,7 +292,7 @@ static inline int pred_non_zero_count(const H264Context *h, H264SliceContext *sl
 
     if(i<64) i= (i+1)>>1;
 
-    tprintf(h->avctx, "pred_nnz L%X T%X n%d s%d P%X\n", left, top, n, scan8[n], i&31);
+    ff_tlog(h->avctx, "pred_nnz L%X T%X n%d s%d P%X\n", left, top, n, scan8[n], i&31);
 
     return i&31;
 }
@@ -482,7 +482,7 @@ static int decode_residual(const H264Context *h, H264SliceContext *sl,
     }
 
     trailing_ones= coeff_token&3;
-    tprintf(h->avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff);
+    ff_tlog(h->avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff);
     assert(total_coeff<=16);
 
     i = show_bits(gb, 3);
@@ -710,7 +710,7 @@ int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl)
 
     mb_xy = sl->mb_xy = sl->mb_x + sl->mb_y*h->mb_stride;
 
-    tprintf(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, sl->mb_x, sl->mb_y);
+    ff_tlog(h->avctx, "pic:%d mb:%d/%d\n", h->frame_num, sl->mb_x, sl->mb_y);
     cbp = 0; /* avoid warning. FIXME: find a solution without slowing
                 down the code */
     if (sl->slice_type_nos != AV_PICTURE_TYPE_I) {
@@ -916,7 +916,7 @@ decode_intra_mb:
                         pred_motion(h, sl, index, block_width, list, sl->ref_cache[list][ scan8[index] ], &mx, &my);
                         mx += get_se_golomb(&sl->gb);
                         my += get_se_golomb(&sl->gb);
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                        ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                         if(IS_SUB_8X8(sub_mb_type)){
                             mv_cache[ 1 ][0]=
@@ -970,7 +970,7 @@ decode_intra_mb:
                     pred_motion(h, sl, 0, 4, list, sl->ref_cache[list][ scan8[0] ], &mx, &my);
                     mx += get_se_golomb(&sl->gb);
                     my += get_se_golomb(&sl->gb);
-                    tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                    ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                     fill_rectangle(sl->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
                 }
@@ -1005,7 +1005,7 @@ decode_intra_mb:
                         pred_16x8_motion(h, sl, 8*i, list, sl->ref_cache[list][scan8[0] + 16*i], &mx, &my);
                         mx += get_se_golomb(&sl->gb);
                         my += get_se_golomb(&sl->gb);
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                        ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                         val= pack16to32(mx,my);
                     }else
@@ -1043,7 +1043,7 @@ decode_intra_mb:
                         pred_8x16_motion(h, sl, i*4, list, sl->ref_cache[list][ scan8[0] + 2*i ], &mx, &my);
                         mx += get_se_golomb(&sl->gb);
                         my += get_se_golomb(&sl->gb);
-                        tprintf(h->avctx, "final mv:%d %d\n", mx, my);
+                        ff_tlog(h->avctx, "final mv:%d %d\n", mx, my);
 
                         val= pack16to32(mx,my);
                     }else
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index c945139..fa40ba4 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -528,8 +528,8 @@ static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContex
                 // Do not use s->qscale as luma quantizer because it has not the same
                 // value in IPCM macroblocks.
                 qp = (h->cur_pic.qscale_table[mb_xy] + h->cur_pic.qscale_table[mbn_xy] + 1) >> 1;
-                tprintf(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize);
-                { int i; for (i = 0; i < 4; i++) tprintf(h->avctx, " bS[%d]:%d", i, bS[i]); tprintf(h->avctx, "\n"); }
+                ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize);
+                { int i; for (i = 0; i < 4; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); }
                 filter_mb_edgeh( &img_y[j*linesize], tmp_linesize, bS, qp, a, b, h, 0 );
                 chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
                 chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbn_xy]) + 1) >> 1;
@@ -593,7 +593,7 @@ static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContex
             // value in IPCM macroblocks.
             if(bS[0]+bS[1]+bS[2]+bS[3]){
                 qp = (h->cur_pic.qscale_table[mb_xy] + h->cur_pic.qscale_table[mbm_xy] + 1) >> 1;
-                tprintf(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
+                ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
                 chroma_qp_avg[0] = (sl->chroma_qp[0] + get_chroma_qp(h, 0, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
                 chroma_qp_avg[1] = (sl->chroma_qp[1] + get_chroma_qp(h, 1, h->cur_pic.qscale_table[mbm_xy]) + 1) >> 1;
                 if( dir == 0 ) {
@@ -676,7 +676,7 @@ static av_always_inline void filter_mb_dir(const H264Context *h, H264SliceContex
         // Do not use s->qscale as luma quantizer because it has not the same
         // value in IPCM macroblocks.
         qp = h->cur_pic.qscale_table[mb_xy];
-        tprintf(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
+        ff_tlog(h->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
         if( dir == 0 ) {
             filter_mb_edgev( &img_y[4*edge << h->pixel_shift], linesize, bS, qp, a, b, h, 0 );
             if (chroma) {
@@ -788,8 +788,8 @@ void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl,
                    get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1;
 
         /* Filter edge */
-        tprintf(h->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);
-        { int i; for (i = 0; i < 8; i++) tprintf(h->avctx, " bS[%d]:%d", i, bS[i]); tprintf(h->avctx, "\n"); }
+        ff_tlog(h->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);
+        { int i; for (i = 0; i < 8; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); }
         if (MB_FIELD(sl)) {
             filter_mb_mbaff_edgev ( h, img_y                ,   linesize, bS  , 1, qp [0], a, b, 1 );
             filter_mb_mbaff_edgev ( h, img_y  + 8*  linesize,   linesize, bS+4, 1, qp [1], a, b, 1 );
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h
index 7023e0f..5e8f237 100644
--- a/libavcodec/h264_mvpred.h
+++ b/libavcodec/h264_mvpred.h
@@ -78,7 +78,7 @@ static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceCon
         *C = sl->mv_cache[list][i - 8 + part_width];
         return topright_ref;
     } else {
-        tprintf(h->avctx, "topright MV not available\n");
+        ff_tlog(h->avctx, "topright MV not available\n");
 
         *C = sl->mv_cache[list][i - 8 - 1];
         return sl->ref_cache[list][i - 8 - 1];
@@ -118,7 +118,7 @@ static av_always_inline void pred_motion(const H264Context *const h,
 
     diagonal_ref = fetch_diagonal_mv(h, sl, &C, index8, list, part_width);
     match_count  = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref);
-    tprintf(h->avctx, "pred_motion match_count=%d\n", match_count);
+    ff_tlog(h->avctx, "pred_motion match_count=%d\n", match_count);
     if (match_count > 1) { //most common
         *mx = mid_pred(A[0], B[0], C[0]);
         *my = mid_pred(A[1], B[1], C[1]);
@@ -145,7 +145,7 @@ static av_always_inline void pred_motion(const H264Context *const h,
         }
     }
 
-    tprintf(h->avctx,
+    ff_tlog(h->avctx,
             "pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n",
             top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref,
             A[0], A[1], ref, *mx, *my, sl->mb_x, sl->mb_y, n, list);
@@ -166,7 +166,7 @@ static av_always_inline void pred_16x8_motion(const H264Context *const h,
         const int top_ref      = sl->ref_cache[list][scan8[0] - 8];
         const int16_t *const B = sl->mv_cache[list][scan8[0] - 8];
 
-        tprintf(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
+        ff_tlog(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
                 top_ref, B[0], B[1], sl->mb_x, sl->mb_y, n, list);
 
         if (top_ref == ref) {
@@ -178,7 +178,7 @@ static av_always_inline void pred_16x8_motion(const H264Context *const h,
         const int left_ref     = sl->ref_cache[list][scan8[8] - 1];
         const int16_t *const A = sl->mv_cache[list][scan8[8] - 1];
 
-        tprintf(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
+        ff_tlog(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n",
                 left_ref, A[0], A[1], sl->mb_x, sl->mb_y, n, list);
 
         if (left_ref == ref) {
@@ -207,7 +207,7 @@ static av_always_inline void pred_8x16_motion(const H264Context *const h,
         const int left_ref     = sl->ref_cache[list][scan8[0] - 1];
         const int16_t *const A = sl->mv_cache[list][scan8[0] - 1];
 
-        tprintf(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
+        ff_tlog(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
                 left_ref, A[0], A[1], sl->mb_x, sl->mb_y, n, list);
 
         if (left_ref == ref) {
@@ -221,7 +221,7 @@ static av_always_inline void pred_8x16_motion(const H264Context *const h,
 
         diagonal_ref = fetch_diagonal_mv(h, sl, &C, scan8[4], list, 2);
 
-        tprintf(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
+        ff_tlog(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n",
                 diagonal_ref, C[0], C[1], sl->mb_x, sl->mb_y, n, list);
 
         if (diagonal_ref == ref) {
@@ -298,7 +298,7 @@ static av_always_inline void pred_pskip_motion(const H264Context *const h,
         goto zeromv;
     }
 
-    tprintf(h->avctx, "pred_pskip: (%d) (%d) at %2d %2d\n",
+    ff_tlog(h->avctx, "pred_pskip: (%d) (%d) at %2d %2d\n",
             top_ref, left_ref, sl->mb_x, sl->mb_y);
 
     if (USES_LIST(sl->topright_type, 0)) {
@@ -325,7 +325,7 @@ static av_always_inline void pred_pskip_motion(const H264Context *const h,
     }
 
     match_count = !diagonal_ref + !top_ref + !left_ref;
-    tprintf(h->avctx, "pred_pskip_motion match_count=%d\n", match_count);
+    ff_tlog(h->avctx, "pred_pskip_motion match_count=%d\n", match_count);
     if (match_count > 1) {
         mx = mid_pred(A[0], B[0], C[0]);
         my = mid_pred(A[1], B[1], C[1]);
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 5782c8e..1ee43b7 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -169,14 +169,14 @@ int ff_h264_fill_default_ref_list(H264Context *h, H264SliceContext *sl)
     }
 #ifdef TRACE
     for (i = 0; i < sl->ref_count[0]; i++) {
-        tprintf(h->avctx, "List0: %s fn:%d 0x%p\n",
+        ff_tlog(h->avctx, "List0: %s fn:%d 0x%p\n",
                 (h->default_ref_list[0][i].long_ref ? "LT" : "ST"),
                 h->default_ref_list[0][i].pic_id,
                 h->default_ref_list[0][i].f.data[0]);
     }
     if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
         for (i = 0; i < sl->ref_count[1]; i++) {
-            tprintf(h->avctx, "List1: %s fn:%d 0x%p\n",
+            ff_tlog(h->avctx, "List1: %s fn:%d 0x%p\n",
                     (h->default_ref_list[1][i].long_ref ? "LT" : "ST"),
                     h->default_ref_list[1][i].pic_id,
                     h->default_ref_list[1][i].f.data[0]);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 3f0d402..16d5878 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -2153,7 +2153,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
             }
 
             if (eos || sl->mb_y >= h->mb_height) {
-                tprintf(h->avctx, "slice end %d %d\n",
+                ff_tlog(h->avctx, "slice end %d %d\n",
                         get_bits_count(&sl->gb), sl->gb.size_in_bits);
                 er_add_slice(sl, sl->resync_mb_x, sl->resync_mb_y, sl->mb_x - 1,
                              sl->mb_y, ER_MB_END);
@@ -2198,7 +2198,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
                         predict_field_decoding_flag(h, sl);
                 }
                 if (sl->mb_y >= h->mb_height) {
-                    tprintf(h->avctx, "slice end %d %d\n",
+                    ff_tlog(h->avctx, "slice end %d %d\n",
                             get_bits_count(&sl->gb), sl->gb.size_in_bits);
 
                     if (get_bits_left(&sl->gb) == 0) {
@@ -2216,7 +2216,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
             }
 
             if (get_bits_left(&sl->gb) <= 0 && sl->mb_skip_run <= 0) {
-                tprintf(h->avctx, "slice end %d %d\n",
+                ff_tlog(h->avctx, "slice end %d %d\n",
                         get_bits_count(&sl->gb), sl->gb.size_in_bits);
 
                 if (get_bits_left(&sl->gb) == 0) {
diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index cb95d39..411bc85 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -783,7 +783,7 @@ static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
                 cw = 0;
 
                 if (get_bits_count(&q->gb) + cw_len > 512) {
-                    av_dlog(NULL, "Band %i coeff %i cw_len %i\n", i, j, cw_len);
+                    ff_dlog(NULL, "Band %i coeff %i cw_len %i\n", i, j, cw_len);
                     return AVERROR_INVALIDDATA;
                 }
 
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index f74ac42..33239eb 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -928,7 +928,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
     if (width != ctx->width || height != ctx->height) {
         int res;
 
-        av_dlog(avctx, "Frame dimensions changed!\n");
+        ff_dlog(avctx, "Frame dimensions changed!\n");
 
         if (width  < 16 || width  > 640 ||
             height < 16 || height > 480 ||
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 92f3062..1fd45f0 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -33,6 +33,7 @@
 #include "ivi.h"
 #include "ivi_dsp.h"
 #include "indeo4data.h"
+#include "internal.h"
 
 #define IVI4_PIC_SIZE_ESC   7
 
@@ -140,7 +141,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
 
     /* null frames don't contain anything else so we just return */
     if (ctx->frame_type >= IVI4_FRAMETYPE_NULL_FIRST) {
-        av_dlog(avctx, "Null frame encountered!\n");
+        ff_dlog(avctx, "Null frame encountered!\n");
         return 0;
     }
 
@@ -149,7 +150,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
     /* we don't do that because Indeo 4 videos can be decoded anyway */
     if (get_bits1(&ctx->gb)) {
         skip_bits_long(&ctx->gb, 32);
-        av_dlog(avctx, "Password-protected clip!\n");
+        ff_dlog(avctx, "Password-protected clip!\n");
     }
 
     pic_size_indx = get_bits(&ctx->gb, 3);
@@ -243,7 +244,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
 
     /* skip picture header extension if any */
     while (get_bits1(&ctx->gb)) {
-        av_dlog(avctx, "Pic hdr extension encountered!\n");
+        ff_dlog(avctx, "Pic hdr extension encountered!\n");
         skip_bits(&ctx->gb, 8);
     }
 
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 5aa7712..6f15a78 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -48,6 +48,19 @@
 #define FF_CODEC_CAP_INIT_CLEANUP           (1 << 1)
 
 
+#ifdef DEBUG
+#   define ff_dlog(ctx, ...) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__)
+#else
+#   define ff_dlog(ctx, ...)
+#endif
+
+#ifdef TRACE
+#   define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__)
+#else
+#   define ff_tlog(p, ...)
+#endif
+
+
 #define FF_SANE_NB_CHANNELS 63U
 
 #define FF_SIGNBIT(x) (x >> CHAR_BIT * sizeof(x) - 1)
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index af7aa13..d681fdf 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -118,7 +118,7 @@ static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s, AVFrame *frame)
         y =   8 + ((B - 56) / 29);
     }
 
-    av_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
+    ff_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
     return copy_from(s, s->second_last_frame, frame, x, y);
 }
 
@@ -144,7 +144,7 @@ static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s, AVFrame *frame)
         y = -(  8 + ((B - 56) / 29));
     }
 
-    av_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
+    ff_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
     return copy_from(s, frame, frame, x, y);
 }
 
@@ -165,7 +165,7 @@ static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s, AVFrame *frame)
     x = -8 + BL;
     y = -8 + BH;
 
-    av_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
+    ff_dlog(NULL, "    motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
     return copy_from(s, s->last_frame, frame, x, y);
 }
 
@@ -178,7 +178,7 @@ static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s, AVFrame *frame)
     x = bytestream2_get_byte(&s->stream_ptr);
     y = bytestream2_get_byte(&s->stream_ptr);
 
-    av_dlog(NULL, "    motion bytes = %d, %d\n", x, y);
+    ff_dlog(NULL, "    motion bytes = %d, %d\n", x, y);
     return copy_from(s, s->last_frame, frame, x, y);
 }
 
@@ -528,7 +528,7 @@ static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s, AVFrame *frame)
     x = bytestream2_get_byte(&s->stream_ptr);
     y = bytestream2_get_byte(&s->stream_ptr);
 
-    av_dlog(NULL, "    motion bytes = %d, %d\n", x, y);
+    ff_dlog(NULL, "    motion bytes = %d, %d\n", x, y);
     return copy_from(s, s->second_last_frame, frame, x, y);
 }
 
@@ -903,7 +903,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)
         for (x = 0; x < s->avctx->width; x += 8) {
             opcode = get_bits(&gb, 4);
 
-            av_dlog(s->avctx,
+            ff_dlog(s->avctx,
                     "  block @ (%3d, %3d): encoding 0x%X, data ptr offset %d\n",
                     x, y, opcode, bytestream2_tell(&s->stream_ptr));
 
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index e198f65..e9e4a35 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -35,6 +35,7 @@
 #include "avcodec.h"
 #include "mpegvideo.h"
 #include "h263.h"
+#include "internal.h"
 #include "mathops.h"
 #include "mpegutils.h"
 #include "unary.h"
@@ -323,7 +324,7 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred)
    code >>= 1;
 
    code = (sign) ? (pred - code) : (pred + code);
-   av_dlog(s->avctx,"H.263+ UMV Motion = %d\n", code);
+   ff_dlog(s->avctx,"H.263+ UMV Motion = %d\n", code);
    return code;
 
 }
@@ -948,7 +949,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
         if (ufep == 1) {
             /* OPPTYPE */
             format = get_bits(&s->gb, 3);
-            av_dlog(s->avctx, "ufep=1, format: %d\n", format);
+            ff_dlog(s->avctx, "ufep=1, format: %d\n", format);
             s->custom_pcf= get_bits1(&s->gb);
             s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */
             if (get_bits1(&s->gb) != 0) {
@@ -999,7 +1000,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
             if (format == 6) {
                 /* Custom Picture Format (CPFMT) */
                 s->aspect_ratio_info = get_bits(&s->gb, 4);
-                av_dlog(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
+                ff_dlog(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
                 /* aspect ratios:
                 0 - forbidden
                 1 - 1:1
@@ -1012,7 +1013,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
                 width = (get_bits(&s->gb, 9) + 1) * 4;
                 skip_bits1(&s->gb);
                 height = get_bits(&s->gb, 9) * 4;
-                av_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
+                ff_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
                 if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
                     /* aspected dimensions */
                     s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8);
diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c
index ce1e5aa..6086e2e 100644
--- a/libavcodec/ivi.c
+++ b/libavcodec/ivi.c
@@ -563,7 +563,7 @@ static int ivi_decode_coded_blocks(GetBitContext *gb, IVIBandDesc *band,
         pos = band->scan[scan_pos];
 
         if (!val)
-            av_dlog(avctx, "Val = 0 encountered!\n");
+            ff_dlog(avctx, "Val = 0 encountered!\n");
 
         q = (base_tab[pos] * quant) >> 9;
         if (q > 1)
@@ -964,7 +964,7 @@ static int decode_band(IVI45DecContext *ctx,
                                       (ctx->planes[0].bands[0].mb_size >> 3) - (band->mb_size >> 3));
             if (result < 0)
                 break;
-            av_dlog(avctx, "Empty tile encountered!\n");
+            ff_dlog(avctx, "Empty tile encountered!\n");
         } else {
             tile->data_size = ivi_dec_tile_data_size(&ctx->gb);
             if (!tile->data_size) {
diff --git a/libavcodec/jpegls.c b/libavcodec/jpegls.c
index 52a4500..19d461f 100644
--- a/libavcodec/jpegls.c
+++ b/libavcodec/jpegls.c
@@ -25,6 +25,7 @@
  * JPEG-LS common code.
  */
 
+#include "internal.h"
 #include "jpegls.h"
 
 void ff_jpegls_init_state(JLSState *state)
@@ -98,5 +99,5 @@ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all)
 
     if (s->reset == 0 || reset_all)
         s->reset = 64;
-    av_dlog(NULL, "[JPEG-LS RESET] T=%i,%i,%i\n", s->T1, s->T2, s->T3);
+    ff_dlog(NULL, "[JPEG-LS RESET] T=%i,%i,%i\n", s->T1, s->T2, s->T3);
 }
diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 9f7735e..d9b08fb 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -77,7 +77,7 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
         av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
         return AVERROR_INVALIDDATA;
     }
-    av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
+    ff_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
 
     return 0;
 }
@@ -298,13 +298,13 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
     else
         shift = point_transform + (16 - s->bits);
 
-    av_dlog(s->avctx,
+    ff_dlog(s->avctx,
             "JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) "
             "RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",
             s->width, s->height, state->near, state->maxval,
             state->T1, state->T2, state->T3,
             state->reset, state->limit, state->qbpp, state->range);
-    av_dlog(s->avctx, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n",
+    ff_dlog(s->avctx, "JPEG params: ILV=%i Pt=%i BPP=%i, scan = %i\n",
             ilv, point_transform, s->bits, s->cur_scan);
     if (ilv == 0) { /* separate planes */
         if (s->cur_scan > s->nb_components) {
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 23f1581..067a17f 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -61,7 +61,7 @@ static int realloc_buffer(LAMEContext *s)
     if (!s->buffer || s->buffer_size - s->buffer_index < BUFFER_SIZE) {
         int new_size = s->buffer_index + 2 * BUFFER_SIZE, err;
 
-        av_dlog(s->avctx, "resizing output buffer: %d -> %d\n", s->buffer_size,
+        ff_dlog(s->avctx, "resizing output buffer: %d -> %d\n", s->buffer_size,
                 new_size);
         if ((err = av_reallocp(&s->buffer, new_size)) < 0) {
             s->buffer_size = s->buffer_index = 0;
@@ -248,7 +248,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         return -1;
     }
     len = hdr.frame_size;
-    av_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len,
+    ff_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len,
             s->buffer_index);
     if (len <= s->buffer_index) {
         if ((ret = ff_alloc_packet(avpkt, len))) {
diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 0704e94..72e0bbb 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -98,7 +98,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
     enum Mode dec_mode;
     int packet_size, ret;
 
-    av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
+    ff_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frame_count=%d!!\n",
             buf, buf_size, avctx->frame_number);
 
     /* get output buffer */
@@ -117,7 +117,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
+    ff_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
               packet_size, buf[0], buf[1], buf[2], buf[3]);
     /* call decoder */
     Decoder_Interface_Decode(s->dec_state, buf, (short *)frame->data[0], 0);
@@ -269,7 +269,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 
     written = Encoder_Interface_Encode(s->enc_state, s->enc_mode, samples,
                                        avpkt->data, 0);
-    av_dlog(avctx, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
+    ff_dlog(avctx, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
             written, s->enc_mode, frame[0]);
 
     /* Get the next frame pts/duration */
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 3d72bbd..c28553d 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -403,7 +403,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     for (i = 0; i < 3; i++)
         s->linesize[i] = s->picture_ptr->linesize[i] << s->interlaced;
 
-    av_dlog(s->avctx, "%d %d %d %d %d %d\n",
+    ff_dlog(s->avctx, "%d %d %d %d %d %d\n",
             s->width, s->height, s->linesize[0], s->linesize[1],
             s->interlaced, s->avctx->height);
 
@@ -916,8 +916,8 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
                             return AVERROR_INVALIDDATA;
                         }
                     }
-                    av_dlog(s->avctx, "mb: %d %d processed\n", mb_y, mb_x);
-                    av_dlog(s->avctx, "%d %d %d %d %d %d %d %d \n",
+                    ff_dlog(s->avctx, "mb: %d %d processed\n", mb_y, mb_x);
+                    ff_dlog(s->avctx, "%d %d %d %d %d %d %d %d \n",
                             mb_x, mb_y, x, y, c, s->bottom_field,
                             (v * mb_y + y) * 8, (h * mb_x + x) * 8);
                     if (++x == h) {
@@ -1153,7 +1153,7 @@ next_field:
         GetBitContext bak = s->gb;
         align_get_bits(&bak);
         if (show_bits(&bak, 16) == 0xFFD1) {
-            av_dlog(s->avctx, "AVRn interlaced picture marker found\n");
+            ff_dlog(s->avctx, "AVRn interlaced picture marker found\n");
             s->gb = bak;
             skip_bits(&s->gb, 16);
             s->bottom_field ^= 1;
@@ -1381,7 +1381,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
     }
     val = -1;
 found:
-    av_dlog(NULL, "find_marker skipped %d bytes\n", skipped);
+    ff_dlog(NULL, "find_marker skipped %d bytes\n", skipped);
     *pbuf_ptr = buf_ptr;
     return val;
 }
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index a765b26..b14160f 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -32,6 +32,7 @@
 #include <limits.h>
 
 #include "avcodec.h"
+#include "internal.h"
 #include "mathops.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
@@ -1518,11 +1519,11 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
     c->skip=0;
     bmin = estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code) +
            2 * penalty_factor;
-    av_dlog(s, " %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
+    ff_dlog(s, " %d %d ", s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1]);
 
     c->skip=0;
     fbmin= bidir_refine(s, mb_x, mb_y) + penalty_factor;
-    av_dlog(s, "%d %d %d %d\n", dmin, fmin, bmin, fbmin);
+    ff_dlog(s, "%d %d %d %d\n", dmin, fmin, bmin, fbmin);
 
     if(s->flags & CODEC_FLAG_INTERLACED_ME){
 //FIXME mb type penalty
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 1bf51f0..6ed151a 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -154,7 +154,7 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s,
     dc += diff;
     s->last_dc[component] = dc;
     block[0] = dc * quant_matrix[0];
-    av_dlog(s->avctx, "dc=%d diff=%d\n", dc, diff);
+    ff_dlog(s->avctx, "dc=%d diff=%d\n", dc, diff);
     i = 0;
     {
         OPEN_READER(re, &s->gb);
@@ -550,7 +550,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
     dc += diff;
     s->last_dc[component] = dc;
     block[0] = dc << (3 - s->intra_dc_precision);
-    av_dlog(s->avctx, "dc=%d\n", block[0]);
+    ff_dlog(s->avctx, "dc=%d\n", block[0]);
     mismatch = block[0] ^ 1;
     i = 0;
     if (s->intra_vlc_format)
@@ -713,7 +713,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
     const int mb_block_count = 4 + (1 << s->chroma_format);
     int ret;
 
-    av_dlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
+    ff_dlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
 
     assert(s->mb_skipped == 0);
 
@@ -777,7 +777,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
         mb_type = btype2mb_type[mb_type];
         break;
     }
-    av_dlog(s->avctx, "mb_type=%x\n", mb_type);
+    ff_dlog(s->avctx, "mb_type=%x\n", mb_type);
 //    motion_type = 0; /* avoid warning */
     if (IS_INTRA(mb_type)) {
         s->bdsp.clear_blocks(s->block[0]);
@@ -877,7 +877,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
             /* motion vectors */
             s->mv_dir = (mb_type >> 13) & 3;
-            av_dlog(s->avctx, "motion_type=%d\n", motion_type);
+            ff_dlog(s->avctx, "motion_type=%d\n", motion_type);
             switch (motion_type) {
             case MT_FRAME: /* or MT_16X8 */
                 if (s->picture_structure == PICT_FRAME) {
@@ -934,12 +934,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
                                                          s->last_mv[i][j][0]);
                                 s->last_mv[i][j][0] = val;
                                 s->mv[i][j][0]      = val;
-                                av_dlog(s->avctx, "fmx=%d\n", val);
+                                ff_dlog(s->avctx, "fmx=%d\n", val);
                                 val = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
                                                          s->last_mv[i][j][1] >> 1);
                                 s->last_mv[i][j][1] = val << 1;
                                 s->mv[i][j][1]      = val;
-                                av_dlog(s->avctx, "fmy=%d\n", val);
+                                ff_dlog(s->avctx, "fmy=%d\n", val);
                             }
                         }
                     }
@@ -1296,10 +1296,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
 // res_change_ffmpeg_aspect.ts 4/3 225/44 ->4/3
 // widescreen-issue562.mpg 4/3 16/9 -> 16/9
 //                    s->avctx->sample_aspect_ratio = av_mul_q(s->avctx->sample_aspect_ratio, (AVRational) {s->width, s->height});
-                    av_dlog(avctx, "A %d/%d\n",
+                    ff_dlog(avctx, "A %d/%d\n",
                             ff_mpeg2_aspect[s->aspect_ratio_info].num,
                             ff_mpeg2_aspect[s->aspect_ratio_info].den);
-                    av_dlog(avctx, "B %d/%d\n", s->avctx->sample_aspect_ratio.num,
+                    ff_dlog(avctx, "B %d/%d\n", s->avctx->sample_aspect_ratio.num,
                             s->avctx->sample_aspect_ratio.den);
                 }
             } else {
@@ -1409,7 +1409,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
     s1->frame_rate_ext.num = get_bits(&s->gb, 2) + 1;
     s1->frame_rate_ext.den = get_bits(&s->gb, 5) + 1;
 
-    av_dlog(s->avctx, "sequence extension\n");
+    ff_dlog(s->avctx, "sequence extension\n");
     s->codec_id = s->avctx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
 
     if (s->avctx->debug & FF_DEBUG_PICT_INFO)
@@ -1502,7 +1502,7 @@ static int load_matrix(MpegEncContext *s, uint16_t matrix0[64],
 
 static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
 {
-    av_dlog(s->avctx, "matrix extension\n");
+    ff_dlog(s->avctx, "matrix extension\n");
 
     if (get_bits1(&s->gb))
         load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
@@ -1583,15 +1583,15 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
     }
 
     /* composite display not parsed */
-    av_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
-    av_dlog(s->avctx, "picture_structure=%d\n", s->picture_structure);
-    av_dlog(s->avctx, "top field first=%d\n", s->top_field_first);
-    av_dlog(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
-    av_dlog(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
-    av_dlog(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
-    av_dlog(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
-    av_dlog(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
-    av_dlog(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
+    ff_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
+    ff_dlog(s->avctx, "picture_structure=%d\n", s->picture_structure);
+    ff_dlog(s->avctx, "top field first=%d\n", s->top_field_first);
+    ff_dlog(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
+    ff_dlog(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
+    ff_dlog(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
+    ff_dlog(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
+    ff_dlog(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
+    ff_dlog(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
 }
 
 static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
@@ -1952,7 +1952,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
     }
 eos: // end of slice
     *buf += (get_bits_count(&s->gb) - 1) / 8;
-    av_dlog(s, "y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
+    ff_dlog(s, "y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y);
     return 0;
 }
 
@@ -1971,7 +1971,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg)
 
         ret = mpeg_decode_slice(s, mb_y, &buf, s->gb.buffer_end - buf);
         emms_c();
-        av_dlog(c, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
+        ff_dlog(c, "ret:%d resync:%d/%d mb:%d/%d ts:%d/%d ec:%d\n",
                 ret, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y,
                 s->start_mb_y, s->end_mb_y, s->er.error_count);
         if (ret < 0) {
@@ -2617,7 +2617,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx, void *data,
     Mpeg1Context *s = avctx->priv_data;
     AVFrame *picture = data;
     MpegEncContext *s2 = &s->mpeg_enc_ctx;
-    av_dlog(avctx, "fill_buffer\n");
+    ff_dlog(avctx, "fill_buffer\n");
 
     if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
         /* special case for last picture */
@@ -2731,7 +2731,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
     if (!(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
         return -1;
     if (!(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
-        av_dlog(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
+        ff_dlog(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
     }
     mpeg_decode_init(avctx);
 
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index e9c7850..08dd18b 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -273,7 +273,7 @@ static av_cold void decode_init_static(void)
         scale_factor_mult[i][0] = MULLx(norm, FIXR(1.0          * 2.0), FRAC_BITS);
         scale_factor_mult[i][1] = MULLx(norm, FIXR(0.7937005259 * 2.0), FRAC_BITS);
         scale_factor_mult[i][2] = MULLx(norm, FIXR(0.6299605249 * 2.0), FRAC_BITS);
-        av_dlog(NULL, "%d: norm=%x s=%x %x %x\n", i, norm,
+        ff_dlog(NULL, "%d: norm=%x s=%x %x %x\n", i, norm,
                 scale_factor_mult[i][0],
                 scale_factor_mult[i][1],
                 scale_factor_mult[i][2]);
@@ -375,7 +375,7 @@ static av_cold void decode_init_static(void)
             k = i & 1;
             is_table_lsf[j][k ^ 1][i] = FIXR(f);
             is_table_lsf[j][k    ][i] = FIXR(1.0);
-            av_dlog(NULL, "is_table_lsf %d %d: %f %f\n",
+            ff_dlog(NULL, "is_table_lsf %d %d: %f %f\n",
                     i, j, (float) is_table_lsf[j][0][i],
                     (float) is_table_lsf[j][1][i]);
         }
@@ -563,7 +563,7 @@ static int mp_decode_layer2(MPADecodeContext *s)
     else
         bound = sblimit;
 
-    av_dlog(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
+    ff_dlog(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
 
     /* sanity check */
     if (bound > sblimit)
@@ -882,7 +882,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
 
             exponent= exponents[s_index];
 
-            av_dlog(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
+            ff_dlog(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
                     i, g->region_size[i] - j, x, y, exponent);
             if (y & 16) {
                 x = y >> 5;
@@ -948,7 +948,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
         last_pos = pos;
 
         code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
-        av_dlog(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
+        ff_dlog(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
         g->sb_hybrid[s_index+0] =
         g->sb_hybrid[s_index+1] =
         g->sb_hybrid[s_index+2] =
@@ -1300,7 +1300,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
 
     for (gr = 0; gr < nb_granules; gr++) {
         for (ch = 0; ch < s->nb_channels; ch++) {
-            av_dlog(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
+            ff_dlog(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
             g = &s->granules[ch][gr];
             g->part2_3_length = get_bits(&s->gb, 12);
             g->big_values     = get_bits(&s->gb,  9);
@@ -1341,7 +1341,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                 /* compute huffman coded region sizes */
                 region_address1 = get_bits(&s->gb, 4);
                 region_address2 = get_bits(&s->gb, 3);
-                av_dlog(s->avctx, "region1=%d region2=%d\n",
+                ff_dlog(s->avctx, "region1=%d region2=%d\n",
                         region_address1, region_address2);
                 init_long_region(s, g, region_address1, region_address2);
             }
@@ -1353,7 +1353,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                 g->preflag = get_bits1(&s->gb);
             g->scalefac_scale     = get_bits1(&s->gb);
             g->count1table_select = get_bits1(&s->gb);
-            av_dlog(s->avctx, "block_type=%d switch_point=%d\n",
+            ff_dlog(s->avctx, "block_type=%d switch_point=%d\n",
                     g->block_type, g->switch_point);
         }
     }
@@ -1365,7 +1365,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                                 FFMAX(0, LAST_BUF_SIZE - s->last_buf_size));
         assert((get_bits_count(&s->gb) & 7) == 0);
         /* now we get bits from the main_data_begin offset */
-        av_dlog(s->avctx, "seekback:%d, lastbuf:%d\n",
+        ff_dlog(s->avctx, "seekback:%d, lastbuf:%d\n",
                 main_data_begin, s->last_buf_size);
 
         memcpy(s->last_buf + s->last_buf_size, ptr, extrasize);
@@ -1407,7 +1407,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
                 /* MPEG1 scale factors */
                 slen1 = slen_table[0][g->scalefac_compress];
                 slen2 = slen_table[1][g->scalefac_compress];
-                av_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
+                ff_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
                 if (g->block_type == 2) {
                     n = g->switch_point ? 17 : 18;
                     j = 0;
diff --git a/libavcodec/mpegaudiodecheader.c b/libavcodec/mpegaudiodecheader.c
index 8efcbe4..3d840d7 100644
--- a/libavcodec/mpegaudiodecheader.c
+++ b/libavcodec/mpegaudiodecheader.c
@@ -94,20 +94,20 @@ int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
     }
 
 #if defined(DEBUG)
-    av_dlog(NULL, "layer%d, %d Hz, %d kbits/s, ",
+    ff_dlog(NULL, "layer%d, %d Hz, %d kbits/s, ",
            s->layer, s->sample_rate, s->bit_rate);
     if (s->nb_channels == 2) {
         if (s->layer == 3) {
             if (s->mode_ext & MODE_EXT_MS_STEREO)
-                av_dlog(NULL, "ms-");
+                ff_dlog(NULL, "ms-");
             if (s->mode_ext & MODE_EXT_I_STEREO)
-                av_dlog(NULL, "i-");
+                ff_dlog(NULL, "i-");
         }
-        av_dlog(NULL, "stereo");
+        ff_dlog(NULL, "stereo");
     } else {
-        av_dlog(NULL, "mono");
+        ff_dlog(NULL, "mono");
     }
-    av_dlog(NULL, "\n");
+    ff_dlog(NULL, "\n");
 #endif
     return 0;
 }
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c
index 4e074a5..7b0261f 100644
--- a/libavcodec/mpegaudioenc.c
+++ b/libavcodec/mpegaudioenc.c
@@ -129,7 +129,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
     s->sblimit = ff_mpa_sblimit_table[table];
     s->alloc_table = ff_mpa_alloc_tables[table];
 
-    av_dlog(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
+    ff_dlog(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
             bitrate, freq, s->frame_size, table, s->frame_frac_incr);
 
     for(i=0;i<s->nb_channels;i++)
@@ -394,7 +394,7 @@ static void compute_scale_factors(MpegAudioContext *s,
                 index = 62; /* value 63 is not allowed */
             }
 
-            av_dlog(NULL, "%2d:%d in=%x %x %d\n",
+            ff_dlog(NULL, "%2d:%d in=%x %x %d\n",
                     j, i, vmax, s->scale_factor_table[index], index);
             /* store the scale factor */
             assert(index >=0 && index <= 63);
@@ -463,7 +463,7 @@ static void compute_scale_factors(MpegAudioContext *s,
             code = 0;           /* kill warning */
         }
 
-        av_dlog(NULL, "%d: %2d %2d %2d %d %d -> %d\n", j,
+        ff_dlog(NULL, "%d: %2d %2d %2d %d %d -> %d\n", j,
                 sf[0], sf[1], sf[2], d1, d2, code);
         scale_code[j] = code;
         sf += 3;
@@ -540,7 +540,7 @@ static void compute_bit_allocation(MpegAudioContext *s,
         }
         if (max_sb < 0)
             break;
-        av_dlog(NULL, "current=%d max=%d max_sb=%d max_ch=%d alloc=%d\n",
+        ff_dlog(NULL, "current=%d max=%d max_sb=%d max_ch=%d alloc=%d\n",
                 current_frame_size, max_frame_size, max_sb, max_ch,
                 bit_alloc[max_ch][max_sb]);
 
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index b88dd58..9db9522 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1757,7 +1757,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
         if (!s->droppable)
             s->next_picture_ptr = s->current_picture_ptr;
     }
-    av_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
+    ff_dlog(s->avctx, "L%p N%p C%p L%p N%p C%p type:%d drop:%d\n",
             s->last_picture_ptr, s->next_picture_ptr,s->current_picture_ptr,
             s->last_picture_ptr    ? s->last_picture_ptr->f->data[0]    : NULL,
             s->next_picture_ptr    ? s->next_picture_ptr->f->data[0]    : NULL,
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index e453ba5..0ad131f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -993,7 +993,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
         if ((s->width & 15) || (s->height & 15))
             direct = 0;
 
-        av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
+        ff_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
                 pic_arg->linesize[1], s->linesize, s->uvlinesize);
 
         i = ff_find_unused_picture(s, direct);
@@ -3139,7 +3139,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
                 if(CONFIG_H263_ENCODER && s->out_format == FMT_H263)
                     ff_h263_loop_filter(s);
             }
-            av_dlog(s->avctx, "MB %d %d bits\n",
+            ff_dlog(s->avctx, "MB %d %d bits\n",
                     s->mb_x + s->mb_y * s->mb_stride, put_bits_count(&s->pb));
         }
     }
@@ -3337,7 +3337,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
         s->pict_type= AV_PICTURE_TYPE_I;
         for(i=0; i<s->mb_stride*s->mb_height; i++)
             s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
-        av_dlog(s, "Scene change detected, encoding as I Frame %d %d\n",
+        ff_dlog(s, "Scene change detected, encoding as I Frame %d %d\n",
                 s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
     }
 
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index d657818..620083f 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -169,7 +169,7 @@ static int mpegvideo_parse(AVCodecParserContext *s,
        to have the full timing information. The time take by this
        function should be negligible for uncorrupted streams */
     mpegvideo_extract_headers(s, avctx, buf, buf_size);
-    av_dlog(NULL, "pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
+    ff_dlog(NULL, "pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
             s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);
 
     *poutbuf = buf;
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 191f81a..402fbe3 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -23,6 +23,7 @@
  */
 
 #include "avcodec.h"
+#include "internal.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
 #include "msmpeg4.h"
@@ -73,7 +74,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
     int code, val, sign, shift;
 
     code = get_vlc2(&s->gb, v2_mv_vlc.table, V2_MV_VLC_BITS, 2);
-    av_dlog(s, "MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
+    ff_dlog(s, "MV code %d at %d %d pred: %d\n", code, s->mb_x,s->mb_y, pred);
     if (code < 0)
         return 0xffff;
 
@@ -249,14 +250,14 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64])
         s->mv[0][0][1] = my;
         *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16;
     } else {
-        av_dlog(s, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
+        ff_dlog(s, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
                 ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
                 show_bits(&s->gb, 24));
         s->ac_pred = get_bits1(&s->gb);
         *mb_type_ptr = MB_TYPE_INTRA;
         if(s->inter_intra_pred){
             s->h263_aic_dir= get_vlc2(&s->gb, ff_inter_intra_vlc.table, INTER_INTRA_VLC_BITS, 1);
-            av_dlog(s, "%d%d %d %d/",
+            ff_dlog(s, "%d%d %d %d/",
                     s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
         }
         if(s->per_mb_rl_table && cbp){
@@ -532,7 +533,7 @@ int ff_msmpeg4_decode_picture_header(MpegEncContext * s)
             s->no_rounding = 0;
         }
     }
-    av_dlog(s->avctx, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
+    ff_dlog(s->avctx, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
             s->inter_intra_pred, s->width, s->height);
 
     s->esc3_level_length= 0;
@@ -720,7 +721,7 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
                         last=  SHOW_UBITS(re, &s->gb, 1); SKIP_BITS(re, &s->gb, 1);
                         if(!s->esc3_level_length){
                             int ll;
-                            av_dlog(s->avctx, "ESC-3 %X at %d %d\n",
+                            ff_dlog(s->avctx, "ESC-3 %X at %d %d\n",
                                     show_bits(&s->gb, 24), s->mb_x, s->mb_y);
                             if(s->qscale<8){
                                 ll= SHOW_UBITS(re, &s->gb, 3); SKIP_BITS(re, &s->gb, 3);
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 999c541..072f6fc 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -36,6 +36,7 @@
 #include "mpegvideo.h"
 #include "msmpeg4.h"
 #include "h263.h"
+#include "internal.h"
 #include "mpeg4video.h"
 #include "msmpeg4.h"
 #include "msmpeg4data.h"
@@ -240,7 +241,7 @@ void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
     s->per_mb_rl_table = 0;
     if(s->msmpeg4_version==4)
         s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
-    av_dlog(s, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
+    ff_dlog(s, "%d %d %d %d %d\n", s->pict_type, s->bit_rate,
             s->inter_intra_pred, s->width, s->height);
 
     if (s->pict_type == AV_PICTURE_TYPE_I) {
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 4404d97..ef83728 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -25,6 +25,7 @@
 
 #include "libavutil/mem.h"
 
+#include "internal.h"
 #include "parser.h"
 
 static AVCodecParser *av_first_parser = NULL;
@@ -222,9 +223,9 @@ int ff_combine_frame(ParseContext *pc, int next,
                      const uint8_t **buf, int *buf_size)
 {
     if (pc->overread) {
-        av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
+        ff_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
                 pc->overread, pc->state, next, pc->index, pc->overread_index);
-        av_dlog(NULL, "%X %X %X %X\n",
+        ff_dlog(NULL, "%X %X %X %X\n",
                 (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
     }
 
@@ -279,9 +280,9 @@ int ff_combine_frame(ParseContext *pc, int next,
     }
 
     if (pc->overread) {
-        av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
+        ff_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n",
                 pc->overread, pc->state, next, pc->index, pc->overread_index);
-        av_dlog(NULL, "%X %X %X %X\n",
+        ff_dlog(NULL, "%X %X %X %X\n",
                 (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
     }
 
diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c
index 7e4dcf8..85703eb 100644
--- a/libavcodec/pcm-bluray.c
+++ b/libavcodec/pcm-bluray.c
@@ -66,7 +66,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
     uint8_t channel_layout = header[2] >> 4;
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
+        ff_dlog(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
                 header[0], header[1], header[2], header[3]);
 
     /* get the sample depth and derive the sample format from it */
@@ -115,7 +115,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
                       avctx->bits_per_coded_sample;
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx,
+        ff_dlog(avctx,
                 "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
                 avctx->channels, avctx->bits_per_coded_sample,
                 avctx->sample_rate, avctx->bit_rate);
@@ -297,7 +297,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data,
 
     retval = bytestream2_tell(&gb);
     if (avctx->debug & FF_DEBUG_BITSTREAM)
-        av_dlog(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
+        ff_dlog(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
                 retval, buf_size);
     return retval + 4;
 }
diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c
index f68af36..cb6bb0e 100644
--- a/libavcodec/pcm-dvd.c
+++ b/libavcodec/pcm-dvd.c
@@ -71,7 +71,7 @@ static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
         return 0;
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx, "pcm_dvd_parse_header: header = %02x%02x%02x\n",
+        ff_dlog(avctx, "pcm_dvd_parse_header: header = %02x%02x%02x\n",
                 header[0], header[1], header[2]);
     /*
      * header[0] emphasis (1), muse(1), reserved(1), frame number(5)
@@ -135,7 +135,7 @@ static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
     }
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
-        av_dlog(avctx,
+        ff_dlog(avctx,
                 "pcm_dvd_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
                 avctx->channels, avctx->bits_per_coded_sample,
                 avctx->sample_rate, avctx->bit_rate);
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 6217c40..72142e6 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -210,7 +210,7 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitleRect *rect,
         return AVERROR_INVALIDDATA;
     }
 
-    av_dlog(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, rect->w * rect->h);
+    ff_dlog(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, rect->w * rect->h);
 
     return 0;
 }
@@ -354,7 +354,7 @@ static int parse_palette_segment(AVCodecContext *avctx,
         YUV_TO_RGB1(cb, cr);
         YUV_TO_RGB2(r, g, b, y);
 
-        av_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
+        ff_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
 
         /* Store color in palette */
         palette->clut[color_id] = RGBA(r,g,b,alpha);
@@ -387,7 +387,7 @@ static int parse_presentation_segment(AVCodecContext *avctx,
 
     ctx->presentation.pts = pts;
 
-    av_dlog(avctx, "Video Dimensions %dx%d\n",
+    ff_dlog(avctx, "Video Dimensions %dx%d\n",
             w, h);
     ret = ff_set_dimensions(avctx, w, h);
     if (ret < 0)
@@ -445,7 +445,7 @@ static int parse_presentation_segment(AVCodecContext *avctx,
             ctx->presentation.objects[i].crop_h = bytestream_get_be16(&buf);
         }
 
-        av_dlog(avctx, "Subtitle Placement x=%d, y=%d\n",
+        ff_dlog(avctx, "Subtitle Placement x=%d, y=%d\n",
                 ctx->presentation.objects[i].x, ctx->presentation.objects[i].y);
 
         if (ctx->presentation.objects[i].x > avctx->width ||
@@ -587,16 +587,16 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
     int           segment_length;
     int i, ret;
 
-    av_dlog(avctx, "PGS sub packet:\n");
+    ff_dlog(avctx, "PGS sub packet:\n");
 
     for (i = 0; i < buf_size; i++) {
-        av_dlog(avctx, "%02x ", buf[i]);
+        ff_dlog(avctx, "%02x ", buf[i]);
         if (i % 16 == 15)
-            av_dlog(avctx, "\n");
+            ff_dlog(avctx, "\n");
     }
 
     if (i & 15)
-        av_dlog(avctx, "\n");
+        ff_dlog(avctx, "\n");
 
     *data_size = 0;
 
@@ -611,7 +611,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
         segment_type   = bytestream_get_byte(&buf);
         segment_length = bytestream_get_be16(&buf);
 
-        av_dlog(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
+        ff_dlog(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
 
         if (segment_type != DISPLAY_SEGMENT && segment_length > buf_end - buf)
             break;
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index dec5bd5..c8bfa36 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -437,7 +437,7 @@ static int decode_frame(AVCodecContext *avctx,
         if (length > 0x7fffffff)
             goto fail;
         tag = bytestream2_get_le32(&s->gb);
-        av_dlog(avctx, "png: tag=%c%c%c%c length=%u\n",
+        ff_dlog(avctx, "png: tag=%c%c%c%c length=%u\n",
                 (tag & 0xff),
                 ((tag >> 8) & 0xff),
                 ((tag >> 16) & 0xff),
@@ -459,7 +459,7 @@ static int decode_frame(AVCodecContext *avctx,
             s->interlace_type   = bytestream2_get_byte(&s->gb);
             bytestream2_skip(&s->gb, 4); /* crc */
             s->state |= PNG_IHDR;
-            av_dlog(avctx, "width=%d height=%d depth=%d color_type=%d "
+            ff_dlog(avctx, "width=%d height=%d depth=%d color_type=%d "
                            "compression_type=%d filter_type=%d interlace_type=%d\n",
                     s->width, s->height, s->bit_depth, s->color_type,
                     s->compression_type, s->filter_type, s->interlace_type);
@@ -526,7 +526,7 @@ static int decode_frame(AVCodecContext *avctx,
                                                             s->width);
                     s->crow_size = s->pass_row_size + 1;
                 }
-                av_dlog(avctx, "row_size=%d crow_size =%d\n",
+                ff_dlog(avctx, "row_size=%d crow_size =%d\n",
                         s->row_size, s->crow_size);
                 s->image_buf      = p->data[0];
                 s->image_linesize = p->linesize[0];
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index e18878d..aae7570 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -27,6 +27,7 @@
 
 #include "libavutil/attributes.h"
 #include "avcodec.h"
+#include "internal.h"
 #include "ratecontrol.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
@@ -306,7 +307,7 @@ int ff_vbv_update(MpegEncContext *s, int frame_size)
     const double min_rate   = s->avctx->rc_min_rate / fps;
     const double max_rate   = s->avctx->rc_max_rate / fps;
 
-    av_dlog(s, "%d %f %d %f %f\n",
+    ff_dlog(s, "%d %f %d %f %f\n",
             buffer_size, rcc->buffer_index, frame_size, min_rate, max_rate);
 
     if (buffer_size) {
@@ -550,7 +551,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce,
             }
         }
     }
-    av_dlog(s, "q:%f max:%f min:%f size:%f index:%f agr:%f\n",
+    ff_dlog(s, "q:%f max:%f min:%f size:%f index:%f agr:%f\n",
             q, max_rate, min_rate, buffer_size, rcc->buffer_index,
             s->rc_buffer_aggressivity);
     if (s->rc_qsquish == 0.0 || qmin == qmax) {
@@ -796,7 +797,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
             assert(pict_type == rce->new_pict_type);
 
         q = rce->new_qscale / br_compensation;
-        av_dlog(s, "%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale,
+        ff_dlog(s, "%f %f %f last:%d var:%d type:%d//\n", q, rce->new_qscale,
                 br_compensation, s->frame_bits, var, pict_type);
     } else {
         rce->pict_type     =
@@ -991,7 +992,7 @@ static int init_pass2(MpegEncContext *s)
             expected_bits     += bits;
         }
 
-        av_dlog(s->avctx,
+        ff_dlog(s->avctx,
                 "expected_bits: %f all_available_bits: %d rate_factor: %f\n",
                 expected_bits, (int)all_available_bits, rate_factor);
         if (expected_bits > all_available_bits) {
@@ -1005,7 +1006,7 @@ static int init_pass2(MpegEncContext *s)
     /* check bitrate calculations and print info */
     qscale_sum = 0.0;
     for (i = 0; i < rcc->num_entries; i++) {
-        av_dlog(s, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",
+        ff_dlog(s, "[lavc rc] entry[%d].new_qscale = %.3f  qp = %.3f\n",
                 i,
                 rcc->entry[i].new_qscale,
                 rcc->entry[i].new_qscale / FF_QP2LAMBDA);
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index e5b76f0..20230f4 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -258,7 +258,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
 
     pb_frame = get_bits1(&s->gb);
 
-    av_dlog(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
+    ff_dlog(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
 
     if (pb_frame) {
         avpriv_request_sample(s->avctx, "pb frame");
@@ -277,7 +277,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
             s->last_dc[0] = get_bits(&s->gb, 8);
             s->last_dc[1] = get_bits(&s->gb, 8);
             s->last_dc[2] = get_bits(&s->gb, 8);
-            av_dlog(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
+            ff_dlog(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
                     s->last_dc[1], s->last_dc[2]);
         }
     }
@@ -574,7 +574,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf,
         }
     }
 
-    av_dlog(avctx, "qscale=%d\n", s->qscale);
+    ff_dlog(avctx, "qscale=%d\n", s->qscale);
 
     /* default quantization values */
     if (s->codec_id == AV_CODEC_ID_RV10) {
@@ -614,7 +614,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf,
     for (s->mb_num_left = mb_count; s->mb_num_left > 0; s->mb_num_left--) {
         int ret;
         ff_update_block_index(s);
-        av_dlog(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
+        ff_dlog(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
 
         s->mv_dir  = MV_DIR_FORWARD;
         s->mv_type = MV_TYPE_16X16;
@@ -686,7 +686,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     int slice_count;
     const uint8_t *slices_hdr = NULL;
 
-    av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
+    ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
 
     /* no supplementary picture */
     if (buf_size == 0) {
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 909ace7..6436881 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -192,7 +192,7 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
         }
 
         if ((stages > 0 && level >= 4) || stages < 0) {
-            av_dlog(NULL,
+            ff_dlog(NULL,
                     "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",
                     stages, level);
             return AVERROR_INVALIDDATA;  /* invalid vector */
@@ -254,7 +254,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
             continue;           /* skip vector */
 
         if ((stages > 0 && level >= 4) || stages < 0) {
-            av_dlog(NULL,
+            ff_dlog(NULL,
                     "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",
                     stages, level);
             return AVERROR_INVALIDDATA;  /* invalid vector */
@@ -480,7 +480,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp,
                                          pitch, motion, x, y, width, height);
 
         if (result != 0) {
-            av_dlog(avctx, "Error in svq1_motion_inter_block %i\n", result);
+            ff_dlog(avctx, "Error in svq1_motion_inter_block %i\n", result);
             break;
         }
         result = svq1_decode_block_non_intra(bitbuf, current, pitch);
@@ -491,7 +491,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp,
                                             pitch, motion, x, y, width, height);
 
         if (result != 0) {
-            av_dlog(avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
+            ff_dlog(avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
             break;
         }
         result = svq1_decode_block_non_intra(bitbuf, current, pitch);
@@ -552,7 +552,7 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
                                            bitbuf->size_in_bits >> 3,
                                            csum);
 
-            av_dlog(avctx, "%s checksum (%02x) for packet data\n",
+            ff_dlog(avctx, "%s checksum (%02x) for packet data\n",
                     (csum == 0) ? "correct" : "incorrect", csum);
         }
 
@@ -657,7 +657,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
     result = svq1_decode_frame_header(avctx, cur);
 
     if (result != 0) {
-        av_dlog(avctx, "Error in svq1_decode_frame_header %i\n", result);
+        ff_dlog(avctx, "Error in svq1_decode_frame_header %i\n", result);
         return result;
     }
 
@@ -728,7 +728,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
                                                      previous, linesize,
                                                      pmv, x, y, width, height);
                     if (result != 0) {
-                        av_dlog(avctx,
+                        ff_dlog(avctx,
                                 "Error in svq1_decode_delta_block %i\n",
                                 result);
                         goto err;
diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index fcc6243..aa90793 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -180,7 +180,7 @@ void ff_vaapi_common_end_frame(AVCodecContext *avctx)
 {
     struct vaapi_context * const vactx = avctx->hwaccel_context;
 
-    av_dlog(avctx, "ff_vaapi_common_end_frame()\n");
+    ff_dlog(avctx, "ff_vaapi_common_end_frame()\n");
 
     destroy_buffers(vactx->display, &vactx->pic_param_buf_id, 1);
     destroy_buffers(vactx->display, &vactx->iq_matrix_buf_id, 1);
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index a97a091..54f4d13 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -230,7 +230,7 @@ static int vaapi_h264_start_frame(AVCodecContext          *avctx,
     VAPictureParameterBufferH264 *pic_param;
     VAIQMatrixBufferH264 *iq_matrix;
 
-    av_dlog(avctx, "vaapi_h264_start_frame()\n");
+    ff_dlog(avctx, "vaapi_h264_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferH264);
 
@@ -296,7 +296,7 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
     H264SliceContext *sl = &h->slice_ctx[0];
     int ret;
 
-    av_dlog(avctx, "vaapi_h264_end_frame()\n");
+    ff_dlog(avctx, "vaapi_h264_end_frame()\n");
     ret = ff_vaapi_commit_slices(vactx);
     if (ret < 0)
         goto finish;
@@ -321,7 +321,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx,
     H264SliceContext *sl  = &h->slice_ctx[0];
     VASliceParameterBufferH264 *slice_param;
 
-    av_dlog(avctx, "vaapi_h264_decode_slice(): buffer %p, size %d\n",
+    ff_dlog(avctx, "vaapi_h264_decode_slice(): buffer %p, size %d\n",
             buffer, size);
 
     /* Fill in VASliceParameterBufferH264. */
diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index 31e0218..541b6a9 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -44,7 +44,7 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
     VAIQMatrixBufferMPEG2 *iq_matrix;
     int i;
 
-    av_dlog(avctx, "vaapi_mpeg2_start_frame()\n");
+    ff_dlog(avctx, "vaapi_mpeg2_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG2);
 
@@ -106,7 +106,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
     GetBitContext gb;
     uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset;
 
-    av_dlog(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dlog(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* Determine macroblock_offset */
     init_get_bits(&gb, buffer, 8 * size);
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
index 4ca1445..2ab7fab 100644
--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -49,7 +49,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
     VAIQMatrixBufferMPEG4 *iq_matrix;
     int i;
 
-    av_dlog(avctx, "vaapi_mpeg4_start_frame()\n");
+    ff_dlog(avctx, "vaapi_mpeg4_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG4);
 
@@ -122,7 +122,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
     MpegEncContext * const s = avctx->priv_data;
     VASliceParameterBufferMPEG4 *slice_param;
 
-    av_dlog(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dlog(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* video_plane_with_short_video_header() contains all GOBs
      * in-order, and this is what VA API (Intel backend) expects: only
diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
index 8886b0b..d6ed101 100644
--- a/libavcodec/vaapi_vc1.c
+++ b/libavcodec/vaapi_vc1.c
@@ -150,7 +150,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
     struct vaapi_context * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferVC1 *pic_param;
 
-    av_dlog(avctx, "vaapi_vc1_start_frame()\n");
+    ff_dlog(avctx, "vaapi_vc1_start_frame()\n");
 
     vactx->slice_param_size = sizeof(VASliceParameterBufferVC1);
 
@@ -316,7 +316,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
     MpegEncContext * const s = &v->s;
     VASliceParameterBufferVC1 *slice_param;
 
-    av_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
+    ff_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
 
     /* Current bit buffer is beyond any marker for VC-1, so skip it */
     if (avctx->codec_id == AV_CODEC_ID_VC1 && IS_MARKER(AV_RB32(buffer))) {
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 6f11910..0631439 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -703,7 +703,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
         v->x8_type = get_bits1(gb);
     } else
         v->x8_type = 0;
-    av_dlog(v->s.avctx, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
+    ff_dlog(v->s.avctx, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
             (v->s.pict_type == AV_PICTURE_TYPE_P) ? 'P' : ((v->s.pict_type == AV_PICTURE_TYPE_I) ? 'I' : 'B'),
             pqindex, v->pq, v->halfpq, v->rangeredfrm);
 
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 1cfe56e..0d578cd 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -889,7 +889,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
                 FFSWAP(uint8_t *, v->mv_f_next[1], v->mv_f[1]);
             }
         }
-        av_dlog(s->avctx, "Consumed %i/%i bits\n",
+        ff_dlog(s->avctx, "Consumed %i/%i bits\n",
                 get_bits_count(&s->gb), s->gb.size_in_bits);
 //  if (get_bits_count(&s->gb) > buf_size * 8)
 //      return -1;
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 0865dc8..5812f9a 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -236,7 +236,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
 
     vc->codebook_count = get_bits(gb, 8) + 1;
 
-    av_dlog(NULL, " Codebooks: %d \n", vc->codebook_count);
+    ff_dlog(NULL, " Codebooks: %d \n", vc->codebook_count);
 
     vc->codebooks = av_mallocz(vc->codebook_count * sizeof(*vc->codebooks));
     tmp_vlc_bits  = av_mallocz(V_MAX_VLCS * sizeof(*tmp_vlc_bits));
@@ -252,7 +252,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
         vorbis_codebook *codebook_setup = &vc->codebooks[cb];
         unsigned ordered, t, entries, used_entries = 0;
 
-        av_dlog(NULL, " %u. Codebook\n", cb);
+        ff_dlog(NULL, " %u. Codebook\n", cb);
 
         if (get_bits(gb, 24) != 0x564342) {
             av_log(vc->avctx, AV_LOG_ERROR,
@@ -280,17 +280,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
 
         ordered = get_bits1(gb);
 
-        av_dlog(NULL, " codebook_dimensions %d, codebook_entries %u\n",
+        ff_dlog(NULL, " codebook_dimensions %d, codebook_entries %u\n",
                 codebook_setup->dimensions, entries);
 
         if (!ordered) {
             unsigned ce, flag;
             unsigned sparse = get_bits1(gb);
 
-            av_dlog(NULL, " not ordered \n");
+            ff_dlog(NULL, " not ordered \n");
 
             if (sparse) {
-                av_dlog(NULL, " sparse \n");
+                ff_dlog(NULL, " sparse \n");
 
                 used_entries = 0;
                 for (ce = 0; ce < entries; ++ce) {
@@ -302,7 +302,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
                         tmp_vlc_bits[ce] = 0;
                 }
             } else {
-                av_dlog(NULL, " not sparse \n");
+                ff_dlog(NULL, " not sparse \n");
 
                 used_entries = entries;
                 for (ce = 0; ce < entries; ++ce)
@@ -312,17 +312,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
             unsigned current_entry  = 0;
             unsigned current_length = get_bits(gb, 5) + 1;
 
-            av_dlog(NULL, " ordered, current length: %u\n", current_length);  //FIXME
+            ff_dlog(NULL, " ordered, current length: %u\n", current_length);  //FIXME
 
             used_entries = entries;
             for (; current_entry < used_entries && current_length <= 32; ++current_length) {
                 unsigned i, number;
 
-                av_dlog(NULL, " number bits: %u ", ilog(entries - current_entry));
+                ff_dlog(NULL, " number bits: %u ", ilog(entries - current_entry));
 
                 number = get_bits(gb, ilog(entries - current_entry));
 
-                av_dlog(NULL, " number: %u\n", number);
+                ff_dlog(NULL, " number: %u\n", number);
 
                 for (i = current_entry; i < number+current_entry; ++i)
                     if (i < used_entries)
@@ -339,7 +339,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
 
         codebook_setup->lookup_type = get_bits(gb, 4);
 
-        av_dlog(NULL, " lookup type: %d : %s \n", codebook_setup->lookup_type,
+        ff_dlog(NULL, " lookup type: %d : %s \n", codebook_setup->lookup_type,
                 codebook_setup->lookup_type ? "vq" : "no lookup");
 
 // If the codebook is used for (inverse) VQ, calculate codevectors.
@@ -353,17 +353,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
             unsigned codebook_value_bits = get_bits(gb, 4) + 1;
             unsigned codebook_sequence_p = get_bits1(gb);
 
-            av_dlog(NULL, " We expect %d numbers for building the codevectors. \n",
+            ff_dlog(NULL, " We expect %d numbers for building the codevectors. \n",
                     codebook_lookup_values);
-            av_dlog(NULL, "  delta %f minmum %f \n",
+            ff_dlog(NULL, "  delta %f minmum %f \n",
                     codebook_delta_value, codebook_minimum_value);
 
             for (i = 0; i < codebook_lookup_values; ++i) {
                 codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);
 
-                av_dlog(NULL, " multiplicands*delta+minmum : %e \n",
+                ff_dlog(NULL, " multiplicands*delta+minmum : %e \n",
                         (float)codebook_multiplicands[i] * codebook_delta_value + codebook_minimum_value);
-                av_dlog(NULL, " multiplicand %u\n", codebook_multiplicands[i]);
+                ff_dlog(NULL, " multiplicand %u\n", codebook_multiplicands[i]);
             }
 
 // Weed out unused vlcs and build codevector vector
@@ -383,7 +383,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
                     float last = 0.0;
                     unsigned lookup_offset = i;
 
-                    av_dlog(vc->avctx, "Lookup offset %u ,", i);
+                    ff_dlog(vc->avctx, "Lookup offset %u ,", i);
 
                     for (k = 0; k < dim; ++k) {
                         unsigned multiplicand_offset = lookup_offset % codebook_lookup_values;
@@ -394,11 +394,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
                     }
                     tmp_vlc_bits[j] = tmp_vlc_bits[i];
 
-                    av_dlog(vc->avctx, "real lookup offset %u, vector: ", j);
+                    ff_dlog(vc->avctx, "real lookup offset %u, vector: ", j);
                     for (k = 0; k < dim; ++k)
-                        av_dlog(vc->avctx, " %f ",
+                        ff_dlog(vc->avctx, " %f ",
                                 codebook_setup->codevectors[j * dim + k]);
-                    av_dlog(vc->avctx, "\n");
+                    ff_dlog(vc->avctx, "\n");
 
                     ++j;
                 }
@@ -466,7 +466,7 @@ static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc)
     for (i = 0; i < vorbis_time_count; ++i) {
         unsigned vorbis_tdtransform = get_bits(gb, 16);
 
-        av_dlog(NULL, " Vorbis time domain transform %u: %u\n",
+        ff_dlog(NULL, " Vorbis time domain transform %u: %u\n",
                 vorbis_time_count, vorbis_tdtransform);
 
         if (vorbis_tdtransform) {
@@ -500,7 +500,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
 
         floor_setup->floor_type = get_bits(gb, 16);
 
-        av_dlog(NULL, " %d. floor type %d \n", i, floor_setup->floor_type);
+        ff_dlog(NULL, " %d. floor type %d \n", i, floor_setup->floor_type);
 
         if (floor_setup->floor_type == 1) {
             int maximum_class = -1;
@@ -510,7 +510,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
 
             floor_setup->data.t1.partitions = get_bits(gb, 5);
 
-            av_dlog(NULL, " %d.floor: %d partitions \n",
+            ff_dlog(NULL, " %d.floor: %d partitions \n",
                     i, floor_setup->data.t1.partitions);
 
             for (j = 0; j < floor_setup->data.t1.partitions; ++j) {
@@ -518,25 +518,25 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
                 if (floor_setup->data.t1.partition_class[j] > maximum_class)
                     maximum_class = floor_setup->data.t1.partition_class[j];
 
-                av_dlog(NULL, " %d. floor %d partition class %d \n",
+                ff_dlog(NULL, " %d. floor %d partition class %d \n",
                         i, j, floor_setup->data.t1.partition_class[j]);
 
             }
 
-            av_dlog(NULL, " maximum class %d \n", maximum_class);
+            ff_dlog(NULL, " maximum class %d \n", maximum_class);
 
             for (j = 0; j <= maximum_class; ++j) {
                 floor_setup->data.t1.class_dimensions[j] = get_bits(gb, 3) + 1;
                 floor_setup->data.t1.class_subclasses[j] = get_bits(gb, 2);
 
-                av_dlog(NULL, " %d floor %d class dim: %d subclasses %d \n", i, j,
+                ff_dlog(NULL, " %d floor %d class dim: %d subclasses %d \n", i, j,
                         floor_setup->data.t1.class_dimensions[j],
                         floor_setup->data.t1.class_subclasses[j]);
 
                 if (floor_setup->data.t1.class_subclasses[j]) {
                     GET_VALIDATED_INDEX(floor_setup->data.t1.class_masterbook[j], 8, vc->codebook_count)
 
-                    av_dlog(NULL, "   masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
+                    ff_dlog(NULL, "   masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
                 }
 
                 for (k = 0; k < (1 << floor_setup->data.t1.class_subclasses[j]); ++k) {
@@ -545,7 +545,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
                         VALIDATE_INDEX(bits, vc->codebook_count)
                     floor_setup->data.t1.subclass_books[j][k] = bits;
 
-                    av_dlog(NULL, "    book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
+                    ff_dlog(NULL, "    book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
                 }
             }
 
@@ -575,7 +575,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
                 for (k = 0; k < floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]]; ++k, ++floor1_values) {
                     floor_setup->data.t1.list[floor1_values].x = get_bits(gb, rangebits);
 
-                    av_dlog(NULL, " %u. floor1 Y coord. %d\n", floor1_values,
+                    ff_dlog(NULL, " %u. floor1 Y coord. %d\n", floor1_values,
                             floor_setup->data.t1.list[floor1_values].x);
                 }
             }
@@ -640,22 +640,22 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
                 return AVERROR(ENOMEM);
 
             /* debug output parsed headers */
-            av_dlog(NULL, "floor0 order: %u\n", floor_setup->data.t0.order);
-            av_dlog(NULL, "floor0 rate: %u\n", floor_setup->data.t0.rate);
-            av_dlog(NULL, "floor0 bark map size: %u\n",
+            ff_dlog(NULL, "floor0 order: %u\n", floor_setup->data.t0.order);
+            ff_dlog(NULL, "floor0 rate: %u\n", floor_setup->data.t0.rate);
+            ff_dlog(NULL, "floor0 bark map size: %u\n",
                     floor_setup->data.t0.bark_map_size);
-            av_dlog(NULL, "floor0 amplitude bits: %u\n",
+            ff_dlog(NULL, "floor0 amplitude bits: %u\n",
                     floor_setup->data.t0.amplitude_bits);
-            av_dlog(NULL, "floor0 amplitude offset: %u\n",
+            ff_dlog(NULL, "floor0 amplitude offset: %u\n",
                     floor_setup->data.t0.amplitude_offset);
-            av_dlog(NULL, "floor0 number of books: %u\n",
+            ff_dlog(NULL, "floor0 number of books: %u\n",
                     floor_setup->data.t0.num_books);
-            av_dlog(NULL, "floor0 book list pointer: %p\n",
+            ff_dlog(NULL, "floor0 book list pointer: %p\n",
                     floor_setup->data.t0.book_list);
             {
                 int idx;
                 for (idx = 0; idx < floor_setup->data.t0.num_books; ++idx) {
-                    av_dlog(NULL, "  Book %d: %u\n", idx + 1,
+                    ff_dlog(NULL, "  Book %d: %u\n", idx + 1,
                             floor_setup->data.t0.book_list[idx]);
                 }
             }
@@ -679,7 +679,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
     if (!vc->residues)
         return AVERROR(ENOMEM);
 
-    av_dlog(NULL, " There are %d residues. \n", vc->residue_count);
+    ff_dlog(NULL, " There are %d residues. \n", vc->residue_count);
 
     for (i = 0; i < vc->residue_count; ++i) {
         vorbis_residue *res_setup = &vc->residues[i];
@@ -688,7 +688,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
 
         res_setup->type = get_bits(gb, 16);
 
-        av_dlog(NULL, " %u. residue type %d\n", i, res_setup->type);
+        ff_dlog(NULL, " %u. residue type %d\n", i, res_setup->type);
 
         res_setup->begin          = get_bits(gb, 24);
         res_setup->end            = get_bits(gb, 24);
@@ -715,7 +715,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
         if (!res_setup->classifs)
             return AVERROR(ENOMEM);
 
-        av_dlog(NULL, "    begin %d end %d part.size %d classif.s %d classbook %d \n",
+        ff_dlog(NULL, "    begin %d end %d part.size %d classif.s %d classbook %d \n",
                 res_setup->begin, res_setup->end, res_setup->partition_size,
                 res_setup->classifications, res_setup->classbook);
 
@@ -726,7 +726,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
                 high_bits = get_bits(gb, 5);
             cascade[j] = (high_bits << 3) + low_bits;
 
-            av_dlog(NULL, "     %u class cascade depth: %d\n", j, ilog(cascade[j]));
+            ff_dlog(NULL, "     %u class cascade depth: %d\n", j, ilog(cascade[j]));
         }
 
         res_setup->maxpass = 0;
@@ -735,7 +735,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
                 if (cascade[j]&(1 << k)) {
                     GET_VALIDATED_INDEX(res_setup->books[j][k], 8, vc->codebook_count)
 
-                    av_dlog(NULL, "     %u class cascade depth %u book: %d\n",
+                    ff_dlog(NULL, "     %u class cascade depth %u book: %d\n",
                             j, k, res_setup->books[j][k]);
 
                     if (k>res_setup->maxpass)
@@ -761,7 +761,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
     if (!vc->mappings)
         return AVERROR(ENOMEM);
 
-    av_dlog(NULL, " There are %d mappings. \n", vc->mapping_count);
+    ff_dlog(NULL, " There are %d mappings. \n", vc->mapping_count);
 
     for (i = 0; i < vc->mapping_count; ++i) {
         vorbis_mapping *mapping_setup = &vc->mappings[i];
@@ -793,7 +793,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
             mapping_setup->coupling_steps = 0;
         }
 
-        av_dlog(NULL, "   %u mapping coupling steps: %d\n",
+        ff_dlog(NULL, "   %u mapping coupling steps: %d\n",
                 i, mapping_setup->coupling_steps);
 
         if (get_bits(gb, 2)) {
@@ -816,7 +816,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
             GET_VALIDATED_INDEX(mapping_setup->submap_floor[j],   8, vc->floor_count)
             GET_VALIDATED_INDEX(mapping_setup->submap_residue[j], 8, vc->residue_count)
 
-            av_dlog(NULL, "   %u mapping %u submap : floor %d, residue %d\n", i, j,
+            ff_dlog(NULL, "   %u mapping %u submap : floor %d, residue %d\n", i, j,
                     mapping_setup->submap_floor[j],
                     mapping_setup->submap_residue[j]);
         }
@@ -855,7 +855,7 @@ static int create_map(vorbis_context *vc, unsigned floor_number)
     }
 
     for (idx = 0; idx <= n; ++idx) {
-        av_dlog(NULL, "floor0 map: map at pos %d is %d\n", idx, map[idx]);
+        ff_dlog(NULL, "floor0 map: map at pos %d is %d\n", idx, map[idx]);
     }
 
     return 0;
@@ -871,7 +871,7 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
     if (!vc->modes)
         return AVERROR(ENOMEM);
 
-    av_dlog(NULL, " There are %d modes.\n", vc->mode_count);
+    ff_dlog(NULL, " There are %d modes.\n", vc->mode_count);
 
     for (i = 0; i < vc->mode_count; ++i) {
         vorbis_mode *mode_setup = &vc->modes[i];
@@ -881,7 +881,7 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
         mode_setup->transformtype = get_bits(gb, 16); //FIXME check
         GET_VALIDATED_INDEX(mode_setup->mapping, 8, vc->mapping_count);
 
-        av_dlog(NULL, " %u mode: blockflag %d, windowtype %d, transformtype %d, mapping %d\n",
+        ff_dlog(NULL, " %u mode: blockflag %d, windowtype %d, transformtype %d, mapping %d\n",
                 i, mode_setup->blockflag, mode_setup->windowtype,
                 mode_setup->transformtype, mode_setup->mapping);
     }
@@ -988,7 +988,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
     ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0);
     ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0);
 
-    av_dlog(NULL, " vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
+    ff_dlog(NULL, " vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
             vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]);
 
 /*
@@ -1091,7 +1091,7 @@ static int vorbis_floor0_decode(vorbis_context *vc,
             av_log(vc->avctx, AV_LOG_ERROR, "floor0 dec: booknumber too high!\n");
             book_idx =  0;
         }
-        av_dlog(NULL, "floor0 dec: booknumber: %u\n", book_idx);
+        ff_dlog(NULL, "floor0 dec: booknumber: %u\n", book_idx);
         codebook = vc->codebooks[vf->book_list[book_idx]];
         /* Invalid codebook! */
         if (!codebook.codevectors)
@@ -1100,13 +1100,13 @@ static int vorbis_floor0_decode(vorbis_context *vc,
         while (lsp_len<vf->order) {
             int vec_off;
 
-            av_dlog(NULL, "floor0 dec: book dimension: %d\n", codebook.dimensions);
-            av_dlog(NULL, "floor0 dec: maximum depth: %d\n", codebook.maxdepth);
+            ff_dlog(NULL, "floor0 dec: book dimension: %d\n", codebook.dimensions);
+            ff_dlog(NULL, "floor0 dec: maximum depth: %d\n", codebook.maxdepth);
             /* read temp vector */
             vec_off = get_vlc2(&vc->gb, codebook.vlc.table,
                                codebook.nb_bits, codebook.maxdepth)
                       * codebook.dimensions;
-            av_dlog(NULL, "floor0 dec: vector offset: %d\n", vec_off);
+            ff_dlog(NULL, "floor0 dec: vector offset: %d\n", vec_off);
             /* copy each vector component and add last to it */
             for (idx = 0; idx < codebook.dimensions; ++idx)
                 lsp[lsp_len+idx] = codebook.codevectors[vec_off+idx] + last;
@@ -1118,7 +1118,7 @@ static int vorbis_floor0_decode(vorbis_context *vc,
         {
             int idx;
             for (idx = 0; idx < lsp_len; ++idx)
-                av_dlog(NULL, "floor0 dec: coeff at %d is %f\n", idx, lsp[idx]);
+                ff_dlog(NULL, "floor0 dec: coeff at %d is %f\n", idx, lsp[idx]);
         }
 
         /* synthesize floor output vector */
@@ -1130,7 +1130,7 @@ static int vorbis_floor0_decode(vorbis_context *vc,
             for (i = 0; i < order; i++)
                 lsp[i] = 2.0f * cos(lsp[i]);
 
-            av_dlog(NULL, "floor0 synth: map_size = %"PRIu32"; m = %d; wstep = %f\n",
+            ff_dlog(NULL, "floor0 synth: map_size = %"PRIu32"; m = %d; wstep = %f\n",
                     vf->map_size[blockflag], order, wstep);
 
             i = 0;
@@ -1172,7 +1172,7 @@ static int vorbis_floor0_decode(vorbis_context *vc,
         return 1;
     }
 
-    av_dlog(NULL, " Floor0 decoded\n");
+    ff_dlog(NULL, " Floor0 decoded\n");
 
     return 0;
 }
@@ -1199,7 +1199,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
     floor1_Y[0] = get_bits(gb, ilog(range - 1));
     floor1_Y[1] = get_bits(gb, ilog(range - 1));
 
-    av_dlog(NULL, "floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
+    ff_dlog(NULL, "floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
 
     offset = 2;
     for (i = 0; i < vf->partitions; ++i) {
@@ -1209,7 +1209,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
         csub = (1 << cbits) - 1;
         cval = 0;
 
-        av_dlog(NULL, "Cbits %u\n", cbits);
+        ff_dlog(NULL, "Cbits %u\n", cbits);
 
         if (cbits) // this reads all subclasses for this partition's class
             cval = get_vlc2(gb, vc->codebooks[vf->class_masterbook[class]].vlc.table,
@@ -1218,7 +1218,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
         for (j = 0; j < cdim; ++j) {
             book = vf->subclass_books[class][cval & csub];
 
-            av_dlog(NULL, "book %d Cbits %u cval %u  bits:%d\n",
+            ff_dlog(NULL, "book %d Cbits %u cval %u  bits:%d\n",
                     book, cbits, cval, get_bits_count(gb));
 
             cval = cval >> cbits;
@@ -1229,7 +1229,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
                 floor1_Y[offset+j] = 0;
             }
 
-            av_dlog(NULL, " floor(%d) = %d \n",
+            ff_dlog(NULL, " floor(%d) = %d \n",
                     vf->list[offset+j].x, floor1_Y[offset+j]);
         }
         offset+=cdim;
@@ -1288,7 +1288,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
             floor1_Y_final[i] = av_clip_uint16(predicted);
         }
 
-        av_dlog(NULL, " Decoded floor(%d) = %u / val %u\n",
+        ff_dlog(NULL, " Decoded floor(%d) = %u / val %u\n",
                 vf->list[i].x, floor1_Y_final[i], val);
     }
 
@@ -1296,7 +1296,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
 
     ff_vorbis_floor1_render_list(vf->list, vf->x_list_dim, floor1_Y_final, floor1_flag, vf->multiplier, vec, vf->list[1].x);
 
-    av_dlog(NULL, " Floor decoded\n");
+    ff_dlog(NULL, " Floor decoded\n");
 
     return 0;
 }
@@ -1317,7 +1317,7 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
             temp = get_vlc2(&vc->gb, codebook->vlc.table,
                                      codebook->nb_bits, 3);
 
-            av_dlog(NULL, "Classword: %u\n", temp);
+            ff_dlog(NULL, "Classword: %u\n", temp);
 
             if (temp < 0) {
                 av_log(vc->avctx, AV_LOG_ERROR,
@@ -1372,7 +1372,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
         return AVERROR_INVALIDDATA;
     }
 
-    av_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d  cpc %d  \n", ch, c_p_c);
+    ff_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d  cpc %d  \n", ch, c_p_c);
 
     for (pass = 0; pass <= vr->maxpass; ++pass) { // FIXME OPTIMIZE?
         int voffset, partition_count, j_times_ptns_to_read;
@@ -1413,7 +1413,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
                                     for (l = 0; l < dim; ++l, ++voffs) {
                                         vec[voffs]+=codebook.codevectors[coffs+l];
 
-                                        av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d  \n",
+                                        ff_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d  \n",
                                                 pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
                                     }
                                 }
@@ -1441,7 +1441,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
                                         vec[voffs       ] += codebook.codevectors[coffs + l    ];
                                         vec[voffs + vlen] += codebook.codevectors[coffs + l + 1];
 
-                                        av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d  \n",
+                                        ff_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d  \n",
                                                 pass, voffset / ch + (voffs % ch) * vlen,
                                                 vec[voffset / ch + (voffs % ch) * vlen],
                                                 codebook.codevectors[coffs + l], coffs, l);
@@ -1458,7 +1458,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
                                         vec[voffs_div + voffs_mod * vlen] +=
                                             codebook.codevectors[coffs + l];
 
-                                        av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d  \n",
+                                        ff_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d  \n",
                                                 pass, voffs_div + voffs_mod * vlen,
                                                 vec[voffs_div + voffs_mod * vlen],
                                                 codebook.codevectors[coffs + l], coffs, l);
@@ -1556,7 +1556,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
     vc->mode_number = mode_number;
     mapping = &vc->mappings[vc->modes[mode_number].mapping];
 
-    av_dlog(NULL, " Mode number: %u , mapping: %d , blocktype %d\n", mode_number,
+    ff_dlog(NULL, " Mode number: %u , mapping: %d , blocktype %d\n", mode_number,
             vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag);
 
     blockflag = vc->modes[mode_number].blockflag;
@@ -1698,7 +1698,7 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
     float *channel_ptrs[255];
     int i, len, ret;
 
-    av_dlog(NULL, "packet length %d \n", buf_size);
+    ff_dlog(NULL, "packet length %d \n", buf_size);
 
     /* get output buffer */
     frame->nb_samples = vc->blocksize[1] / 2;
@@ -1729,7 +1729,7 @@ static int vorbis_decode_frame(AVCodecContext *avctx, void *data,
         return buf_size;
     }
 
-    av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",
+    ff_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",
             get_bits_count(gb) / 8, get_bits_count(gb) % 8, len);
 
     frame->nb_samples = len;
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 52c68d2..c48d927 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2158,7 +2158,7 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
             return -1;
         }
         token = get_bits(gb, 5);
-        av_dlog(avctx, "hti %d hbits %x token %d entry : %d size %d\n",
+        ff_dlog(avctx, "hti %d hbits %x token %d entry : %d size %d\n",
                 s->hti, s->hbits, token, s->entries, s->huff_code_size);
         s->huffman_table[s->hti][token][0] = s->hbits;
         s->huffman_table[s->hti][token][1] = s->huff_code_size;
diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c
index 86f2fcf..553929d 100644
--- a/libavcodec/vqavideo.c
+++ b/libavcodec/vqavideo.c
@@ -235,7 +235,7 @@ static int decode_format80(GetByteContext *gb, int src_size,
     start = bytestream2_tell(gb);
     while (bytestream2_tell(gb) - start < src_size) {
         opcode = bytestream2_get_byte(gb);
-        av_dlog(NULL, "      opcode %02X: ", opcode);
+        ff_dlog(NULL, "      opcode %02X: ", opcode);
 
         /* 0x80 means that frame is finished */
         if (opcode == 0x80)
@@ -251,7 +251,7 @@ static int decode_format80(GetByteContext *gb, int src_size,
 
             count   = bytestream2_get_le16(gb);
             src_pos = bytestream2_get_le16(gb);
-            av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
+            ff_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
             CHECK_COUNT();
             CHECK_COPY(src_pos);
             for (i = 0; i < count; i++)
@@ -262,7 +262,7 @@ static int decode_format80(GetByteContext *gb, int src_size,
 
             count = bytestream2_get_le16(gb);
             color = bytestream2_get_byte(gb);
-            av_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
+            ff_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
             CHECK_COUNT();
             memset(&dest[dest_index], color, count);
             dest_index += count;
@@ -271,7 +271,7 @@ static int decode_format80(GetByteContext *gb, int src_size,
 
             count = (opcode & 0x3F) + 3;
             src_pos = bytestream2_get_le16(gb);
-            av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
+            ff_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
             CHECK_COUNT();
             CHECK_COPY(src_pos);
             for (i = 0; i < count; i++)
@@ -281,7 +281,7 @@ static int decode_format80(GetByteContext *gb, int src_size,
         } else if (opcode > 0x80) {
 
             count = opcode & 0x3F;
-            av_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
+            ff_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
             CHECK_COUNT();
             bytestream2_get_buffer(gb, &dest[dest_index], count);
             dest_index += count;
@@ -290,7 +290,7 @@ static int decode_format80(GetByteContext *gb, int src_size,
 
             count = ((opcode & 0x70) >> 4) + 3;
             src_pos = bytestream2_get_byte(gb) | ((opcode & 0x0F) << 8);
-            av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
+            ff_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
             CHECK_COUNT();
             CHECK_COPY(dest_index - src_pos);
             for (i = 0; i < count; i++)
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index ad948d1..3fe68a4 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -22,6 +22,7 @@
 #include "libavutil/attributes.h"
 
 #include "avcodec.h"
+#include "internal.h"
 #include "sinewin.h"
 #include "wma.h"
 #include "wma_common.h"
@@ -183,13 +184,13 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
         else
             high_freq = high_freq * 0.5;
     }
-    av_dlog(s->avctx, "flags2=0x%x\n", flags2);
-    av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
+    ff_dlog(s->avctx, "flags2=0x%x\n", flags2);
+    ff_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
             s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate,
             avctx->block_align);
-    av_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
+    ff_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
             bps, bps1, high_freq, s->byte_offset_bits);
-    av_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
+    ff_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
             s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
 
     /* compute the scale factor band sizes for each MDCT block size */
@@ -279,14 +280,14 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
             }
             s->exponent_high_sizes[k] = j;
 #if 0
-            tprintf(s->avctx, "%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
+            ff_tlog(s->avctx, "%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ",
                     s->frame_len >> k,
                     s->coefs_end[k],
                     s->high_band_start[k],
                     s->exponent_high_sizes[k]);
             for (j = 0; j < s->exponent_high_sizes[k]; j++)
-                tprintf(s->avctx, " %d", s->exponent_high_bands[k][j]);
-            tprintf(s->avctx, "\n");
+                ff_tlog(s->avctx, " %d", s->exponent_high_bands[k][j]);
+            ff_tlog(s->avctx, "\n");
 #endif /* 0 */
         }
     }
@@ -295,12 +296,12 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2)
     {
         int i, j;
         for (i = 0; i < s->nb_block_sizes; i++) {
-            tprintf(s->avctx, "%5d: n=%2d:",
+            ff_tlog(s->avctx, "%5d: n=%2d:",
                     s->frame_len >> i,
                     s->exponent_sizes[i]);
             for (j = 0; j < s->exponent_sizes[i]; j++)
-                tprintf(s->avctx, " %d", s->exponent_bands[i][j]);
-            tprintf(s->avctx, "\n");
+                ff_tlog(s->avctx, " %d", s->exponent_bands[i][j]);
+            ff_tlog(s->avctx, "\n");
         }
     }
 #endif /* TRACE */
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 2141e38..8a90767 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -56,16 +56,16 @@ static void dump_floats(WMACodecContext *s, const char *name,
 {
     int i;
 
-    tprintf(s->avctx, "%s[%d]:\n", name, n);
+    ff_tlog(s->avctx, "%s[%d]:\n", name, n);
     for (i = 0; i < n; i++) {
         if ((i & 7) == 0)
-            tprintf(s->avctx, "%4d: ", i);
-        tprintf(s->avctx, " %8.*f", prec, tab[i]);
+            ff_tlog(s->avctx, "%4d: ", i);
+        ff_tlog(s->avctx, " %8.*f", prec, tab[i]);
         if ((i & 7) == 7)
-            tprintf(s->avctx, "\n");
+            ff_tlog(s->avctx, "\n");
     }
     if ((i & 7) != 0)
-        tprintf(s->avctx, "\n");
+        ff_tlog(s->avctx, "\n");
 }
 #endif /* TRACE */
 
@@ -429,7 +429,7 @@ static int wma_decode_block(WMACodecContext *s)
     FFTContext *mdct;
 
 #ifdef TRACE
-    tprintf(s->avctx, "***decode_block: %d:%d\n",
+    ff_tlog(s->avctx, "***decode_block: %d:%d\n",
             s->frame_count - 1, s->block_num);
 #endif /* TRACE */
 
@@ -641,7 +641,7 @@ static int wma_decode_block(WMACodecContext *s)
                         }
                         exp_power[j]   = e2 / n;
                         last_high_band = j;
-                        tprintf(s->avctx, "%d: power=%f (%d)\n", j, exp_power[j], n);
+                        ff_tlog(s->avctx, "%d: power=%f (%d)\n", j, exp_power[j], n);
                     }
                     exponents += n << bsize >> esize;
                 }
@@ -714,7 +714,7 @@ static int wma_decode_block(WMACodecContext *s)
         /* no need to optimize this case because it should almost
          * never happen */
         if (!s->channel_coded[0]) {
-            tprintf(s->avctx, "rare ms-stereo case happened\n");
+            ff_tlog(s->avctx, "rare ms-stereo case happened\n");
             memset(s->coefs[0], 0, sizeof(float) * s->block_len);
             s->channel_coded[0] = 1;
         }
@@ -755,7 +755,7 @@ static int wma_decode_frame(WMACodecContext *s, float **samples,
     int ret, ch;
 
 #ifdef TRACE
-    tprintf(s->avctx, "***decode_frame: %d size=%d\n",
+    ff_tlog(s->avctx, "***decode_frame: %d size=%d\n",
             s->frame_count++, s->frame_len);
 #endif /* TRACE */
 
@@ -799,7 +799,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
     float **samples;
     int samples_offset;
 
-    tprintf(avctx, "***decode_superframe:\n");
+    ff_tlog(avctx, "***decode_superframe:\n");
 
     if (buf_size == 0) {
         s->last_superframe_len = 0;
@@ -904,7 +904,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data,
         samples_offset += s->frame_len;
     }
 
-    av_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n",
+    ff_dlog(s->avctx, "%d %d %d %d outbytes:%td eaten:%d\n",
             s->frame_len_bits, s->block_len_bits, s->frame_len, s->block_len,
             (int8_t *) samples - (int8_t *) data, avctx->block_align);
 
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index eea7f94..2a24904 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -200,8 +200,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
         }
         /* dump the extradata */
         for (i = 0; i < avctx->extradata_size; i++)
-            av_dlog(avctx, "[%x] ", avctx->extradata[i]);
-        av_dlog(avctx, "\n");
+            ff_dlog(avctx, "[%x] ", avctx->extradata[i]);
+        ff_dlog(avctx, "\n");
 
     } else {
         avpriv_request_sample(avctx, "Unsupported extradata size");
@@ -950,7 +950,7 @@ static int decode_subframe(WmallDecodeCtx *s)
                    "Invalid number of padding bits in raw PCM tile\n");
             return AVERROR_INVALIDDATA;
         }
-        av_dlog(s->avctx, "RAWPCM %d bits per sample. "
+        ff_dlog(s->avctx, "RAWPCM %d bits per sample. "
                 "total %d bits, remain=%d\n", bits,
                 bits * s->num_channels * subframe_len, get_bits_count(&s->gb));
         for (i = 0; i < s->num_channels; i++)
@@ -1054,13 +1054,13 @@ static int decode_frame(WmallDecodeCtx *s)
         /* usually true for the first frame */
         if (get_bits1(gb)) {
             skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "start skip: %i\n", skip);
+            ff_dlog(s->avctx, "start skip: %i\n", skip);
         }
 
         /* sometimes true for the last frame */
         if (get_bits1(gb)) {
             skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "end skip: %i\n", skip);
+            ff_dlog(s->avctx, "end skip: %i\n", skip);
         }
 
     }
@@ -1080,7 +1080,7 @@ static int decode_frame(WmallDecodeCtx *s)
         }
     }
 
-    av_dlog(s->avctx, "Frame done\n");
+    ff_dlog(s->avctx, "Frame done\n");
 
     if (s->skip_frame)
         s->skip_frame = 0;
@@ -1226,7 +1226,7 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
             if (num_bits_prev_frame < remaining_packet_bits && !s->packet_loss)
                 decode_frame(s);
         } else if (s->num_saved_bits - s->frame_offset) {
-            av_dlog(avctx, "ignoring %x previously saved bits\n",
+            ff_dlog(avctx, "ignoring %x previously saved bits\n",
                     s->num_saved_bits - s->frame_offset);
         }
 
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 5e06376..184ae99 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -298,8 +298,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
         s->bits_per_sample = AV_RL16(edata_ptr);
         /** dump the extradata */
         for (i = 0; i < avctx->extradata_size; i++)
-            av_dlog(avctx, "[%x] ", avctx->extradata[i]);
-        av_dlog(avctx, "\n");
+            ff_dlog(avctx, "[%x] ", avctx->extradata[i]);
+        ff_dlog(avctx, "\n");
 
     } else {
         avpriv_request_sample(avctx, "Unknown extradata size");
@@ -607,7 +607,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
         int i;
         int offset = 0;
         for (i = 0; i < s->channel[c].num_subframes; i++) {
-            av_dlog(s->avctx, "frame[%i] channel[%i] subframe[%i]"
+            ff_dlog(s->avctx, "frame[%i] channel[%i] subframe[%i]"
                     " len %i\n", s->frame_num, c, i,
                     s->channel[c].subframe_len[i]);
             s->channel[c].subframe_offset[i] = offset;
@@ -807,7 +807,7 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
     const uint16_t* run;
     const float* level;
 
-    av_dlog(s->avctx, "decode coefficients for channel %i\n", c);
+    ff_dlog(s->avctx, "decode coefficients for channel %i\n", c);
 
     vlctable = get_bits1(&s->gb);
     vlc = &coef_vlc[vlctable];
@@ -1092,7 +1092,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
         }
     }
 
-    av_dlog(s->avctx,
+    ff_dlog(s->avctx,
             "processing subframe with offset %i len %i\n", offset, subframe_len);
 
     /** get a list of all channels that contain the estimated block */
@@ -1119,7 +1119,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
         s->parsed_all_subframes = 1;
 
 
-    av_dlog(s->avctx, "subframe is part of %i channels\n",
+    ff_dlog(s->avctx, "subframe is part of %i channels\n",
             s->channels_for_cur_subframe);
 
     /** calculate number of scale factor bands and their offsets */
@@ -1236,7 +1236,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
             return AVERROR_INVALIDDATA;
     }
 
-    av_dlog(s->avctx, "BITSTREAM: subframe header length was %i\n",
+    ff_dlog(s->avctx, "BITSTREAM: subframe header length was %i\n",
             get_bits_count(&s->gb) - s->subframe_offset);
 
     /** parse coefficients */
@@ -1250,7 +1250,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
                    sizeof(*s->channel[c].coeffs) * subframe_len);
     }
 
-    av_dlog(s->avctx, "BITSTREAM: subframe length was %i\n",
+    ff_dlog(s->avctx, "BITSTREAM: subframe length was %i\n",
             get_bits_count(&s->gb) - s->subframe_offset);
 
     if (transmit_coeffs) {
@@ -1318,7 +1318,7 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
     if (s->len_prefix)
         len = get_bits(gb, s->log2_frame_size);
 
-    av_dlog(s->avctx, "decoding frame with length %x\n", len);
+    ff_dlog(s->avctx, "decoding frame with length %x\n", len);
 
     /** decode tile information */
     if (decode_tilehdr(s)) {
@@ -1337,7 +1337,7 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
     /** read drc info */
     if (s->dynamic_range_compression) {
         s->drc_gain = get_bits(gb, 8);
-        av_dlog(s->avctx, "drc_gain %i\n", s->drc_gain);
+        ff_dlog(s->avctx, "drc_gain %i\n", s->drc_gain);
     }
 
     /** no idea what these are for, might be the number of samples
@@ -1348,18 +1348,18 @@ static int decode_frame(WMAProDecodeCtx *s, AVFrame *frame, int *got_frame_ptr)
         /** usually true for the first frame */
         if (get_bits1(gb)) {
             skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "start skip: %i\n", skip);
+            ff_dlog(s->avctx, "start skip: %i\n", skip);
         }
 
         /** sometimes true for the last frame */
         if (get_bits1(gb)) {
             skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
-            av_dlog(s->avctx, "end skip: %i\n", skip);
+            ff_dlog(s->avctx, "end skip: %i\n", skip);
         }
 
     }
 
-    av_dlog(s->avctx, "BITSTREAM: frame header length was %i\n",
+    ff_dlog(s->avctx, "BITSTREAM: frame header length was %i\n",
             get_bits_count(gb) - s->frame_offset);
 
     /** reset subframe states */
@@ -1542,7 +1542,7 @@ static int decode_packet(AVCodecContext *avctx, void *data,
 
         /** get number of bits that need to be added to the previous frame */
         num_bits_prev_frame = get_bits(gb, s->log2_frame_size);
-        av_dlog(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
+        ff_dlog(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
                 num_bits_prev_frame);
 
         /** check for packet loss */
@@ -1565,14 +1565,14 @@ static int decode_packet(AVCodecContext *avctx, void *data,
             /** append the previous frame data to the remaining data from the
                 previous packet to create a full frame */
             save_bits(s, gb, num_bits_prev_frame, 1);
-            av_dlog(avctx, "accumulated %x bits of frame data\n",
+            ff_dlog(avctx, "accumulated %x bits of frame data\n",
                     s->num_saved_bits - s->frame_offset);
 
             /** decode the cross packet frame if it is valid */
             if (!s->packet_loss)
                 decode_frame(s, data, got_frame_ptr);
         } else if (s->num_saved_bits - s->frame_offset) {
-            av_dlog(avctx, "ignoring %x previously saved bits\n",
+            ff_dlog(avctx, "ignoring %x previously saved bits\n",
                     s->num_saved_bits - s->frame_offset);
         }
 
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index d9869df..6455f2f 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -20,6 +20,7 @@
 
 #include "avcodec.h"
 #include "h263.h"
+#include "internal.h"
 #include "intrax8.h"
 #include "mathops.h"
 #include "mpegutils.h"
@@ -426,15 +427,15 @@ int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64])
         }
     } else {
         if (s->pict_type == AV_PICTURE_TYPE_P)
-            av_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
-        av_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
+            ff_dlog(s->avctx, "%d%d ", s->inter_intra_pred, cbp);
+        ff_dlog(s->avctx, "I at %d %d %d %06X\n", s->mb_x, s->mb_y,
                 ((cbp & 3) ? 1 : 0) + ((cbp & 0x3C) ? 2 : 0),
                 show_bits(&s->gb, 24));
         s->ac_pred = get_bits1(&s->gb);
         if (s->inter_intra_pred) {
             s->h263_aic_dir = get_vlc2(&s->gb, ff_inter_intra_vlc.table,
                                        INTER_INTRA_VLC_BITS, 1);
-            av_dlog(s->avctx, "%d%d %d %d/",
+            ff_dlog(s->avctx, "%d%d %d %d/",
                     s->ac_pred, s->h263_aic_dir, s->mb_x, s->mb_y);
         }
         if (s->per_mb_rl_table && cbp) {



More information about the ffmpeg-cvslog mailing list