summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2008-06-05 15:59:24 +0000
committerjbrjake <[email protected]>2008-06-05 15:59:24 +0000
commit44c4de92be3a9ec7c18903b0453e477f379e430b (patch)
treedbb9dccc050a853faa5e39016dfcf6a21165751f
parent4576706b8db62654aa4ab529eca0c5b5ad4488b1 (diff)
Adds a job->cfr boolean to indicate "encode this with a constant frame rate" instead of passing through the true frame durations from the source. Includes CLI implementation, which sets cfr to 1 if the user specifies a frame rate. Otherwise, it uses "same as source" frame rate.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1496 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/common.h27
-rw-r--r--libhb/sync.c2
-rw-r--r--test/test.c2
3 files changed, 19 insertions, 12 deletions
diff --git a/libhb/common.h b/libhb/common.h
index 0e531d922..c12348be5 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -133,12 +133,13 @@ struct hb_job_s
width: must be a multiple of 16
height: must be a multiple of 16
keep_ratio: used by UIs
+ grayscale: black and white encoding
pixel_ratio: store pixel aspect ratio in the video
pixel_aspect_width: numerator for pixel aspect ratio
pixel_aspect_height: denominator for pixel aspect ratio
- maxWidth: keep width below this
- maxHeight: keep height below this */
-
+ modulus: set a number besides 16 for dimensions to be multiples of
+ maxWidth: keep width below this
+ maxHeight: keep height below this */
int crop[4];
int deinterlace;
hb_list_t * filters;
@@ -150,18 +151,21 @@ struct hb_job_s
int pixel_aspect_width;
int pixel_aspect_height;
int modulus;
- int maxWidth;
- int maxHeight;
-
+ int maxWidth;
+ int maxHeight;
/* Video settings:
vcodec: output codec
vquality: output quality (0.0..1.0)
- if < 0.0 or > 1.0, bitrate is used instead
+ if < 0.0 or > 1.0, bitrate is used instead,
+ except with x264, to use its real QP/RF scale
vbitrate: output bitrate (kbps)
- pass: 0, 1 or 2 (or -1 for scan)
vrate, vrate_base: output framerate is vrate / vrate_base
- h264_level: boolean for whether or not we're encoding for iPod
+ vfr: boolean for variable frame rate detelecine
+ cfr: boolean to use constant frame rates instead of
+ passing through the source's frame durations.
+ pass: 0, 1 or 2 (or -1 for scan)
+ h264_level: vestigial boolean to decide if we're encoding for iPod
crf: boolean for whether to use constant rate factor with x264
x264opts: string of extra x264 options
areBframes: boolean to note if b-frames are included in x264opts */
@@ -176,13 +180,14 @@ struct hb_job_s
int vbitrate;
int vrate;
int vrate_base;
+ int vfr;
+ int cfr;
int pass;
int h264_13;
int h264_level;
int crf;
char *x264opts;
int areBframes;
- int vfr;
/* List of audio settings. */
hb_list_t * list_audio;
@@ -191,7 +196,7 @@ struct hb_job_s
subtitle: index in hb_title_t's subtitles list, starting
from 0. -1 means no subtitle */
int subtitle;
- int subtitleSmartAdjust;
+ int subtitleSmartAdjust;
/* Muxer settings
mux: output file format
diff --git a/libhb/sync.c b/libhb/sync.c
index f9c738bdf..0b0852bc5 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -512,7 +512,7 @@ static int SyncVideo( hb_work_object_t * w )
}
int64_t duration;
- if ( job->mux & HB_MUX_AVI || job->title->rate_base != job->vrate_base )
+ if ( job->mux & HB_MUX_AVI || job->cfr )
{
/*
* The concept of variable frame rate video was a bit too advanced
diff --git a/test/test.c b/test/test.c
index b30af9a8c..2c91287a6 100644
--- a/test/test.c
+++ b/test/test.c
@@ -87,6 +87,7 @@ static int largeFileSize = 0;
static int preset = 0;
static char * preset_name = 0;
static int vfr = 0;
+static int cfr = 0;
static int mp4_optimize = 0;
static int ipod_atom = 0;
@@ -884,6 +885,7 @@ static int HandleEvents( hb_handle_t * h )
}
if( vrate )
{
+ job->cfr = 1;
job->vrate = 27000000;
job->vrate_base = vrate;
}