1 /*
2 * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
3 * Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef AVCODEC_CAVS_H
23 #define AVCODEC_CAVS_H
24
31
32 #define SLICE_MAX_START_CODE 0x000001af
33 #define EXT_START_CODE 0x000001b5
34 #define USER_START_CODE 0x000001b2
35 #define CAVS_START_CODE 0x000001b0
36 #define PIC_I_START_CODE 0x000001b3
37 #define PIC_PB_START_CODE 0x000001b6
38
46
47 #define ESCAPE_CODE 59
48
57
58 #define MV_BWD_OFFS 12
60
74 };
75
81 };
82
92 };
93
102 };
103
111 };
112
118 };
119
141 };
142
149
156 };
157
162
173 int dist[2];
///< temporal distances from current frame to ref frames
187 int flags;
///< availability flags of neighbouring macroblocks
188 int stc;
///< last start code
192
193 /** mv motion vector cache
194 0: D3 B2 B3 C2
195 4: A1 X0 X1 -
196 8: A3 X2 X3 -
197
198 X are the vectors in the current macroblock (5,6,9,10)
199 A is the macroblock to the left (4,8)
200 B is the macroblock to the top (1,2)
201 C is the macroblock to the top-right (3)
202 D is the macroblock to the top-left (0)
203
204 the same is repeated for backward motion vectors */
208
209 /** luma pred mode cache
210 0: -- B2 B3
211 3: A1 X0 X1
212 6: A3 X2 X3 */
222
223 /** intra prediction is done with un-deblocked samples
224 they are saved here before deblocking the MB */
229
233
234 /* scaling factors for MV prediction */
238
240
244
249
251 switch(size) {
256 mv[1] = mv[0];
257 break;
260 break;
261 }
262 }
263
278
279 #endif /* AVCODEC_CAVS_H */
This structure describes decoded (raw) audio or video data.
uint8_t * edge_emu_buffer
int direct_den[2]
for scaling in direct B block
const cavs_vector ff_cavs_intra_mv
mark block as using intra prediction
int mbidx
macroblock coordinates
const uint8_t ff_cavs_chroma_qp[64]
void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv)
void ff_cavs_init_mb(AVSContext *h)
initialise predictors for motion vectors and intra prediction
int ff_cavs_init(AVCodecContext *avctx)
uint8_t intern_border_y[26]
void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top, uint8_t **left, int block)
uint8_t * top_border_y
intra prediction is done with un-deblocked samples they are saved here before deblocking the MB ...
cavs_vector mv[2 *4 *3]
mv motion vector cache 0: D3 B2 B3 C2 4: A1 X0 X1 - 8: A3 X2 X3 -
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
bitstream reader API header.
int dist[2]
temporal distances from current frame to ref frames
int ff_cavs_next_mb(AVSContext *h)
save predictors for later macroblocks and increase macroblock address
void ff_cavs_load_intra_pred_chroma(AVSContext *h)
int scale_den[2]
for scaling neighbouring MVs
int ff_cavs_end(AVCodecContext *avctx)
AVSFrame cur
currently decoded frame
int ff_cavs_init_top_lines(AVSContext *h)
some predictions require data from the top-neighbouring macroblock.
uint8_t left_border_y[26]
void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC, enum cavs_mv_pred mode, enum cavs_block size, int ref)
int skip_mode_flag
select between skip_count or one skip_flag per MB
uint8_t * cv
current MB sample pointers
int stream_revision
0 for samples from 2006, 1 for rm52j encoder
uint8_t left_border_u[10]
void(* intra_pred_c[7])(uint8_t *d, uint8_t *top, uint8_t *left, ptrdiff_t stride)
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
const uint8_t ff_cavs_partition_flags[30]
const cavs_vector ff_cavs_dir_mv
mark block as "no prediction from this direction" e.g.
uint8_t left_border_v[10]
static const int8_t mv[256][2]
void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type)
main external API structure.
int sym_factor
for scaling in symmetrical B block
int pred_mode_Y[3 *3]
luma pred mode cache 0: – B2 B3 3: A1 X0 X1 6: A3 X2 X3
void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type)
in-loop deblocking filter for a single macroblock
static int ref[MAX_W *MAX_W]
int flags
availability flags of neighbouring macroblocks
Core video DSP helper functions.
Decoded Picture Buffer (DPB).
static void set_mvs(cavs_vector *mv, enum cavs_block size)
void(* intra_pred_l[8])(uint8_t *d, uint8_t *top, uint8_t *left, ptrdiff_t stride)
H264ChromaContext h264chroma
mode
Use these values in ebur128_init (or'ed).
int ff_cavs_init_pic(AVSContext *h)