FFmpeg
hqx.h
Go to the documentation of this file.
1 /*
2  * Canopus HQX decoder
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_HQX_H
22 #define AVCODEC_HQX_H
23 
24 #include <stdint.h>
25 
26 #include "libavutil/frame.h"
27 #include "libavutil/mem_internal.h"
28 
29 #include "get_bits.h"
30 #include "hqxdsp.h"
31 
32 enum HQXACMode {
33  HQX_AC_Q0 = 0,
40 };
41 
42 typedef struct HQXLUT {
43  int16_t lev;
45  int8_t bits;
46 } HQXLUT;
47 
48 typedef struct HQXAC {
50  const HQXLUT *lut;
51 } HQXAC;
52 
53 struct HQXContext;
54 
55 typedef int (*mb_decode_func)(struct HQXContext *ctx,
56  int slice_no, int x, int y);
57 
58 typedef struct HQXSlice {
60  DECLARE_ALIGNED(16, int16_t, block)[16][64];
61 } HQXSlice;
62 
63 typedef struct HQXContext {
65  HQXSlice slice[16];
66 
69 
70  int format, dcb, width, height;
72 
74  unsigned int data_size;
75  uint32_t slice_off[17];
76 
78  VLC dc_vlc[3];
79 } HQXContext;
80 
81 #define HQX_CBP_VLC_BITS 5
82 #define HQX_DC_VLC_BITS 9
83 
84 extern const HQXAC ff_hqx_ac[NUM_HQX_AC];
85 
87 
88 #endif /* AVCODEC_HQX_H */
#define extra_bits(eb)
Definition: intrax8.c:125
Definition: hqx.h:48
fg outputs[0] format
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
int interlaced
Definition: hqx.h:71
int(* mb_decode_func)(struct HQXContext *ctx, int slice_no, int x, int y)
Definition: hqx.h:55
GetBitContext gb
Definition: hqx.h:59
Definition: hqx.h:36
mb_decode_func decode_func
Definition: hqx.h:68
int ff_hqx_init_vlcs(HQXContext *ctx)
Definition: hqxvlc.c:2151
Definition: hqx.h:35
const HQXAC ff_hqx_ac[NUM_HQX_AC]
Definition: hqxvlc.c:2132
uint8_t * src
Definition: hqx.h:73
The exact code depends on how similar the blocks are and how related they are to the block
uint8_t
uint8_t run
Definition: hqx.h:44
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:117
#define height
bitstream reader API header.
const HQXLUT * lut
Definition: hqx.h:50
int lut_bits
Definition: hqx.h:49
Definition: hqx.h:63
Definition: vlc.h:26
reference-counted frame API
Definition: hqx.h:58
static VLC dc_vlc
Definition: clearvideo.c:84
Definition: hqx.h:37
AVFormatContext * ctx
Definition: movenc.c:48
HQX DSP routines.
HQXACMode
Definition: hqx.h:32
int width
Definition: hqx.h:70
Definition: hqx.h:33
int8_t bits
Definition: hqx.h:45
Definition: hqx.h:42
int16_t lev
Definition: hqx.h:43
int
unsigned int data_size
Definition: hqx.h:74
AVFrame * pic
Definition: hqx.h:67
Definition: hqx.h:39
VLC cbp_vlc
Definition: hqx.h:77
Definition: hqx.h:34
HQXDSPContext hqxdsp
Definition: hqx.h:64