[FFmpeg-cvslog] Eliminate pointless '#if 1' statements without matching '#else'.
Diego Biurrun
git at videolan.org
Wed Apr 27 03:56:16 CEST 2011
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Apr 26 13:52:12 2011 +0200| [e6ff064845d02c43526c8a56dab121c219f16659] | committer: Diego Biurrun
Eliminate pointless '#if 1' statements without matching '#else'.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6ff064845d02c43526c8a56dab121c219f16659
---
ffserver.c | 2 --
libavcodec/dct-test.c | 5 +----
libavcodec/dsputil.c | 2 --
libavcodec/error_resilience.c | 17 +++++------------
libavcodec/h264.h | 2 --
libavcodec/motion_est_template.c | 2 --
libavcodec/msmpeg4.c | 7 +++----
libavcodec/sh4/qpel.c | 2 --
libavcodec/snow.c | 2 --
libavformat/nutenc.c | 2 --
libavutil/pca.c | 3 +--
11 files changed, 10 insertions(+), 36 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 829eb2e..fe030b9 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2185,10 +2185,8 @@ static int open_input_stream(HTTPContext *c, const char *info)
}
}
-#if 1
if (c->fmt_in->iformat->read_seek)
av_seek_frame(c->fmt_in, -1, stream_pos, 0);
-#endif
/* set the start time (needed for maxtime and RTP packet timing) */
c->start_time = cur_time;
c->first_pts = AV_NOPTS_VALUE;
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index e943d6a..c3c376e 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -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]));
-#if 1 // dump systematic errors
for(i=0; i<64; i++){
if(i%8==0) printf("\n");
printf("%7d ", (int)sysErr[i]);
}
printf("\n");
-#endif
printf("%s %s: err_inf=%d err2=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n",
is_idct ? "IDCT" : "DCT",
name, err_inf, (double)err2 / NB_ITS / 64.0, (double)sysErrMax / NB_ITS, maxout, blockSumErrMax);
-#if 1 //Speed test
+
/* speed test */
for(i=0;i<64;i++)
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",
is_idct ? "IDCT" : "DCT",
name, (double)it1 * 1000.0 / (double)ti1);
-#endif
}
DECLARE_ALIGNED(8, static uint8_t, img_dest)[64];
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 215c1e4..dbfc8ce 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -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_qpel16_mc00_c ff_put_pixels16x16_c
-#if 1
#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){\
const int h=2;\
@@ -2522,7 +2521,6 @@ H264_MC(avg_, 16)
#undef op_put
#undef op2_avg
#undef op2_put
-#endif
#define put_h264_qpel8_mc00_c ff_put_pixels8x8_c
#define avg_h264_qpel8_mc00_c ff_avg_pixels8x8_c
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index d4d5839..e0b64b0 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -786,7 +786,6 @@ void ff_er_frame_end(MpegEncContext *s){
}
}
-#if 1
/* handle overlapping slices */
for(error_type=1; error_type<=3; error_type++){
int end_ok=0;
@@ -807,8 +806,7 @@ void ff_er_frame_end(MpegEncContext *s){
end_ok=0;
}
}
-#endif
-#if 1
+
/* handle slices with partitions of different length */
if(s->partitioned_frame){
int end_ok=0;
@@ -829,7 +827,7 @@ void ff_er_frame_end(MpegEncContext *s){
end_ok=0;
}
}
-#endif
+
/* handle missing slices */
if(s->error_recognition>=4){
int end_ok=1;
@@ -853,7 +851,6 @@ void ff_er_frame_end(MpegEncContext *s){
}
}
-#if 1
/* backward mark errors */
distance=9999999;
for(error_type=1; error_type<=3; error_type++){
@@ -878,7 +875,6 @@ void ff_er_frame_end(MpegEncContext *s){
distance= 9999999;
}
}
-#endif
/* forward mark errors */
error=0;
@@ -893,7 +889,7 @@ void ff_er_frame_end(MpegEncContext *s){
s->error_status_table[mb_xy]|= error;
}
}
-#if 1
+
/* handle not partitioned case */
if(!s->partitioned_frame){
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;
}
}
-#endif
dc_error= ac_error= mv_error=0;
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;
}
}
-#if 1
+
/* 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[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);
-#endif
+
/* filter luma DC */
filter181(s->dc_val[0], s->mb_width*2, s->mb_height*2, s->b8_stride);
-#if 1
/* render DC only intra */
for(mb_y=0; mb_y<s->mb_height; mb_y++){
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);
}
}
-#endif
if(s->avctx->error_concealment&FF_EC_DEBLOCK){
/* filter horizontal block boundaries */
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 96720ac..f22454b 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -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)){
int 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]);
}
diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c
index faf03d2..09ec9f7 100644
--- a/libavcodec/motion_est_template.c
+++ b/libavcodec/motion_est_template.c
@@ -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)]
+ (mv_penalty[bx - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
-#if 1
int key;
int map_generation= c->map_generation;
#ifndef NDEBUG
@@ -172,7 +171,6 @@ static int hpel_motion_search(MpegEncContext * s,
assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
-#endif
if(t<=b){
CHECK_HALF_MV(0, 1, mx ,my-1)
if(l<=r){
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 0dba8d9..85713b5 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -985,10 +985,9 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
if(level<=MAX_LEVEL && run<=MAX_RUN){
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
-#endif
+
+ s->ac_stats[s->mb_intra][n > 3][40][63][0]++; //esc3 like
+
code = get_rl_index(rl, last, run, level);
put_bits(&s->pb, rl->table_vlc[code][1], rl->table_vlc[code][0]);
if (code == rl->n) {
diff --git a/libavcodec/sh4/qpel.c b/libavcodec/sh4/qpel.c
index ff88b76..3242872 100644
--- a/libavcodec/sh4/qpel.c
+++ b/libavcodec/sh4/qpel.c
@@ -897,7 +897,6 @@ QPEL_MC(0, avg_ , _ , op_avg)
#undef op_put
#undef op_put_no_rnd
-#if 1
#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){\
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
@@ -1298,7 +1297,6 @@ H264_MC(avg_, 16)
#undef op_put
#undef op2_avg
#undef op2_put
-#endif
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;
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 42145f5..7e862f2 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -3299,10 +3299,8 @@ static void iterative_me(SnowContext *s){
}
best_rd= ref_rd;
*block= ref_b;
-#if 1
check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd);
//FIXME RD style color selection
-#endif
if(!same_block(block, &backup)){
if(tb ) tb ->type &= ~BLOCK_OPT;
if(lb ) lb ->type &= ~BLOCK_OPT;
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index c17a15d..df5dc6f 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -175,7 +175,6 @@ static void build_frame_code(AVFormatContext *s){
}
key_frame= intra_only;
-#if 1
if(is_audio){
int frame_bytes= codec->frame_size*(int64_t)codec->bit_rate / (8*codec->sample_rate);
int pts;
@@ -199,7 +198,6 @@ static void build_frame_code(AVFormatContext *s){
ft->pts_delta=1;
start2++;
}
-#endif
if(codec->has_b_frames){
pred_count=5;
diff --git a/libavutil/pca.c b/libavutil/pca.c
index 770dc8d..56bf707 100644
--- a/libavutil/pca.c
+++ b/libavutil/pca.c
@@ -218,7 +218,6 @@ int main(void){
printf("\n");
}
-#if 1
for(i=0; i<LEN; i++){
double v[LEN];
double error=0;
@@ -233,7 +232,7 @@ int main(void){
printf("%f ", error);
}
printf("\n");
-#endif
+
for(i=0; i<LEN; i++){
for(j=0; j<LEN; j++){
printf("%9.6f ", eigenvector[i + j*LEN]);
More information about the ffmpeg-cvslog
mailing list