55 "Extradata does not contain selected resolution\n");
64 mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
79 for(j = 0; j < 4; j+= 2){
85 for(k = 0; k < 2; k++){
119 return rv30_p_types[code];
121 return rv30_b_types[code];
125 const int stride,
const int lim)
130 for(i = 0; i < 4; i++){
131 diff = ((src[-2*step] - src[1*step]) - (src[-1*step] - src[0*step])*4) >> 3;
132 diff = av_clip(diff, -lim, lim);
133 src[-1*step] = cm[src[-1*step] + diff];
134 src[ 0*step] = cm[src[ 0*step] - diff];
145 int loc_lim, cur_lim, left_lim = 0, top_lim = 0;
148 for(mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_pos++){
160 for(mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_pos++){
164 for(j = 0; j < 16; j += 4){
166 for(i = !mb_x; i < 4; i++, Y += 4){
171 else if(!i && r->
deblock_coefs[mb_pos - 1] & (1 << (ij + 3)))
179 for(k = 0; k < 2; k++){
180 int cur_cbp, left_cbp = 0;
181 cur_cbp = (r->
cbp_chroma[mb_pos] >> (k*4)) & 0xF;
183 left_cbp = (r->
cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF;
184 for(j = 0; j < 8; j += 4){
186 for(i = !mb_x; i < 2; i++, C += 4){
187 int ij = i + (j >> 1);
189 if (cur_cbp & (1 << ij))
191 else if(!i && left_cbp & (1 << (ij + 1)))
193 else if( i && cur_cbp & (1 << (ij - 1)))
202 for(mb_x = 0; mb_x < s->
mb_width; mb_x++, mb_pos++){
206 for(j = 4*!row; j < 16; j += 4){
208 for(i = 0; i < 4; i++, Y += 4){
221 for(k = 0; k < 2; k++){
222 int cur_cbp, top_cbp = 0;
223 cur_cbp = (r->
cbp_chroma[mb_pos] >> (k*4)) & 0xF;
226 for(j = 4*!row; j < 8; j += 4){
228 for(i = 0; i < 2; i++, C += 4){
229 int ij = i + (j >> 1);
233 else if(!j && top_cbp & (1 << (ij + 2)))
235 else if( j && cur_cbp & (1 << (ij - 2)))
263 av_log(avctx,
AV_LOG_ERROR,
"Insufficient extradata - need at least %d bytes, got %d\n",
static const uint8_t rv30_luma_dc_quant[32]
DC quantizer mapping for RV30.
int(* decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst)
void(* loop_filter)(struct RV34DecContext *r, int row)
#define IS_SEPARATE_DC(a)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
B-frame macroblock, forward prediction.
static av_cold int init(AVCodecContext *avctx)
static const uint8_t rv30_loop_filt_lim[32]
Loop filter limits are taken from this table.
Bidirectionally predicted B-frame macroblock, no motion vectors.
static unsigned svq3_get_ue_golomb(GetBitContext *gb)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static av_cold int rv30_decode_init(AVCodecContext *avctx)
Initialize decoder.
RV30 and RV40 decoder common data declarations.
const uint8_t * luma_dc_quant_p
luma subblock DC quantizer for interframes
static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst)
Decode 4x4 intra types array.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
uint16_t * deblock_coefs
deblock coefficients for each macroblock
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int rv30_decode_mb_info(RV34DecContext *r)
Decode macroblock information.
enum AVPixelFormat ff_pixfmt_list_420[]
int quant
quantizer used for this slice
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int(* parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
static const uint8_t rv30_itype_from_context[900]
This table is used for retrieving the current intra type based on its neighbors and adjustment provid...
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
void ff_mpeg_flush(AVCodecContext *avctx)
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Intra macroblock with DCs in a separate 4x4 block.
Picture * current_picture_ptr
pointer to the current picture
static const uint8_t rv30_itype_code[9 *9 *2]
This table is used for storing the differences between the predicted and the real intra type...
static void flush(AVCodecContext *avctx)
int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx)
essential slice information
static void rv30_loop_filter(RV34DecContext *r, int row)
ptrdiff_t linesize
line size, in bytes, may be different from width
main external API structure.
static void close(AVCodecParserContext *s)
int height
picture size. must be a multiple of 16
static void rv30_weak_loop_filter(uint8_t *src, const int step, const int stride, const int lim)
P-frame macroblock, 8x8 motion compensation partitions.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits1(GetBitContext *s)
av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
Initialize decoder.
ptrdiff_t uvlinesize
line size, for chroma in bytes, may be different from width
int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
int intra_types_stride
block types array stride
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
P-frame macroblock, one motion frame.
av_cold int ff_rv34_decode_end(AVCodecContext *avctx)
struct AVCodecContext * avctx
int(* decode_mb_info)(struct RV34DecContext *r)
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
#define CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
B-frame macroblock, backward prediction.
int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
int ff_rv34_get_start_offset(GetBitContext *gb, int mb_size)
Decode starting slice position.
static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
const uint8_t * luma_dc_quant_i
luma subblock DC quantizer for intraframes
int rpr
one field size in RV30 slice header
int type
slice type (intra, inter)
static int init_thread_copy(AVCodecContext *avctx)
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
miscellaneous RV30 tables
int rv30
indicates which RV variasnt is currently decoded
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
uint8_t * cbp_chroma
CBP values for chroma subblocks.