#include "avcodec.h"
#include "bytestream.h"
+#include "internal.h"
#include "vp56.h"
#include "vp56data.h"
if (x<0 || x+12>=s->plane_width[plane] ||
y<0 || y+12>=s->plane_height[plane]) {
- s->dsp.emulated_edge_mc(s->edge_emu_buffer,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
src + s->block_offset[b] + (dy-2)*stride + (dx-2),
stride, 12, 12, x, y,
s->plane_width[plane],
static int ff_vp56_decode_mbs(AVCodecContext *avctx, void *, int, int);
-int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
}
res = s->parse_header(s, buf, remaining_buf_size);
- if (!res)
- return -1;
+ if (res < 0)
+ return res;
- if (res == 2) {
+ if (res == VP56_SIZE_CHANGE) {
for (i = 0; i < 4; i++) {
if (s->frames[i].data[0])
avctx->release_buffer(avctx, &s->frames[i]);
}
p->reference = 3;
- if (avctx->get_buffer(avctx, p) < 0) {
+ if (ff_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
- if (res == 2) {
+ if (res == VP56_SIZE_CHANGE) {
if (vp56_size_changed(s)) {
avctx->release_buffer(avctx, p);
return -1;
remaining_buf_size -= alpha_offset;
res = s->alpha_context->parse_header(s->alpha_context, buf, remaining_buf_size);
- if (res != 1) {
- if(res==2) {
+ if (res != 0) {
+ if(res==VP56_SIZE_CHANGE) {
av_log(avctx, AV_LOG_ERROR, "Alpha reconfiguration\n");
avctx->width = bak_w;
avctx->height = bak_h;
p->qscale_table = s->qscale_table;
p->qscale_type = FF_QSCALE_TYPE_VP56;
*(AVFrame*)data = *p;
- *data_size = sizeof(AVFrame);
+ *got_frame = 1;
return avpkt->size;
}
avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
ff_dsputil_init(&s->dsp, avctx);
+ ff_videodsp_init(&s->vdsp, 8);
ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
ff_init_scantable_permutation(s->dsp.idct_permutation, s->vp3dsp.idct_perm);