summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2013-09-17 11:40:36 +0800
committerRockchip2013-09-17 11:40:36 +0800
commitc6be58707ae992f0aa09904a360c25bed85ec970 (patch)
treec5c13963f42afe0fde8f4a2953f06f6721358458
parentd397f5f69760290956847c16490192799750a83a (diff)
add mvc config support, must sync with update libffmpeg.so in device
-rw-r--r--libavcodec/avcodec.h2
-rw-r--r--libavcodec/h264.c2
-rw-r--r--libavcodec/h264.h1
-rw-r--r--libavcodec/h264_parser.c13
-rw-r--r--libavcodec/h264_ps.c13
5 files changed, 29 insertions, 2 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index fe83fef..ac756a9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3025,6 +3025,8 @@ typedef struct AVCodecContext {
#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244
#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA)
#define FF_PROFILE_H264_CAVLC_444 44
+#define FF_PROFILE_H264_MVC_HIGH (118)
+#define FF_PROFILE_H264_STEREO_HIGH (128)
#define FF_PROFILE_VC1_SIMPLE 0
#define FF_PROFILE_VC1_MAIN 1
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index fbc94b8..ea5b059 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4194,6 +4194,8 @@ static const AVProfile profiles[] = {
{ FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
{ FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
{ FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
+ { FF_PROFILE_H264_MVC_HIGH, "Multiview high" },
+ { FF_PROFILE_H264_STEREO_HIGH, "Stereo high" },
{ FF_PROFILE_UNKNOWN },
};
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 298f983..430a6f9 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -121,6 +121,7 @@ enum {
NAL_END_STREAM,
NAL_FILLER_DATA,
NAL_SPS_EXT,
+ NAL_SUBSET_SEQ_PARAM_SET = 0x0F,
NAL_AUXILIARY_SLICE = 19
};
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 2628195..743bd76 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -197,6 +197,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
init_get_bits(&h->s.gb, ptr, 8*dst_length);
switch(h->nal_unit_type) {
case NAL_SPS:
+ case NAL_SUBSET_SEQ_PARAM_SET:
ff_h264_decode_seq_parameter_set(h);
break;
case NAL_PPS:
@@ -230,7 +231,17 @@ static inline int parse_nal_units(AVCodecParserContext *s,
av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS referenced\n");
return -1;
}
- h->sps = *h->sps_buffers[h->pps.sps_id];
+
+ /*
+ ** if current stream is mvc stream, use mvc profile_idc as
+ ** sps->profile_idc, all here is for report mvc profile_idc
+ ** to player for mvc disable support.
+ ** @Sep 17th, 2013, by hbb.
+ */
+ if ((h->sps.profile_idc !=118) && (h->sps.profile_idc !=128)) {
+ h->sps = *h->sps_buffers[h->pps.sps_id];
+ }
+
h->frame_num = get_bits(&h->s.gb, h->sps.log2_max_frame_num);
avctx->profile = ff_h264_get_profile(&h->sps);
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 2cf8365..2a62ebc 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -354,7 +354,18 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
return -1;
sps->time_offset_length = 24;
- sps->profile_idc= profile_idc;
+ /*
+ ** if current stream is mvc stream, use mvc profile_idc as
+ ** sps->profile_idc, all here is for report mvc profile_idc
+ ** to player for mvc disable support.
+ ** @Sep 17th, 2013, by hbb.
+ */
+ if ((h->sps.profile_idc !=118) && (h->sps.profile_idc !=128)) {
+ sps->profile_idc = profile_idc;
+ } else {
+ sps->profile_idc = h->sps.profile_idc;
+ }
+
sps->constraint_set_flags = constraint_set_flags;
sps->level_idc= level_idc;
sps->full_range = -1;