]> git.sesse.net Git - ffmpeg/blob - libavcodec/scpr3.h
avformat/avio: Add Metacube support
[ffmpeg] / libavcodec / scpr3.h
1 /*
2  * ScreenPressor version 3 decoder
3  *
4  * Copyright (c) 2017 Paul B Mahol
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22
23 #ifndef AVCODEC_SCPR3_H
24 #define AVCODEC_SCPR3_H
25
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include "avcodec.h"
31 #include "internal.h"
32
33 typedef struct PixelModel3 {
34     uint8_t    type;
35     uint8_t    length;
36     uint8_t    maxpos;
37     uint8_t    fshift;
38     uint16_t   size;
39     uint32_t   cntsum;
40     uint8_t    symbols[256];
41     uint16_t   freqs[256];
42     uint16_t   freqs1[256];
43     uint16_t   cnts[256];
44     uint8_t    dectab[32];
45 } PixelModel3;
46
47 typedef struct FillModel3 {
48     uint32_t   cntsum;
49     uint16_t   freqs[2][5];
50     uint16_t   cnts[5];
51     uint8_t    dectab[32];
52 } FillModel3;
53
54 typedef struct OpModel3 {
55     uint32_t   cntsum;
56     uint16_t   freqs[2][6];
57     uint16_t   cnts[6];
58     uint8_t    dectab[32];
59 } OpModel3;
60
61 typedef struct RunModel3 {
62     uint32_t   cntsum;
63     uint16_t   freqs[2][256];
64     uint16_t   cnts[256];
65     uint8_t    dectab[32];
66 } RunModel3;
67
68 typedef struct SxyModel3 {
69     uint32_t   cntsum;
70     uint16_t   freqs[2][16];
71     uint16_t   cnts[16];
72     uint8_t    dectab[32];
73 } SxyModel3;
74
75 typedef struct MVModel3 {
76     uint32_t   cntsum;
77     uint16_t   freqs[2][512];
78     uint16_t   cnts[512];
79     uint8_t    dectab[32];
80 } MVModel3;
81
82 #endif /* AVCODEC_SCPR3_H */