OSDN Git Service

clean up crufty legacy code
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 23 Oct 2010 19:11:31 +0000 (19:11 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 23 Oct 2010 19:11:31 +0000 (19:11 +0000)
remove unused code relating to avi, ogm, psp, ipod, and forcing h264 levels

git-svn-id: svn://localhost/HandBrake/trunk@3622 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/common.c
libhb/common.h
libhb/encavcodec.c
libhb/encx264.c
libhb/muxcommon.c
libhb/muxmp4.c
libhb/work.c
test/test.c

index d800267..9c6120a 100644 (file)
@@ -488,16 +488,8 @@ int hb_calc_bitrate( hb_job_t * job, int size )
        (quite guessed) */
     switch( job->mux )
     {
-       case HB_MUX_MP4:
-       case HB_MUX_PSP:
-               case HB_MUX_IPOD:
-               case HB_MUX_MKV:
-            overhead = 6;
-            break;
-        case HB_MUX_AVI:
-            overhead = 24;
-            break;
-        case HB_MUX_OGM:
+        case HB_MUX_MP4:
+        case HB_MUX_MKV:
             overhead = 6;
             break;
         default:
index 7383bf6..bb394c4 100644 (file)
@@ -220,7 +220,6 @@ struct hb_job_s
          vrate, vrate_base: output framerate is vrate / vrate_base
          cfr:               0 (vfr), 1 (cfr), 2 (pfr) [see render.c]
          pass:              0, 1 or 2 (or -1 for scan)
-         h264_level:        vestigial boolean to decide if we're encoding for iPod
          x264opts:          string of extra x264 options
          areBframes:        boolean to note if b-frames are included in x264opts */
 #define HB_VCODEC_MASK   0x0000FF
@@ -236,8 +235,6 @@ struct hb_job_s
     int             vfr;
     int             cfr;
     int             pass;
-    int             h264_13;
-    int             h264_level;
     char            *x264opts;
     int             areBframes;
     int             color_matrix;
@@ -253,10 +250,6 @@ struct hb_job_s
          file: file path */
 #define HB_MUX_MASK 0xFF0000
 #define HB_MUX_MP4  0x010000
-#define HB_MUX_PSP  0x020000
-#define HB_MUX_AVI  0x040000
-#define HB_MUX_OGM  0x080000
-#define HB_MUX_IPOD 0x100000
 #define HB_MUX_MKV  0x200000
 
     int             mux;
index 5ae5a39..eaf7b70 100644 (file)
@@ -115,14 +115,10 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
                 job->anamorphic.par_width, job->anamorphic.par_height );
     }
 
-    if( job->mux & ( HB_MUX_MP4 | HB_MUX_PSP ) )
+    if( job->mux & HB_MUX_MP4 )
     {
         context->flags |= CODEC_FLAG_GLOBAL_HEADER;
     }
-    if( job->mux & HB_MUX_PSP )
-    {
-        context->flags |= CODEC_FLAG_BITEXACT;
-    }
     if( job->grayscale )
     {
         context->flags |= CODEC_FLAG_GRAY;
@@ -164,7 +160,7 @@ int encavcodecInit( hb_work_object_t * w, hb_job_t * job )
     }
     pv->context = context;
 
-    if( ( job->mux & ( HB_MUX_MP4 | HB_MUX_PSP ) ) && job->pass != 1 )
+    if( ( job->mux & HB_MUX_MP4 ) && job->pass != 1 )
     {
 #if 0
         /* Hem hem */
index 2a3c2b6..83d3eda 100644 (file)
@@ -169,13 +169,6 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
     }
 
     param.i_log_level  = X264_LOG_INFO;
