diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index f1576e6b03..d55df43a5e 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -943,10 +943,10 @@ static int decode_audio_specific_config(AACContext *ac, GetBitContext gb; int i, ret; - av_dlog(avctx, "audio specific config size %d\n", bit_size >> 3); + ff_dlog(avctx, "audio specific config size %d\n", bit_size >> 3); for (i = 0; i < bit_size >> 3; i++) - av_dlog(avctx, "%02x ", data[i]); - av_dlog(avctx, "\n"); + ff_dlog(avctx, "%02x ", data[i]); + ff_dlog(avctx, "\n"); if ((ret = init_get_bits(&gb, data, bit_size)) < 0) return ret; @@ -993,7 +993,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 dc529087b2..1e831fbfee 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1687,43 +1687,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; @@ -1731,11 +1731,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) { @@ -1745,17 +1745,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) { @@ -1764,23 +1764,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 7c652af9d3..c81db189f7 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -253,24 +253,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/bitstream.c b/libavcodec/bitstream.c index 6e550ff7d1..e18171f039 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -31,6 +31,7 @@ #include "libavutil/atomic.h" #include "libavutil/avassert.h" #include "avcodec.h" +#include "internal.h" #include "mathops.h" #include "get_bits.h" #include "put_bits.h" @@ -169,7 +170,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, if (table_nb_bits > 30) return -1; 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 = (volatile VLC_TYPE (*)[2])&vlc->table[table_index]; @@ -179,7 +180,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); @@ -191,7 +192,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, } for (k = 0; k < nb; k++) { int bits = table[j][1]; - 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 (bits != 0 && bits != n) { av_log(NULL, AV_LOG_ERROR, "incorrect codes\n"); return AVERROR_INVALIDDATA; @@ -221,7 +222,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) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 02ac0e0b7d..1d2020b6d9 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1020,14 +1020,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 0339eef340..bd534261b7 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -464,7 +464,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; } @@ -1518,14 +1518,14 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data, 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"); } if (s->ext_coding) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 071a59be58..af28218fb9 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -145,7 +145,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 (buf[0x21] == 0x58) { /* 10 bit */ ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 10; @@ -176,7 +176,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; @@ -199,7 +199,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) @@ -214,7 +214,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] + 0x280LL) { av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index (%d < %d).\n", @@ -451,7 +451,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 d7105a1479..005602e744 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -828,7 +828,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) { @@ -859,7 +859,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx) down_step = 1<m.avctx, "out lambda %d\n", lambda); + //ff_dlog(ctx->m.avctx, "out lambda %d\n", lambda); ctx->lambda = lambda; return 0; } @@ -888,7 +888,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); @@ -920,7 +920,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 f9fdb6a8b9..af467f7b64 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 (1 < p_end - p) { - 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 e2b37e42dd..7fb80f8712 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" #include "libavutil/opt.h" @@ -893,20 +894,20 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis uint8_t *map_table; #if 0 - 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"); #endif if (!region) @@ -1064,16 +1065,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++; version = ((*buf)>>4)&15; @@ -1131,9 +1132,9 @@ 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) + !!(depth & 0x40) + !!(depth & 0x20) > 1) { - av_dlog(avctx, "More than one bit level marked: %x\n", depth); + ff_dlog(avctx, "More than one bit level marked: %x\n", depth); if (avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL) return AVERROR_INVALIDDATA; } @@ -1223,11 +1224,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); @@ -1304,7 +1305,7 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx, ctx->time_out = timeout; ctx->version = version; - 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(ctx->compute_edt == 1) save_subtitle_set(avctx, sub, got_output); @@ -1348,7 +1349,7 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx, display->next = ctx->display_list; ctx->display_list = display; - 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) { @@ -1541,19 +1542,19 @@ static int dvbsub_decode(AVCodecContext *avctx, int ret = 0; int got_segment = 0; - 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; } @@ -1573,7 +1574,7 @@ static int dvbsub_decode(AVCodecContext *avctx, } if (p_end - p < segment_length) { - av_dlog(avctx, "incomplete or broken packet"); + ff_dlog(avctx, "incomplete or broken packet"); ret = -1; goto end; } @@ -1608,7 +1609,7 @@ static int dvbsub_decode(AVCodecContext *avctx, got_segment |= 16; 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 388bbf2fee..fbd6bf504b 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -222,7 +222,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); @@ -245,7 +245,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; @@ -342,7 +342,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 @@ -355,7 +355,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)); @@ -376,7 +376,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)); @@ -385,7 +385,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 && get_bits_left(&gb) > 0) { - 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 ffb2bcc115..673fc6051e 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -249,7 +249,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; @@ -257,7 +257,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 */ @@ -290,7 +290,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: @@ -302,7 +302,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: @@ -310,7 +310,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: @@ -318,7 +318,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; @@ -341,7 +341,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; } } @@ -570,7 +570,7 @@ static int dvdsub_decode(AVCodecContext *avctx, char ppm_name[32]; snprintf(ppm_name, sizeof(ppm_name), "/tmp/%05d.ppm", ctx->sub_id++); - 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(ppm_name, sub->rects[0]->pict.data[0], diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index 466b2b51df..129011b960 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -335,7 +335,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 b8df7efe8d..78ba1bed79 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -77,7 +77,7 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state, } 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 @@ -165,7 +165,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)); } @@ -750,7 +750,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 942bc3772c..5b0ade4f06 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -256,7 +256,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); @@ -342,7 +342,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 8791a2d750..f429167fe0 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -365,7 +365,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, s->blocks = av_mallocz((v_blocks + !!v_part) * (h_blocks + !!h_part) * sizeof(s->blocks[0])); - 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 14e8adab2e..acbc13482a 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); @@ -265,7 +265,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 5bd5fb60ca..08dd98b597 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -543,7 +543,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 942689c43b..affaecb172 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -685,11 +685,7 @@ 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, ...) { } #define GET_RL_VLC GET_RL_VLC_INTERNAL #endif diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 9ba436e14c..c179f45c30 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -148,7 +148,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, "image x=%d y=%d w=%d h=%d\n", left, top, width, height); + ff_dlog(s->avctx, "image x=%d y=%d w=%d h=%d\n", left, top, width, height); if (has_local_palette) { pal_size = 1 << bits_per_pixel; @@ -315,7 +315,7 @@ static int gif_read_extension(GifState *s) ext_code = bytestream2_get_byteu(&s->gb); ext_len = bytestream2_get_byteu(&s->gb); - av_dlog(s->avctx, "ext_code=0x%x len=%d\n", ext_code, ext_len); + ff_dlog(s->avctx, "ext_code=0x%x len=%d\n", ext_code, ext_len); switch(ext_code) { case GIF_GCE_EXT_LABEL: @@ -336,13 +336,13 @@ static int gif_read_extension(GifState *s) s->transparent_color_index = -1; s->gce_disposal = (gce_flags >> 2) & 0x7; - av_dlog(s->avctx, "gce_flags=%x tcolor=%d disposal=%d\n", + ff_dlog(s->avctx, "gce_flags=%x tcolor=%d disposal=%d\n", gce_flags, s->transparent_color_index, s->gce_disposal); if (s->gce_disposal > 3) { s->gce_disposal = GCE_DISPOSAL_NONE; - av_dlog(s->avctx, "invalid value in gce_disposal (%d). Using default value of 0.\n", ext_len); + ff_dlog(s->avctx, "invalid value in gce_disposal (%d). Using default value of 0.\n", ext_len); } ext_len = bytestream2_get_byteu(&s->gb); @@ -359,7 +359,7 @@ static int gif_read_extension(GifState *s) bytestream2_skipu(&s->gb, ext_len); ext_len = bytestream2_get_byteu(&s->gb); - av_dlog(s->avctx, "ext_len1=%d\n", ext_len); + ff_dlog(s->avctx, "ext_len1=%d\n", ext_len); } return 0; } @@ -395,7 +395,7 @@ static int gif_read_header1(GifState *s) s->avctx->sample_aspect_ratio.den = 64; } - av_dlog(s->avctx, "screen_w=%d screen_h=%d bpp=%d global_palette=%d\n", + ff_dlog(s->avctx, "screen_w=%d screen_h=%d bpp=%d global_palette=%d\n", s->screen_width, s->screen_height, s->bits_per_pixel, s->has_global_palette); diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index e9a3a8bcaa..ca20ba8eae 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -592,8 +592,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 c28a465651..821a4e68b7 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -241,10 +241,10 @@ 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)); - tprintf(NULL, "Decoding MB at %dx%d\n", s->mb_x, s->mb_y); + ff_tlog(NULL, "Decoding MB at %dx%d\n", s->mb_x, s->mb_y); ret = s->decode_mb(s, s->block); if (s->pict_type != AV_PICTURE_TYPE_B) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index a8ffdde978..0ed57a26c1 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -342,7 +342,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 8cee11f2da..bafc40f96a 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -36,7 +36,7 @@ #include "h264dsp.h" #include "h264pred.h" #include "h264qpel.h" -#include "internal.h" // for avpriv_find_start_code() +#include "internal.h" #include "mpegutils.h" #include "parser.h" #include "qpeldsp.h" @@ -1017,7 +1017,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 11d0e32a8e..401566ed6d 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1918,7 +1918,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 */ @@ -2073,7 +2073,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, sl->intra4x4_pred_mode_cache[scan8[i]]); } } @@ -2163,7 +2163,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]= @@ -2228,7 +2228,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); @@ -2260,7 +2260,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); @@ -2297,7 +2297,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 42afce9f7e..b0251f405c 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -293,7 +293,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; } @@ -483,7 +483,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); av_assert2(total_coeff<=16); i = show_bits(gb, 3); @@ -717,7 +717,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) { @@ -923,7 +923,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]= @@ -977,7 +977,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); } @@ -1012,7 +1012,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 @@ -1050,7 +1050,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 aed14fd007..cb91134185 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -526,8 +526,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; @@ -591,9 +591,9 @@ 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, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], h->cur_pic.qscale_table[mbn_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); - //{ 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, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], h->cur_pic.qscale_table[mbn_xy]); + 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); + //{ int i; for (i = 0; i < 4; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); } 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,9 +676,9 @@ 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, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], h->cur_pic.qscale_table[mbn_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); - //{ 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, QPc:%d, QPcn:%d\n", mb_x, mb_y, dir, edge, qp, h->chroma_qp[0], h->cur_pic.qscale_table[mbn_xy]); + 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); + //{ int i; for (i = 0; i < 4; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); } if( dir == 0 ) { filter_mb_edgev( &img_y[4*edge << h->pixel_shift], linesize, bS, qp, a, b, h, 0 ); if (chroma) { @@ -790,8 +790,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 e7db550f15..57fa9b90ef 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 8e3c21455d..c424b9e3a2 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -174,14 +174,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].parent ? (h->default_ref_list[0][i].parent->long_ref ? "LT" : "ST") : "NULL", h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].parent ? h->default_ref_list[0][i].parent->f.data[0] : 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].parent ? (h->default_ref_list[1][i].parent->long_ref ? "LT" : "ST") : "NULL", h->default_ref_list[1][i].pic_id, h->default_ref_list[1][i].parent ? h->default_ref_list[1][i].parent->f.data[0] : 0); diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 57cc063045..33aff9787a 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -2412,7 +2412,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); @@ -2467,7 +2467,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 @@ -2486,7 +2486,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/indeo3.c b/libavcodec/indeo3.c index 9fde0fdf6c..3d0f906e0f 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -945,7 +945,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 31088f9e0c..1c2491d6c1 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); @@ -244,7 +245,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 38630eebcb..38108b4b6e 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 96c0cd1397..0fc1bb69a4 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(s->avctx, "motion byte = %d, (x, y) = (%d, %d)\n", B, x, y); + ff_dlog(s->avctx, "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(s->avctx, "motion byte = %d, (x, y) = (%d, %d)\n", B, x, y); + ff_dlog(s->avctx, "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(s->avctx, "motion byte = %d, (x, y) = (%d, %d)\n", B, x, y); + ff_dlog(s->avctx, "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(s->avctx, "motion bytes = %d, %d\n", x, y); + ff_dlog(s->avctx, "motion bytes = %d, %d\n", x, y); return copy_from(s, s->last_frame, frame, x, y); } @@ -553,7 +553,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(s->avctx, "motion bytes = %d, %d\n", x, y); + ff_dlog(s->avctx, "motion bytes = %d, %d\n", x, y); return copy_from(s, s->second_last_frame, frame, x, y); } @@ -928,7 +928,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 f36124e932..580c52264d 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -36,6 +36,7 @@ #include "avcodec.h" #include "mpegvideo.h" #include "h263.h" +#include "internal.h" #include "mathops.h" #include "mpegutils.h" #include "unary.h" @@ -302,7 +303,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; } @@ -956,7 +957,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) { @@ -1009,7 +1010,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 @@ -1022,7 +1023,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s) width = (get_bits(&s->gb, 9) + 1) * 4; check_marker(&s->gb, "in dimensions"); 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 c4d2aa1657..4525ff494c 100644 --- a/libavcodec/ivi.c +++ b/libavcodec/ivi.c @@ -562,7 +562,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) @@ -988,7 +988,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 216c486001..7f9fa8d60c 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) @@ -96,5 +97,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 e6fa01fe45..09ddf07a96 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -137,7 +137,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; } diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 6b9561d71a..b5d50048aa 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; @@ -255,7 +255,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_packet2(avctx, avpkt, len)) < 0) diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index b2ad839211..556792ad77 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -99,7 +99,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 */ @@ -116,7 +116,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); @@ -265,7 +265,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, avpkt->data[0]); /* Get the next frame pts/duration */ diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 60348d59b4..2d6451ce90 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -599,7 +599,7 @@ unk_pixfmt: for (i = 0; i < 4; 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); @@ -1301,8 +1301,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) { @@ -1850,7 +1850,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end) buf_ptr = 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 a0a5965321..7e16880d95 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -32,6 +32,7 @@ #include #include "avcodec.h" +#include "internal.h" #include "mathops.h" #include "mpegutils.h" #include "mpegvideo.h" @@ -1546,11 +1547,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 285f45db6b..0edb39dd86 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -156,7 +156,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); @@ -568,7 +568,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) @@ -735,7 +735,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); av_assert2(s->mb_skipped == 0); @@ -800,7 +800,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]); @@ -897,7 +897,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) /* 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) { @@ -954,12 +954,12 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) 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] = 2 * val; s->mv[i][j][1] = val; - av_dlog(s->avctx, "fmy=%d\n", val); + ff_dlog(s->avctx, "fmy=%d\n", val); } } } @@ -1303,10 +1303,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 { @@ -1461,7 +1461,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) @@ -1554,7 +1554,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); @@ -1614,15 +1614,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) @@ -1997,7 +1997,7 @@ eos: // end of slice return AVERROR_INVALIDDATA; } *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; } @@ -2016,7 +2016,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) { @@ -2879,7 +2879,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/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 47b41b4949..8449392ea1 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1169,7 +1169,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_BITS(re, &s->gb, 1); } - tprintf(s->avctx, "dct[%d][%d] = %- 4d end?:%d\n", scan_table[i&63]&7, scan_table[i&63] >> 3, level, i>62); + ff_tlog(s->avctx, "dct[%d][%d] = %- 4d end?:%d\n", scan_table[i&63]&7, scan_table[i&63] >> 3, level, i>62); if (i > 62) { i -= 192; if (i & (~63)) { diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 2326a9025b..1cc5ac47f4 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -279,7 +279,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]); @@ -381,7 +381,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]); } @@ -584,7 +584,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) @@ -903,7 +903,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; @@ -969,7 +969,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] = @@ -1333,7 +1333,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); @@ -1374,7 +1374,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); } @@ -1386,7 +1386,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); } } @@ -1397,7 +1397,7 @@ static int mp_decode_layer3(MPADecodeContext *s) int extrasize = av_clip(get_bits_left(&s->gb) >> 3, 0, EXTRABYTES); av_assert1((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); @@ -1439,7 +1439,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 6af6e4b239..5e996b4902 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_template.c b/libavcodec/mpegaudioenc_template.c index 1bf9471ffe..5a0897f036 100644 --- a/libavcodec/mpegaudioenc_template.c +++ b/libavcodec/mpegaudioenc_template.c @@ -139,7 +139,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;inb_channels;i++) @@ -410,7 +410,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 */ av_assert2(index >=0 && index <= 63); @@ -479,7 +479,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; @@ -556,7 +556,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 b7e4fe1dca..802b738d30 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1852,7 +1852,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 53f584dac8..6194366b4d 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1130,7 +1130,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) if (s->linesize & (STRIDE_ALIGN-1)) direct = 0; - av_dlog(s->avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0], + ff_dlog(s->avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0], pic_arg->linesize[1], s->linesize, s->uvlinesize); i = ff_find_unused_picture(s, direct); @@ -3361,7 +3361,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)); } } @@ -3568,7 +3568,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; if(s->msmpeg4_version >= 3) s->no_rounding=1; - av_dlog(s, "Scene change detected, encoding as I Frame %"PRId64" %"PRId64"\n", + ff_dlog(s, "Scene change detected, encoding as I Frame %"PRId64" %"PRId64"\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 c9240248df..cbea9b6cec 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -186,7 +186,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, av_q2d(avctx->framerate), s->repeat_pict); *poutbuf = buf; diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 94ea3c27ba..942a181f57 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" @@ -74,7 +75,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; @@ -254,14 +255,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){ @@ -539,7 +540,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; @@ -730,7 +731,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 d369147983..cd81c9486c 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -35,6 +35,7 @@ #include "libavutil/mem.h" #include "mpegvideo.h" #include "h263.h" +#include "internal.h" #include "mpeg4video.h" #include "msmpeg4.h" #include "msmpeg4data.h" @@ -239,7 +240,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 59a3c7508b..406a65f90c 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -27,6 +27,7 @@ #include "libavutil/atomic.h" #include "libavutil/mem.h" +#include "internal.h" #include "parser.h" #include "internal.h" @@ -232,9 +233,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]); } @@ -293,9 +294,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 695bc31753..5819e5371c 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 */ @@ -116,7 +116,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); @@ -296,7 +296,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 e4184a5d3f..47d5d68dfd 100644 --- a/libavcodec/pcm-dvd.c +++ b/libavcodec/pcm-dvd.c @@ -73,7 +73,7 @@ static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header) s->last_header = -1; 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) @@ -139,7 +139,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 2bee31540e..0d307f5302 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -213,7 +213,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; } @@ -357,7 +357,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); @@ -390,7 +390,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) @@ -456,7 +456,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 || @@ -602,16 +602,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; @@ -626,7 +626,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 901abaebd3..3b28b296c9 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -651,7 +651,7 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s, s->cur_w); 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 32a4de976d..178e193b70 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" @@ -319,7 +320,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) { @@ -566,7 +567,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) { @@ -818,7 +819,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) av_assert0(pict_type == rce->new_pict_type); q = rce->new_qscale / br_compensation; - av_dlog(s, "%f %f %f last:%d var:%"PRId64" type:%d//\n", q, rce->new_qscale, + ff_dlog(s, "%f %f %f last:%d var:%"PRId64" type:%d//\n", q, rce->new_qscale, br_compensation, s->frame_bits, var, pict_type); } else { rce->pict_type = @@ -1023,7 +1024,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) { @@ -1037,7 +1038,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 7097b29d5e..4fde24df26 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]); } } @@ -594,7 +594,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) { @@ -634,7 +634,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; @@ -706,7 +706,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); s->flags = avctx->flags; s->flags2 = avctx->flags2; diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index f65915c475..6394647a0c 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -189,7 +189,7 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels, } if ((stages > 0 && level >= 4)) { - 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 */ @@ -253,7 +253,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels, continue; /* skip vector */ if ((stages > 0 && level >= 4)) { - 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 */ @@ -475,7 +475,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); @@ -486,7 +486,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); @@ -550,7 +550,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); } @@ -659,7 +659,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; } @@ -730,7 +730,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 15531e46bd..6ac22e64fa 100644 --- a/libavcodec/vaapi.c +++ b/libavcodec/vaapi.c @@ -183,7 +183,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 aef0791c0e..1a990b3146 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 0d9059b260..7bebedb521 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "internal.h" #include "mpegutils.h" #include "vaapi_internal.h" @@ -44,7 +45,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 +107,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 23556af995..cac7a5c9a4 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -22,6 +22,7 @@ #include "vaapi_internal.h" #include "h263.h" +#include "internal.h" #include "mpeg4video.h" /** Reconstruct bitstream intra_dc_vlc_thr */ @@ -49,7 +50,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 +123,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); /* Fill in VASliceParameterBufferMPEG4 */ slice_param = (VASliceParameterBufferMPEG4 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size); diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index bba46d337f..912d205a7e 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 a84522c130..08e1f2c4c7 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -714,7 +714,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 6c47d45dbd..86e214a78a 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1004,7 +1004,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 19bde18a6b..2926e8e59d 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -246,7 +246,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)); @@ -262,7 +262,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, @@ -290,17 +290,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) { @@ -312,7 +312,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) @@ -322,17 +322,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) @@ -349,7 +349,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. @@ -363,17 +363,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 @@ -395,7 +395,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; @@ -406,11 +406,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; } @@ -478,7 +478,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) { @@ -512,7 +512,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; @@ -522,7 +522,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) { @@ -530,25 +530,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) { @@ -557,7 +557,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]); } } @@ -587,7 +587,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); } } @@ -652,22 +652,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]); } } @@ -691,7 +691,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]; @@ -700,7 +700,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); @@ -726,7 +726,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); @@ -737,7 +737,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; @@ -746,7 +746,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) @@ -772,7 +772,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]; @@ -804,7 +804,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)) { @@ -827,7 +827,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]); } @@ -866,7 +866,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; @@ -882,7 +882,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]; @@ -892,7 +892,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); } @@ -1002,7 +1002,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc) if (!vc->fdsp) return AVERROR(ENOMEM); - 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]); /* @@ -1104,7 +1104,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) @@ -1113,13 +1113,13 @@ static int vorbis_floor0_decode(vorbis_context *vc, while (lsp_lenorder) { 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; @@ -1131,7 +1131,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 */ @@ -1143,7 +1143,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; @@ -1185,7 +1185,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; } @@ -1212,7 +1212,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) { @@ -1222,7 +1222,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[partition_class]].vlc.table, @@ -1231,7 +1231,7 @@ static int vorbis_floor1_decode(vorbis_context *vc, for (j = 0; j < cdim; ++j) { book = vf->subclass_books[partition_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; @@ -1245,7 +1245,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; @@ -1304,7 +1304,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); } @@ -1312,7 +1312,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; } @@ -1335,7 +1335,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); av_assert0(temp < 65536); @@ -1400,7 +1400,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, } } - 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; @@ -1441,7 +1441,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); } } @@ -1469,7 +1469,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); @@ -1486,7 +1486,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); @@ -1592,7 +1592,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; @@ -1736,7 +1736,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); if (*buf == 1 && buf_size > 7) { init_get_bits(gb, buf+1, buf_size*8 - 8); @@ -1804,7 +1804,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 8a7c6b21e8..7cd04fb281 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2196,7 +2196,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 4dcebd4849..7d838c4536 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -234,7 +234,7 @@ static int decode_format80(VqaContext *s, int src_size, start = bytestream2_tell(&s->gb); while (bytestream2_tell(&s->gb) - start < src_size) { opcode = bytestream2_get_byte(&s->gb); - av_dlog(s->avctx, "opcode %02X: ", opcode); + ff_dlog(s->avctx, "opcode %02X: ", opcode); /* 0x80 means that frame is finished */ if (opcode == 0x80) @@ -250,7 +250,7 @@ static int decode_format80(VqaContext *s, int src_size, count = bytestream2_get_le16(&s->gb); src_pos = bytestream2_get_le16(&s->gb); - av_dlog(s->avctx, "(1) copy %X bytes from absolute pos %X\n", count, src_pos); + ff_dlog(s->avctx, "(1) copy %X bytes from absolute pos %X\n", count, src_pos); CHECK_COUNT(); CHECK_COPY(src_pos); for (i = 0; i < count; i++) @@ -261,7 +261,7 @@ static int decode_format80(VqaContext *s, int src_size, count = bytestream2_get_le16(&s->gb); color = bytestream2_get_byte(&s->gb); - av_dlog(s->avctx, "(2) set %X bytes to %02X\n", count, color); + ff_dlog(s->avctx, "(2) set %X bytes to %02X\n", count, color); CHECK_COUNT(); memset(&dest[dest_index], color, count); dest_index += count; @@ -270,7 +270,7 @@ static int decode_format80(VqaContext *s, int src_size, count = (opcode & 0x3F) + 3; src_pos = bytestream2_get_le16(&s->gb); - av_dlog(s->avctx, "(3) copy %X bytes from absolute pos %X\n", count, src_pos); + ff_dlog(s->avctx, "(3) copy %X bytes from absolute pos %X\n", count, src_pos); CHECK_COUNT(); CHECK_COPY(src_pos); for (i = 0; i < count; i++) @@ -280,7 +280,7 @@ static int decode_format80(VqaContext *s, int src_size, } else if (opcode > 0x80) { count = opcode & 0x3F; - av_dlog(s->avctx, "(4) copy %X bytes from source to dest\n", count); + ff_dlog(s->avctx, "(4) copy %X bytes from source to dest\n", count); CHECK_COUNT(); bytestream2_get_buffer(&s->gb, &dest[dest_index], count); dest_index += count; @@ -289,7 +289,7 @@ static int decode_format80(VqaContext *s, int src_size, count = ((opcode & 0x70) >> 4) + 3; src_pos = bytestream2_get_byte(&s->gb) | ((opcode & 0x0F) << 8); - av_dlog(s->avctx, "(5) copy %X bytes from relpos %X\n", count, src_pos); + ff_dlog(s->avctx, "(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 99a87f62fa..4c1bf00486 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 ffbf511adc..d60cf1febb 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -53,16 +53,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 */ @@ -436,7 +436,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 */ @@ -657,7 +657,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; } @@ -730,7 +730,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; } @@ -771,7 +771,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 */ @@ -815,7 +815,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; @@ -944,7 +944,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, void *data, samples_offset += s->frame_len; } - av_dlog(s->avctx, "%d %d %d %d outbytes:%"PTRDIFF_SPECIFIER" eaten:%d\n", + ff_dlog(s->avctx, "%d %d %d %d outbytes:%"PTRDIFF_SPECIFIER" 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 fcadbc034b..843ce90b3a 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -210,8 +210,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"); @@ -932,7 +932,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++) @@ -1035,13 +1035,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); } } @@ -1064,7 +1064,7 @@ static int decode_frame(WmallDecodeCtx *s) } } - av_dlog(s->avctx, "Frame done\n"); + ff_dlog(s->avctx, "Frame done\n"); s->skip_frame = 0; @@ -1213,7 +1213,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 3b7a8128fd..c319b39836 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -302,8 +302,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"); @@ -626,7 +626,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; @@ -826,7 +826,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]; @@ -1111,7 +1111,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 */ @@ -1138,7 +1138,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 */ @@ -1257,7 +1257,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 */ @@ -1271,7 +1271,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) { @@ -1339,7 +1339,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)) { @@ -1358,7 +1358,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 @@ -1369,18 +1369,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 */ @@ -1556,7 +1556,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 */ @@ -1579,14 +1579,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 bb14d5610d..d2b9b13053 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" @@ -417,15 +418,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) {