FFmpeg
dcahuff.h
Go to the documentation of this file.
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 "put_bits.h"
31 #include "vlc.h"
32 
33 #define DCA_CODE_BOOKS 10
34 #define DCA_BITALLOC_12_COUNT 5
35 
36 typedef struct DCAVLC {
37  int offset; ///< Code values offset
38  int max_depth; ///< Parameter for get_vlc2()
39  VLC vlc[7]; ///< Actual codes
40 } DCAVLC;
41 
46 
47 extern VLC ff_dca_vlc_tnl_grp[5];
48 extern VLC ff_dca_vlc_tnl_scf;
49 extern VLC ff_dca_vlc_damp;
50 extern VLC ff_dca_vlc_dph;
53 extern VLC ff_dca_vlc_rsd_amp;
54 extern VLC ff_dca_vlc_avg_g3;
55 extern VLC ff_dca_vlc_st_grid;
56 extern VLC ff_dca_vlc_grid_2;
57 extern VLC ff_dca_vlc_grid_3;
58 extern VLC ff_dca_vlc_rsd;
59 
60 av_cold void ff_dca_init_vlcs(void);
61 uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t abits);
62 void ff_dca_vlc_enc_quant(PutBitContext *pb, int *values, uint8_t n, uint8_t sel, uint8_t abits);
63 uint32_t ff_dca_vlc_calc_alloc_bits(int *values, uint8_t n, uint8_t sel);
64 void ff_dca_vlc_enc_alloc(PutBitContext *pb, int *values, uint8_t n, uint8_t sel);
65 
66 #endif /* AVCODEC_DCAHUFF_H */
ff_dca_vlc_quant_index
DCAVLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS]
Definition: dcahuff.c:1250
DCAVLC::offset
int offset
Code values offset.
Definition: dcahuff.h:37
ff_dca_vlc_calc_quant_bits
uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t abits)
Definition: dcahuff.c:1334
ff_dca_vlc_avg_g3
VLC ff_dca_vlc_avg_g3
Definition: dcahuff.c:1259
ff_dca_vlc_bit_allocation
DCAVLC ff_dca_vlc_bit_allocation
Definition: dcahuff.c:1247
ff_dca_vlc_st_grid
VLC ff_dca_vlc_st_grid
Definition: dcahuff.c:1260
ff_dca_vlc_dph
VLC ff_dca_vlc_dph
Definition: dcahuff.c:1255
ff_dca_vlc_transition_mode
DCAVLC ff_dca_vlc_transition_mode
Definition: dcahuff.c:1248
av_cold
#define av_cold
Definition: attributes.h:90
DCAVLC::max_depth
int max_depth
Parameter for get_vlc2()
Definition: dcahuff.h:38
ff_dca_vlc_rsd_amp
VLC ff_dca_vlc_rsd_amp
Definition: dcahuff.c:1258
PutBitContext
Definition: put_bits.h:50
ff_dca_init_vlcs
av_cold void ff_dca_init_vlcs(void)
Definition: dcahuff.c:1265
DCAVLC::vlc
VLC vlc[7]
Actual codes.
Definition: dcahuff.h:39
ff_dca_vlc_calc_alloc_bits
uint32_t ff_dca_vlc_calc_alloc_bits(int *values, uint8_t n, uint8_t sel)
Definition: dcahuff.c:1356
ff_dca_vlc_rsd_apprx
VLC ff_dca_vlc_rsd_apprx
Definition: dcahuff.c:1257
ff_dca_vlc_enc_quant
void ff_dca_vlc_enc_quant(PutBitContext *pb, int *values, uint8_t n, uint8_t sel, uint8_t abits)
Definition: dcahuff.c:1346
ff_dca_vlc_fst_rsd_amp
VLC ff_dca_vlc_fst_rsd_amp
Definition: dcahuff.c:1256
DCA_CODE_BOOKS
#define DCA_CODE_BOOKS
Definition: dcahuff.h:33
ff_dca_vlc_tnl_grp
VLC ff_dca_vlc_tnl_grp[5]
Definition: dcahuff.c:1252
ff_dca_vlc_enc_alloc
void ff_dca_vlc_enc_alloc(PutBitContext *pb, int *values, uint8_t n, uint8_t sel)
Definition: dcahuff.c:1367
attributes.h
ff_dca_vlc_grid_2
VLC ff_dca_vlc_grid_2
Definition: dcahuff.c:1261
ff_dca_vlc_scale_factor
DCAVLC ff_dca_vlc_scale_factor
Definition: dcahuff.c:1249
ff_dca_vlc_grid_3
VLC ff_dca_vlc_grid_3
Definition: dcahuff.c:1262
ff_dca_vlc_tnl_scf
VLC ff_dca_vlc_tnl_scf
Definition: dcahuff.c:1253
VLC
Definition: vlc.h:31
values
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return values
Definition: filter_design.txt:263
DCAVLC
Definition: dcahuff.h:36
ff_dca_vlc_rsd
VLC ff_dca_vlc_rsd
Definition: dcahuff.c:1263
ff_dca_vlc_damp
VLC ff_dca_vlc_damp
Definition: dcahuff.c:1254
vlc.h
put_bits.h