Eliminate pointless '#if 1' statements without matching '#else'.

pull/2/head
Diego Biurrun 14 years ago
parent 9d35fa520e
commit e6ff064845
  1. 2
      ffserver.c
  2. 5
      libavcodec/dct-test.c
  3. 2
      libavcodec/dsputil.c
  4. 17
      libavcodec/error_resilience.c
  5. 2
      libavcodec/h264.h
  6. 2
      libavcodec/motion_est_template.c
  7. 5
      libavcodec/msmpeg4.c
  8. 2
      libavcodec/sh4/qpel.c
  9. 2
      libavcodec/snow.c
  10. 2
      libavformat/nutenc.c
  11. 3
      libavutil/pca.c

@ -2185,10 +2185,8 @@ static int open_input_stream(HTTPContext *c, const char *info)
} }
} }
#if 1
if (c->fmt_in->iformat->read_seek) if (c->fmt_in->iformat->read_seek)
av_seek_frame(c->fmt_in, -1, stream_pos, 0); av_seek_frame(c->fmt_in, -1, stream_pos, 0);
#endif
/* set the start time (needed for maxtime and RTP packet timing) */ /* set the start time (needed for maxtime and RTP packet timing) */
c->start_time = cur_time; c->start_time = cur_time;
c->first_pts = AV_NOPTS_VALUE; c->first_pts = AV_NOPTS_VALUE;

@ -312,18 +312,16 @@ static void dct_error(const char *name, int is_idct,
} }
for(i=0; i<64; i++) sysErrMax= FFMAX(sysErrMax, FFABS(sysErr[i])); for(i=0; i<64; i++) sysErrMax= FFMAX(sysErrMax, FFABS(sysErr[i]));
#if 1 // dump systematic errors
for(i=0; i<64; i++){ for(i=0; i<64; i++){
if(i%8==0) printf("\n"); if(i%8==0) printf("\n");
printf("%7d ", (int)sysErr[i]); printf("%7d ", (int)sysErr[i]);
} }
printf("\n"); printf("\n");
#endif
printf("%s %s: err_inf=%d err2=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n", printf("%s %s: err_inf=%d err2=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n",
is_idct ? "IDCT" : "DCT", is_idct ? "IDCT" : "DCT",
name, err_inf, (double)err2 / NB_ITS / 64.0, (double)sysErrMax / NB_ITS, maxout, blockSumErrMax); name, err_inf, (double)err2 / NB_ITS / 64.0, (double)sysErrMax / NB_ITS, maxout, blockSumErrMax);
#if 1 //Speed test
/* speed test */ /* speed test */
for(i=0;i<64;i++) for(i=0;i<64;i++)
block1[i] = 0; block1[i] = 0;
@ -376,7 +374,6 @@ static void dct_error(const char *name, int is_idct,
printf("%s %s: %0.1f kdct/s\n", printf("%s %s: %0.1f kdct/s\n",
is_idct ? "IDCT" : "DCT", is_idct ? "IDCT" : "DCT",
name, (double)it1 * 1000.0 / (double)ti1); name, (double)it1 * 1000.0 / (double)ti1);
#endif
} }
DECLARE_ALIGNED(8, static uint8_t, img_dest)[64]; DECLARE_ALIGNED(8, static uint8_t, img_dest)[64];

@ -2100,7 +2100,6 @@ QPEL_MC(0, avg_ , _ , op_avg)
#define put_no_rnd_qpel8_mc00_c ff_put_pixels8x8_c #define put_no_rnd_qpel8_mc00_c ff_put_pixels8x8_c
#define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c #define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
#if 1
#define H264_LOWPASS(OPNAME, OP, OP2) \ #define H264_LOWPASS(OPNAME, OP, OP2) \
static av_unused void OPNAME ## h264_qpel2_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\ static av_unused void OPNAME ## h264_qpel2_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
const int h=2;\ const int h=2;\
@ -2522,7 +2521,6 @@ H264_MC(avg_, 16)
#undef op_put #undef op_put
#undef op2_avg #undef op2_avg
#undef op2_put #undef op2_put
#endif
#define put_h264_qpel8_mc00_c ff_put_pixels8x8_c #define put_h264_qpel8_mc00_c ff_put_pixels8x8_c
#define avg_h264_qpel8_mc00_c ff_avg_pixels8x8_c #define avg_h264_qpel8_mc00_c ff_avg_pixels8x8_c

@ -786,7 +786,6 @@ void ff_er_frame_end(MpegEncContext *s){
} }
} }
#if 1
/* handle overlapping slices */ /* handle overlapping slices */
for(error_type=1; error_type<=3; error_type++){ for(error_type=1; error_type<=3; error_type++){
int end_ok=0; int end_ok=0;
@ -807,8 +806,7 @@ void ff_er_frame_end(MpegEncContext *s){
end_ok=0; end_ok=0;
} }
} }
#endif
#if 1
/* handle slices with partitions of different length */ /* handle slices with partitions of different length */
if(s->partitioned_frame){ if(s->partitioned_frame){
int end_ok=0; int end_ok=0;
@ -829,7 +827,7 @@ void ff_er_frame_end(MpegEncContext *s){
end_ok=0; end_ok=0;
} }
} }
#endif
/* handle missing slices */ /* handle missing slices */
if(s->error_recognition>=4){ if(s->error_recognition>=4){
int end_ok=1; int end_ok=1;
@ -853,7 +851,6 @@ void ff_er_frame_end(MpegEncContext *s){
} }
} }
#if 1
/* backward mark errors */ /* backward mark errors */
distance=9999999; distance=9999999;
for(error_type=1; error_type<=3; error_type++){ for(error_type=1; error_type<=3; error_type++){
@ -878,7 +875,6 @@ void ff_er_frame_end(MpegEncContext *s){
distance= 9999999; distance= 9999999;
} }
} }
#endif
/* forward mark errors */ /* forward mark errors */
error=0; error=0;
@ -893,7 +889,7 @@ void ff_er_frame_end(MpegEncContext *s){
s->error_status_table[mb_xy]|= error; s->error_status_table[mb_xy]|= error;
} }
} }
#if 1
/* handle not partitioned case */ /* handle not partitioned case */
if(!s->partitioned_frame){ if(!s->partitioned_frame){
for(i=0; i<s->mb_num; i++){ for(i=0; i<s->mb_num; i++){
@ -904,7 +900,6 @@ void ff_er_frame_end(MpegEncContext *s){
s->error_status_table[mb_xy]= error; s->error_status_table[mb_xy]= error;
} }
} }
#endif
dc_error= ac_error= mv_error=0; dc_error= ac_error= mv_error=0;
for(i=0; i<s->mb_num; i++){ for(i=0; i<s->mb_num; i++){
@ -1065,16 +1060,15 @@ void ff_er_frame_end(MpegEncContext *s){
s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3; s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3;
} }
} }
#if 1
/* guess DC for damaged blocks */ /* guess DC for damaged blocks */
guess_dc(s, s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride, 1); guess_dc(s, s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride, 1);
guess_dc(s, s->dc_val[1], s->mb_width , s->mb_height , s->mb_stride, 0); guess_dc(s, s->dc_val[1], s->mb_width , s->mb_height , s->mb_stride, 0);
guess_dc(s, s->dc_val[2], s->mb_width , s->mb_height , s->mb_stride, 0); guess_dc(s, s->dc_val[2], s->mb_width , s->mb_height , s->mb_stride, 0);
#endif
/* filter luma DC */ /* filter luma DC */
filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride); filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride);
#if 1
/* render DC only intra */ /* render DC only intra */
for(mb_y=0; mb_y<s->mb_height; mb_y++){ for(mb_y=0; mb_y<s->mb_height; mb_y++){
for(mb_x=0; mb_x<s->mb_width; mb_x++){ for(mb_x=0; mb_x<s->mb_width; mb_x++){
@ -1094,7 +1088,6 @@ void ff_er_frame_end(MpegEncContext *s){
put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y); put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y);
} }
} }
#endif
if(s->avctx->error_concealment&FF_EC_DEBLOCK){ if(s->avctx->error_concealment&FF_EC_DEBLOCK){
/* filter horizontal block boundaries */ /* filter horizontal block boundaries */

@ -997,7 +997,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){
} }
} }
#if 1
if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){ if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){
int list; int list;
for(list=0; list<h->list_count; list++){ for(list=0; list<h->list_count; list++){
@ -1172,7 +1171,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){
} }
} }
} }
#endif
h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
} }

