On Thu, Jun 23, 2016 at 8:46 AM, Diego Biurrun <di...@biurrun.de> wrote:
> ---
>
> This does not seem worth the ifdef soup to me.
>
>  libavcodec/msmpeg4dec.c | 25 -------------------------
>  1 file changed, 25 deletions(-)
>
> diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
> index 28187b3..a2d0ad4 100644
> --- a/libavcodec/msmpeg4dec.c
> +++ b/libavcodec/msmpeg4dec.c
> @@ -620,7 +620,6 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, 
> int *dir_ptr)
>      return level;
>  }
>
> -//#define ERROR_DETAILS
>  int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
>                                int n, int coded, const uint8_t *scan_table)
>  {
> @@ -750,12 +749,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>                      else         level= level * qmul - qadd;
>                      i+= run + 1;
>                      if(last) i+=192;
> -#ifdef ERROR_DETAILS
> -                if(run==66)
> -                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 
> level=%d\n", level);
> -                else if((i>62 && i<192) || i>192+63)
> -                    av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 
> i=%d run=%d level=%d\n", i, run, level);
> -#endif
>                  } else {
>                      /* second escape */
>                      SKIP_BITS(re, &s->gb, 2);
> @@ -763,12 +756,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>                      i+= run + rl->max_run[run>>7][level/qmul] + run_diff; 
> //FIXME opt indexing
>                      level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - 
> SHOW_SBITS(re, &s->gb, 1);
>                      LAST_SKIP_BITS(re, &s->gb, 1);
> -#ifdef ERROR_DETAILS
> -                if(run==66)
> -                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 
> level=%d\n", level);
> -                else if((i>62 && i<192) || i>192+63)
> -                    av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 
> i=%d run=%d level=%d\n", i, run, level);
> -#endif
>                  }
>              } else {
>                  /* first escape */
> @@ -778,23 +765,11 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>                  level = level + rl->max_level[run>>7][(run-1)&63] * 
> qmul;//FIXME opt indexing
>                  level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
> &s->gb, 1);
>                  LAST_SKIP_BITS(re, &s->gb, 1);
> -#ifdef ERROR_DETAILS
> -                if(run==66)
> -                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 
> level=%d\n", level);
> -                else if((i>62 && i<192) || i>192+63)
> -                    av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 
> i=%d run=%d level=%d\n", i, run, level);
> -#endif
>              }
>          } else {
>              i+= run;
>              level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
> &s->gb, 1);
>              LAST_SKIP_BITS(re, &s->gb, 1);
> -#ifdef ERROR_DETAILS
> -                if(run==66)
> -                    av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code 
> level=%d\n", level);
> -                else if((i>62 && i<192) || i>192+63)
> -                    av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d 
> level=%d\n", i, run, level);
> -#endif
>          }
>          if (i > 62){
>              i-= 192;
> --

how about replacing the #ifdefs with avctx->debug checks
-- 
Vittorio
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to