FFmpeg
intrax8.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVCODEC_INTRAX8_H
20 #define AVCODEC_INTRAX8_H
21 
22 #include "blockdsp.h"
23 #include "get_bits.h"
24 #include "intrax8dsp.h"
25 #include "wmv2dsp.h"
26 #include "mpegpicture.h"
27 
28 typedef struct IntraX8Context {
29  const VLCElem *j_ac_vlc_table[4]; // they point to the static j_mb_vlc.table
32 
34 
35  // set by ff_intrax8_common_init
36  uint8_t *prediction_table; // 2 * (mb_w * 2)
37  uint8_t permutated_scantable[3][64];
39  uint8_t idct_permutation[64];
41  int *block_last_index; ///< last nonzero coefficient in block
42  int16_t (*block)[64];
43 
44  // set by the caller codec
47  int quant;
48  int dquant;
49  int qsum;
53 
54  // calculated per frame
58  uint8_t *dest[3];
59  uint8_t scratchpad[42]; // size of the block is fixed (8x8 plus padding)
60 
61  // changed per block
62  int edges;
63  int flat_dc;
67  int orient;
68  int est_run;
69 
70  // block props
71  int mb_x, mb_y;
74 
75 /**
76  * Initialize IntraX8 frame decoder.
77  * @param avctx pointer to AVCodecContext
78  * @param w pointer to IntraX8Context
79  * @param block pointer to block array
80  * @param block_last_index pointer to index array
81  * @param mb_width macroblock width
82  * @param mb_height macroblock height
83  * @return 0 on success, a negative AVERROR value on error
84  */
87  int16_t (*block)[64],
88  int block_last_index[12],
89  int mb_width, int mb_height);
90 
91 /**
92  * Destroy IntraX8 frame structure.
93  * @param w pointer to IntraX8Context
94  */
96 
97 /**
98  * Decode single IntraX8 frame.
99  * lowres decoding is theoretically impossible.
100  * @param w pointer to IntraX8Context
101  * @param pict the output Picture containing an AVFrame
102  * @param gb open bitstream reader
103  * @param mb_x pointer to the x coordinate of the current macroblock
104  * @param mb_y pointer to the y coordinate of the current macroblock
105  * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
106  * @param quant_offset offset away from zero
107  * @param loopfilter enable filter after decoding a block
108  */
110  GetBitContext *gb, int *mb_x, int *mb_y,
111  int quant, int halfpq,
112  int loopfilter, int lowdelay);
113 
114 #endif /* AVCODEC_INTRAX8_H */
IntraX8Context::frame
AVFrame * frame
Definition: intrax8.h:51
IntraX8Context::j_ac_vlc_table
const VLCElem * j_ac_vlc_table[4]
Definition: intrax8.h:29
blockdsp.h
IntraX8DSPContext
Definition: intrax8dsp.h:25
IntraX8Context::dsp
IntraX8DSPContext dsp
Definition: intrax8.h:45
IntraX8Context::quant_dc_chroma
int quant_dc_chroma
Definition: intrax8.h:55
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:330
w
uint8_t w
Definition: llviddspenc.c:38
IntraX8Context::gb
GetBitContext * gb
Definition: intrax8.h:52
Picture
Picture.
Definition: mpegpicture.h:46
IntraX8Context::divide_quant_dc_luma
int divide_quant_dc_luma
Definition: intrax8.h:56
IntraX8Context::j_dc_vlc_table
const VLCElem * j_dc_vlc_table[3]
Definition: intrax8.h:31
BlockDSPContext
Definition: blockdsp.h:32
intrax8dsp.h
IntraX8Context::wdsp
WMV2DSPContext wdsp
Definition: intrax8.h:38
IntraX8Context::prediction_table
uint8_t * prediction_table
Definition: intrax8.h:36
IntraX8Context::orient
int orient
Definition: intrax8.h:67
IntraX8Context::raw_orient
int raw_orient
Definition: intrax8.h:65
IntraX8Context::qsum
int qsum
Definition: intrax8.h:49
GetBitContext
Definition: get_bits.h:107
IntraX8Context::est_run
int est_run
Definition: intrax8.h:68
IntraX8Context::loopfilter
int loopfilter
Definition: intrax8.h:50
quant
static int quant(float coef, const float Q, const float rounding)
Quantize one coefficient.
Definition: aacenc_utils.h:59
IntraX8Context::divide_quant_dc_chroma
int divide_quant_dc_chroma
Definition: intrax8.h:57
get_bits.h
IntraX8Context
Definition: intrax8.h:28
IntraX8Context::predicted_dc
int predicted_dc
Definition: intrax8.h:64
wmv2dsp.h
IntraX8Context::dquant
int dquant
Definition: intrax8.h:48
IntraX8Context::chroma_orient
int chroma_orient
Definition: intrax8.h:66
IntraX8Context::avctx
AVCodecContext * avctx
Definition: intrax8.h:40
IntraX8Context::j_orient_vlc_table
const VLCElem * j_orient_vlc_table
Definition: intrax8.h:30
ff_intrax8_common_end
void ff_intrax8_common_end(IntraX8Context *w)
Destroy IntraX8 frame structure.
Definition: intrax8.c:733
IntraX8Context::scratchpad
uint8_t scratchpad[42]
Definition: intrax8.h:59
IntraX8Context::flat_dc
int flat_dc
Definition: intrax8.h:63
VLCElem
Definition: vlc.h:27
IntraX8Context::block
int16_t(* block)[64]
Definition: intrax8.h:42
mpegpicture.h
IntraX8Context::edges
int edges
Definition: intrax8.h:62
IntraX8Context::block_last_index
int * block_last_index
last nonzero coefficient in block
Definition: intrax8.h:41
WMV2DSPContext
Definition: wmv2dsp.h:26
IntraX8Context::dest
uint8_t * dest[3]
Definition: intrax8.h:58
ff_intrax8_decode_picture
int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict, GetBitContext *gb, int *mb_x, int *mb_y, int quant, int halfpq, int loopfilter, int lowdelay)
Decode single IntraX8 frame.
Definition: intrax8.c:738
IntraX8Context::mb_height
int mb_height
Definition: intrax8.h:72
IntraX8Context::quant
int quant
Definition: intrax8.h:47
IntraX8Context::idct_permutation
uint8_t idct_permutation[64]
Definition: intrax8.h:39
ff_intrax8_common_init
int ff_intrax8_common_init(AVCodecContext *avctx, IntraX8Context *w, int16_t(*block)[64], int block_last_index[12], int mb_width, int mb_height)
Initialize IntraX8 frame decoder.
Definition: intrax8.c:694
IntraX8Context::use_quant_matrix
int use_quant_matrix
Definition: intrax8.h:33
AVCodecContext
main external API structure.
Definition: avcodec.h:426
IntraX8Context::mb_y
int mb_y
Definition: intrax8.h:71
IntraX8Context::mb_width
int mb_width
Definition: intrax8.h:72
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
IntraX8Context::bdsp
BlockDSPContext bdsp
Definition: intrax8.h:46
IntraX8Context::mb_x
int mb_x
Definition: intrax8.h:71
IntraX8Context::permutated_scantable
uint8_t permutated_scantable[3][64]
Definition: intrax8.h:37