Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-05-31 13:33:54 +0300
committerPaul B Mahol <onemda@gmail.com>2022-06-05 14:06:54 +0300
commit973fab565378cbdd0712977152a66f5b17938d51 (patch)
tree720f0b9c6e8f3cf64c4134d0ae78a5e30d97a577 /libavcodec/qoi.h
parentc6364b711bad1fe2fbd90e5b2798f87080ddf5ea (diff)
avcodec: add QOI decoder and demuxer and parser and encoder and muxer
Diffstat (limited to 'libavcodec/qoi.h')
-rw-r--r--libavcodec/qoi.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libavcodec/qoi.h b/libavcodec/qoi.h
new file mode 100644
index 0000000000..3efab1e55b
--- /dev/null
+++ b/libavcodec/qoi.h
@@ -0,0 +1,35 @@
+/*
+ * QOI image format
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_QOI_H
+#define AVCODEC_QOI_H
+
+#define QOI_OP_INDEX 0x00 /* 00xxxxxx */
+#define QOI_OP_DIFF 0x40 /* 01xxxxxx */
+#define QOI_OP_LUMA 0x80 /* 10xxxxxx */
+#define QOI_OP_RUN 0xc0 /* 11xxxxxx */
+#define QOI_OP_RGB 0xfe /* 11111110 */
+#define QOI_OP_RGBA 0xff /* 11111111 */
+
+#define QOI_MASK_2 0xc0 /* 11000000 */
+
+#define QOI_COLOR_HASH(px) (px[0]*3 + px[1]*5 + px[2]*7 + px[3]*11)
+
+#endif /* AVCODEC_QOI_H */