~noskcaj/ubuntu/saucy/libav/merge0.8.7-1

« back to all changes in this revision

Viewing changes to libavcodec/ivi_common.h

  • Committer: Package Import Robot
  • Author(s): Jamie Strandboge
  • Date: 2012-11-16 12:39:50 UTC
  • mfrom: (26.1.1 quantal-security)
  • Revision ID: package-import@ubuntu.com-20121116123950-p11m12vkg2n8zc98
Tags: 6:0.8.4-0ubuntu1
No change rebuild for raring

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include <stdint.h>
35
35
 
36
36
#define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes
 
37
#define IVI4_STREAM_ANALYSER    0
 
38
#define IVI5_IS_PROTECTED       0x20
37
39
 
38
40
/**
39
41
 *  huffman codebook descriptor
116
118
    int         ypos;
117
119
    int         width;
118
120
    int         height;
 
121
    int         mb_size;
119
122
    int         is_empty;  ///< = 1 if this tile doesn't contain any data
120
123
    int         data_size; ///< size of the data in bytes
121
124
    int         num_MBs;   ///< number of macroblocks in this tile
132
135
    int             band_num;       ///< band number
133
136
    int             width;
134
137
    int             height;
 
138
    int             aheight;        ///< aligned band height
135
139
    const uint8_t   *data_ptr;      ///< ptr to the first byte of the band data
136
140
    int             data_size;      ///< size of the band data
137
141
    int16_t         *buf;           ///< pointer to the output buffer for this band
192
196
    uint8_t     chroma_bands;
193
197
} IVIPicConfig;
194
198
 
 
199
typedef struct IVI45DecContext {
 
200
    GetBitContext   gb;
 
201
    AVFrame         frame;
 
202
    RVMapDesc       rvmap_tabs[9];   ///< local corrected copy of the static rvmap tables
 
203
 
 
204
    uint32_t        frame_num;
 
205
    int             frame_type;
 
206
    int             prev_frame_type; ///< frame type of the previous frame
 
207
    uint32_t        data_size;       ///< size of the frame data in bytes from picture header
 
208
    int             is_scalable;
 
209
    int             transp_status;   ///< transparency mode status: 1 - enabled
 
210
    const uint8_t   *frame_data;     ///< input frame data pointer
 
211
    int             inter_scal;      ///< signals a sequence of scalable inter frames
 
212
    uint32_t        frame_size;      ///< frame size in bytes
 
213
    uint32_t        pic_hdr_size;    ///< picture header size in bytes
 
214
    uint8_t         frame_flags;
 
215
    uint16_t        checksum;        ///< frame checksum
 
216
 
 
217
    IVIPicConfig    pic_conf;
 
218
    IVIPlaneDesc    planes[3];       ///< color planes
 
219
 
 
220
    int             buf_switch;      ///< used to switch between three buffers
 
221
    int             dst_buf;         ///< buffer index for the currently decoded frame
 
222
    int             ref_buf;         ///< inter frame reference buffer index
 
223
    int             ref2_buf;        ///< temporal storage for switching buffers
 
224
 
 
225
    IVIHuffTab      mb_vlc;          ///< current macroblock table descriptor
 
226
    IVIHuffTab      blk_vlc;         ///< current block table descriptor
 
227
 
 
228
    uint8_t         rvmap_sel;
 
229
    uint8_t         in_imf;
 
230
    uint8_t         in_q;            ///< flag for explicitly stored quantiser delta
 
231
    uint8_t         pic_glob_quant;
 
232
    uint8_t         unknown1;
 
233
 
 
234
    uint16_t        gop_hdr_size;
 
235
    uint8_t         gop_flags;
 
236
    uint32_t        lock_word;
 
237
 
 
238
#if IVI4_STREAM_ANALYSER
 
239
    uint8_t         has_b_frames;
 
240
    uint8_t         has_transp;
 
241
    uint8_t         uses_tiling;
 
242
    uint8_t         uses_haar;
 
243
    uint8_t         uses_fullpel;
 
244
#endif
 
245
 
 
246
    int             (*decode_pic_hdr)  (struct IVI45DecContext *ctx, AVCodecContext *avctx);
 
247
    int             (*decode_band_hdr) (struct IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx);
 
248
    int             (*decode_mb_info)  (struct IVI45DecContext *ctx, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx);
 
249
    void            (*switch_buffers)  (struct IVI45DecContext *ctx);
 
250
    int             (*is_nonnull_frame)(struct IVI45DecContext *ctx);
 
251
 
 
252
    int gop_invalid;
 
253
} IVI45DecContext;
 
254
 
195
255
/** compare some properties of two pictures */
196
256
static inline int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2)
197
257
{
316
376
int  ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile);
317
377
 
318
378
/**
319
 
 *  Handle empty tiles by performing data copying and motion
320
 
 *  compensation respectively.
321
 
 *
322
 
 *  @param[in]  avctx     ptr to the AVCodecContext
323
 
 *  @param[in]  band      pointer to the band descriptor
324
 
 *  @param[in]  tile      pointer to the tile descriptor
325
 
 *  @param[in]  mv_scale  scaling factor for motion vectors
326
 
 */
327
 
void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band,
328
 
                               IVITile *tile, int32_t mv_scale);
329
 
 
330
 
/**
331
379
 *  Convert and output the current plane.
332
380
 *  This conversion is done by adding back the bias value of 128
333
381
 *  (subtracted in the encoder) and clipping the result.
348
396
 */
349
397
int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch);
350
398
 
 
399
int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
 
400
                        AVPacket *avpkt);
 
401
av_cold int ff_ivi_decode_close(AVCodecContext *avctx);
 
402
 
351
403
#endif /* AVCODEC_IVI_COMMON_H */