rv34.h
Go to the documentation of this file.
1 /*
2  * RV30/40 decoder common data declarations
3  * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
4  *
5  * This file is part of Libav.
6  *
7  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
27 #ifndef AVCODEC_RV34_H
28 #define AVCODEC_RV34_H
29 
30 #include "avcodec.h"
31 #include "dsputil.h"
32 #include "mpegvideo.h"
33 
34 #include "h264pred.h"
35 #include "rv34dsp.h"
36 
37 #define MB_TYPE_SEPARATE_DC 0x01000000
38 #define IS_SEPARATE_DC(a) ((a) & MB_TYPE_SEPARATE_DC)
39 
57 };
58 
64 typedef struct RV34VLC{
66  VLC cbp[2][4];
71 }RV34VLC;
72 
74 typedef struct SliceInfo{
75  int type;
76  int quant;
77  int vlc_set;
78  int start, end;
79  int width;
80  int height;
81  int pts;
82 }SliceInfo;
83 
85 typedef struct RV34DecContext{
89  int8_t *intra_types;
93 
97 
98  int *mb_type;
99  int block_type;
100  int luma_vlc;
102  int is16;
103  int dmv[4][2];
104 
105  int rv30;
106  int rpr;
107 
112 
113  uint16_t *cbp_luma;
115  uint16_t *deblock_coefs;
116 
118  DECLARE_ALIGNED(8, uint32_t, avail_cache)[3*4];
119 
124 
126  int (*decode_mb_info)(struct RV34DecContext *r);
127  int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst);
128  void (*loop_filter)(struct RV34DecContext *r, int row);
130 
134 int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
136 int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt);
140 
141 #endif /* AVCODEC_RV34_H */
P-frame macroblock with DCs in a separate 4x4 block, one motion vector.
Definition: rv34.h:55
int vlc_set
VLCs used for this slice.
Definition: rv34.h:77
VLC second_pattern[2]
VLCs used for decoding coefficients in the subblocks 2 and 3.
Definition: rv34.h:68
int last_pts
Definition: rv34.h:108
P-frame macroblock, 16x8 motion compensation partitions.
Definition: rv34.h:52
uint8_t * tmp_b_block_y[2]
temporary blocks for RV4 weighted MC
Definition: rv34.h:121
int(* decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst)
Definition: rv34.h:127
void(* loop_filter)(struct RV34DecContext *r, int row)
Definition: rv34.h:128
uint32_t avail_cache[3 *4]
8x8 block available flags (for MV prediction)
Definition: rv34.h:118
B-frame macroblock, forward prediction.
Definition: rv34.h:48
int dmv[4][2]
differential motion vectors for the current macroblock
Definition: rv34.h:103
Bidirectionally predicted B-frame macroblock, two motion vectors.
Definition: rv34.h:54
MpegEncContext s
Definition: rv34.h:86
int height
coded height
Definition: rv34.h:80
Bidirectionally predicted B-frame macroblock, no motion vectors.
Definition: rv34.h:51
int ff_rv34_decode_init(AVCodecContext *avctx)
Initialize decoder.
Definition: rv34.c:1465
RV40BlockTypes
RV30 and RV40 Macroblock types.
Definition: rv34.h:43
mpegvideo header.
VLC cbppattern[2]
VLCs used for pattern of coded block patterns decoding.
Definition: rv34.h:65
int weight2
B frame distance fractions (0.14) used in motion compensation.
Definition: rv34.h:110
int start
Definition: rv34.h:78
const uint8_t * luma_dc_quant_p
luma subblock DC quantizer for interframes
Definition: rv34.h:92
int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx)
Definition: rv34.c:1509
uint8_t * tmp_b_block_base
Definition: rv34.h:123
int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Definition: rv34.c:1526
uint8_t
int scaled_weight
Definition: rv34.h:109
uint16_t * cbp_luma
CBP values for luma subblocks.
Definition: rv34.h:113
int width
coded width
Definition: rv34.h:79
uint16_t * deblock_coefs
deblock coefficients for each macroblock
Definition: rv34.h:115
Context for storing H.264 prediction functions.
Definition: h264pred.h:92
const char data[16]
Definition: mxf.c:66
Skipped block.
Definition: rv34.h:50
P-frame macroblock, 8x16 motion compensation partitions.
Definition: rv34.h:53
#define r
Definition: input.c:51
int ff_rv34_decode_end(AVCodecContext *avctx)
Definition: rv34.c:1781
int quant
quantizer used for this slice
Definition: rv34.h:76
int(* parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
Definition: rv34.h:125
RV30/40 decoder motion compensation functions.
int luma_vlc
which VLC set will be used for decoding of luma blocks
Definition: rv34.h:100
int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: rv34.c:1588
VLC tables used by the decoder.
Definition: rv34.h:64
Definition: get_bits.h:63
int end
start and end macroblocks of the slice
Definition: rv34.h:78
Intra macroblock with DCs in a separate 4x4 block.
Definition: rv34.h:45
int * mb_type
internal macroblock types
Definition: rv34.h:98
H264PredContext h
functions for 4x4 and 16x16 intra block prediction
Definition: rv34.h:95
VLC coefficient
VLCs used for decoding big coefficients.
Definition: rv34.h:70
VLC first_pattern[4]
VLCs used for decoding coefficients in the first subblock.
Definition: rv34.h:67
int mv_weight1
Definition: rv34.h:111
struct SliceInfo SliceInfo
essential slice information
essential slice information
Definition: rv34.h:74
external API header
main external API structure.
Definition: avcodec.h:1339
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
RV34VLC * cur_vlcs
VLC set used for current frame decoding.
Definition: rv34.h:94
SliceInfo si
current slice information
Definition: rv34.h:96
struct RV34VLC RV34VLC
VLC tables used by the decoder.
P-frame macroblock, 8x8 motion compensation partitions.
Definition: rv34.h:47
VLC cbp[2][4]
VLCs used for coded block patterns decoding.
Definition: rv34.h:66
int intra_types_stride
block types array stride
Definition: rv34.h:90
int is16
current block has additional 16x16 specific features or not
Definition: rv34.h:102
H.264 / AVC / MPEG4 prediction functions.
int8_t * intra_types
block types
Definition: rv34.h:89
P-frame macroblock, one motion frame.
Definition: rv34.h:46
int ff_rv34_get_start_offset(GetBitContext *gb, int blocks)
common decoding functions
Definition: rv34.c:328
int cur_pts
Definition: rv34.h:108
MpegEncContext.
Definition: mpegvideo.h:212
int weight1
Definition: rv34.h:110
int(* decode_mb_info)(struct RV34DecContext *r)
Definition: rv34.h:126
uint8_t * tmp_b_block_uv[4]
Definition: rv34.h:122
int mv_weight2
Definition: rv34.h:111
B-frame macroblock, backward prediction.
Definition: rv34.h:49
VLC third_pattern[2]
VLCs used for decoding coefficients in the last subblock.
Definition: rv34.h:69
DSP utils.
decoder context
Definition: rv34.h:85
int block_type
current block type
Definition: rv34.h:99
int next_pts
Definition: rv34.h:108
const uint8_t * luma_dc_quant_i
luma subblock DC quantizer for intraframes
Definition: rv34.h:91
int rpr
one field size in RV30 slice header
Definition: rv34.h:106
int8_t * intra_types_hist
old block types, used for prediction
Definition: rv34.h:88
int type
slice type (intra, inter)
Definition: rv34.h:75
int rv30
indicates which RV variasnt is currently decoded
Definition: rv34.h:105
This structure stores compressed data.
Definition: avcodec.h:898
Intra macroblock.
Definition: rv34.h:44
int chroma_vlc
which VLC set will be used for decoding of chroma blocks
Definition: rv34.h:101
RV34DSPContext rdsp
Definition: rv34.h:87
struct RV34DecContext RV34DecContext
decoder context
int pts
frame timestamp
Definition: rv34.h:81
uint8_t * cbp_chroma
CBP values for chroma subblocks.
Definition: rv34.h:114