summaryrefslogtreecommitdiffstats
path: root/libhb/encx265.c
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2018-08-24 10:47:02 +0200
committerDamiano Galassi <[email protected]>2018-08-28 08:43:22 +0200
commit5c9ddef6b4b174fe452e8099b6c0ffb3c35c4036 (patch)
tree489ec68da720d3f366231142dc6900b16994ef7e /libhb/encx265.c
parentd3a3ac2bbad637fc462e5ce37bc72537f0441ea5 (diff)
Refactor the color tag code, and pass it to the FFmpeg encoders.
Diffstat (limited to 'libhb/encx265.c')
-rw-r--r--libhb/encx265.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/libhb/encx265.c b/libhb/encx265.c
index cce69e330..1cdf4f7c3 100644
--- a/libhb/encx265.c
+++ b/libhb/encx265.c
@@ -155,39 +155,10 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
* flags, if any, should be set in the x265_param struct).
*/
char colorprim[11], transfer[11], colormatrix[11];
- switch (job->color_matrix_code)
- {
- case 1: // ITU BT.601 DVD or SD TV content (NTSC)
- strcpy(colorprim, "smpte170m");
- strcpy(transfer, "bt709");
- strcpy(colormatrix, "smpte170m");
- break;
- case 2: // ITU BT.601 DVD or SD TV content (PAL)
- strcpy(colorprim, "bt470bg");
- strcpy(transfer, "bt709");
- strcpy(colormatrix, "smpte170m");
- break;
- case 3: // ITU BT.709 HD content
- strcpy(colorprim, "bt709");
- strcpy(transfer, "bt709");
- strcpy(colormatrix, "bt709");
- break;
- case 4: // ITU BT.2020 UHD content
- strcpy(colorprim, "bt2020");
- strcpy(transfer, "bt709");
- strcpy(colormatrix, "bt2020nc");
- break;
- case 5: // custom
- snprintf(colorprim, sizeof(colorprim), "%d", job->color_prim);
- snprintf(transfer, sizeof(transfer), "%d", job->color_transfer);
- snprintf(colormatrix, sizeof(colormatrix), "%d", job->color_matrix);
- break;
- default: // detected during scan
- snprintf(colorprim, sizeof(colorprim), "%d", job->title->color_prim);
- snprintf(transfer, sizeof(transfer), "%d", job->title->color_transfer);
- snprintf(colormatrix, sizeof(colormatrix), "%d", job->title->color_matrix);
- break;
- }
+ snprintf(colorprim, sizeof(colorprim), "%d", job->color_prim);
+ snprintf(transfer, sizeof(transfer), "%d", job->color_transfer);
+ snprintf(colormatrix, sizeof(colormatrix), "%d", job->color_matrix);
+
if (param_parse(pv, param, "colorprim", colorprim) ||
param_parse(pv, param, "transfer", transfer) ||
param_parse(pv, param, "colormatrix", colormatrix))
@@ -219,7 +190,6 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
* Reload colorimetry settings in case custom
* values were set in the encoder_options string.
*/
- job->color_matrix_code = 4;
job->color_prim = param->vui.colorPrimaries;
job->color_transfer = param->vui.transferCharacteristics;
job->color_matrix = param->vui.matrixCoeffs;