Commit be315a32 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote branch 'qatar/master'

* qatar/master:
Duplicate  AMV: disable DR1 and don't override EMU_EDGE
Duplicate  lavf: inspect more frames for fps when container time base is coarse
Wrong and we have correct fix: Fix races in default av_log handler
  vorbis: Replace sized int_fast integer types with plain int/unsigned.
  Remove disabled non-optimized code variants.
NO  bswap.h: Remove disabled code.
  Remove some disabled printf debug cruft.
  Replace more disabled printf() calls by av_dlog().
NO  tests: Remove disabled code.
NO  Replace some commented-out debug printf() / av_log() messages with av_dlog().
  vorbisdec: Replace some sizeof(type) by sizeof(*variable).
NO  vf_fieldorder: Replace FFmpeg by Libav in license boilerplate.

Conflicts:
	libavcodec/h264.c
	libavcodec/vorbisdec.c
	libavutil/log.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 500bf397 70892657
......@@ -3327,7 +3327,6 @@ static void opt_input_file(const char *filename)
case AVMEDIA_TYPE_AUDIO:
input_codecs[nb_input_codecs-1] = avcodec_find_decoder_by_name(audio_codec_name);
set_context_opts(dec, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM, input_codecs[nb_input_codecs-1]);
//fprintf(stderr, "\nInput Audio channels: %d", dec->channels);
channel_layout = dec->channel_layout;
audio_channels = dec->channels;
audio_sample_rate = dec->sample_rate;
......
......@@ -450,17 +450,6 @@ static int decode_frame(AVCodecContext *avctx,
idct_put(a, mb_x, mb_y);
}
}
#if 0
int i;
printf("%d %d\n", 8*buf_size, get_bits_count(&a->gb));
for(i=get_bits_count(&a->gb); i<8*buf_size; i++){
printf("%d", get_bits1(&a->gb));
}
for(i=0; i<s->avctx->extradata_size; i++){
printf("%c\n", ((uint8_t*)s->avctx->extradata)[i]);
}
#endif
*picture= *(AVFrame*)&a->picture;
*data_size = sizeof(AVPicture);
......
......@@ -2100,13 +2100,6 @@ static int hadamard8_diff8x8_c(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t
+BUTTERFLYA(temp[8*2+i], temp[8*6+i])
+BUTTERFLYA(temp[8*3+i], temp[8*7+i]);
}
#if 0
static int maxi=0;
if(sum>maxi){
maxi=sum;
printf("MAX:%d\n", maxi);
}
#endif
return sum;
}
......
......@@ -567,14 +567,6 @@ retry:
s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build,
s->divx_packed ? "p" : "");
#if 0 // dump bits per frame / qp / complexity
{
static FILE *f=NULL;
if(!f) f=fopen("rate_qp_cplx.txt", "w");
fprintf(f, "%d %d %f\n", buf_size, s->qscale, buf_size*(double)s->qscale);
}
#endif
#if HAVE_MMX
if (s->codec_id == CODEC_ID_MPEG4 && s->xvid_build>=0 && avctx->idct_algo == FF_IDCT_AUTO && (av_get_cpu_flags() & AV_CPU_FLAG_MMX)) {
avctx->idct_algo= FF_IDCT_XVIDMMX;
......
......@@ -153,10 +153,6 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_l
h->nal_unit_type= src[0]&0x1F;
src++; length--;
#if 0
for(i=0; i<length; i++)
printf("%2X ", src[i]);
#endif
#if HAVE_FAST_UNALIGNED
# if HAVE_FAST_64BIT
......
......@@ -352,11 +352,6 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
if(generate_bits_table(s->bits[i], s->len[i])<0){
return -1;
}
#if 0
for(j=0; j<256; j++){
printf("%6X, %2d, %3d\n", s->bits[i][j], s->len[i][j], j);
}
#endif
free_vlc(&s->vlc[i]);
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
}
......
......@@ -1119,10 +1119,8 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
// pic->mb_cmp_score[s->mb_stride * mb_y + mb_x] = dmin;
c->mc_mb_var_sum_temp += (vard+128)>>8;
#if 0
printf("varc=%4d avg_var=%4d (sum=%4d) vard=%4d mx=%2d my=%2d\n",
varc, s->avg_mb_var, sum, vard, mx - xx, my - yy);
#endif
av_dlog(s, "varc=%4d avg_var=%4d (sum=%4d) vard=%4d mx=%2d my=%2d\n",
varc, s->avg_mb_var, sum, vard, mx - xx, my - yy);
if(mb_type){
int p_score= FFMIN(vard, varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*100);
int i_score= varc-500+(s->lambda2>>FF_LAMBDA_SHIFT)*20;
......
......@@ -634,25 +634,6 @@ static int funny_diamond_search(MpegEncContext * s, int *best, int dmin,
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
if(dy>dx){
dx^=dy; dy^=dx; dx^=dy;
}
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%8d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
......@@ -985,22 +966,6 @@ static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%6d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
......
......@@ -888,10 +888,6 @@ static void mpeg1_encode_block(MpegEncContext *s,
j = s->intra_scantable.permutated[i];
level = block[j];
next_coef:
#if 0
if (level != 0)
av_dlog(s->avctx, "level[%d]=%d\n", i, level);
#endif
/* encode using VLC */
if (level != 0) {
run = i - last_non_zero - 1;
......
......@@ -591,13 +591,6 @@ static void compute_bit_allocation(MpegAudioContext *s,
}
*padding = max_frame_size - current_frame_size;
assert(*padding >= 0);
#if 0
for(i=0;i<s->sblimit;i++) {
printf("%d ", bit_alloc[i]);
}
printf("\n");
#endif
}
/*
......@@ -719,15 +712,7 @@ static void encode_frame(MpegAudioContext *s,
/* group the 3 values to save bits */
put_bits(p, -bits,
q[0] + steps * (q[1] + steps * q[2]));
#if 0
printf("%d: gr1 %d\n",
i, q[0] + steps * (q[1] + steps * q[2]));
#endif
} else {
#if 0
printf("%d: gr3 %d %d %d\n",
i, q[0], q[1], q[2]);
#endif
put_bits(p, bits, q[0]);
put_bits(p, bits, q[1]);
put_bits(p, bits, q[2]);
......
......@@ -617,10 +617,6 @@ void msmpeg4_encode_mb(MpegEncContext * s,
}
coded_cbp |= val << (5 - i);
}
#if 0
if (coded_cbp)
printf("cbp=%x %x\n", cbp, coded_cbp);
#endif
if(s->msmpeg4_version<=2){
if (s->pict_type == FF_I_TYPE) {
......@@ -1383,17 +1379,6 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
{
int code;
#if 0
{
int i;
for(i=0; i<s->gb.size_in_bits; i++)
av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
// get_bits1(&s->gb);
av_log(s->avctx, AV_LOG_DEBUG, "END\n");
return -1;
}
#endif
if(s->msmpeg4_version==1){
int start_code = get_bits_long(&s->gb, 32);
if(start_code!=0x00000100){
......
......@@ -272,12 +272,11 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
pc->overread++;
}
#if 0
if(pc->overread){
printf("overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index);
printf("%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]);
av_dlog(pc, "overread %d, state:%X next:%d index:%d o_index:%d\n",
pc->overread, pc->state, next, pc->index, pc->overread_index);
av_dlog(pc, "%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]);
}
#endif
return 0;
}
......
......@@ -806,14 +806,6 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
rcc->last_mc_mb_var_sum= pic->mc_mb_var_sum;
rcc->last_mb_var_sum= pic->mb_var_sum;
}
#if 0
{
static int mvsum=0, texsum=0;
mvsum += s->mv_bits;
texsum += s->i_tex_bits + s->p_tex_bits;
printf("%d %d//\n\n", mvsum, texsum);
}
#endif
return q;
}
......
......@@ -54,8 +54,6 @@ static const float odd_table[] __attribute__ ((aligned(8))) = {
#undef c6
#undef c7
#if 1
#define load_matrix(table) \
do { \
const float *t = table; \
......@@ -84,52 +82,11 @@ static const float odd_table[] __attribute__ ((aligned(8))) = {
register float fr2 __asm__("fr2"); \
register float fr3 __asm__("fr3")
#else
/* generic C code for check */
static void ftrv_(const float xf[],float fv[])
{
float f0,f1,f2,f3;
f0 = fv[0];
f1 = fv[1];
f2 = fv[2];
f3 = fv[3];
fv[0] = xf[0]*f0 + xf[4]*f1 + xf[ 8]*f2 + xf[12]*f3;
fv[1] = xf[1]*f0 + xf[5]*f1 + xf[ 9]*f2 + xf[13]*f3;
fv[2] = xf[2]*f0 + xf[6]*f1 + xf[10]*f2 + xf[14]*f3;
fv[3] = xf[3]*f0 + xf[7]*f1 + xf[11]*f2 + xf[15]*f3;
}
static void load_matrix_(float xf[],const float table[])
{
int i;
for(i=0;i<16;i++) xf[i]=table[i];
}
#define ftrv() ftrv_(xf,fv)
#define load_matrix(table) load_matrix_(xf,table)
#define DEFREG \
float fv[4],xf[16]
#define fr0 fv[0]
#define fr1 fv[1]
#define fr2 fv[2]
#define fr3 fv[3]
#endif
#if 1
#define DESCALE(x,n) (x)*(1.0f/(1<<(n)))
#else
#define DESCALE(x,n) (((int)(x)+(1<<(n-1)))>>(n))
#endif
/* this code work worse on gcc cvs. 3.2.3 work fine */
#if 1
//optimized
void idct_sh4(DCTELEM *block)
......@@ -252,111 +209,3 @@ void idct_sh4(DCTELEM *block)
fp_single_leave(fpscr);
}
#else
void idct_sh4(DCTELEM *block)
{
DEFREG;
int i;
float tblock[8*8],*fblock;
/* row */
/* even part */
load_matrix(even_table);
fblock = tblock;
i = 8;
do {
fr0 = block[0];
fr1 = block[2];
fr2 = block[4];
fr3 = block[6];
block+=8;
ftrv();
fblock[0] = fr0;
fblock[2] = fr1;
fblock[4] = fr2;
fblock[6] = fr3;
fblock+=8;
} while(--i);
block-=8*8;
fblock-=8*8;
load_matrix(odd_table);
i = 8;
do {
float t0,t1,t2,t3;
fr0 = block[1];
fr1 = block[3];
fr2 = block[5];
fr3 = block[7];
block+=8;
ftrv();
t0 = fblock[0];
t1 = fblock[2];
t2 = fblock[4];
t3 = fblock[6];
fblock[0] = t0 + fr0;
fblock[7] = t0 - fr0;
fblock[1] = t1 + fr1;
fblock[6] = t1 - fr1;
fblock[2] = t2 + fr2;
fblock[5] = t2 - fr2;
fblock[3] = t3 + fr3;
fblock[4] = t3 - fr3;
fblock+=8;
} while(--i);
block-=8*8;
fblock-=8*8;
/* col */
/* even part */
load_matrix(even_table);
i = 8;
do {
fr0 = fblock[8*0];
fr1 = fblock[8*2];
fr2 = fblock[8*4];
fr3 = fblock[8*6];
ftrv();
fblock[8*0] = fr0;
fblock[8*2] = fr1;
fblock[8*4] = fr2;
fblock[8*6] = fr3;
fblock++;
} while(--i);
fblock-=8;
load_matrix(odd_table);
i=8;
do {
float t0,t1,t2,t3;
fr0 = fblock[8*1];
fr1 = fblock[8*3];
fr2 = fblock[8*5];
fr3 = fblock[8*7];
ftrv();
t0 = fblock[8*0];
t1 = fblock[8*2];
t2 = fblock[8*4];
t3 = fblock[8*6];
fblock++;
block[8*0] = DESCALE(t0 + fr0,3);
block[8*7] = DESCALE(t0 - fr0,3);
block[8*1] = DESCALE(t1 + fr1,3);
block[8*6] = DESCALE(t1 - fr1,3);
block[8*2] = DESCALE(t2 + fr2,3);
block[8*5] = DESCALE(t2 - fr2,3);
block[8*3] = DESCALE(t3 + fr3,3);
block[8*4] = DESCALE(t3 - fr3,3);
block++;
} while(--i);
}
#endif
......@@ -378,13 +378,6 @@ static int svq1_motion_inter_block (MpegEncContext *s, GetBitContext *bitbuf,
if(x + (mv.x >> 1)<0)
mv.x= 0;
#if 0
int w= (s->width+15)&~15;
int h= (s->height+15)&~15;
if(x + (mv.x >> 1)<0 || y + (mv.y >> 1)<0 || x + (mv.x >> 1) + 16 > w || y + (mv.y >> 1) + 16> h)
av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mv.x >> 1), y + (mv.y >> 1));
#endif
src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch];
dst = current;
......@@ -461,12 +454,6 @@ static int svq1_motion_inter_4v_block (MpegEncContext *s, GetBitContext *bitbuf,
if(x + (mvx >> 1)<0)
mvx= 0;
#if 0
int w= (s->width+15)&~15;
int h= (s->height+15)&~15;
if(x + (mvx >> 1)<0 || y + (mvy >> 1)<0 || x + (mvx >> 1) + 8 > w || y + (mvy >> 1) + 8> h)
av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mvx >> 1), y + (mvy >> 1));
#endif
src = &previous[(x + (mvx >> 1)) + (y + (mvy >> 1))*pitch];
dst = current;
......
......@@ -51,14 +51,13 @@ unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
// the two bits[p] > 32 checks should be redundant, all calling code should
// already ensure that, but since it allows overwriting the stack it seems
// reasonable to check redundantly.
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num)
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
{
uint_fast32_t exit_at_level[33] = {
404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint_fast8_t i, j;
uint_fast32_t code, p;
unsigned i, j, p, code;
#ifdef V_DEBUG
GetBitContext gb;
......@@ -78,8 +77,8 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num)
exit_at_level[i+1] = 1 << i;
#ifdef V_DEBUG
av_log(NULL, AV_LOG_INFO, " %d. of %d code len %d code %d - ", p, num, bits[p], codes[p]);
init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]);
init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
for (i = 0; i < bits[p]; ++i)
av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
av_log(NULL, AV_LOG_INFO, "\n");
......
......@@ -38,7 +38,7 @@ typedef struct {
void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values);
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num);
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
uint_fast16_t * y_list, int * flag,
int multiplier, float * out, int samples);
......
This diff is collapsed.
......@@ -185,15 +185,6 @@ static void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len)
s->lsp_pow_m_table2[i] = b - a;
b = a;
}
#if 0
for(i=1;i<20;i++) {
float v, r1, r2;
v = 5.0 / i;
r1 = pow_m1_4(s, v);
r2 = pow(v,-0.25);
printf("%f^-0.25=%f e=%f\n", v, r1, r2 - r1);
}
#endif
}
/**
......
......@@ -116,16 +116,6 @@ int ff_wmv2_decode_picture_header(MpegEncContext * s)
Wmv2Context * const w= (Wmv2Context*)s;
int code;
#if 0
{
int i;
for(i=0; i<s->gb.size*8; i++)
printf("%d", get_bits1(&s->gb));
// get_bits1(&s->gb);
printf("END\n");
return -1;
}
#endif
if(s->picture_number==0)
decode_ext_header(w);
......@@ -316,10 +306,6 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n,
if(w->per_block_abt)
w->abt_type= decode012(&s->gb);
#if 0
if(w->per_block_abt)
printf("B%d", w->abt_type);
#endif
w->abt_type_table[n]= w->abt_type;
if(w->abt_type){
......
......@@ -116,22 +116,11 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
q = s->c_dc_scale;
/* note: block[0] is assumed to be positive */
if (!s->h263_aic) {
#if 1
__asm__ volatile (
"mul %%ecx \n\t"
: "=d" (level), "=a"(dummy)
: "a" ((block[0]>>2) + q), "c" (ff_inverse[q<<1])
);
#else
__asm__ volatile (
"xorl %%edx, %%edx \n\t"
"divw %%cx \n\t"
"movzwl %%ax, %%eax \n\t"
: "=a" (level)
: "a" ((block[0]>>2) + q), "c" (q<<1)
: "%edx"
);
#endif
} else
/* For AIC we skip quant/dequant of INTRADC */
level = (block[0] + 4)>>3;
......
......@@ -416,9 +416,6 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ffm->header[1] & FLAG_DTS)
if (ffm_read_data(s, ffm->header+16, 4, 1) != 4)
return -1;
#if 0
av_hexdump_log(s, AV_LOG_DEBUG, ffm->header, FRAME_HEADER_SIZE);
#endif
ffm->read_state = READ_DATA;
/* fall thru */
case READ_DATA:
......
......@@ -663,9 +663,6 @@ static int mpegts_push_data(MpegTSFilter *filter,
if (pes->data_index == PES_START_SIZE) {
/* we got all the PES or section header. We can now
decide */
#if 0
av_hex_dump_log(pes->stream, AV_LOG_DEBUG, pes->header, pes->data_index);
#endif
if (pes->header[0] == 0x00 && pes->header[1] == 0x00 &&
pes->header[2] == 0x01) {
/* it must be an mpeg2 PES stream */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment