Browse code

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

Diego Biurrun authored on 2011/04/26 20:52:12
Showing 11 changed files
... ...
@@ -2185,10 +2185,8 @@ static int open_input_stream(HTTPContext *c, const char *info)
2185 2185
         }
2186 2186
     }
2187 2187
 
2188
-#if 1
2189 2188
     if (c->fmt_in->iformat->read_seek)
2190 2189
         av_seek_frame(c->fmt_in, -1, stream_pos, 0);
2191
-#endif
2192 2190
     /* set the start time (needed for maxtime and RTP packet timing) */
2193 2191
     c->start_time = cur_time;
2194 2192
     c->first_pts = AV_NOPTS_VALUE;
... ...
@@ -312,18 +312,16 @@ static void dct_error(const char *name, int is_idct,
312 312
     }
313 313
     for(i=0; i<64; i++) sysErrMax= FFMAX(sysErrMax, FFABS(sysErr[i]));
314 314
 
315
-#if 1 // dump systematic errors
316 315
     for(i=0; i<64; i++){
317 316
         if(i%8==0) printf("\n");
318 317
         printf("%7d ", (int)sysErr[i]);
319 318
     }
320 319
     printf("\n");
321
-#endif
322 320
 
323 321
     printf("%s %s: err_inf=%d err2=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n",
324 322
            is_idct ? "IDCT" : "DCT",
325 323
            name, err_inf, (double)err2 / NB_ITS / 64.0, (double)sysErrMax / NB_ITS, maxout, blockSumErrMax);
326
-#if 1 //Speed test
324
+
327 325
     /* speed test */
328 326
     for(i=0;i<64;i++)
329 327
         block1[i] = 0;
... ...
@@ -376,7 +374,6 @@ static void dct_error(const char *name, int is_idct,
376 376
     printf("%s %s: %0.1f kdct/s\n",
377 377
            is_idct ? "IDCT" : "DCT",
378 378
            name, (double)it1 * 1000.0 / (double)ti1);
379
-#endif
380 379
 }
381 380
 
382 381
 DECLARE_ALIGNED(8, static uint8_t, img_dest)[64];
... ...
@@ -2100,7 +2100,6 @@ QPEL_MC(0, avg_       , _       , op_avg)
2100 2100
 #define put_no_rnd_qpel8_mc00_c  ff_put_pixels8x8_c
2101 2101
 #define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
2102 2102
 
2103
-#if 1
2104 2103
 #define H264_LOWPASS(OPNAME, OP, OP2) \
2105 2104
 static av_unused void OPNAME ## h264_qpel2_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
2106 2105
     const int h=2;\
... ...
@@ -2522,7 +2521,6 @@ H264_MC(avg_, 16)
2522 2522
 #undef op_put
2523 2523
 #undef op2_avg
2524 2524
 #undef op2_put
2525
-#endif
2526 2525
 
2527 2526
 #define put_h264_qpel8_mc00_c  ff_put_pixels8x8_c
2528 2527
 #define avg_h264_qpel8_mc00_c  ff_avg_pixels8x8_c
... ...
@@ -786,7 +786,6 @@ void ff_er_frame_end(MpegEncContext *s){
786 786
         }
787 787
     }
788 788
 
789
-#if 1
790 789
     /* handle overlapping slices */
791 790
     for(error_type=1; error_type<=3; error_type++){
792 791
         int end_ok=0;
... ...
@@ -807,8 +806,7 @@ void ff_er_frame_end(MpegEncContext *s){
807 807
                 end_ok=0;
808 808
         }
809 809
     }
810
-#endif
811
-#if 1
810
+
812 811
     /* handle slices with partitions of different length */
813 812
     if(s->partitioned_frame){
814 813
         int end_ok=0;
... ...
@@ -829,7 +827,7 @@ void ff_er_frame_end(MpegEncContext *s){
829 829
                 end_ok=0;
830 830
         }
831 831
     }
832
-#endif
832
+
833 833
     /* handle missing slices */
834 834
     if(s->error_recognition>=4){
835 835
         int end_ok=1;
... ...
@@ -853,7 +851,6 @@ void ff_er_frame_end(MpegEncContext *s){
853 853
         }
854 854
     }
855 855
 
856
-#if 1
857 856
     /* backward mark errors */
858 857
     distance=9999999;
859 858
     for(error_type=1; error_type<=3; error_type++){
... ...
@@ -878,7 +875,6 @@ void ff_er_frame_end(MpegEncContext *s){
878 878
                 distance= 9999999;
879 879
         }
880 880
     }
881
-#endif
882 881
 
883 882
     /* forward mark errors */
884 883
     error=0;
... ...
@@ -893,7 +889,7 @@ void ff_er_frame_end(MpegEncContext *s){
893 893
             s->error_status_table[mb_xy]|= error;
894 894
         }
895 895
     }
896
-#if 1
896
+
897 897
     /* handle not partitioned case */
898 898
     if(!s->partitioned_frame){
899 899
         for(i=0; i<s->mb_num; i++){
... ...
@@ -904,7 +900,6 @@ void ff_er_frame_end(MpegEncContext *s){
904 904
             s->error_status_table[mb_xy]= error;
905 905
         }
906 906
     }
907
-#endif
908 907
 
909 908
     dc_error= ac_error= mv_error=0;
910 909
     for(i=0; i<s->mb_num; i++){
... ...
@@ -1065,16 +1060,15 @@ void ff_er_frame_end(MpegEncContext *s){
1065 1065
             s->dc_val[2][mb_x + mb_y*s->mb_stride]= (dcv+4)>>3;
1066 1066
         }
1067 1067
     }
1068
-#if 1
1068
+
1069 1069
     /* guess DC for damaged blocks */
1070 1070
     guess_dc(s, s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride, 1);
1071 1071
     guess_dc(s, s->dc_val[1], s->mb_width  , s->mb_height  , s->mb_stride, 0);
1072 1072
     guess_dc(s, s->dc_val[2], s->mb_width  , s->mb_height  , s->mb_stride, 0);
1073
-#endif
1073
+
1074 1074
     /* filter luma DC */
1075 1075
     filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride);
