/*
* Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
for (b=0; b<6; b++) {
VP56RefDc *ab = &s->above_blocks[s->above_block_idx[b]];
- VP56RefDc *lb = &s->left_block[vp56_b6to4[b]];
+ VP56RefDc *lb = &s->left_block[ff_vp56_b6to4[b]];
int count = 0;
int dc = 0;
int i;
count++;
}
if (count == 0)
- dc = s->prev_dc[vp56_b2p[b]][ref_frame];
+ dc = s->prev_dc[ff_vp56_b2p[b]][ref_frame];
else if (count == 2)
dc /= 2;
s->block_coeff[b][idx] += dc;
- s->prev_dc[vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx];
+ s->prev_dc[ff_vp56_b2p[b]][ref_frame] = s->block_coeff[b][idx];
ab->dc_coeff = s->block_coeff[b][idx];
ab->ref_frame = ref_frame;
lb->dc_coeff = s->block_coeff[b][idx];
switch (mb_type) {
case VP56_MB_INTRA:
for (b=0; b<b_max; b++) {
- plane = vp56_b2p[b+ab];
+ plane = ff_vp56_b2p[b+ab];
s->dsp.idct_put(frame_current->data[plane] + s->block_offset[b],
s->stride[plane], s->block_coeff[b]);
}
case VP56_MB_INTER_NOVEC_PF:
case VP56_MB_INTER_NOVEC_GF:
for (b=0; b<b_max; b++) {
- plane = vp56_b2p[b+ab];
+ plane = ff_vp56_b2p[b+ab];
off = s->block_offset[b];
s->dsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
frame_ref->data[plane] + off,
for (b=0; b<b_max; b++) {
int x_off = b==1 || b==3 ? 8 : 0;
int y_off = b==2 || b==3 ? 8 : 0;
- plane = vp56_b2p[b+ab];
+ plane = ff_vp56_b2p[b+ab];
vp56_mc(s, b, plane, frame_ref->data[plane], s->stride[plane],
16*col+x_off, 16*row+y_off);
s->dsp.idct_add(frame_current->data[plane] + s->block_offset[b],
}
if (!is_alpha) {
- p->reference = 1;
+ p->reference = 3;
if (avctx->get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
next:
if (p->key_frame || golden_frame) {
- if (s->framep[VP56_FRAME_GOLDEN]->data[0] &&
+ if (s->framep[VP56_FRAME_GOLDEN]->data[0] && s->framep[VP56_FRAME_GOLDEN] != p &&
s->framep[VP56_FRAME_GOLDEN] != s->framep[VP56_FRAME_GOLDEN2])
avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN]);
s->framep[VP56_FRAME_GOLDEN] = p;
ff_vp56dsp_init(&s->vp56dsp, avctx->codec->id);
ff_init_scantable(s->dsp.idct_permutation, &s->scantable,ff_zigzag_direct);
- for (i=0; i<4; i++)
+ for (i=0; i<4; i++) {
s->framep[i] = &s->frames[i];
+ avcodec_get_frame_defaults(&s->frames[i]);
+ }
s->framep[VP56_FRAME_UNUSED] = s->framep[VP56_FRAME_GOLDEN];
s->framep[VP56_FRAME_UNUSED2] = s->framep[VP56_FRAME_GOLDEN2];
s->edge_emu_buffer_alloc = NULL;