diff options
author | David Conrad <lessen42@gmail.com> | 2010-05-05 21:38:02 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2010-05-05 21:38:02 +0000 |
commit | e9d96831f73f95d4b2cd69dd20dae95558b3be99 (patch) | |
tree | 2b89ee4cce5b0b33a79e21332cfb477a7bb7fb25 /libavcodec/libschroedingerenc.c | |
parent | 37284120cad35fc6df2ff98d7f183b3eda85448d (diff) | |
download | ffmpeg-e9d96831f73f95d4b2cd69dd20dae95558b3be99.tar.gz |
schroenc: Set colorspace info
Originally committed as revision 23030 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libschroedingerenc.c')
-rw-r--r-- | libavcodec/libschroedingerenc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index 1ce2417c6e..c4a0433043 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -128,6 +128,24 @@ static int libschroedinger_encode_init(AVCodecContext *avccontext) if (SetSchroChromaFormat(avccontext) == -1) return -1; + if (avccontext->color_primaries == AVCOL_PRI_BT709) { + p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_HDTV; + } else if (avccontext->color_primaries == AVCOL_PRI_BT470BG) { + p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_625; + } else if (avccontext->color_primaries == AVCOL_PRI_SMPTE170M) { + p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_525; + } + + if (avccontext->colorspace == AVCOL_SPC_BT709) { + p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_HDTV; + } else if (avccontext->colorspace == AVCOL_SPC_BT470BG) { + p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_SDTV; + } + + if (avccontext->color_trc == AVCOL_TRC_BT709) { + p_schro_params->format->transfer_function = SCHRO_TRANSFER_CHAR_TV_GAMMA; + } + if (ff_get_schro_frame_format(p_schro_params->format->chroma_format, &p_schro_params->frame_format) == -1) { av_log(avccontext, AV_LOG_ERROR, |