Mercurial > libavcodec.hg
annotate ivi_common.h @ 11321:e0feb5fa4e97 libavcodec
Make the following functions static (and remove ff_), they are only used
inside libxvidff.c:
ff_xvid_encode_init(), ff_xvid_encode_frame(), ff_xvid_encode_close()
author | cehoyos |
---|---|
date | Sun, 28 Feb 2010 18:57:18 +0000 |
parents | d617766bf19b |
children | 7dd2a45249a9 |
rev | line source |
---|---|
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
1 /* |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
2 * common functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
3 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
4 * Copyright (c) 2009 Maxim Poliakovski |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
5 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
6 * This file is part of FFmpeg. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
7 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
8 * FFmpeg is free software; you can redistribute it and/or |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
10 * License as published by the Free Software Foundation; either |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
11 * version 2.1 of the License, or (at your option) any later version. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
12 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
13 * FFmpeg is distributed in the hope that it will be useful, |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
17 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
19 * License along with FFmpeg; if not, write to the Free Software |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
21 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
22 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
23 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
24 * @file libavcodec/ivi_common.h |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
25 * This file contains structures and macros shared by both Indeo4 and |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
26 * Indeo5 decoders. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
27 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
28 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
29 #ifndef AVCODEC_IVI_COMMON_H |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
30 #define AVCODEC_IVI_COMMON_H |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
31 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
32 #include "avcodec.h" |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
33 #include "get_bits.h" |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
34 #include <stdint.h> |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
35 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
36 #define IVI_DEBUG 0 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
37 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
38 #define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
39 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
40 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
41 * huffman codebook descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
42 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
43 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
44 int32_t num_rows; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
45 uint8_t xbits[16]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
46 } IVIHuffDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
47 |
11309
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
48 /** |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
49 * macroblock/block huffman table descriptor |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
50 */ |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
51 typedef struct { |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
52 int32_t tab_sel; /// index of one of the predefined tables |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
53 /// or "7" for custom one |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
54 VLC *tab; /// pointer to the table associated with tab_sel |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
55 |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
56 //! the following are used only when tab_sel == 7 |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
57 IVIHuffDesc cust_desc; /// custom Huffman codebook descriptor |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
58 VLC cust_tab; /// vlc table for custom codebook |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
59 } IVIHuffTab; |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
60 |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
61 enum { |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
62 IVI_MB_HUFF = 0, /// Huffman table is used for coding macroblocks |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
63 IVI_BLK_HUFF = 1 /// Huffman table is used for coding blocks |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
64 }; |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
65 |
11246
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
66 extern VLC ff_ivi_mb_vlc_tabs [8]; ///< static macroblock Huffman tables |
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
67 extern VLC ff_ivi_blk_vlc_tabs[8]; ///< static block Huffman tables |
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
68 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
69 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
70 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
71 * run-value (RLE) table descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
72 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
73 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
74 uint8_t eob_sym; ///< end of block symbol |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
75 uint8_t esc_sym; ///< escape symbol |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
76 uint8_t runtab[256]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
77 int8_t valtab[256]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
78 } RVMapDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
79 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
80 extern const RVMapDesc ff_ivi_rvmap_tabs[9]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
81 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
82 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
83 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
84 * information for Indeo macroblock (16x16, 8x8 or 4x4) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
85 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
86 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
87 int16_t xpos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
88 int16_t ypos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
89 uint32_t buf_offs; ///< address in the output buffer for this mb |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
90 uint8_t type; ///< macroblock type: 0 - INTRA, 1 - INTER |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
91 uint8_t cbp; ///< coded block pattern |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
92 uint8_t q_delta; ///< quant delta |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
93 int8_t mv_x; ///< motion vector (x component) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
94 int8_t mv_y; ///< motion vector (y component) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
95 } IVIMbInfo; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
96 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
97 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
98 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
99 * information for Indeo tile |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
100 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
101 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
102 int xpos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
103 int ypos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
104 int width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
105 int height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
106 int is_empty; ///< = 1 if this tile doesn't contain any data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
107 int data_size; ///< size of the data in bytes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
108 int num_MBs; ///< number of macroblocks in this tile |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
109 IVIMbInfo *mbs; ///< array of macroblock descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
110 IVIMbInfo *ref_mbs; ///< ptr to the macroblock descriptors of the reference tile |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
111 } IVITile; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
112 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
113 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
114 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
115 * information for Indeo wavelet band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
116 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
117 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
118 int plane; ///< plane number this band belongs to |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
119 int band_num; ///< band number |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
120 int width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
121 int height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
122 const uint8_t *data_ptr; ///< ptr to the first byte of the band data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
123 int data_size; ///< size of the band data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
124 int16_t *buf; ///< pointer to the output buffer for this band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
125 int16_t *ref_buf; ///< pointer to the reference frame buffer (for motion compensation) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
126 int16_t *bufs[3]; ///< array of pointers to the band buffers |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
127 int pitch; ///< pitch associated with the buffers above |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
128 int is_empty; ///< = 1 if this band doesn't contain any data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
129 int mb_size; ///< macroblock size |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
130 int blk_size; ///< block size |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
131 int is_halfpel; ///< precision of the motion compensation: 0 - fullpel, 1 - halfpel |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
132 int inherit_mv; ///< tells if motion vector is inherited from reference macroblock |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
133 int inherit_qdelta; ///< tells if quantiser delta is inherited from reference macroblock |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
134 int qdelta_present; ///< tells if Qdelta signal is present in the bitstream (Indeo5 only) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
135 int quant_mat; ///< dequant matrix index |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
136 int glob_quant; ///< quant base for this band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
137 const uint8_t *scan; ///< ptr to the scan pattern |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
138 |
11309
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
139 IVIHuffTab blk_vlc; ///< vlc table for decoding block data |
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
140 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
141 uint16_t *dequant_intra; ///< ptr to dequant tables for intra blocks |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
142 uint16_t *dequant_inter; ///< ptr dequant tables for inter blocks |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
143 int num_corr; ///< number of correction entries |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
144 uint8_t corr[61*2]; ///< rvmap correction pairs |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
145 int rvmap_sel; ///< rvmap table selector |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
146 RVMapDesc *rv_map; ///< ptr to the RLE table for this band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
147 int num_tiles; ///< number of tiles in this band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
148 IVITile *tiles; ///< array of tile descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
149 void (*inv_transform)(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags); ///< inverse transform function pointer |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
150 void (*dc_transform) (const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); ///< dc transform function pointer, it may be NULL |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
151 int is_2d_trans; ///< 1 indicates that the two-dimensional inverse transform is used |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
152 int32_t checksum; ///< for debug purposes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
153 int checksum_present; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
154 int bufsize; ///< band buffer size in bytes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
155 const uint8_t *intra_base; ///< quantization matrix for intra blocks |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
156 const uint8_t *inter_base; ///< quantization matrix for inter blocks |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
157 const uint8_t *intra_scale; ///< quantization coefficient for intra blocks |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
158 const uint8_t *inter_scale; ///< quantization coefficient for inter blocks |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
159 } IVIBandDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
160 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
161 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
162 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
163 * color plane (luma or chroma) information |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
164 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
165 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
166 uint16_t width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
167 uint16_t height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
168 uint8_t num_bands; ///< number of bands this plane subdivided into |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
169 IVIBandDesc *bands; ///< array of band descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
170 } IVIPlaneDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
171 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
172 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
173 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
174 uint16_t pic_width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
175 uint16_t pic_height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
176 uint16_t chroma_width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
177 uint16_t chroma_height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
178 uint16_t tile_width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
179 uint16_t tile_height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
180 uint8_t luma_bands; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
181 uint8_t chroma_bands; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
182 } IVIPicConfig; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
183 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
184 /** compares some properties of two pictures */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
185 static inline int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
186 { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
187 return (str1->pic_width != str2->pic_width || str1->pic_height != str2->pic_height || |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
188 str1->chroma_width != str2->chroma_width || str1->chroma_height != str2->chroma_height || |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
189 str1->tile_width != str2->tile_width || str1->tile_height != str2->tile_height || |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
190 str1->luma_bands != str2->luma_bands || str1->chroma_bands != str2->chroma_bands); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
191 } |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
192 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
193 /** calculate number of tiles in a stride */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
194 #define IVI_NUM_TILES(stride, tile_size) (((stride) + (tile_size) - 1) / (tile_size)) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
195 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
196 /** calculate number of macroblocks in a tile */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
197 #define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size) \ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
198 ((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size))) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
199 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
200 /** convert unsigned values into signed ones (the sign is in the LSB) */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
201 #define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1))) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
202 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
203 /** scales motion vector */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
204 static inline int ivi_scale_mv(int mv, int mv_scale) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
205 { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
206 return (mv + (mv > 0) + (mv_scale - 1)) >> mv_scale; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
207 } |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
208 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
209 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
210 * Generates a huffman codebook from the given descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
211 * and converts it into the FFmpeg VLC table. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
212 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
213 * @param cb [in] pointer to codebook descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
214 * @param vlc [out] where to place the generated VLC table |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
215 * @param flag [in] flag: 1 - for static or 0 for dynamic tables |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
216 * @return result code: 0 - OK, -1 = error (invalid codebook descriptor) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
217 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
218 int ff_ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
219 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
220 /** |
11246
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
221 * Initializes static codes used for macroblock and block decoding. |
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
222 */ |
11308
06e2ff1295bd
Make it clear that ff_ivi_init_static_vlc() does not need arguments
kostya
parents:
11246
diff
changeset
|
223 void ff_ivi_init_static_vlc(void); |
11246
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
224 |
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
225 /** |
11309
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
226 * Decodes a huffman codebook descriptor from the bitstream |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
227 * and selects specified huffman table. |
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
228 * |
11309
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
229 * @param gb [in,out] the GetBit context |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
230 * @param desc_coded [in] flag signalling if table descriptor was coded |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
231 * @param which_tab [in] codebook purpose (IVI_MB_HUFF or IVI_BLK_HUFF) |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
232 * @param huff_tab [out] pointer to the descriptor of the selected table |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
233 * @param avctx [in] AVCodecContext pointer |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
234 * @return zero on success, negative value otherwise |
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
235 */ |
11309
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
236 int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, |
d617766bf19b
Encapsulate VLC information needed for decoding blocks and macroblocks in
kostya
parents:
11308
diff
changeset
|
237 IVIHuffTab *huff_tab, AVCodecContext *avctx); |
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
238 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
239 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
240 * Compares two huffman codebook descriptors. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
241 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
242 * @param desc1 [in] ptr to the 1st descriptor to compare |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
243 * @param desc2 [in] ptr to the 2nd descriptor to compare |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
244 * @return comparison result: 0 - equal, 1 - not equal |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
245 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
246 int ff_ivi_huff_desc_cmp(const IVIHuffDesc *desc1, const IVIHuffDesc *desc2); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
247 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
248 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
249 * Copies huffman codebook descriptors. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
250 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
251 * @param dst [out] ptr to the destination descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
252 * @param src [in] ptr to the source descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
253 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
254 void ff_ivi_huff_desc_copy(IVIHuffDesc *dst, const IVIHuffDesc *src); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
255 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
256 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
257 * Initializes planes (prepares descriptors, allocates buffers etc). |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
258 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
259 * @param planes [in,out] pointer to the array of the plane descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
260 * @param cfg [in] pointer to the ivi_pic_config structure describing picture layout |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
261 * @return result code: 0 - OK |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
262 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
263 int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
264 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
265 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
266 * Frees planes, bands and macroblocks buffers. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
267 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
268 * @param planes [in] pointer to the array of the plane descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
269 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
270 void ff_ivi_free_buffers(IVIPlaneDesc *planes); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
271 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
272 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
273 * Initializes tile and macroblock descriptors. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
274 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
275 * @param planes [in,out] pointer to the array of the plane descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
276 * @param tile_width [in] tile width |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
277 * @param tile_height [in] tile height |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
278 * @return result code: 0 - OK |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
279 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
280 int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
281 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
282 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
283 * Decodes size of the tile data. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
284 * The size is stored as a variable-length field having the following format: |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
285 * if (tile_data_size < 255) than this field is only one byte long |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
286 * if (tile_data_size >= 255) than this field four is byte long: 0xFF X1 X2 X3 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
287 * where X1-X3 is size of the tile data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
288 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
289 * @param gb [in,out] the GetBit context |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
290 * @return size of the tile data in bytes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
291 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
292 int ff_ivi_dec_tile_data_size(GetBitContext *gb); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
293 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
294 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
295 * Decodes block data: |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
296 * extracts huffman-coded transform coefficients from the bitstream, |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
297 * dequantizes them, applies inverse transform and motion compensation |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
298 * in order to reconstruct the picture. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
299 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
300 * @param gb [in,out] the GetBit context |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
301 * @param band [in] pointer to the band descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
302 * @param tile [in] pointer to the tile descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
303 * @return result code: 0 - OK, -1 = error (corrupted blocks data) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
304 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
305 int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
306 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
307 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
308 * Handles empty tiles by performing data copying and motion |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
309 * compensation respectively. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
310 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
311 * @param avctx [in] ptr to the AVCodecContext |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
312 * @param band [in] pointer to the band descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
313 * @param tile [in] pointer to the tile descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
314 * @param mv_scale [in] scaling factor for motion vectors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
315 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
316 void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
317 IVITile *tile, int32_t mv_scale); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
318 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
319 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
320 * Converts and outputs the current plane. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
321 * This conversion is done by adding back the bias value of 128 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
322 * (subtracted in the encoder) and clipping the result. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
323 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
324 * @param plane [in] pointer to the descriptor of the plane being processed |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
325 * @param dst [out] pointer to the buffer receiving converted pixels |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
326 * @param dst_pitch [in] pitch for moving to the next y line |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
327 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
328 void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
329 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
330 #if IVI_DEBUG |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
331 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
332 * Calculates band checksum from band data. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
333 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
334 uint16_t ivi_calc_band_checksum (IVIBandDesc *band); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
335 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
336 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
337 * Verifies that band data lies in range. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
338 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
339 int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
340 #endif |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
341 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
342 #endif /* AVCODEC_IVI_COMMON_H */ |