[FFmpeg-cvslog] hevc: don't check for errors in PTL code
Guillaume Martres
git at videolan.org
Sat Dec 14 03:37:24 CET 2013
ffmpeg | branch: master | Guillaume Martres <smarter at ubuntu.com> | Fri Dec 13 20:05:23 2013 +0100| [dddc9b7a8ec3a03e48c69991ca7f20f10dd6f022] | committer: Michael Niedermayer
hevc: don't check for errors in PTL code
The value of XXX_reserved_zero_44bits should be ignored, no need to
report an error when it's not zero.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dddc9b7a8ec3a03e48c69991ca7f20f10dd6f022
---
libavcodec/hevc_ps.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 858b8bf..56d3faf 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -192,7 +192,7 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
}
-static int decode_profile_tier_level(HEVCContext *s, ProfileTierLevel *ptl)
+static void decode_profile_tier_level(HEVCContext *s, ProfileTierLevel *ptl)
{
int i;
HEVCLocalContext *lc = s->HEVClc;
@@ -214,16 +214,13 @@ static int decode_profile_tier_level(HEVCContext *s, ProfileTierLevel *ptl)
ptl->interlaced_source_flag = get_bits1(gb);
ptl->non_packed_constraint_flag = get_bits1(gb);
ptl->frame_only_constraint_flag = get_bits1(gb);
- if (get_bits(gb, 16) != 0) // XXX_reserved_zero_44bits[0..15]
- return -1;
- if (get_bits(gb, 16) != 0) // XXX_reserved_zero_44bits[16..31]
- return -1;
- if (get_bits(gb, 12) != 0) // XXX_reserved_zero_44bits[32..43]
- return -1;
- return 0;
+
+ skip_bits(gb, 16); // XXX_reserved_zero_44bits[0..15]
+ skip_bits(gb, 16); // XXX_reserved_zero_44bits[16..31]
+ skip_bits(gb, 12); // XXX_reserved_zero_44bits[32..43]
}
-static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
+static void parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
{
int i;
HEVCLocalContext *lc = s->HEVClc;
@@ -244,7 +241,6 @@ static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers)
if (ptl->sub_layer_level_present_flag[i])
ptl->sub_layer_PTL[i].level_idc = get_bits(gb, 8);
}
- return 0;
}
static void decode_sublayer_hrd(HEVCContext *s, int nb_cpb,
@@ -362,10 +358,8 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
goto err;
}
- if (parse_ptl(s, &vps->ptl, vps->vps_max_sub_layers) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Error decoding profile tier level.\n");
- goto err;
- }
+ parse_ptl(s, &vps->ptl, vps->vps_max_sub_layers);
+
vps->vps_sub_layer_ordering_info_present_flag = get_bits1(gb);
i = vps->vps_sub_layer_ordering_info_present_flag ? 0 : vps->vps_max_sub_layers - 1;
@@ -649,11 +643,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
skip_bits1(gb); // temporal_id_nesting_flag
- if (parse_ptl(s, &sps->ptl, sps->max_sub_layers) < 0) {
- av_log(s->avctx, AV_LOG_ERROR, "error decoding profile tier level\n");
- ret = AVERROR_INVALIDDATA;
- goto err;
- }
+ parse_ptl(s, &sps->ptl, sps->max_sub_layers);
+
sps_id = get_ue_golomb_long(gb);
if (sps_id >= MAX_SPS_COUNT) {
av_log(s->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", sps_id);
More information about the ffmpeg-cvslog
mailing list