diff options
author | jbrjake <[email protected]> | 2008-10-19 23:39:52 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2008-10-19 23:39:52 +0000 |
commit | d83151d2858999d5ae7b491cf9b282aeb9dfd7b7 (patch) | |
tree | 1e3e8f5bef10d930bd9e71bcf5f0f201cea25c7f /libhb | |
parent | d235fedfc43b5b736806b4e072c11c803c2804ca (diff) |
Adds a configuration option for whether the COLR atom and h.264 VUI header should signal Bt.601 or Bt.7709 color, instead of just setting it based on whether the source is standard or high definition (which is preserved as default, and made more sensitive to letterboxed HD content).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1851 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.h | 1 | ||||
-rw-r--r-- | libhb/encx264.c | 17 | ||||
-rw-r--r-- | libhb/muxmp4.c | 13 | ||||
-rw-r--r-- | libhb/work.c | 9 |
4 files changed, 37 insertions, 3 deletions
diff --git a/libhb/common.h b/libhb/common.h index 5c89430d3..c00268da1 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -187,6 +187,7 @@ struct hb_job_s int crf; char *x264opts; int areBframes; + int color_matrix; /* List of audio settings. */ hb_list_t * list_audio; diff --git a/libhb/encx264.c b/libhb/encx264.c index 4a831ba38..0e3edd040 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -195,8 +195,21 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) /* set up the VUI color model & gamma to match what the COLR atom * set in muxmp4.c says. See libhb/muxmp4.c for notes. */ - - if ( job->title->height >= 720 ) + if( job->color_matrix == 1 ) + { + // ITU BT.601 DVD or SD TV content + param.vui.i_colorprim = 6; + param.vui.i_transfer = 1; + param.vui.i_colmatrix = 6; + } + else if( job->color_matrix == 2 ) + { + // ITU BT.709 HD content + param.vui.i_colorprim = 1; + param.vui.i_transfer = 1; + param.vui.i_colmatrix = 1; + } + else if ( job->title->width >= 1280 || job->title->width >= 720 ) { // we guess that 720p or above is ITU BT.709 HD content param.vui.i_colorprim = 1; diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index a6ddedf5d..dfee48c54 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -251,10 +251,21 @@ static int MP4Init( hb_mux_object_t * m ) // Per the notes at: // http://developer.apple.com/quicktime/icefloe/dispatch019.html#colr // http://forum.doom9.org/showthread.php?t=133982#post1090068 + // the user can set it from job->color_matrix, otherwise by default // we say anything that's likely to be HD content is ITU BT.709 and // DVD, SD TV & other content is ITU BT.601. We look at the title height // rather than the job height here to get uncropped input dimensions. - if ( job->title->height >= 720 ) + if( job->color_matrix == 1 ) + { + // ITU BT.601 DVD or SD TV content + MP4AddColr(m->file, mux_data->track, 6, 1, 6); + } + else if( job->color_matrix == 2 ) + { + // ITU BT.709 HD content + MP4AddColr(m->file, mux_data->track, 1, 1, 1); + } + else if ( job->title->width >= 1280 || job->title->height >= 720 ) { // we guess that 720p or above is ITU BT.709 HD content MP4AddColr(m->file, mux_data->track, 1, 1, 1); diff --git a/libhb/work.c b/libhb/work.c index f64738e52..6caa153e8 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -214,6 +214,15 @@ hb_display_job_info( hb_job_t * job ) title->width, title->height, job->width, job->height, job->crop[0], job->crop[1], job->crop[2], job->crop[3] ); } + + if( job->color_matrix ) + { + hb_log( " + color space: %s", job->color_matrix == 1 ? "ITU Bt.601 (SD)" : "ITU Bt.709 (HD)"); + } + else + { + hb_log( " + color space: %s", ( title->width < 1280 || title->height < 720 ) ? "ITU Bt.601 (SD)" : "ITU Bt.709 (HD)"); + } if ( job->grayscale ) hb_log( " + grayscale mode" ); |