[FFmpeg-cvslog] avformat/hevcdec: cosmetics, whitespaces

Dirk Farin git at videolan.org
Thu Oct 17 10:26:23 CEST 2013


ffmpeg | branch: master | Dirk Farin <dirk.farin at gmail.com> | Sat Oct 12 11:55:44 2013 +0200| [2ac31773f3fc13e65147e335ace4cefa58599252] | committer: Michael Niedermayer

avformat/hevcdec: cosmetics, whitespaces

This reduces the difference to the latest hevc demuxer

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ac31773f3fc13e65147e335ace4cefa58599252
---

 libavformat/hevcdec.c |   50 +++++++++++++++++++++++++------------------------
 1 file changed, 26 insertions(+), 24 deletions(-)

diff --git a/libavformat/hevcdec.c b/libavformat/hevcdec.c
index 51e1504..c187652 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 at 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)



More information about the ffmpeg-cvslog mailing list