1076 1076
 
1077
-#if 1
1078 1077
     /* render DC only intra */
1079 1078
     for(mb_y=0; mb_y<s->mb_height; mb_y++){
1080 1079
         for(mb_x=0; mb_x<s->mb_width; mb_x++){
... ...
@@ -1094,7 +1088,6 @@ void ff_er_frame_end(MpegEncContext *s){
1094 1094
             put_dc(s, dest_y, dest_cb, dest_cr, mb_x, mb_y);
1095 1095
         }
1096 1096
     }
1097
-#endif
1098 1097
 
1099 1098
     if(s->avctx->error_concealment&FF_EC_DEBLOCK){
1100 1099
         /* filter horizontal block boundaries */
... ...
@@ -997,7 +997,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){
997 997
     }
998 998
     }
999 999
 
1000
-#if 1
1001 1000
     if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){
1002 1001
         int list;
1003 1002
         for(list=0; list<h->list_count; list++){
... ...
@@ -1172,7 +1171,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){
1172 1172
             }
1173 1173
         }
1174 1174
     }
1175
-#endif
1176 1175
 
1177 1176
         h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
1178 1177
 }
... ...
@@ -158,7 +158,6 @@ static int hpel_motion_search(MpegEncContext * s,
158 158
         const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
159 159
                      + (mv_penalty[bx   - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
160 160
 
161
-#if 1
162 161
         int key;
163 162
         int map_generation= c->map_generation;
164 163
 #ifndef NDEBUG
... ...
@@ -172,7 +171,6 @@ static int hpel_motion_search(MpegEncContext * s,
172 172
         assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
173 173
         key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
174 174
         assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
175
-#endif
176 175
         if(t<=b){
177 176
             CHECK_HALF_MV(0, 1, mx  ,my-1)
178 177
             if(l<=r){
... ...
@@ -985,10 +985,9 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
985 985
             if(level<=MAX_LEVEL && run<=MAX_RUN){
986 986
                 s->ac_stats[s->mb_intra][n>3][level][run][last]++;
987 987
             }
988
-#if 0
989
-else
990
-    s->ac_stats[s->mb_intra][n>3][40][63][0]++; //esc3 like
991
-#endif
988
+
989
+            s->ac_stats[s->mb_intra][n > 3][40][63][0]++; //esc3 like
990
+
992 991
             code = get_rl_index(rl, last, run, level);
993 992
             put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
994 993
             if (code == rl->n) {
... ...
@@ -897,7 +897,6 @@ QPEL_MC(0, avg_       , _       , op_avg)
897 897
 #undef op_put
898 898
 #undef op_put_no_rnd
899 899
 
900
-#if 1
901 900
 #define H264_LOWPASS(OPNAME, OP, OP2) \
902 901
 static inline void OPNAME ## h264_qpel_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride,int w,int h){\
903 902
     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
... ...
@@ -1298,7 +1297,6 @@ H264_MC(avg_, 16)
1298 1298
 #undef op_put
1299 1299
 #undef op2_avg
1300 1300
 #undef op2_put
1301
-#endif
1302 1301
 
1303 1302
 static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){
1304 1303
     uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
... ...
@@ -3299,10 +3299,8 @@ static void iterative_me(SnowContext *s){
3299 3299
                 }
3300 3300
                 best_rd= ref_rd;
3301 3301
                 *block= ref_b;
3302
-#if 1
3303 3302
                 check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd);
3304 3303
                 //FIXME RD style color selection
3305
-#endif
3306 3304
                 if(!same_block(block, &backup)){
3307 3305
                     if(tb ) tb ->type &= ~BLOCK_OPT;
3308 3306
                     if(lb ) lb ->type &= ~BLOCK_OPT;
... ...
@@ -175,7 +175,6 @@ static void build_frame_code(AVFormatContext *s){
175 175
         }
176 176
 
177 177
         key_frame= intra_only;
178
-#if 1
179 178
         if(is_audio){
180 179
             int frame_bytes= codec->frame_size*(int64_t)codec->bit_rate / (8*codec->sample_rate);
181 180
             int pts;
... ...
@@ -199,7 +198,6 @@ static void build_frame_code(AVFormatContext *s){
199 199
             ft->pts_delta=1;
200 200
             start2++;
201 201
         }
202
-#endif
203 202
 
204 203
         if(codec->has_b_frames){
205 204
             pred_count=5;
... ...
@@ -218,7 +218,6 @@ int main(void){
218 218
         printf("\n");
219 219
     }
220 220
 
221
-#if 1
222 221
     for(i=0; i<LEN; i++){
223 222
         double v[LEN];
224 223
         double error=0;
... ...
@@ -233,7 +232,7 @@ int main(void){
233 233
         printf("%f ", error);
234 234
     }
235 235
     printf("\n");
236
-#endif
236
+
237 237
     for(i=0; i<LEN; i++){
238 238
         for(j=0; j<LEN; j++){
239 239
             printf("%9.6f ", eigenvector[i + j*LEN]);