Skip to content

Commit

Permalink
Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'
Browse files Browse the repository at this point in the history
* commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25':
  lavc: Replace av_dlog and tprintf with internal macros

Conflicts:
	libavcodec/aacdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/bitstream.c
	libavcodec/dcadec.c
	libavcodec/dnxhddec.c
	libavcodec/dvbsubdec.c
	libavcodec/dvdec.c
	libavcodec/dvdsubdec.c
	libavcodec/get_bits.h
	libavcodec/gifdec.c
	libavcodec/h264.h
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_refs.c
	libavcodec/imc.c
	libavcodec/interplayvideo.c
	libavcodec/jpeglsdec.c
	libavcodec/libopencore-amr.c
	libavcodec/mjpegdec.c
	libavcodec/mpeg12dec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_parser.c
	libavcodec/pngdec.c
	libavcodec/ratecontrol.c
	libavcodec/rv10.c
	libavcodec/svq1dec.c
	libavcodec/vqavideo.c
	libavcodec/wmadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Apr 20, 2015
2 parents 40d552d + 6a85dfc commit 8f7b022
Show file tree
Hide file tree
Showing 75 changed files with 460 additions and 436 deletions.
8 changes: 4 additions & 4 deletions libavcodec/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
62 changes: 31 additions & 31 deletions libavcodec/ac3enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,55 +1687,55 @@ 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;
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_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) {
Expand All @@ -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) {
Expand All @@ -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
Expand Down
36 changes: 18 additions & 18 deletions libavcodec/alsdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
9 changes: 5 additions & 4 deletions libavcodec/bitstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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];
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions libavcodec/cook.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions libavcodec/dcadec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions libavcodec/dnxhddec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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",
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions libavcodec/dnxhdenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -859,7 +859,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
down_step = 1<<LAMBDA_FRAC_BITS;
}
}
//av_dlog(ctx->m.avctx, "out lambda %d\n", lambda);
//ff_dlog(ctx->m.avctx, "out lambda %d\n", lambda);
ctx->lambda = lambda;
return 0;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 8f7b022

Please sign in to comment.