]> granicus.if.org Git - handbrake/commitdiff
Update Libav -> HandBrake colorimetry translation after http://git.libav.org/?p=libav...
authorRodeo <tdskywalker@gmail.com>
Fri, 7 Sep 2012 18:15:22 +0000 (18:15 +0000)
committerRodeo <tdskywalker@gmail.com>
Fri, 7 Sep 2012 18:15:22 +0000 (18:15 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4932 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/decavcodec.c

index a5312273d7940043e2e05826b583f712a478194e..783342a44521dbb3457a9f2b6b8708df3577111d 100644 (file)
@@ -1317,14 +1317,16 @@ static int decavcodecvInfo( hb_work_object_t *w, hb_work_info_t *info )
         }
     }
 
-    /* AVCOL_TRC_BT709 -> HB_COLR_TRA_BT709
-     * AVCOL_TRC_GAMMA22 (bt470m) -> HB_COLR_TRA_BT709
-     * AVCOL_TRC_GAMMA28 (bt470bg) -> HB_COLR_TRA_BT709
-     * AVCOL_TRC_UNSPECIFIED, AVCOL_TRC_NB:
-     * -> ITU BT.709 -> HB_COLR_TRA_BT709
-     * -> ITU BT.601 -> HB_COLR_TRA_BT709
-     * TODO: AVCOL_TRC_SMPTE240M -> HB_COLR_TRA_SMPTE240M but it's not yet in Libav */
-    info->color_transfer = HB_COLR_TRA_BT709;
+    switch( pv->context->color_trc )
+    {
+        case AVCOL_TRC_SMPTE240M:
+            info->color_transfer = HB_COLR_TRA_SMPTE240M;
+            break;
+        default:
+            // ITU BT.601, BT.709, anything else
+            info->color_transfer = HB_COLR_TRA_BT709;
+            break;
+    }
 
     switch( pv->context->colorspace )
     {