Imported Upstream version 6.1
[platform/upstream/ffmpeg.git] / libavcodec / dcahuff.h
1 /*
2  * DCA compatible decoder - huffman tables
3  * Copyright (C) 2004 Gildas Bazin
4  * Copyright (C) 2007 Konstantin Shishkov
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_DCAHUFF_H
24 #define AVCODEC_DCAHUFF_H
25
26 #include <stdint.h>
27
28 #include "libavutil/attributes.h"
29
30 #include "vlc.h"
31
32 #define DCA_CODE_BOOKS      10
33 #define DCA_BITALLOC_12_COUNT    5
34 #define DCA_NUM_BITALLOC_CODES (1 * 3 + \
35                                 3 * (5 + 7 + 9 + 13) \
36                                 + 7 * (17 + 25 + 33 + 65 + 129))
37
38 extern VLC  ff_dca_vlc_bit_allocation[5];
39 #define DCA_TMODE_VLC_BITS 3
40 extern VLC  ff_dca_vlc_transition_mode[4];
41 #define DCA_SCALES_VLC_BITS 9
42 extern VLC  ff_dca_vlc_scale_factor[5];
43 extern VLC  ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7];
44
45 #define DCA_TNL_GRP_VLC_BITS 9
46 extern VLC  ff_dca_vlc_tnl_grp[5];
47 #define DCA_TNL_SCF_VLC_BITS 9
48 extern VLC  ff_dca_vlc_tnl_scf;
49 #define DCA_DAMP_VLC_BITS 6
50 extern VLC  ff_dca_vlc_damp;
51 #define DCA_DPH_VLC_BITS 6
52 extern VLC  ff_dca_vlc_dph;
53 #define DCA_FST_RSD_VLC_BITS 9
54 extern VLC  ff_dca_vlc_fst_rsd_amp;
55 #define DCA_RSD_APPRX_VLC_BITS 5
56 extern VLC  ff_dca_vlc_rsd_apprx;
57 #define DCA_RSD_AMP_VLC_BITS 9
58 extern VLC  ff_dca_vlc_rsd_amp;
59 #define DCA_AVG_G3_VLC_BITS 9
60 extern VLC  ff_dca_vlc_avg_g3;
61 #define DCA_ST_GRID_VLC_BITS 9
62 extern VLC  ff_dca_vlc_st_grid;
63 #define DCA_GRID_VLC_BITS 9
64 extern VLC  ff_dca_vlc_grid_2;
65 extern VLC  ff_dca_vlc_grid_3;
66 #define DCA_RSD_VLC_BITS 6
67 extern VLC  ff_dca_vlc_rsd;
68
69 extern const int8_t  ff_dca_bitalloc_offsets[DCA_CODE_BOOKS];
70 extern const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS];
71 extern const uint8_t ff_dca_vlc_src_tables[][2];
72
73 av_cold void ff_dca_init_vlcs(void);
74
75 #endif /* AVCODEC_DCAHUFF_H */