diff options
author | Dirk Farin <dirk.farin@gmail.com> | 2013-10-12 11:55:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-17 10:14:11 +0200 |
commit | 2ac31773f3fc13e65147e335ace4cefa58599252 (patch) | |
tree | 0cc89c03f1ddea899b7d2de7cab1ef0cc0c36f82 /libavformat/hevcdec.c | |
parent | 21b3563dcbaabc177f6eec4c0ffc77c0981b92bd (diff) | |
download | ffmpeg-2ac31773f3fc13e65147e335ace4cefa58599252.tar.gz |
avformat/hevcdec: cosmetics, whitespaces
This reduces the difference to the latest hevc demuxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hevcdec.c')
-rw-r--r-- | libavformat/hevcdec.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/libavformat/hevcdec.c b/libavformat/hevcdec.c index 51e1504459..c187652765 100644 --- a/libavformat/hevcdec.c +++ b/libavformat/hevcdec.c @@ -1,5 +1,5 @@ /* - * RAW H.265 video demuxer + * RAW HEVC video demuxer * Copyright (c) 2013 Dirk Farin <dirk.farin@gmail.com> * * This file is part of FFmpeg. @@ -22,39 +22,41 @@ #include "avformat.h" #include "rawdec.h" +#include "libavcodec/hevc.h" + static int hevc_probe(AVProbeData *p) { - uint32_t code= -1; - int vps=0, sps=0, pps=0, idr=0; + uint32_t code = -1; + int vps = 0, sps = 0, pps = 0, irap = 0; int i; - for(i=0; i<p->buf_size-1; i++){ - code = (code<<8) + p->buf[i]; + for (i = 0; i < p->buf_size - 1; i++) { + code = (code << 8) + p->buf[i]; if ((code & 0xffffff00) == 0x100) { - uint8_t nal2 = p->buf[i+1]; - int type = (code & 0x7E)>>1; - - if (code & 0x81) // forbidden and reserved zero bits - return 0; - - if (nal2 & 0xf8) // reserved zero - return 0; - - switch (type) { - case 32: vps++; break; - case 33: sps++; break; - case 34: pps++; break; - case 19: - case 20: idr++; break; - } + uint8_t nal2 = p->buf[i + 1]; + int type = (code & 0x7E) >> 1; + + if (code & 0x81) // forbidden and reserved zero bits + return 0; + + if (nal2 & 0xf8) // reserved zero + return 0; + + switch (type) { + case NAL_VPS: vps++; break; + case NAL_SPS: sps++; break; + case NAL_PPS: pps++; break; + case 19: + case 20: irap++; break; + } } } - // printf("vps=%d, sps=%d, pps=%d, idr=%d\n", vps, sps, pps, idr); + // printf("vps=%d, sps=%d, pps=%d, irap=%d\n", vps, sps, pps, irap); - if (vps && sps && pps && idr) + if (vps && sps && pps && irap) return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg return 0; } -FF_DEF_RAWVIDEO_DEMUXER(hevc , "raw HEVC video", hevc_probe, "h265,265,hevc", AV_CODEC_ID_HEVC) +FF_DEF_RAWVIDEO_DEMUXER(hevc, "raw HEVC video", hevc_probe, "hevc,h265,265", AV_CODEC_ID_HEVC) |