[vlc-commits] avcodec: add missing color xfer mappings

Francois Cartegnie git at videolan.org
Sun Dec 25 19:04:20 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Dec 25 18:14:33 2016 +0100| [b948167ad2a6cb8ee097bfc0a913f6d4cdd2ed05] | committer: Francois Cartegnie

avcodec: add missing color xfer mappings

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b948167ad2a6cb8ee097bfc0a913f6d4cdd2ed05
---

 modules/codec/avcodec/encoder.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index bee7393..af8cacb 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -294,6 +294,7 @@ static void set_video_color_settings( encoder_t *p_enc, AVCodecContext *p_contex
             p_context->colorspace = AVCOL_SPC_BT2020_CL;
             break;
         default:
+            p_context->colorspace = AVCOL_SPC_UNSPECIFIED;
             break;
     }
 
@@ -305,9 +306,24 @@ static void set_video_color_settings( encoder_t *p_enc, AVCodecContext *p_contex
         case TRANSFER_FUNC_SRGB:
             p_context->color_trc = AVCOL_TRC_GAMMA22;
             break;
+        case TRANSFER_FUNC_BT470_BG:
+            p_context->color_trc = AVCOL_TRC_GAMMA28;
+            break;
+        case TRANSFER_FUNC_BT470_M:
+            p_context->color_trc = AVCOL_TRC_GAMMA22;
+            break;
         case TRANSFER_FUNC_BT709:
             p_context->color_trc = AVCOL_TRC_BT709;
             break;
+        case TRANSFER_FUNC_SMPTE_ST2084:
+            p_context->color_trc = AVCOL_TRC_SMPTEST2084;
+            break;
+        case TRANSFER_FUNC_SMPTE_240:
+            p_context->color_trc = AVCOL_TRC_SMPTE240M;
+            break;
+        default:
+            p_context->color_trc = AVCOL_TRC_UNSPECIFIED;
+            break;
     }
     switch( p_enc->fmt_in.video.primaries )
     {
@@ -323,6 +339,12 @@ static void set_video_color_settings( encoder_t *p_enc, AVCodecContext *p_contex
         case COLOR_PRIMARIES_BT2020:
             p_context->color_primaries = AVCOL_PRI_BT2020;
             break;
+        case COLOR_PRIMARIES_FCC1953:
+            p_context->color_primaries = AVCOL_PRI_BT470M;
+            break;
+        default:
+            p_context->color_primaries = AVCOL_PRI_UNSPECIFIED;
+            break;
     }
 }
 



More information about the vlc-commits mailing list