Mercurial > libavcodec.hg
comparison libschroedingerenc.c @ 11685:d3098fb8ec05 libavcodec
schroenc: Set colorspace info
author | conrad |
---|---|
date | Wed, 05 May 2010 21:38:02 +0000 |
parents | b4aff04c10cf |
children |
comparison
equal
deleted
inserted
replaced
11684:b4aff04c10cf | 11685:d3098fb8ec05 |
---|---|
126 p_schro_params->format->height = avccontext->height; | 126 p_schro_params->format->height = avccontext->height; |
127 | 127 |
128 if (SetSchroChromaFormat(avccontext) == -1) | 128 if (SetSchroChromaFormat(avccontext) == -1) |
129 return -1; | 129 return -1; |
130 | 130 |
131 if (avccontext->color_primaries == AVCOL_PRI_BT709) { | |
132 p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_HDTV; | |
133 } else if (avccontext->color_primaries == AVCOL_PRI_BT470BG) { | |
134 p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_625; | |
135 } else if (avccontext->color_primaries == AVCOL_PRI_SMPTE170M) { | |
136 p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_525; | |
137 } | |
138 | |
139 if (avccontext->colorspace == AVCOL_SPC_BT709) { | |
140 p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_HDTV; | |
141 } else if (avccontext->colorspace == AVCOL_SPC_BT470BG) { | |
142 p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_SDTV; | |
143 } | |
144 | |
145 if (avccontext->color_trc == AVCOL_TRC_BT709) { | |
146 p_schro_params->format->transfer_function = SCHRO_TRANSFER_CHAR_TV_GAMMA; | |
147 } | |
148 | |
131 if (ff_get_schro_frame_format(p_schro_params->format->chroma_format, | 149 if (ff_get_schro_frame_format(p_schro_params->format->chroma_format, |
132 &p_schro_params->frame_format) == -1) { | 150 &p_schro_params->frame_format) == -1) { |
133 av_log(avccontext, AV_LOG_ERROR, | 151 av_log(avccontext, AV_LOG_ERROR, |
134 "This codec currently supports only planar YUV 4:2:0, 4:2:2" | 152 "This codec currently supports only planar YUV 4:2:0, 4:2:2" |
135 " and 4:4:4 formats.\n"); | 153 " and 4:4:4 formats.\n"); |