-    if( job->h264_level )
-    {
-        param.b_cabac     = 0;
-        param.i_level_idc = job->h264_level;
-        hb_log( "encx264: encoding at level %i",
-                param.i_level_idc );
-    }
     
     /*
                This section passes the string x264opts to libx264 for parsing into
@@ -426,16 +419,6 @@ static hb_buffer_t *nal_encode( hb_work_object_t *w, x264_picture_t *pic_out,
             continue;
         }
 
-        if( job->mux & HB_MUX_AVI )
-        {
-            if( nal[i].i_ref_idc == NAL_PRIORITY_HIGHEST )
-            {
-                buf->frametype = HB_FRAME_KEY;
-            }
-            buf->size += size;
-            continue;
-        }
-
         /* H.264 in .mp4 or .mkv */
         switch( nal[i].i_type )
         {
index ca7e20a..f47b442 100644 (file)
@@ -451,16 +451,8 @@ hb_work_object_t * hb_muxer_init( hb_job_t * job )
         switch( job->mux )
         {
         case HB_MUX_MP4:
-        case HB_MUX_PSP:
-        case HB_MUX_IPOD:
             mux->m = hb_mux_mp4_init( job );
             break;
-        case HB_MUX_AVI:
-            mux->m = hb_mux_avi_init( job );
-            break;
-        case HB_MUX_OGM:
-            mux->m = hb_mux_ogm_init( job );
-            break;
         case HB_MUX_MKV:
             mux->m = hb_mux_mkv_init( job );
             break;
index 3580a54..7cd4e0f 100644 (file)
@@ -148,7 +148,7 @@ static int MP4Init( hb_mux_object_t * m )
         MP4AddH264PictureParameterSet( m->file, mux_data->track,
                 job->config.h264.pps, job->config.h264.pps_length );
 
-               if( job->h264_level == 30 || job->ipod_atom)
+               if( job->ipod_atom )
                {
                        hb_deep_log( 2, "muxmp4: adding iPod atom");
                        MP4AddIPodUUID(m->file, mux_data->track);
index ebbc408..cf8d4d4 100644 (file)
@@ -183,17 +183,9 @@ void hb_display_job_info( hb_job_t * job )
                 hb_log( "     + custom color matrix: %s", job->color_matrix == 1 ? "ITU Bt.601 (SD)" : "ITU Bt.709 (HD)");
             break;
 
-        case HB_MUX_AVI:
-            hb_log("   + container: AVI");
-            break;
-
         case HB_MUX_MKV:
             hb_log("   + container: Matroska (.mkv)");
             break;
-
-        case HB_MUX_OGM:
-            hb_log("   + conttainer: Ogg Media (.ogm)");
-            break;
     }
 
     if( job->chapter_markers )
@@ -478,16 +470,6 @@ static void do_job( hb_job_t * job, int cpu_count )
         hb_log( "New dimensions %i * %i", job->width, job->height );
     }
 
-    if( job->mux & HB_MUX_AVI )
-    {
-        // The concept of variable frame rate video was a bit too advanced
-        // for Microsoft so AVI doesn't support it. Since almost all dvd
-        // video is VFR we have to convert it to constant frame rate to
-        // put it in an AVI container. So duplicate, drop and
-        // otherwise trash video frames to appease the gods of Redmond.
-        job->cfr = 1;
-    }
-
     if ( job->cfr == 0 )
     {
         /* Ensure we're using "Same as source" FPS */
index 2af2408..a2a8b55 100644 (file)
@@ -62,8 +62,6 @@ static int    rotate                = 0;
 static char * rotate_opt            = 0;
 static int    grayscale   = 0;
 static int    vcodec      = HB_VCODEC_FFMPEG;
-static int    h264_13     = 0;
-static int    h264_30     = 0;
 static hb_list_t * audios = NULL;
 static hb_audio_config_t * audio = NULL;
 static int    num_audio_tracks = 0;
@@ -1356,14 +1354,6 @@ static int HandleEvents( hb_handle_t * h )
             {
                 job->vcodec = vcodec;
             }
-            if( h264_13 )
-            {
-                job->h264_level = 13;
-            }
-               if( h264_30 )
-               {
-                   job->h264_level = 30;
-            }
             if( vrate )
             {
                 job->cfr = cfr;
@@ -3081,16 +3071,6 @@ static int ParseOptions( int argc, char ** argv )
                 {
                     vcodec = HB_VCODEC_X264;
                 }
-                else if( !strcasecmp( optarg, "x264b13" ) )
-                {
-                    vcodec = HB_VCODEC_X264;
-                    h264_13 = 1;
-                }
-                else if( !strcasecmp( optarg, "x264b30" ) )
-                {
-                    vcodec = HB_VCODEC_X264;
-                    h264_30 = 1;
-                }
                 else if( !strcasecmp( optarg, "theora" ) )
                 {
                     vcodec = HB_VCODEC_THEORA;
@@ -3382,12 +3362,9 @@ static int CheckOptions( int argc, char ** argv )
 
             /* autodetect */
             if( p && ( !strcasecmp( p, ".mp4" )  ||
-                            !strcasecmp( p, ".m4v" ) ) )
+                       !strcasecmp( p, ".m4v" ) ) )
             {
-                if ( h264_30 == 1 )
-                    mux = HB_MUX_IPOD;
-                else
-                    mux = HB_MUX_MP4;
+                mux = HB_MUX_MP4;
             }
             else if( p && !strcasecmp(p, ".mkv" ) )
             {
@@ -3407,10 +3384,7 @@ static int CheckOptions( int argc, char ** argv )
         else if( !strcasecmp( format, "mp4" ) ||
                  !strcasecmp( format, "m4v" ) )
         {
-            if ( h264_30 == 1)
-                mux = HB_MUX_IPOD;
-            else
-                mux = HB_MUX_MP4;
+            mux = HB_MUX_MP4;
         }
         else if( !strcasecmp( format, "mkv" ) )
         {