summaryrefslogtreecommitdiff
path: root/libavcodec/h264_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-08-01 15:11:05 -0300
committerJames Almer <jamrial@gmail.com>2016-08-01 15:11:05 -0300
commitf41048f6ec5671c2e09ae317cecc1e98ecc3c2ce (patch)
tree6a592b4d93164256410d27cf46e8da427b741bc4 /libavcodec/h264_parser.c
parent12759cc0345cec5a418d8caec5435297d1ec04b2 (diff)
parent5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c (diff)
downloadffmpeg-f41048f6ec5671c2e09ae317cecc1e98ecc3c2ce.tar.gz
Merge commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c'
* commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c': h264: add H264_ prefix to the NAL unit types Conflicts: libavcodec/h264_parse.c libavcodec/h264_parser.c libavcodec/h264_slice.c libavcodec/h264dec.c Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/h264_parser.c')
-rw-r--r--libavcodec/h264_parser.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 20efdaaa7d..0352b21fd1 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -106,14 +106,14 @@ static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf,
state >>= 1; // 2->1, 1->0, 0->0
} else if (state <= 5) {
int nalu_type = buf[i] & 0x1F;
- if (nalu_type == NAL_SEI || nalu_type == NAL_SPS ||
- nalu_type == NAL_PPS || nalu_type == NAL_AUD) {
+ if (nalu_type == H264_NAL_SEI || nalu_type == H264_NAL_SPS ||
+ nalu_type == H264_NAL_PPS || nalu_type == H264_NAL_AUD) {
if (pc->frame_start_found) {
i++;
goto found;
}
- } else if (nalu_type == NAL_SLICE || nalu_type == NAL_DPA ||
- nalu_type == NAL_IDR_SLICE) {
+ } else if (nalu_type == H264_NAL_SLICE || nalu_type == H264_NAL_DPA ||
+ nalu_type == H264_NAL_IDR_SLICE) {
state += 8;
continue;
}
@@ -303,10 +303,10 @@ static inline int parse_nal_units(AVCodecParserContext *s,
state = buf[buf_index];
switch (state & 0x1f) {
- case NAL_SLICE:
- case NAL_IDR_SLICE:
+ case H264_NAL_SLICE:
+ case H264_NAL_IDR_SLICE:
// Do not walk the whole buffer just to decode slice header
- if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) {
+ if ((state & 0x1f) == H264_NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) {
/* IDR or disposable slice
* No need to decode many bytes because MMCOs shall not be present. */
if (src_length > 60)
@@ -332,17 +332,17 @@ static inline int parse_nal_units(AVCodecParserContext *s,
nal.type = get_bits(&nal.gb, 5);
switch (nal.type) {
- case NAL_SPS:
+ case H264_NAL_SPS:
ff_h264_decode_seq_parameter_set(&nal.gb, avctx, &p->ps, 0);
break;
- case NAL_PPS:
+ case H264_NAL_PPS:
ff_h264_decode_picture_parameter_set(&nal.gb, avctx, &p->ps,
nal.size_bits);
break;
- case NAL_SEI:
+ case H264_NAL_SEI:
ff_h264_sei_decode(&p->sei, &nal.gb, &p->ps, avctx);
break;
- case NAL_IDR_SLICE:
+ case H264_NAL_IDR_SLICE:
s->key_frame = 1;
p->poc.prev_frame_num = 0;
@@ -350,7 +350,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
p->poc.prev_poc_msb =
p->poc.prev_poc_lsb = 0;
/* fall through */
- case NAL_SLICE:
+ case H264_NAL_SLICE:
get_ue_golomb_long(&nal.gb); // skip first_mb_in_slice
slice_type = get_ue_golomb_31(&nal.gb);
s->pict_type = ff_h264_golomb_to_pict_type[slice_type % 5];
@@ -440,7 +440,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
}
}
- if (nal.type == NAL_IDR_SLICE)
+ if (nal.type == H264_NAL_IDR_SLICE)
get_ue_golomb_long(&nal.gb); /* idr_pic_id */
if (sps->poc_type == 0) {
p->poc.poc_lsb = get_bits(&nal.gb, sps->log2_max_poc_lsb);
@@ -469,7 +469,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
* FIXME: MMCO_RESET could appear in non-first slice.
* Maybe, we should parse all undisposable non-IDR slice of this
* picture until encountering MMCO_RESET in a slice of it. */
- if (nal.ref_idc && nal.type != NAL_IDR_SLICE) {
+ if (nal.ref_idc && nal.type != H264_NAL_IDR_SLICE) {
got_reset = scan_mmco_reset(s, &nal.gb, avctx);
if (got_reset < 0)
goto fail;
@@ -637,17 +637,17 @@ static int h264_split(AVCodecContext *avctx,
if ((state & 0xFFFFFF00) != 0x100)
break;
nalu_type = state & 0x1F;
- if (nalu_type == NAL_SPS) {
+ if (nalu_type == H264_NAL_SPS) {
has_sps = 1;
- } else if (nalu_type == NAL_PPS)
+ } else if (nalu_type == H264_NAL_PPS)
has_pps = 1;
/* else if (nalu_type == 0x01 ||
* nalu_type == 0x02 ||
* nalu_type == 0x05) {
* }
*/
- else if ((nalu_type != NAL_SEI || has_pps) &&
- nalu_type != NAL_AUD && nalu_type != NAL_SPS_EXT &&
+ else if ((nalu_type != H264_NAL_SEI || has_pps) &&
+ nalu_type != H264_NAL_AUD && nalu_type != H264_NAL_SPS_EXT &&
nalu_type != 0x0f) {
if (has_sps) {
while (ptr - 4 > buf && ptr[-5] == 0)