diff options
author | jstebbins <[email protected]> | 2010-10-23 19:11:31 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-10-23 19:11:31 +0000 |
commit | 71339bee34b6dbc248ee2027ead281369f02024c (patch) | |
tree | ff7459e51ab72d48a58b4b0a5bb59284523f7eca | |
parent | a31c919e771257d81192439f3afcea0f444a27bc (diff) |
clean up crufty legacy code
remove unused code relating to avi, ogm, psp, ipod, and forcing h264 levels
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3622 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/common.c | 12 | ||||
-rw-r--r-- | libhb/common.h | 7 | ||||
-rw-r--r-- | libhb/encavcodec.c | 8 | ||||
-rw-r--r-- | libhb/encx264.c | 17 | ||||
-rw-r--r-- | libhb/muxcommon.c | 8 | ||||
-rw-r--r-- | libhb/muxmp4.c | 2 | ||||
-rw-r--r-- | libhb/work.c | 18 | ||||
-rw-r--r-- | test/test.c | 32 |
8 files changed, 8 insertions, 96 deletions
diff --git a/libhb/common.c b/libhb/common.c index d800267fe..9c6120a44 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -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: diff --git a/libhb/common.h b/libhb/common.h index 7383bf627..bb394c4f4 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -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; diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index 5ae5a3929..eaf7b7020 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -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 */ diff --git a/libhb/encx264.c b/libhb/encx264.c index 2a3c2b6e2..83d3edabb 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -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 ) { diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index ca7e20ae0..f47b442b5 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -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; diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index 3580a5459..7cd4e0fcf 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -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); diff --git a/libhb/work.c b/libhb/work.c index ebbc408bf..cf8d4d464 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -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 */ diff --git a/test/test.c b/test/test.c index 2af240882..a2a8b55af 100644 --- a/test/test.c +++ b/test/test.c @@ -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" ) ) { |