diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-05-31 13:33:54 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-06-05 14:06:54 +0300 |
commit | 973fab565378cbdd0712977152a66f5b17938d51 (patch) | |
tree | 720f0b9c6e8f3cf64c4134d0ae78a5e30d97a577 /libavcodec/qoi.h | |
parent | c6364b711bad1fe2fbd90e5b2798f87080ddf5ea (diff) |
avcodec: add QOI decoder and demuxer and parser and encoder and muxer
Diffstat (limited to 'libavcodec/qoi.h')
-rw-r--r-- | libavcodec/qoi.h | 35 |
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 */ |