Commit 0ed14bba authored by Clément Bœsch's avatar Clément Bœsch

Merge commit '72da8d9b'

* commit '72da8d9b':
  h264_parser: remove the remaining dependencies on the h264 decoder
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents 34ec084b 72da8d9b
......@@ -2697,7 +2697,7 @@ vp9_cuvid_decoder_deps="cuda cuvid CUVIDVP9PICPARAMS"
vp9_cuvid_decoder_select="vp9_cuvid_hwaccel"
# parsers
h264_parser_select="h264_decoder"
h264_parser_select="golomb h264dsp"
hevc_parser_select="golomb"
mpegvideo_parser_select="mpegvideo"
mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
......
......@@ -924,7 +924,8 @@ OBJS-$(CONFIG_G729_PARSER) += g729_parser.o
OBJS-$(CONFIG_GSM_PARSER) += gsm_parser.o
OBJS-$(CONFIG_H261_PARSER) += h261_parser.o
OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264_parse.o h2645_parse.o
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264_parse.o h2645_parse.o \
h264_ps.o h264_sei.o h264data.o
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o h2645_parse.o hevc_ps.o hevc_data.o
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
......
......@@ -782,34 +782,6 @@ static void flush_dpb(AVCodecContext *avctx)
h->context_initialized = 0;
}
/**
* Compute profile from profile_idc and constraint_set?_flags.
*
* @param sps SPS
*
* @return profile as defined by FF_PROFILE_H264_*
*/
int ff_h264_get_profile(const SPS *sps)
{
int profile = sps->profile_idc;
switch (sps->profile_idc) {
case FF_PROFILE_H264_BASELINE:
// constraint_set1_flag set to 1
profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0;
break;
case FF_PROFILE_H264_HIGH_10:
case FF_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
// constraint_set3_flag set to 1
profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0;
break;
}
return profile;
}
#if FF_API_CAP_VDPAU
static const uint8_t start_code[] = { 0x00, 0x00, 0x01 };
#endif
......
......@@ -707,11 +707,6 @@ extern const uint16_t ff_h264_mb_sizes[4];
int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
H264ParamSets *ps, int ignore_truncation);
/**
* compute profile from sps
*/
int ff_h264_get_profile(const SPS *sps);
/**
* Decode PPS
*/
......
......@@ -468,3 +468,30 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
}
return size;
}
/**
* Compute profile from profile_idc and constraint_set?_flags.
*
* @param sps SPS
*
* @return profile as defined by FF_PROFILE_H264_*
*/
int ff_h264_get_profile(const SPS *sps)
{
int profile = sps->profile_idc;
switch (sps->profile_idc) {
case FF_PROFILE_H264_BASELINE:
// constraint_set1_flag set to 1
profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0;
break;
case FF_PROFILE_H264_HIGH_10:
case FF_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
// constraint_set3_flag set to 1
profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0;
break;
}
return profile;
}
......@@ -87,4 +87,9 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, struct H264ParamSets
int *is_avc, int *nal_length_size,
int err_recognition, void *logctx);
/**
* compute profile from sps
*/
int ff_h264_get_profile(const struct SPS *sps);
#endif /* AVCODEC_H264_PARSE_H */
This diff is collapsed.
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