const dec_2dvlc_t *r, int esc_golomb_order,
int qp, uint8_t *dst, int stride) {
int i, level_code, esc_code, level, run, mask;
- DCTELEM level_buf[64];
- uint8_t run_buf[64];
+ DCTELEM level_buf[65];
+ uint8_t run_buf[65];
DCTELEM *block = h->block;
for(i=0;i<65;i++) {
uint8_t *left = NULL;
uint8_t *d;
- init_mb(h);
+ ff_cavs_init_mb(h);
/* get intra prediction modes from stream */
for(block=0;block<4;block++) {
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra chroma pred mode\n");
return -1;
}
- modify_mb_i(h, &pred_mode_uv);
+ ff_cavs_modify_mb_i(h, &pred_mode_uv);
/* get coded block pattern */
if(h->pic_type == FF_I_TYPE)
/* luma intra prediction interleaved with residual decode/transform/add */
for(block=0;block<4;block++) {
d = h->cy + h->luma_scan[block];
- load_intra_pred_luma(h, top, &left, block);
+ ff_cavs_load_intra_pred_luma(h, top, &left, block);
h->intra_pred_l[h->pred_mode_Y[ff_cavs_scan3x3[block]]]
(d, top, left, h->l_stride);
if(h->cbp & (1<<block))
}
/* chroma intra prediction */
- load_intra_pred_chroma(h);
+ ff_cavs_load_intra_pred_chroma(h);
h->intra_pred_c[pred_mode_uv](h->cu, &h->top_border_u[h->mbx*10],
h->left_border_u, h->c_stride);
h->intra_pred_c[pred_mode_uv](h->cv, &h->top_border_v[h->mbx*10],
GetBitContext *gb = &h->s.gb;
int ref[4];
- init_mb(h);
+ ff_cavs_init_mb(h);
switch(mb_type) {
case P_SKIP:
ff_cavs_mv(h, MV_FWD_X0, MV_FWD_C2, MV_PRED_PSKIP, BLK_16X16, 0);
enum sub_mb_t sub_type[4];
int flags;
- init_mb(h);
+ ff_cavs_init_mb(h);
/* reset all MVs */
h->mv[MV_FWD_X0] = ff_cavs_dir_mv;
int align;
align = (-get_bits_count(gb)) & 7;
if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
- get_bits_long(gb,24+align);
+ skip_bits_long(gb,24+align);
h->stc = get_bits(gb,8);
decode_slice_header(h,gb);
}
return -1;
ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct);
}
- get_bits(&s->gb,16);//bbv_dwlay
+ skip_bits(&s->gb,16);//bbv_dwlay
if(h->stc == PIC_PB_START_CODE) {
h->pic_type = get_bits(&s->gb,2) + FF_I_TYPE;
if(h->pic_type > FF_B_TYPE) {
} else {
h->pic_type = FF_I_TYPE;
if(get_bits1(&s->gb))
- get_bits(&s->gb,16);//time_code
+ skip_bits(&s->gb,16);//time_code
}
/* release last B frame */
if(h->picture.data[0])
if(h->progressive)
h->pic_structure = 1;
else if(!(h->pic_structure = get_bits1(&s->gb) && (h->stc == PIC_PB_START_CODE)) )
- get_bits1(&s->gb); //advanced_pred_mode_disable
+ skip_bits1(&s->gb); //advanced_pred_mode_disable
skip_bits1(&s->gb); //top_field_first
skip_bits1(&s->gb); //repeat_first_field
h->qp_fixed = get_bits1(&s->gb);
if(h->pic_type == FF_I_TYPE) {
do {
decode_mb_i(h, 0);
- } while(next_mb(h));
+ } while(ff_cavs_next_mb(h));
} else if(h->pic_type == FF_P_TYPE) {
do {
if(h->skip_mode_flag) {
skip_count = get_ue_golomb(&s->gb);
while(skip_count--) {
decode_mb_p(h,P_SKIP);
- if(!next_mb(h))
+ if(!ff_cavs_next_mb(h))
goto done;
}
mb_type = get_ue_golomb(&s->gb) + P_16X16;
decode_mb_i(h, mb_type - P_8X8 - 1);
} else
decode_mb_p(h,mb_type);
- } while(next_mb(h));
+ } while(ff_cavs_next_mb(h));
} else { /* FF_B_TYPE */
do {
if(h->skip_mode_flag) {
skip_count = get_ue_golomb(&s->gb);
while(skip_count--) {
decode_mb_b(h,B_SKIP);
- if(!next_mb(h))
+ if(!ff_cavs_next_mb(h))
goto done;
}
mb_type = get_ue_golomb(&s->gb) + B_DIRECT;
decode_mb_i(h, mb_type - B_8X8 - 1);
} else
decode_mb_b(h,mb_type);
- } while(next_mb(h));
+ } while(ff_cavs_next_mb(h));
}
done:
if(h->pic_type != FF_B_TYPE) {
}
static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
- uint8_t * buf, int buf_size) {
+ const uint8_t * buf, int buf_size) {
AVSContext *h = avctx->priv_data;
MpegEncContext *s = &h->s;
int input_size;
const uint8_t *buf_end;
const uint8_t *buf_ptr;
AVFrame *picture = data;
- uint32_t stc;
+ uint32_t stc = -1;
s->avctx = avctx;
cavs_decode_frame,
CODEC_CAP_DR1 | CODEC_CAP_DELAY,
.flush= cavs_flush,
+ .long_name= NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"),
};