9abc7e0f |
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
|
98790382 |
#ifndef AVCODEC_INTRAX8_H
#define AVCODEC_INTRAX8_H |
49e9a4bf |
|
15932389 |
#include "blockdsp.h" |
9106a698 |
#include "get_bits.h" |
68127e1b |
#include "idctdsp.h" |
15616eb0 |
#include "intrax8dsp.h" |
9a0aa8d0 |
#include "wmv2dsp.h" |
eaeba6f2 |
#include "mpegpicture.h" |
f0a838e5 |
|
e4cbf752 |
typedef struct IntraX8Context { |
2ade1cda |
VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc
VLC *j_orient_vlc;
VLC *j_dc_vlc[3]; |
9abc7e0f |
int use_quant_matrix; |
2ade1cda |
// set by ff_intrax8_common_init
uint8_t *prediction_table; // 2 * (mb_w * 2) |
9abc7e0f |
ScanTable scantable[3]; |
9a0aa8d0 |
WMV2DSPContext wdsp;
uint8_t idct_permutation[64]; |
1eaae7ab |
AVCodecContext *avctx; |
9fa888c0 |
int *block_last_index; ///< last nonzero coefficient in block
int16_t (*block)[64]; |
2ade1cda |
// set by the caller codec |
15616eb0 |
IntraX8DSPContext dsp; |
68127e1b |
IDCTDSPContext idsp; |
15932389 |
BlockDSPContext bdsp; |
9abc7e0f |
int quant;
int dquant;
int qsum; |
57739332 |
int loopfilter; |
eaeba6f2 |
AVFrame *frame; |
8072345e |
GetBitContext *gb; |
2ade1cda |
// calculated per frame |
9abc7e0f |
int quant_dc_chroma;
int divide_quant_dc_luma;
int divide_quant_dc_chroma; |
922b7e6d |
uint8_t *dest[3]; |
65f14128 |
uint8_t scratchpad[42]; // size of the block is fixed (8x8 plus padding) |
2ade1cda |
// changed per block |
9abc7e0f |
int edges;
int flat_dc;
int predicted_dc;
int raw_orient;
int chroma_orient;
int orient;
int est_run; |
d0540fd0 |
// block props
int mb_x, mb_y;
int mb_width, mb_height; |
9abc7e0f |
} IntraX8Context;
|
ad8aa8e6 |
/**
* Initialize IntraX8 frame decoder. |
1eaae7ab |
* @param avctx pointer to AVCodecContext |
ad8aa8e6 |
* @param w pointer to IntraX8Context |
68127e1b |
* @param idsp pointer to IDCTDSPContext |
9fa888c0 |
* @param block pointer to block array
* @param block_last_index pointer to index array |
d0540fd0 |
* @param mb_width macroblock width
* @param mb_height macroblock height |
0372e73f |
* @return 0 on success, a negative AVERROR value on error |
ad8aa8e6 |
*/ |
1eaae7ab |
int ff_intrax8_common_init(AVCodecContext *avctx,
IntraX8Context *w, IDCTDSPContext *idsp, |
9fa888c0 |
int16_t (*block)[64],
int block_last_index[12], |
ca8c7591 |
int mb_width, int mb_height); |
ad8aa8e6 |
/**
* Destroy IntraX8 frame structure.
* @param w pointer to IntraX8Context
*/ |
2ade1cda |
void ff_intrax8_common_end(IntraX8Context *w); |
ad8aa8e6 |
/**
* Decode single IntraX8 frame. |
c29ac4ab |
* lowres decoding is theoretically impossible. |
ad8aa8e6 |
* @param w pointer to IntraX8Context |
eaeba6f2 |
* @param pict the output Picture containing an AVFrame |
8072345e |
* @param gb open bitstream reader |
b1268e0f |
* @param mb_x pointer to the x coordinate of the current macroblock
* @param mb_y pointer to the y coordinate of the current macroblock |
ad8aa8e6 |
* @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
* @param quant_offset offset away from zero |
57739332 |
* @param loopfilter enable filter after decoding a block |
ad8aa8e6 |
*/ |
eaeba6f2 |
int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict, |
b1268e0f |
GetBitContext *gb, int *mb_x, int *mb_y, |
c2084ffc |
int quant, int halfpq,
int loopfilter, int lowdelay); |
49e9a4bf |
|
98790382 |
#endif /* AVCODEC_INTRAX8_H */ |