[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: fourcc: add WebP image format

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Nov 13 09:29:47 UTC 2021



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
ff6820d5 by Tristan Matthews at 2021-11-13T08:53:05+00:00
fourcc: add WebP image format

Refs #19446

(cherry picked from commit ca04206095232821323f5624113c570f610e2659)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -
3ad9f3c2 by Tristan Matthews at 2021-11-13T08:53:05+00:00
demux: image: add WebP probing

Refs #19446

(cherry picked from commit 816f1630123b781a74cab3591583e9a05e7a29a3)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -
fb79c124 by Tristan Matthews at 2021-11-13T08:53:05+00:00
vpx: decode WebP's VP8 chunks

Fixes #19446

(cherry picked from commit ac9038e9ac46792f294e2fe348d66f1e12340d2e)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -


4 changed files:

- include/vlc_fourcc.h
- modules/codec/vpx.c
- modules/demux/image.c
- src/misc/fourcc_list.h


Changes:

=====================================
include/vlc_fourcc.h
=====================================
@@ -400,6 +400,7 @@
 #define VLC_CODEC_PCX             VLC_FOURCC('p','c','x',' ')
 #define VLC_CODEC_XWD             VLC_FOURCC('X','W','D',' ')
 #define VLC_CODEC_TXD             VLC_FOURCC('T','X','D',' ')
+#define VLC_CODEC_WEBP            VLC_FOURCC('W','E','B','P')
 
 
 /* Audio codec */


=====================================
modules/codec/vpx.c
=====================================
@@ -290,6 +290,7 @@ static int OpenDecoder(vlc_object_t *p_this)
     switch (dec->fmt_in.i_codec)
     {
 #ifdef ENABLE_VP8_DECODER
+    case VLC_CODEC_WEBP:
     case VLC_CODEC_VP8:
         iface = &vpx_codec_vp8_dx_algo;
         vp_version = 8;


=====================================
modules/demux/image.c
=====================================
@@ -407,6 +407,21 @@ static bool IsJfif(stream_t *s)
     return true;
 }
 
+static bool IsWebP(stream_t *s)
+{
+    const uint8_t *header;
+    if (vlc_stream_Peek(s, &header, 20) < 20) /* WebP header size */
+        return false;
+    if (memcmp(&header[0], "RIFF", 4))
+        return false;
+    /* TODO: support other chunk types */
+    if (memcmp(&header[8], "WEBPVP8 ", 8))
+        return false;
+    /* skip headers */
+    vlc_stream_Seek(s, 20);
+    return true;
+}
+
 static bool IsSpiff(stream_t *s)
 {
     const uint8_t *header;
@@ -607,6 +622,9 @@ static const image_format_t formats[] = {
     { .codec = VLC_CODEC_JPEG,
       .detect = IsExif,
     },
+    { .codec = VLC_CODEC_WEBP,
+      .detect = IsWebP,
+    },
     { .codec = VLC_CODEC_BPG,
       .marker_size = 4,
       .marker = { 'B', 'P', 'G', 0xFB },


=====================================
src/misc/fourcc_list.h
=====================================
@@ -1007,6 +1007,9 @@ static const staticentry_t p_list_video[] = {
         A("LJ2C"),
         A("LJ2K"),
 
+    B(VLC_CODEC_WEBP, "WebP Image"),
+        A("WEBP"),
+
     B(VLC_CODEC_LAGARITH, "Lagarith Lossless"),
         A("LAGS"),
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a108715f1d0f6e7c878a5b9ba01c799f08dc78f3...fb79c1242d8c6b640124a7c36126e5002107cae8

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a108715f1d0f6e7c878a5b9ba01c799f08dc78f3...fb79c1242d8c6b640124a7c36126e5002107cae8
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list