This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit ba7a998c57685bd40f8e0d268ab8ee697ac96a73
Author:     James Almer <[email protected]>
AuthorDate: Thu Oct 29 15:26:09 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Sat Oct 31 20:38:49 2026 -0300

    avformat: add a raw LCEVC demuxer
    
    Signed-off-by: James Almer <[email protected]>
---
 libavformat/Makefile                  |  1 +
 libavformat/allformats.c              |  1 +
 libavformat/{hevcdec.c => lcevcdec.c} | 34 +++++++++++++---------------------
 3 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index ae8baaa12f..e012ce5ae6 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -359,6 +359,7 @@ OBJS-$(CONFIG_LAF_DEMUXER)               += lafdec.o
 OBJS-$(CONFIG_LATM_MUXER)                += latmenc.o rawenc.o
 OBJS-$(CONFIG_LC3_DEMUXER)               += lc3.o
 OBJS-$(CONFIG_LC3_MUXER)                 += lc3.o
+OBJS-$(CONFIG_LCEVC_DEMUXER)             += lcevcdec.o
 OBJS-$(CONFIG_LMLM4_DEMUXER)             += lmlm4.o
 OBJS-$(CONFIG_LOAS_DEMUXER)              += loasdec.o rawdec.o
 OBJS-$(CONFIG_LUODAT_DEMUXER)            += luodatdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index a4e859da33..c18072c082 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -263,6 +263,7 @@ extern const FFInputFormat  ff_laf_demuxer;
 extern const FFOutputFormat ff_latm_muxer;
 extern const FFInputFormat  ff_lc3_demuxer;
 extern const FFOutputFormat ff_lc3_muxer;
+extern const FFInputFormat  ff_lcevc_demuxer;
 extern const FFInputFormat  ff_lmlm4_demuxer;
 extern const FFInputFormat  ff_loas_demuxer;
 extern const FFInputFormat  ff_luodat_demuxer;
diff --git a/libavformat/hevcdec.c b/libavformat/lcevcdec.c
similarity index 55%
copy from libavformat/hevcdec.c
copy to libavformat/lcevcdec.c
index 4fc4068cd5..66ea063f6d 100644
--- a/libavformat/hevcdec.c
+++ b/libavformat/lcevcdec.c
@@ -1,6 +1,5 @@
 /*
- * RAW HEVC video demuxer
- * Copyright (c) 2013 Dirk Farin <[email protected]>
+ * RAW LCEVC video demuxer
  *
  * This file is part of FFmpeg.
  *
@@ -19,46 +18,39 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavcodec/hevc/hevc.h"
+#include "libavcodec/lcevc.h"
 
 #include "avformat.h"
 #include "rawdec.h"
 
-static int hevc_probe(const AVProbeData *p)
+static int lcevc_probe(const AVProbeData *p)
 {
     uint32_t code = -1;
-    int vps = 0, sps = 0, pps = 0, irap = 0;
+    int idr = 0;
     int 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;
+            int nal2 = p->buf[i + 1];
+            int type = (code & 0x3E) >> 1;
 
-            if (code & 0x81) // forbidden and reserved zero bits
+            if (code & 0x80) // forbidden zero bit
                 return 0;
-
-            if (nal2 & 0xf8) // reserved zero
+            if (!(code & 0x40)) // forbidden one bit
+                return 0;
+            if (!(code & 1) || nal2 != 0xff) // reserved ones
                 return 0;
 
             switch (type) {
-            case HEVC_NAL_VPS:        vps++;  break;
-            case HEVC_NAL_SPS:        sps++;  break;
-            case HEVC_NAL_PPS:        pps++;  break;
-            case HEVC_NAL_BLA_N_LP:
-            case HEVC_NAL_BLA_W_LP:
-            case HEVC_NAL_BLA_W_RADL:
-            case HEVC_NAL_CRA_NUT:
-            case HEVC_NAL_IDR_N_LP:
-            case HEVC_NAL_IDR_W_RADL: irap++; break;
+            case LCEVC_IDR_NUT: idr++;  break;
             }
         }
     }
 
-    if (vps && sps && pps && irap)
+    if (idr)
         return AVPROBE_SCORE_EXTENSION + 1; // 1 more than .mpg
     return 0;
 }
 
-FF_DEF_RAWVIDEO_DEMUXER(hevc, "raw HEVC video", hevc_probe, "hevc,h265,265", 
AV_CODEC_ID_HEVC)
+FF_DEF_RAWVIDEO_DEMUXER(lcevc, "raw LCEVC video", lcevc_probe, "lcevc", 
AV_CODEC_ID_LCEVC)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to