[FFmpeg-cvslog] r17369 - in trunk/libavcodec: error_resilience.c mpegvideo.c

diego subversion
Mon Feb 16 12:49:08 CET 2009


Author: diego
Date: Mon Feb 16 12:49:08 2009
New Revision: 17369

Log:
Get rid of some '#if CONFIG_MPEG_XVMC_DECODER' preprocessor checks around if
statements by merging the CONFIG_MPEG_XVMC_DECODER check into the if condition.

Modified:
   trunk/libavcodec/error_resilience.c
   trunk/libavcodec/mpegvideo.c

Modified: trunk/libavcodec/error_resilience.c
==============================================================================
--- trunk/libavcodec/error_resilience.c	Mon Feb 16 12:35:38 2009	(r17368)
+++ trunk/libavcodec/error_resilience.c	Mon Feb 16 12:49:08 2009	(r17369)
@@ -563,10 +563,9 @@ static int is_intra_more_likely(MpegEncC
 
     if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction
 
-#if CONFIG_MPEG_XVMC_DECODER
     //prevent dsp.sad() check, that requires access to the image
-    if(s->avctx->xvmc_acceleration && s->pict_type==FF_I_TYPE) return 1;
-#endif
+    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration && s->pict_type == FF_I_TYPE)
+        return 1;
 
     skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs
     is_intra_likely=0;
@@ -935,10 +934,9 @@ void ff_er_frame_end(MpegEncContext *s){
     }else
         guess_mv(s);
 
-#if CONFIG_MPEG_XVMC_DECODER
     /* the filters below are not XvMC compatible, skip them */
-    if(s->avctx->xvmc_acceleration) goto ec_clean;
-#endif
+    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
+        goto ec_clean;
     /* fill DC for inter blocks */
     for(mb_y=0; mb_y<s->mb_height; mb_y++){
         for(mb_x=0; mb_x<s->mb_width; mb_x++){
@@ -1024,9 +1022,7 @@ void ff_er_frame_end(MpegEncContext *s){
         v_block_filter(s, s->current_picture.data[2], s->mb_width  , s->mb_height  , s->uvlinesize, 0);
     }
 
-#if CONFIG_MPEG_XVMC_DECODER
 ec_clean:
-#endif
     /* clean a few tables */
     for(i=0; i<s->mb_num; i++){
         const int mb_xy= s->mb_index2xy[i];

Modified: trunk/libavcodec/mpegvideo.c
==============================================================================
--- trunk/libavcodec/mpegvideo.c	Mon Feb 16 12:35:38 2009	(r17368)
+++ trunk/libavcodec/mpegvideo.c	Mon Feb 16 12:49:08 2009	(r17369)
@@ -936,10 +936,9 @@ alloc:
         update_noise_reduction(s);
     }
 
-#if CONFIG_MPEG_XVMC_DECODER
-    if(s->avctx->xvmc_acceleration)
+    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
         return ff_xvmc_field_start(s, avctx);
-#endif
+
     return 0;
 }
 
@@ -948,12 +947,10 @@ void MPV_frame_end(MpegEncContext *s)
 {
     int i;
     /* draw edge for correct motion prediction if outside */
-#if CONFIG_MPEG_XVMC_DECODER
 //just to make sure that all data is rendered.
-    if(s->avctx->xvmc_acceleration){
+    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
         ff_xvmc_field_end(s);
     }else
-#endif
     if(!(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
        && s->unrestricted_mv
        && s->current_picture.reference
@@ -1733,12 +1730,10 @@ void MPV_decode_mb_internal(MpegEncConte
 {
     int mb_x, mb_y;
     const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
-#if CONFIG_MPEG_XVMC_DECODER
-    if(s->avctx->xvmc_acceleration){
+    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){
         ff_xvmc_decode_mb(s);//xvmc uses pblocks
         return;
     }
-#endif
 
     mb_x = s->mb_x;
     mb_y = s->mb_y;




More information about the ffmpeg-cvslog mailing list