Commit 72da8d9b authored by Anton Khirnov's avatar Anton Khirnov

h264_parser: remove the remaining dependencies on the h264 decoder

parent 98c97994
......@@ -2192,7 +2192,7 @@ nvenc_h264_encoder_deps="nvenc"
nvenc_hevc_encoder_deps="nvenc"
# parsers
h264_parser_select="h264_decoder"
h264_parser_select="golomb h264dsp"
hevc_parser_select="golomb"
mpegvideo_parser_select="mpegvideo"
mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp"
......
......@@ -728,7 +728,8 @@ OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.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
......
......@@ -753,33 +753,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;
}
static int get_last_needed_nal(H264Context *h)
{
int nals_needed = 0;
......
......@@ -663,11 +663,6 @@ extern const uint16_t ff_h264_mb_sizes[4];
int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
H264ParamSets *ps);
/**
* compute profile from sps
*/
int ff_h264_get_profile(const SPS *sps);
/**
* Decode PPS
*/
......
......@@ -449,3 +449,30 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
}
return 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;
}
......@@ -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