2 * This file is part of FFmpeg.
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.
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.
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
19 #ifndef AVCODEC_INTRAX8_H
20 #define AVCODEC_INTRAX8_H
24 #include "mpegvideo.h"
26 #include "intrax8dsp.h"
28 #include "mpegpicture.h"
30 typedef struct IntraX8Context {
31 VLC *j_ac_vlc[4]; // they point to the static j_mb_vlc
37 // set by ff_intrax8_common_init
38 uint8_t *prediction_table; // 2 * (mb_w * 2)
39 ScanTable scantable[3];
41 uint8_t idct_permutation[64];
42 AVCodecContext *avctx;
44 //set by the caller codec
46 IntraX8DSPContext dsp;
56 // calculated per frame
58 int divide_quant_dc_luma;
59 int divide_quant_dc_chroma;
61 uint8_t scratchpad[42]; // size of the block is fixed (8x8 plus padding)
74 * Initialize IntraX8 frame decoder.
75 * Requires valid MpegEncContext with valid s->mb_width before calling.
76 * @param avctx pointer to AVCodecContext
77 * @param w pointer to IntraX8Context
78 * @param idsp pointer to IDCTDSPContext
79 * @param s pointer to MpegEncContext of the parent codec
80 * @return 0 on success, a negative AVERROR value on error
82 int ff_intrax8_common_init(AVCodecContext *avctx,
83 IntraX8Context *w, IDCTDSPContext *idsp,
84 MpegEncContext *const s);
87 * Destroy IntraX8 frame structure.
88 * @param w pointer to IntraX8Context
90 void ff_intrax8_common_end(IntraX8Context *w);
93 * Decode single IntraX8 frame.
94 * The parent codec must call ff_mpv_frame_start() before calling this function.
95 * The parent codec must call ff_mpv_frame_end() after calling this function.
96 * This function does not use ff_mpv_decode_mb().
97 * lowres decoding is theoretically impossible.
98 * @param w pointer to IntraX8Context
99 * @param pict the output Picture containing an AVFrame
100 * @param gb open bitstream reader
101 * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
102 * @param quant_offset offset away from zero
103 * @param loopfilter enable filter after decoding a block
105 int ff_intrax8_decode_picture(IntraX8Context *w, Picture *pict,
107 int quant, int halfpq, int loopfilter);
109 #endif /* AVCODEC_INTRAX8_H */