#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
+#include "golomb.h"
#include "rv34.h"
#include "rv40vlc2.h"
t = get_bits(gb, 13); /// ???
if(!si->type || !get_bits1(gb))
rv40_parse_picture_size(gb, &w, &h);
+ if(avcodec_check_dimensions(r->s.avctx, w, h) < 0)
+ return -1;
si->width = w;
si->height = h;
mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
/**
* Decode 4x4 intra types array.
*/
-static int rv40_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int *dst)
+static int rv40_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst)
{
MpegEncContext *s = &r->s;
int i, j, k, v;
int A, B, C;
int pattern;
- int *ptr;
+ int8_t *ptr;
for(i = 0; i < 4; i++, dst += s->b4_stride){
if(!i && s->first_slice_line){
int count = 0;
if(!r->s.mb_skip_run)
- r->s.mb_skip_run = ff_rv34_get_gamma(gb);
+ r->s.mb_skip_run = svq3_get_ue_golomb(gb) + 1;
if(--r->s.mb_skip_run)
return RV34_MB_SKIP;
- if(r->avail[0])
+ if(r->avail_cache[5-1])
blocks[r->mb_type[mb_pos - 1]]++;
- if(r->avail[1]){
+ if(r->avail_cache[5-4]){
blocks[r->mb_type[mb_pos - s->mb_stride]]++;
- if(r->avail[2])
+ if(r->avail_cache[5-2])
blocks[r->mb_type[mb_pos - s->mb_stride + 1]]++;
- if(r->avail[3])
+ if(r->avail_cache[5-5])
blocks[r->mb_type[mb_pos - s->mb_stride - 1]]++;
}
prev_type = i;
}
}
- if(s->pict_type == P_TYPE){
+ if(s->pict_type == FF_P_TYPE){
prev_type = block_num_to_ptype_vlc_num[prev_type];
q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1);
if(q < PBTYPE_ESCAPE)