@ -158,7 +158,6 @@ static int hpel_motion_search(MpegEncContext * s,
const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
+ (mv_penalty[bx - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor; + (mv_penalty[bx - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
#if 1
int key; int key;
int map_generation= c->map_generation; int map_generation= c->map_generation;
#ifndef NDEBUG #ifndef NDEBUG
@ -172,7 +171,6 @@ static int hpel_motion_search(MpegEncContext * s,
assert(map[(index+1)&(ME_MAP_SIZE-1)] == key); assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation; key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
assert(map[(index-1)&(ME_MAP_SIZE-1)] == key); assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
#endif
if(t<=b){ if(t<=b){
CHECK_HALF_MV(0, 1, mx ,my-1) CHECK_HALF_MV(0, 1, mx ,my-1)
if(l<=r){ if(l<=r){

@ -985,10 +985,9 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
if(level<=MAX_LEVEL && run<=MAX_RUN){ if(level<=MAX_LEVEL && run<=MAX_RUN){
s->ac_stats[s->mb_intra][n>3][level][run][last]++; s->ac_stats[s->mb_intra][n>3][level][run][last]++;
} }
#if 0
else
s->ac_stats[s->mb_intra][n > 3][40][63][0]++; //esc3 like s->ac_stats[s->mb_intra][n > 3][40][63][0]++; //esc3 like
#endif
code = get_rl_index(rl, last, run, level); code = get_rl_index(rl, last, run, level);
put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]); put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
if (code == rl->n) { if (code == rl->n) {

@ -897,7 +897,6 @@ QPEL_MC(0, avg_ , _ , op_avg)
#undef op_put #undef op_put
#undef op_put_no_rnd #undef op_put_no_rnd
#if 1
#define H264_LOWPASS(OPNAME, OP, OP2) \ #define H264_LOWPASS(OPNAME, OP, OP2) \
static inline void OPNAME ## h264_qpel_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,int w,int h){\ static inline void OPNAME ## h264_qpel_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,int w,int h){\
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\ uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
@ -1298,7 +1297,6 @@ H264_MC(avg_, 16)
#undef op_put #undef op_put
#undef op2_avg #undef op2_avg
#undef op2_put #undef op2_put
#endif
static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){ static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;

@ -3299,10 +3299,8 @@ static void iterative_me(SnowContext *s){
} }
best_rd= ref_rd; best_rd= ref_rd;
*block= ref_b; *block= ref_b;
#if 1
check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd); check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd);
//FIXME RD style color selection //FIXME RD style color selection
#endif
if(!same_block(block, &backup)){ if(!same_block(block, &backup)){
if(tb ) tb ->type &= ~BLOCK_OPT; if(tb ) tb ->type &= ~BLOCK_OPT;
if(lb ) lb ->type &= ~BLOCK_OPT; if(lb ) lb ->type &= ~BLOCK_OPT;

@ -175,7 +175,6 @@ static void build_frame_code(AVFormatContext *s){
} }
key_frame= intra_only; key_frame= intra_only;
#if 1
if(is_audio){ if(is_audio){
int frame_bytes= codec->frame_size*(int64_t)codec->bit_rate / (8*codec->sample_rate); int frame_bytes= codec->frame_size*(int64_t)codec->bit_rate / (8*codec->sample_rate);
int pts; int pts;
@ -199,7 +198,6 @@ static void build_frame_code(AVFormatContext *s){
ft->pts_delta=1; ft->pts_delta=1;
start2++; start2++;
} }
#endif
if(codec->has_b_frames){ if(codec->has_b_frames){
pred_count=5; pred_count=5;

@ -218,7 +218,6 @@ int main(void){
printf("\n"); printf("\n");
} }
#if 1
for(i=0; i<LEN; i++){ for(i=0; i<LEN; i++){
double v[LEN]; double v[LEN];
double error=0; double error=0;
@ -233,7 +232,7 @@ int main(void){
printf("%f ", error); printf("%f ", error);
} }
printf("\n"); printf("\n");
#endif
for(i=0; i<LEN; i++){ for(i=0; i<LEN; i++){
for(j=0; j<LEN; j++){ for(j=0; j<LEN; j++){
printf("%9.6f ", eigenvector[i + j*LEN]); printf("%9.6f ", eigenvector[i + j*LEN]);

Loading…
Cancel
Save