| ... | ... |
@@ -3212,7 +3212,6 @@ static void opt_input_file(const char *filename) |
| 3212 | 3212 |
case AVMEDIA_TYPE_AUDIO: |
| 3213 | 3213 |
input_codecs[nb_input_codecs-1] = avcodec_find_decoder_by_name(audio_codec_name); |
| 3214 | 3214 |
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]); |
| 3215 |
- //fprintf(stderr, "\nInput Audio channels: %d", dec->channels); |
|
| 3216 | 3215 |
channel_layout = dec->channel_layout; |
| 3217 | 3216 |
audio_channels = dec->channels; |
| 3218 | 3217 |
audio_sample_rate = dec->sample_rate; |
| ... | ... |
@@ -450,17 +450,6 @@ static int decode_frame(AVCodecContext *avctx, |
| 450 | 450 |
idct_put(a, mb_x, mb_y); |
| 451 | 451 |
} |
| 452 | 452 |
} |
| 453 |
-#if 0 |
|
| 454 |
-int i; |
|
| 455 |
-printf("%d %d\n", 8*buf_size, get_bits_count(&a->gb));
|
|
| 456 |
-for(i=get_bits_count(&a->gb); i<8*buf_size; i++){
|
|
| 457 |
- printf("%d", get_bits1(&a->gb));
|
|
| 458 |
-} |
|
| 459 |
- |
|
| 460 |
-for(i=0; i<s->avctx->extradata_size; i++){
|
|
| 461 |
- printf("%c\n", ((uint8_t*)s->avctx->extradata)[i]);
|
|
| 462 |
-} |
|
| 463 |
-#endif |
|
| 464 | 453 |
|
| 465 | 454 |
*picture= *(AVFrame*)&a->picture; |
| 466 | 455 |
*data_size = sizeof(AVPicture); |
| ... | ... |
@@ -493,25 +493,6 @@ static void idct248_error(const char *name, |
| 493 | 493 |
if (v > err_max) |
| 494 | 494 |
err_max = v; |
| 495 | 495 |
} |
| 496 |
-#if 0 |
|
| 497 |
- printf("ref=\n");
|
|
| 498 |
- for(i=0;i<8;i++) {
|
|
| 499 |
- int j; |
|
| 500 |
- for(j=0;j<8;j++) {
|
|
| 501 |
- printf(" %3d", img_dest1[i*8+j]);
|
|
| 502 |
- } |
|
| 503 |
- printf("\n");
|
|
| 504 |
- } |
|
| 505 |
- |
|
| 506 |
- printf("out=\n");
|
|
| 507 |
- for(i=0;i<8;i++) {
|
|
| 508 |
- int j; |
|
| 509 |
- for(j=0;j<8;j++) {
|
|
| 510 |
- printf(" %3d", img_dest[i*8+j]);
|
|
| 511 |
- } |
|
| 512 |
- printf("\n");
|
|
| 513 |
- } |
|
| 514 |
-#endif |
|
| 515 | 496 |
} |
| 516 | 497 |
printf("%s %s: err_inf=%d\n",
|
| 517 | 498 |
1 ? "IDCT248" : "DCT248", |
| ... | ... |
@@ -3327,13 +3327,6 @@ static int hadamard8_diff8x8_c(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t |
| 3327 | 3327 |
+BUTTERFLYA(temp[8*2+i], temp[8*6+i]) |
| 3328 | 3328 |
+BUTTERFLYA(temp[8*3+i], temp[8*7+i]); |
| 3329 | 3329 |
} |
| 3330 |
-#if 0 |
|
| 3331 |
-static int maxi=0; |
|
| 3332 |
-if(sum>maxi){
|
|
| 3333 |
- maxi=sum; |
|
| 3334 |
- printf("MAX:%d\n", maxi);
|
|
| 3335 |
-} |
|
| 3336 |
-#endif |
|
| 3337 | 3330 |
return sum; |
| 3338 | 3331 |
} |
| 3339 | 3332 |
|
| ... | ... |
@@ -552,14 +552,6 @@ retry: |
| 552 | 552 |
s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build, |
| 553 | 553 |
s->divx_packed ? "p" : ""); |
| 554 | 554 |
|
| 555 |
-#if 0 // dump bits per frame / qp / complexity |
|
| 556 |
-{
|
|
| 557 |
- static FILE *f=NULL; |
|
| 558 |
- if(!f) f=fopen("rate_qp_cplx.txt", "w");
|
|
| 559 |
- fprintf(f, "%d %d %f\n", buf_size, s->qscale, buf_size*(double)s->qscale); |
|
| 560 |
-} |
|
| 561 |
-#endif |
|
| 562 |
- |
|
| 563 | 555 |
#if HAVE_MMX |
| 564 | 556 |
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)) {
|
| 565 | 557 |
avctx->idct_algo= FF_IDCT_XVIDMMX; |
| ... | ... |
@@ -152,10 +152,6 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_l |
| 152 | 152 |
h->nal_unit_type= src[0]&0x1F; |
| 153 | 153 |
|
| 154 | 154 |
src++; length--; |
| 155 |
-#if 0 |
|
| 156 |
- for(i=0; i<length; i++) |
|
| 157 |
- printf("%2X ", src[i]);
|
|
| 158 |
-#endif |
|
| 159 | 155 |
|
| 160 | 156 |
#if HAVE_FAST_UNALIGNED |
| 161 | 157 |
# if HAVE_FAST_64BIT |
| ... | ... |
@@ -2748,12 +2744,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
|
| 2748 | 2748 |
int next_avc= h->is_avc ? 0 : buf_size; |
| 2749 | 2749 |
|
| 2750 | 2750 |
h->max_contexts = avctx->thread_count; |
| 2751 |
-#if 0 |
|
| 2752 |
- int i; |
|
| 2753 |
- for(i=0; i<50; i++){
|
|
| 2754 |
- av_log(NULL, AV_LOG_ERROR,"%02X ", buf[i]); |
|
| 2755 |
- } |
|
| 2756 |
-#endif |
|
| 2757 | 2751 |
if(!(s->flags2 & CODEC_FLAG2_CHUNKS)){
|
| 2758 | 2752 |
h->current_slice = 0; |
| 2759 | 2753 |
if (!s->first_field) |
| ... | ... |
@@ -352,11 +352,6 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
|
| 352 | 352 |
if(generate_bits_table(s->bits[i], s->len[i])<0){
|
| 353 | 353 |
return -1; |
| 354 | 354 |
} |
| 355 |
-#if 0 |
|
| 356 |
-for(j=0; j<256; j++){
|
|
| 357 |
-printf("%6X, %2d, %3d\n", s->bits[i][j], s->len[i][j], j);
|
|
| 358 |
-} |
|
| 359 |
-#endif |
|
| 360 | 355 |
free_vlc(&s->vlc[i]); |
| 361 | 356 |
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0); |
| 362 | 357 |
} |
| ... | ... |
@@ -632,25 +632,6 @@ static int funny_diamond_search(MpegEncContext * s, int *best, int dmin, |
| 632 | 632 |
|
| 633 | 633 |
if(x!=best[0] || y!=best[1]) |
| 634 | 634 |
dia_size=0; |
| 635 |
-#if 0 |
|
| 636 |
-{
|
|
| 637 |
-int dx, dy, i; |
|
| 638 |
-static int stats[8*8]; |
|
| 639 |
-dx= FFABS(x-best[0]); |
|
| 640 |
-dy= FFABS(y-best[1]); |
|
| 641 |
-if(dy>dx){
|
|
| 642 |
- dx^=dy; dy^=dx; dx^=dy; |
|
| 643 |
-} |
|
| 644 |
-stats[dy*8 + dx] ++; |
|
| 645 |
-if(256*256*256*64 % (stats[0]+1)==0){
|
|
| 646 |
- for(i=0; i<64; i++){
|
|
| 647 |
- if((i&7)==0) printf("\n");
|
|
| 648 |
- printf("%8d ", stats[i]);
|
|
| 649 |
- } |
|
| 650 |
- printf("\n");
|
|
| 651 |
-} |
|
| 652 |
-} |
|
| 653 |
-#endif |
|
| 654 | 635 |
} |
| 655 | 636 |
return dmin; |
| 656 | 637 |
} |
| ... | ... |
@@ -983,22 +964,6 @@ static int var_diamond_search(MpegEncContext * s, int *best, int dmin, |
| 983 | 983 |
|
| 984 | 984 |
if(x!=best[0] || y!=best[1]) |
| 985 | 985 |
dia_size=0; |
| 986 |
-#if 0 |
|
| 987 |
-{
|
|
| 988 |
-int dx, dy, i; |
|
| 989 |
-static int stats[8*8]; |
|
| 990 |
-dx= FFABS(x-best[0]); |
|
| 991 |
-dy= FFABS(y-best[1]); |
|
| 992 |
-stats[dy*8 + dx] ++; |
|
| 993 |
-if(256*256*256*64 % (stats[0]+1)==0){
|
|
| 994 |
- for(i=0; i<64; i++){
|
|
| 995 |
- if((i&7)==0) printf("\n");
|
|
| 996 |
- printf("%6d ", stats[i]);
|
|
| 997 |
- } |
|
| 998 |
- printf("\n");
|
|
| 999 |
-} |
|
| 1000 |
-} |
|
| 1001 |
-#endif |
|
| 1002 | 986 |
} |
| 1003 | 987 |
return dmin; |
| 1004 | 988 |
} |
| ... | ... |
@@ -888,10 +888,6 @@ static void mpeg1_encode_block(MpegEncContext *s, |
| 888 | 888 |
j = s->intra_scantable.permutated[i]; |
| 889 | 889 |
level = block[j]; |
| 890 | 890 |
next_coef: |
| 891 |
-#if 0 |
|
| 892 |
- if (level != 0) |
|
| 893 |
- av_dlog(s->avctx, "level[%d]=%d\n", i, level); |
|
| 894 |
-#endif |
|
| 895 | 891 |
/* encode using VLC */ |
| 896 | 892 |
if (level != 0) {
|
| 897 | 893 |
run = i - last_non_zero - 1; |
| ... | ... |
@@ -585,13 +585,6 @@ static void compute_bit_allocation(MpegAudioContext *s, |
| 585 | 585 |
} |
| 586 | 586 |
*padding = max_frame_size - current_frame_size; |
| 587 | 587 |
assert(*padding >= 0); |
| 588 |
- |
|
| 589 |
-#if 0 |
|
| 590 |
- for(i=0;i<s->sblimit;i++) {
|
|
| 591 |
- printf("%d ", bit_alloc[i]);
|
|
| 592 |
- } |
|
| 593 |
- printf("\n");
|
|
| 594 |
-#endif |
|
| 595 | 588 |
} |
| 596 | 589 |
|
| 597 | 590 |
/* |
| ... | ... |
@@ -713,15 +706,7 @@ static void encode_frame(MpegAudioContext *s, |
| 713 | 713 |
/* group the 3 values to save bits */ |
| 714 | 714 |
put_bits(p, -bits, |
| 715 | 715 |
q[0] + steps * (q[1] + steps * q[2])); |
| 716 |
-#if 0 |
|
| 717 |
- printf("%d: gr1 %d\n",
|
|
| 718 |
- i, q[0] + steps * (q[1] + steps * q[2])); |
|
| 719 |
-#endif |
|
| 720 | 716 |
} else {
|
| 721 |
-#if 0 |
|
| 722 |
- printf("%d: gr3 %d %d %d\n",
|
|
| 723 |
- i, q[0], q[1], q[2]); |
|
| 724 |
-#endif |
|
| 725 | 717 |
put_bits(p, bits, q[0]); |
| 726 | 718 |
put_bits(p, bits, q[1]); |
| 727 | 719 |
put_bits(p, bits, q[2]); |
| ... | ... |
@@ -617,10 +617,6 @@ void msmpeg4_encode_mb(MpegEncContext * s, |
| 617 | 617 |
} |
| 618 | 618 |
coded_cbp |= val << (5 - i); |
| 619 | 619 |
} |
| 620 |
-#if 0 |
|
| 621 |
- if (coded_cbp) |
|
| 622 |
- printf("cbp=%x %x\n", cbp, coded_cbp);
|
|
| 623 |
-#endif |
|
| 624 | 620 |
|
| 625 | 621 |
if(s->msmpeg4_version<=2){
|
| 626 | 622 |
if (s->pict_type == FF_I_TYPE) {
|
| ... | ... |
@@ -1383,17 +1379,6 @@ int msmpeg4_decode_picture_header(MpegEncContext * s) |
| 1383 | 1383 |
{
|
| 1384 | 1384 |
int code; |
| 1385 | 1385 |
|
| 1386 |
-#if 0 |
|
| 1387 |
-{
|
|
| 1388 |
-int i; |
|
| 1389 |
-for(i=0; i<s->gb.size_in_bits; i++) |
|
| 1390 |
- av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); |
|
| 1391 |
-// get_bits1(&s->gb); |
|
| 1392 |
-av_log(s->avctx, AV_LOG_DEBUG, "END\n"); |
|
| 1393 |
-return -1; |
|
| 1394 |
-} |
|
| 1395 |
-#endif |
|
| 1396 |
- |
|
| 1397 | 1386 |
if(s->msmpeg4_version==1){
|
| 1398 | 1387 |
int start_code = get_bits_long(&s->gb, 32); |
| 1399 | 1388 |
if(start_code!=0x00000100){
|
| ... | ... |
@@ -806,14 +806,6 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) |
| 806 | 806 |
rcc->last_mc_mb_var_sum= pic->mc_mb_var_sum; |
| 807 | 807 |
rcc->last_mb_var_sum= pic->mb_var_sum; |
| 808 | 808 |
} |
| 809 |
-#if 0 |
|
| 810 |
-{
|
|
| 811 |
- static int mvsum=0, texsum=0; |
|
| 812 |
- mvsum += s->mv_bits; |
|
| 813 |
- texsum += s->i_tex_bits + s->p_tex_bits; |
|
| 814 |
- printf("%d %d//\n\n", mvsum, texsum);
|
|
| 815 |
-} |
|
| 816 |
-#endif |
|
| 817 | 809 |
return q; |
| 818 | 810 |
} |
| 819 | 811 |
|
| ... | ... |
@@ -293,23 +293,6 @@ static int rv20_decode_picture_header(MpegEncContext *s) |
| 293 | 293 |
{
|
| 294 | 294 |
int seq, mb_pos, i; |
| 295 | 295 |
|
| 296 |
-#if 0 |
|
| 297 |
- GetBitContext gb= s->gb; |
|
| 298 |
- for(i=0; i<64; i++){
|
|
| 299 |
- av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&gb)); |
|
| 300 |
- if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " "); |
|
| 301 |
- } |
|
| 302 |
- av_log(s->avctx, AV_LOG_DEBUG, "\n"); |
|
| 303 |
-#endif |
|
| 304 |
-#if 0 |
|
| 305 |
- av_log(s->avctx, AV_LOG_DEBUG, "%3dx%03d/%02Xx%02X ", s->width, s->height, s->width/4, s->height/4); |
|
| 306 |
- for(i=0; i<s->avctx->extradata_size; i++){
|
|
| 307 |
- av_log(s->avctx, AV_LOG_DEBUG, "%02X ", ((uint8_t*)s->avctx->extradata)[i]); |
|
| 308 |
- if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " "); |
|
| 309 |
- } |
|
| 310 |
- av_log(s->avctx, AV_LOG_DEBUG, "\n"); |
|
| 311 |
-#endif |
|
| 312 |
- |
|
| 313 | 296 |
if(s->avctx->sub_id == 0x30202002 || s->avctx->sub_id == 0x30203002){
|
| 314 | 297 |
if (get_bits(&s->gb, 3)){
|
| 315 | 298 |
av_log(s->avctx, AV_LOG_ERROR, "unknown triplet set\n"); |
| ... | ... |
@@ -378,13 +378,6 @@ static int svq1_motion_inter_block (MpegEncContext *s, GetBitContext *bitbuf, |
| 378 | 378 |
if(x + (mv.x >> 1)<0) |
| 379 | 379 |
mv.x= 0; |
| 380 | 380 |
|
| 381 |
-#if 0 |
|
| 382 |
- int w= (s->width+15)&~15; |
|
| 383 |
- int h= (s->height+15)&~15; |
|
| 384 |
- if(x + (mv.x >> 1)<0 || y + (mv.y >> 1)<0 || x + (mv.x >> 1) + 16 > w || y + (mv.y >> 1) + 16> h) |
|
| 385 |
- av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mv.x >> 1), y + (mv.y >> 1)); |
|
| 386 |
-#endif |
|
| 387 |
- |
|
| 388 | 381 |
src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1))*pitch]; |
| 389 | 382 |
dst = current; |
| 390 | 383 |
|
| ... | ... |
@@ -461,12 +454,6 @@ static int svq1_motion_inter_4v_block (MpegEncContext *s, GetBitContext *bitbuf, |
| 461 | 461 |
if(x + (mvx >> 1)<0) |
| 462 | 462 |
mvx= 0; |
| 463 | 463 |
|
| 464 |
-#if 0 |
|
| 465 |
- int w= (s->width+15)&~15; |
|
| 466 |
- int h= (s->height+15)&~15; |
|
| 467 |
- if(x + (mvx >> 1)<0 || y + (mvy >> 1)<0 || x + (mvx >> 1) + 8 > w || y + (mvy >> 1) + 8> h) |
|
| 468 |
- av_log(s->avctx, AV_LOG_INFO, "%d %d %d %d\n", x, y, x + (mvx >> 1), y + (mvy >> 1)); |
|
| 469 |
-#endif |
|
| 470 | 464 |
src = &previous[(x + (mvx >> 1)) + (y + (mvy >> 1))*pitch]; |
| 471 | 465 |
dst = current; |
| 472 | 466 |
|
| ... | ... |
@@ -178,15 +178,6 @@ static void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len) |
| 178 | 178 |
s->lsp_pow_m_table2[i] = b - a; |
| 179 | 179 |
b = a; |
| 180 | 180 |
} |
| 181 |
-#if 0 |
|
| 182 |
- for(i=1;i<20;i++) {
|
|
| 183 |
- float v, r1, r2; |
|
| 184 |
- v = 5.0 / i; |
|
| 185 |
- r1 = pow_m1_4(s, v); |
|
| 186 |
- r2 = pow(v,-0.25); |
|
| 187 |
- printf("%f^-0.25=%f e=%f\n", v, r1, r2 - r1);
|
|
| 188 |
- } |
|
| 189 |
-#endif |
|
| 190 | 181 |
} |
| 191 | 182 |
|
| 192 | 183 |
/** |
| ... | ... |
@@ -116,16 +116,6 @@ int ff_wmv2_decode_picture_header(MpegEncContext * s) |
| 116 | 116 |
Wmv2Context * const w= (Wmv2Context*)s; |
| 117 | 117 |
int code; |
| 118 | 118 |
|
| 119 |
-#if 0 |
|
| 120 |
-{
|
|
| 121 |
-int i; |
|
| 122 |
-for(i=0; i<s->gb.size*8; i++) |
|
| 123 |
- printf("%d", get_bits1(&s->gb));
|
|
| 124 |
-// get_bits1(&s->gb); |
|
| 125 |
-printf("END\n");
|
|
| 126 |
-return -1; |
|
| 127 |
-} |
|
| 128 |
-#endif |
|
| 129 | 119 |
if(s->picture_number==0) |
| 130 | 120 |
decode_ext_header(w); |
| 131 | 121 |
|
| ... | ... |
@@ -316,10 +306,6 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, |
| 316 | 316 |
|
| 317 | 317 |
if(w->per_block_abt) |
| 318 | 318 |
w->abt_type= decode012(&s->gb); |
| 319 |
-#if 0 |
|
| 320 |
- if(w->per_block_abt) |
|
| 321 |
- printf("B%d", w->abt_type);
|
|
| 322 |
-#endif |
|
| 323 | 319 |
w->abt_type_table[n]= w->abt_type; |
| 324 | 320 |
|
| 325 | 321 |
if(w->abt_type){
|
| ... | ... |
@@ -417,9 +417,6 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 417 | 417 |
if (ffm->header[1] & FLAG_DTS) |
| 418 | 418 |
if (ffm_read_data(s, ffm->header+16, 4, 1) != 4) |
| 419 | 419 |
return -1; |
| 420 |
-#if 0 |
|
| 421 |
- av_hexdump_log(s, AV_LOG_DEBUG, ffm->header, FRAME_HEADER_SIZE); |
|
| 422 |
-#endif |
|
| 423 | 420 |
ffm->read_state = READ_DATA; |
| 424 | 421 |
/* fall thru */ |
| 425 | 422 |
case READ_DATA: |
| ... | ... |
@@ -662,9 +662,6 @@ static int mpegts_push_data(MpegTSFilter *filter, |
| 662 | 662 |
if (pes->data_index == PES_START_SIZE) {
|
| 663 | 663 |
/* we got all the PES or section header. We can now |
| 664 | 664 |
decide */ |
| 665 |
-#if 0 |
|
| 666 |
- av_hex_dump_log(pes->stream, AV_LOG_DEBUG, pes->header, pes->data_index); |
|
| 667 |
-#endif |
|
| 668 | 665 |
if (pes->header[0] == 0x00 && pes->header[1] == 0x00 && |
| 669 | 666 |
pes->header[2] == 0x01) {
|
| 670 | 667 |
/* it must be an mpeg2 PES stream */ |