[FFmpeg-devel] [PATCH] remove disabled code part 1

Michael Niedermayer michaelni
Fri Aug 7 14:23:45 CEST 2009


On Fri, Aug 07, 2009 at 11:15:19AM +0200, Diego Biurrun wrote:
> I started looking into disabled code, there is lots of it and probably
> mostly cruft.  Here is a patch that removes it, starting at the top
> level and the tests subdirectory.  More patches shall follow later.
> 
> I will commit approved hunks only.
> 
> Diego

>  ffmpeg.c          |   33 ------------------
>  ffplay.c          |   98 ------------------------------------------------------
>  ffserver.c        |   52 ----------------------------
>  tests/tiny_psnr.c |   15 --------
>  tests/videogen.c  |    5 --
>  5 files changed, 203 deletions(-)
> f1e17a43064331b1a4deb1682e51d31aef80d404  if_zero_part1.diff
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 19605)
> +++ ffmpeg.c	(working copy)
> @@ -130,11 +130,6 @@
>  static float video_qscale = 0;
>  static uint16_t *intra_matrix = NULL;
>  static uint16_t *inter_matrix = NULL;
> -#if 0 //experimental, (can be removed)
> -static float video_rc_qsquish=1.0;
> -static float video_rc_qmod_amp=0;
> -static int video_rc_qmod_freq=0;
> -#endif
>  static const char *video_rc_override_string=NULL;
>  static int video_disable = 0;
>  static int video_discard = 0;
> @@ -1401,12 +1396,6 @@
>                  if (ost->source_index == ist_index) {
>                      os = output_files[ost->file_index];
>  
> -#if 0
> -                    printf("%d: got pts=%0.3f %0.3f\n", i,
> -                           (double)pkt->pts / AV_TIME_BASE,
> -                           ((double)ist->pts / AV_TIME_BASE) -
> -                           ((double)ost->st->pts.val * ost->st->time_base.num / ost->st->time_base.den));
> -#endif
>                      /* set the input output pts pairs */
>                      //ost->sync_ipts = (double)(ist->pts + input_files_ts_offset[ist->file_index] - start_time)/ AV_TIME_BASE;
>  
> @@ -2371,28 +2360,6 @@
>      return ret;
>  }
>  
> -#if 0
> -int file_read(const char *filename)
> -{
> -    URLContext *h;
> -    unsigned char buffer[1024];
> -    int len, i;
> -
> -    if (url_open(&h, filename, O_RDONLY) < 0) {
> -        printf("could not open '%s'\n", filename);
> -        return -1;
> -    }
> -    for(;;) {
> -        len = url_read(h, buffer, sizeof(buffer));
> -        if (len <= 0)
> -            break;
> -        for(i=0;i<len;i++) putchar(buffer[i]);
> -    }
> -    url_close(h);
> -    return 0;
> -}
> -#endif
> -
>  static void opt_format(const char *arg)
>  {
>      /* compatibility stuff for pgmyuv */
> Index: tests/videogen.c
> ===================================================================
> --- tests/videogen.c	(revision 19605)
> +++ tests/videogen.c	(working copy)
> @@ -273,11 +273,6 @@
>          exit(1);
>      }
>  
> -#if 0
> -    for(i=0;i<256;i++)
> -        printf("cos(%d)=%d\n", i, int_cos(i));
> -#endif
> -
>      w = DEFAULT_WIDTH;
>      h = DEFAULT_HEIGHT;
>  

ok



> Index: tests/tiny_psnr.c
> ===================================================================
> --- tests/tiny_psnr.c	(revision 19605)
> +++ tests/tiny_psnr.c	(working copy)
> @@ -51,21 +51,6 @@
>   582360139072LL,
>  };
>  
> -#if 0
> -// 16.16 fixpoint exp()
> -static unsigned int exp16(unsigned int a){
> -    int i;
> -    int out= 1<<16;
> -
> -    for(i=19;i>=0;i--){
> -        if(a&(1<<i))
> -            out= (out*exp16_table[i] + (1<<15))>>16;
> -    }
> -
> -    return out;
> -}
> -#endif
> -
>  // 16.16 fixpoint log()
>  static int64_t log16(uint64_t a){
>      int i;

id like to keep this one

[...]
> @@ -1171,23 +1095,6 @@
>      if (vp->bmp)
>          SDL_FreeYUVOverlay(vp->bmp);
>  
> -#if 0
> -    /* XXX: use generic function */
> -    /* XXX: disable overlay if no hardware acceleration or if RGB format */
> -    switch(is->video_st->codec->pix_fmt) {
> -    case PIX_FMT_YUV420P:
> -    case PIX_FMT_YUV422P:
> -    case PIX_FMT_YUV444P:
> -    case PIX_FMT_YUYV422:
> -    case PIX_FMT_YUV410P:
> -    case PIX_FMT_YUV411P:
> -        is_yuv = 1;
> -        break;
> -    default:
> -        is_yuv = 0;
> -        break;
> -    }
> -#endif
>      vp->bmp = SDL_CreateYUVOverlay(is->video_st->codec->width,
>                                     is->video_st->codec->height,
>                                     SDL_YV12_OVERLAY,

ok


> @@ -1538,11 +1445,6 @@
>                          samples_size = wanted_size;
>                      }
>                  }
> -#if 0
> -                printf("diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
> -                       diff, avg_diff, samples_size - samples_size1,
> -                       is->audio_clock, is->video_clock, is->audio_diff_threshold);
> -#endif
>              }
>          } else {
>              /* too big difference : may be initial PTS errors, so

appears as if it could be usefull


> Index: ffserver.c
> ===================================================================
> --- ffserver.c	(revision 19605)
> +++ ffserver.c	(working copy)

no maintained by me

remaining hunks i didnt comment on are "dont know what it does exactly / not
sure if usefull"

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090807/b6ed34ff/attachment.pgp>



More information about the ffmpeg-devel mailing list