comparison msmpeg4.c @ 3177:8d1b2cc2a75b libavcodec

(f)printf --> av_log conversion taken from a patch by Steve L'Homme
author diego
date Wed, 08 Mar 2006 11:43:10 +0000
parents 0b546eab515d
children 87187ebe2c28
comparison
equal deleted inserted replaced
3176:babf844e1308 3177:8d1b2cc2a75b
432 s->esc3_level_length= 0; 432 s->esc3_level_length= 0;
433 s->esc3_run_length= 0; 433 s->esc3_run_length= 0;
434 434
435 #ifdef DEBUG 435 #ifdef DEBUG
436 intra_count = 0; 436 intra_count = 0;
437 printf("*****frame %d:\n", frame_count++); 437 av_log(s->avctx, AV_LOG_DEBUG, "*****frame %d:\n", frame_count++);
438 #endif 438 #endif
439 } 439 }
440 440
441 void msmpeg4_encode_ext_header(MpegEncContext * s) 441 void msmpeg4_encode_ext_header(MpegEncContext * s)
442 { 442 {
502 mx += 32; 502 mx += 32;
503 my += 32; 503 my += 32;
504 #if 0 504 #if 0
505 if ((unsigned)mx >= 64 || 505 if ((unsigned)mx >= 64 ||
506 (unsigned)my >= 64) 506 (unsigned)my >= 64)
507 fprintf(stderr, "error mx=%d my=%d\n", mx, my); 507 av_log(s->avctx, AV_LOG_ERROR, "error mx=%d my=%d\n", mx, my);
508 #endif 508 #endif
509 mv = &mv_tables[s->mv_table_index]; 509 mv = &mv_tables[s->mv_table_index];
510 510
511 code = mv->table_mv_index[(mx << 6) | my]; 511 code = mv->table_mv_index[(mx << 6) | my];
512 set_stat(ST_MV); 512 set_stat(ST_MV);
1212 1212
1213 #if 0 1213 #if 0
1214 { 1214 {
1215 int i; 1215 int i;
1216 for(i=0; i<s->gb.size_in_bits; i++) 1216 for(i=0; i<s->gb.size_in_bits; i++)
1217 printf("%d", get_bits1(&s->gb)); 1217 av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
1218 // get_bits1(&s->gb); 1218 // get_bits1(&s->gb);
1219 printf("END\n"); 1219 av_log(s->avctx, AV_LOG_DEBUG, "END\n");
1220 return -1; 1220 return -1;
1221 } 1221 }
1222 #endif 1222 #endif
1223 1223
1224 if(s->msmpeg4_version==1){ 1224 if(s->msmpeg4_version==1){
1368 1368
1369 s->esc3_level_length= 0; 1369 s->esc3_level_length= 0;
1370 s->esc3_run_length= 0; 1370 s->esc3_run_length= 0;
1371 1371
1372 #ifdef DEBUG 1372 #ifdef DEBUG
1373 printf("*****frame %d:\n", frame_count++); 1373 av_log(s->avctx, AV_LOG_DEBUG, "*****frame %d:\n", frame_count++);
1374 #endif 1374 #endif
1375 return 0; 1375 return 0;
1376 } 1376 }
1377 1377
1378 int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) 1378 int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size)
1792 { 1792 {
1793 const int abs_level= ABS(level); 1793 const int abs_level= ABS(level);
1794 const int run1= run - rl->max_run[last][abs_level] - run_diff; 1794 const int run1= run - rl->max_run[last][abs_level] - run_diff;
1795 if(abs_level<=MAX_LEVEL && run<=MAX_RUN){ 1795 if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
1796 if(abs_level <= rl->max_level[last][run]){ 1796 if(abs_level <= rl->max_level[last][run]){
1797 fprintf(stderr, "illegal 3. esc, vlc encoding possible\n"); 1797 av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, vlc encoding possible\n");
1798 return DECODING_AC_LOST; 1798 return DECODING_AC_LOST;
1799 } 1799 }
1800 if(abs_level <= rl->max_level[last][run]*2){ 1800 if(abs_level <= rl->max_level[last][run]*2){
1801 fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n"); 1801 av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n");
1802 return DECODING_AC_LOST; 1802 return DECODING_AC_LOST;
1803 } 1803 }
1804 if(run1>=0 && abs_level <= rl->max_level[last][run1]){ 1804 if(run1>=0 && abs_level <= rl->max_level[last][run1]){
1805 fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n"); 1805 av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n");
1806 return DECODING_AC_LOST; 1806 return DECODING_AC_LOST;
1807 } 1807 }
1808 } 1808 }
1809 } 1809 }
1810 #endif 1810 #endif
1811 //level = level * qmul + (level>0) * qadd - (level<=0) * qadd ; 1811 //level = level * qmul + (level>0) * qadd - (level<=0) * qadd ;
1812 if (level>0) level= level * qmul + qadd; 1812 if (level>0) level= level * qmul + qadd;
1813 else level= level * qmul - qadd; 1813 else level= level * qmul - qadd;
1814 #if 0 // waste of time too :( 1814 #if 0 // waste of time too :(
1815 if(level>2048 || level<-2048){ 1815 if(level>2048 || level<-2048){
1816 fprintf(stderr, "|level| overflow in 3. esc\n"); 1816 av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 3. esc\n");
1817 return DECODING_AC_LOST; 1817 return DECODING_AC_LOST;
1818 } 1818 }
1819 #endif 1819 #endif
1820 i+= run + 1; 1820 i+= run + 1;
1821 if(last) i+=192; 1821 if(last) i+=192;