void ff_vp56_init_dequant(VP56Context *s, int quantizer)
{
s->quantizer = quantizer;
- s->dequant_dc = vp56_dc_dequant[quantizer] << 2;
- s->dequant_ac = vp56_ac_dequant[quantizer] << 2;
+ s->dequant_dc = ff_vp56_dc_dequant[quantizer] << 2;
+ s->dequant_ac = ff_vp56_ac_dequant[quantizer] << 2;
}
static int vp56_get_vectors_predictors(VP56Context *s, int row, int col,
VP56mv mvp;
for (pos=0; pos<12; pos++) {
- mvp.x = col + vp56_candidate_predictor_pos[pos][0];
- mvp.y = row + vp56_candidate_predictor_pos[pos][1];
+ mvp.x = col + ff_vp56_candidate_predictor_pos[pos][0];
+ mvp.y = row + ff_vp56_candidate_predictor_pos[pos][1];
if (mvp.x < 0 || mvp.x >= s->mb_width ||
mvp.y < 0 || mvp.y >= s->mb_height)
continue;
offset = mvp.x + s->mb_width*mvp.y;
- if (vp56_reference_frame[s->macroblocks[offset].type] != ref_frame)
+ if (ff_vp56_reference_frame[s->macroblocks[offset].type] != ref_frame)
continue;
if ((s->macroblocks[offset].mv.x == vect[0].x &&
s->macroblocks[offset].mv.y == vect[0].y) ||
if (vp56_rac_get_prob(c, 174)) {
int idx = vp56_rac_gets(c, 4);
memcpy(model->mb_types_stats[ctx],
- vp56_pre_def_mb_type_stats[idx][ctx],
+ ff_vp56_pre_def_mb_type_stats[idx][ctx],
sizeof(model->mb_types_stats[ctx]));
}
if (vp56_rac_get_prob(c, 254)) {
if (vp56_rac_get_prob(c, 205)) {
int delta, sign = vp56_rac_get(c);
- delta = vp56_rac_get_tree(c, vp56_pmbtm_tree,
- vp56_mb_type_model_model);
+ delta = vp56_rac_get_tree(c, ff_vp56_pmbtm_tree,
+ ff_vp56_mb_type_model_model);
if (!delta)
delta = 4 * vp56_rac_gets(c, 7);
model->mb_types_stats[ctx][type][i] += (delta ^ -sign) + sign;
if (vp56_rac_get_prob(c, mb_type_model[0]))
return prev_type;
else
- return vp56_rac_get_tree(c, vp56_pmbt_tree, mb_type_model);
+ return vp56_rac_get_tree(c, ff_vp56_pmbt_tree, mb_type_model);
}
static void vp56_decode_4mv(VP56Context *s, int row, int col)
}
static void vp56_deblock_filter(VP56Context *s, uint8_t *yuv,
- int stride, int dx, int dy)
+ ptrdiff_t stride, int dx, int dy)
{
- int t = vp56_filter_threshold[s->quantizer];
+ int t = ff_vp56_filter_threshold[s->quantizer];
if (dx) s->vp56dsp.edge_filter_hor(yuv + 10-dx , stride, t);
if (dy) s->vp56dsp.edge_filter_ver(yuv + stride*(10-dy), stride, t);
}
static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
- int stride, int x, int y)
+ ptrdiff_t stride, int x, int y)
{
uint8_t *dst = s->frames[VP56_FRAME_CURRENT]->data[plane] + s->block_offset[b];
uint8_t *src_block;
y<0 || y+12>=s->plane_height[plane]) {
s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
src + s->block_offset[b] + (dy-2)*stride + (dx-2),
- stride, 12, 12, x, y,
+ stride, stride,
+ 12, 12, x, y,
s->plane_width[plane],
s->plane_height[plane]);
src_block = s->edge_emu_buffer;
mb_type = VP56_MB_INTRA;
else
mb_type = vp56_decode_mv(s, row, col);
- ref_frame = vp56_reference_frame[mb_type];
+ ref_frame = ff_vp56_reference_frame[mb_type];
s->parse_coeff(s);
s->mb_height = (avctx->coded_height+15) / 16;
if (s->mb_width > 1000 || s->mb_height > 1000) {
- avcodec_set_dimensions(avctx, 0, 0);
+ ff_set_dimensions(avctx, 0, 0);
av_log(avctx, AV_LOG_ERROR, "picture too big\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
s->above_blocks = av_realloc(s->above_blocks,
if (s->has_alpha) {
if (remaining_buf_size < 3)
- return -1;
+ return AVERROR_INVALIDDATA;
alpha_offset = bytestream_get_be24(&buf);
remaining_buf_size -= 3;
if (remaining_buf_size < alpha_offset)
- return -1;
+ return AVERROR_INVALIDDATA;
}
for (is_alpha=0; is_alpha < 1+s->has_alpha; is_alpha++) {
int mb_row, mb_col, mb_row_flip, mb_offset = 0;
- int block, y, uv, stride_y, stride_uv;
+ int block, y, uv;
+ ptrdiff_t stride_y, stride_uv;
int golden_frame = 0;
s->modelp = &s->models[is_alpha];
for (i = 0; i < 4; i++)
av_frame_unref(s->frames[i]);
if (is_alpha) {
- avcodec_set_dimensions(avctx, 0, 0);
- return -1;
+ ff_set_dimensions(avctx, 0, 0);
+ return AVERROR_INVALIDDATA;
}
}
if (!is_alpha) {
- if (ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF) < 0) {
+ int ret = ff_get_buffer(avctx, p, AV_GET_BUFFER_FLAG_REF);
+ if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
if (res == VP56_SIZE_CHANGE)
if (vp56_size_changed(avctx)) {
av_frame_unref(p);
- return -1;
+ return AVERROR_INVALIDDATA;
}
}
ff_hpeldsp_init(&s->hdsp, avctx->flags);
ff_videodsp_init(&s->vdsp, 8);
ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
- ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
for (i = 0; i < 64; i++) {
-#define T(x) (x >> 3) | ((x & 7) << 3)
- s->idct_scantable[i] = T(ff_zigzag_direct[i]);
-#undef T
+#define TRANSPOSE(x) (x >> 3) | ((x & 7) << 3)
+ s->idct_scantable[i] = TRANSPOSE(ff_zigzag_direct[i]);
+#undef TRANSPOSE
}
for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) {