Mercurial > libavcodec.hg
annotate ivi_common.h @ 11300:1f512abdf680 libavcodec
Simplify code to set cbp_*
this seems 1 cpu cycle slower even though we practically just remove code.
Speed loss seems caused by the merge of if(left_type), iam commiting this
anyway as i cant imagine this to be anything but compiler messup.
author | michael |
---|---|
date | Fri, 26 Feb 2010 09:13:40 +0000 |
parents | b75449aaea3e |
children | 06e2ff1295bd |
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 |
11246
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
48 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
|
49 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
|
50 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
51 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
52 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
53 * run-value (RLE) table descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
54 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
55 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
56 uint8_t eob_sym; ///< end of block symbol |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
57 uint8_t esc_sym; ///< escape symbol |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
58 uint8_t runtab[256]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
59 int8_t valtab[256]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
60 } RVMapDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
61 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
62 extern const RVMapDesc ff_ivi_rvmap_tabs[9]; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
63 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
64 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
65 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
66 * information for Indeo macroblock (16x16, 8x8 or 4x4) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
67 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
68 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
69 int16_t xpos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
70 int16_t ypos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
71 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
|
72 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
|
73 uint8_t cbp; ///< coded block pattern |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
74 uint8_t q_delta; ///< quant delta |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
75 int8_t mv_x; ///< motion vector (x component) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
76 int8_t mv_y; ///< motion vector (y component) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
77 } IVIMbInfo; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
78 |
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 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
81 * information for Indeo tile |
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 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
84 int xpos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
85 int ypos; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
86 int width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
87 int height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
88 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
|
89 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
|
90 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
|
91 IVIMbInfo *mbs; ///< array of macroblock descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
92 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
|
93 } IVITile; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
94 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
95 |
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 * information for Indeo wavelet band |
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 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
100 int plane; ///< plane number this band belongs to |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
101 int band_num; ///< band number |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
102 int width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
103 int height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
104 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
|
105 int data_size; ///< size of the band data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
106 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
|
107 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
|
108 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
|
109 int pitch; ///< pitch associated with the buffers above |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
110 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
|
111 int mb_size; ///< macroblock size |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
112 int blk_size; ///< block size |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
113 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
|
114 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
|
115 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
|
116 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
|
117 int quant_mat; ///< dequant matrix index |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
118 int glob_quant; ///< quant base for this band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
119 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
|
120 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
121 int huff_sel; ///< huffman table for this band |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
122 IVIHuffDesc huff_desc; ///< table descriptor associated with the selector above |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
123 VLC *blk_vlc; ///< ptr to the vlc table for decoding block data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
124 VLC blk_vlc_cust; ///< custom block vlc table |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
125 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
126 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
|
127 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
|
128 int num_corr; ///< number of correction entries |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
129 uint8_t corr[61*2]; ///< rvmap correction pairs |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
130 int rvmap_sel; ///< rvmap table selector |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
131 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
|
132 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
|
133 IVITile *tiles; ///< array of tile descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
134 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
|
135 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
|
136 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
|
137 int32_t checksum; ///< for debug purposes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
138 int checksum_present; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
139 int bufsize; ///< band buffer size in bytes |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
140 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
|
141 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
|
142 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
|
143 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
|
144 } IVIBandDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
145 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
146 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
147 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
148 * color plane (luma or chroma) information |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
149 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
150 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
151 uint16_t width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
152 uint16_t height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
153 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
|
154 IVIBandDesc *bands; ///< array of band descriptors |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
155 } IVIPlaneDesc; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
156 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
157 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
158 typedef struct { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
159 uint16_t pic_width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
160 uint16_t pic_height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
161 uint16_t chroma_width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
162 uint16_t chroma_height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
163 uint16_t tile_width; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
164 uint16_t tile_height; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
165 uint8_t luma_bands; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
166 uint8_t chroma_bands; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
167 } IVIPicConfig; |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
168 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
169 /** compares some properties of two pictures */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
170 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
|
171 { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
172 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
|
173 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
|
174 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
|
175 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
|
176 } |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
177 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
178 /** calculate number of tiles in a stride */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
179 #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
|
180 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
181 /** calculate number of macroblocks in a tile */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
182 #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
|
183 ((((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
|
184 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
185 /** 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
|
186 #define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1))) |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
187 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
188 /** scales motion vector */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
189 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
|
190 { |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
191 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
|
192 } |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
193 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
194 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
195 * Generates a huffman codebook from the given descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
196 * and converts it into the FFmpeg VLC table. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
197 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
198 * @param cb [in] pointer to codebook descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
199 * @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
|
200 * @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
|
201 * @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
|
202 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
203 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
|
204 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
205 /** |
11246
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
206 * 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
|
207 */ |
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
208 void ff_ivi_init_static_vlc(); |
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
209 |
b75449aaea3e
Macroblock and block Huffman code sets are to be used by both Indeo 4 and
kostya
parents:
11180
diff
changeset
|
210 /** |
11054
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
211 * Decodes a huffman codebook descriptor from the bitstream. |
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 gb [in,out] the GetBit context |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
214 * @param desc [out] ptr to descriptor to be filled with data |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
215 * @return selector indicating huffman table: |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
216 * (0...6 - predefined, 7 - custom one supplied with the bitstream) |
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_dec_huff_desc(GetBitContext *gb, IVIHuffDesc *desc); |
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 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
221 * Compares two huffman codebook descriptors. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
222 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
223 * @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
|
224 * @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
|
225 * @return comparison result: 0 - equal, 1 - not equal |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
226 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
227 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
|
228 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
229 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
230 * Copies huffman codebook descriptors. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
231 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
232 * @param dst [out] ptr to the destination descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
233 * @param src [in] ptr to the source descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
234 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
235 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
|
236 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
237 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
238 * Initializes planes (prepares descriptors, allocates buffers etc). |
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 * @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
|
241 * @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
|
242 * @return result code: 0 - OK |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
243 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
244 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
|
245 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
246 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
247 * Frees planes, bands and macroblocks buffers. |
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 * @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
|
250 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
251 void ff_ivi_free_buffers(IVIPlaneDesc *planes); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
252 |
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 * Initializes tile and macroblock descriptors. |
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 * @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
|
257 * @param tile_width [in] tile width |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
258 * @param tile_height [in] tile height |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
259 * @return result code: 0 - OK |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
260 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
261 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
|
262 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
263 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
264 * Decodes size of the tile data. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
265 * 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
|
266 * 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
|
267 * 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
|
268 * 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
|
269 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
270 * @param gb [in,out] the GetBit context |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
271 * @return size of the tile data in bytes |
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 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
|
274 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
275 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
276 * Decodes block data: |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
277 * extracts huffman-coded transform coefficients from the bitstream, |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
278 * dequantizes them, applies inverse transform and motion compensation |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
279 * in order to reconstruct the picture. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
280 * |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
281 * @param gb [in,out] the GetBit context |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
282 * @param band [in] pointer to the band descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
283 * @param tile [in] pointer to the tile descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
284 * @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
|
285 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
286 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
|
287 |
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 * 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
|
290 * compensation respectively. |
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 * @param avctx [in] ptr to the AVCodecContext |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
293 * @param band [in] pointer to the band descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
294 * @param tile [in] pointer to the tile descriptor |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
295 * @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
|
296 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
297 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
|
298 IVITile *tile, int32_t mv_scale); |
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 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
301 * Converts and outputs the current plane. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
302 * 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
|
303 * (subtracted in the encoder) and clipping the result. |
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 * @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
|
306 * @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
|
307 * @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
|
308 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
309 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
|
310 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
311 #if IVI_DEBUG |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
312 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
313 * Calculates band checksum from band data. |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
314 */ |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
315 uint16_t ivi_calc_band_checksum (IVIBandDesc *band); |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
316 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
317 /** |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
318 * Verifies that band data lies in range. |
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 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
|
321 #endif |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
322 |
3b79a8709f43
Indeo Video Interactive 4 and 5 common code and DSP functions.
kostya
parents:
diff
changeset
|
323 #endif /* AVCODEC_IVI_COMMON_H */ |