Commit 74f77eb0 authored by Michael Niedermayer's avatar Michael Niedermayer

H264: set colorspace and full range to values indicating unspecified by default

Code based on ffdshow
Author unknown
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3775af0f
...@@ -2670,7 +2670,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ ...@@ -2670,7 +2670,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
} }
if(h->sps.video_signal_type_present_flag){ if(h->sps.video_signal_type_present_flag){
s->avctx->color_range = h->sps.full_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; s->avctx->color_range = h->sps.full_range>0 ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
if(h->sps.colour_description_present_flag){ if(h->sps.colour_description_present_flag){
s->avctx->color_primaries = h->sps.color_primaries; s->avctx->color_primaries = h->sps.color_primaries;
s->avctx->color_trc = h->sps.color_trc; s->avctx->color_trc = h->sps.color_trc;
......
...@@ -338,10 +338,12 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ ...@@ -338,10 +338,12 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
sps->profile_idc= profile_idc; sps->profile_idc= profile_idc;
sps->constraint_set_flags = constraint_set_flags; sps->constraint_set_flags = constraint_set_flags;
sps->level_idc= level_idc; sps->level_idc= level_idc;
sps->full_range = -1;
memset(sps->scaling_matrix4, 16, sizeof(sps->scaling_matrix4)); memset(sps->scaling_matrix4, 16, sizeof(sps->scaling_matrix4));
memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8)); memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8));
sps->scaling_matrix_present = 0; sps->scaling_matrix_present = 0;
sps->colorspace = 2; //AVCOL_SPC_UNSPECIFIED
if(sps->profile_idc >= 100){ //high profile if(sps->profile_idc >= 100){ //high profile
sps->chroma_format_idc= get_ue_golomb_31(&s->gb); sps->chroma_format_idc= get_ue_golomb_31(&s->gb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment