* @author Marco Gerards <marco@gnu.org>, David Conrad, Jordi Ortiz <nenjordi@gmail.com>
*/
+#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/thread.h"
#include "avcodec.h"
MpegvideoEncDSPContext mpvencdsp;
VideoDSPContext vdsp;
DiracDSPContext diracdsp;
- DiracGolombLUT *reader_ctx;
DiracVersionInfo version;
GetBitContext gb;
AVDiracSeqHeader seq;
s->threads_num_buf = -1;
s->thread_buf_size = -1;
- ff_dirac_golomb_reader_init(&s->reader_ctx);
ff_diracdsp_init(&s->diracdsp);
ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx);
ff_videodsp_init(&s->vdsp, 8);
DiracContext *s = avctx->priv_data;
int i;
- ff_dirac_golomb_reader_end(&s->reader_ctx);
-
dirac_decode_flush(avctx);
for (i = 0; i < MAX_FRAMES; i++)
av_frame_free(&s->all_frames[i].avframe);
coef_num = subband_coeffs(s, slice->slice_x, slice->slice_y, i, coeffs_num);
if (s->pshift)
- coef_par = ff_dirac_golomb_read_32bit(s->reader_ctx, addr,
- length, tmp_buf, coef_num);
+ coef_par = ff_dirac_golomb_read_32bit(addr, length,
+ tmp_buf, coef_num);
else
- coef_par = ff_dirac_golomb_read_16bit(s->reader_ctx, addr,
- length, tmp_buf, coef_num);
+ coef_par = ff_dirac_golomb_read_16bit(addr, length,
+ tmp_buf, coef_num);
if (coef_num > coef_par) {
const int start_b = coef_par * (1 << (s->pshift + 1));
s->num_y = get_interleaved_ue_golomb(gb);
if (s->num_x * s->num_y == 0 || s->num_x * (uint64_t)s->num_y > INT_MAX ||
s->num_x * (uint64_t)s->avctx->width > INT_MAX ||
- s->num_y * (uint64_t)s->avctx->height > INT_MAX
+ s->num_y * (uint64_t)s->avctx->height > INT_MAX ||
+ s->num_x > s->avctx->width ||
+ s->num_y > s->avctx->height
) {
av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n");
s->num_x = s->num_y = 0;
int *c = s->globalmc[ref].perspective;
int64_t m = (1<<ep) - (c[0]*(int64_t)x + c[1]*(int64_t)y);
- int64_t mx = m * (int64_t)((A[0][0] * (int64_t)x + A[0][1]*(int64_t)y) + (1<<ez) * b[0]);
- int64_t my = m * (int64_t)((A[1][0] * (int64_t)x + A[1][1]*(int64_t)y) + (1<<ez) * b[1]);
+ int64_t mx = m * (int64_t)((A[0][0] * (int64_t)x + A[0][1]*(int64_t)y) + (1LL<<ez) * b[0]);
+ int64_t my = m * (int64_t)((A[1][0] * (int64_t)x + A[1][1]*(int64_t)y) + (1LL<<ez) * b[1]);
block->u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep);
block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep);
}
}
+ for (i = 0; i < 4 + 2*s->num_refs; i++) {
+ if (arith[i].error)
+ return arith[i].error;
+ }
+
return 0;
}
return buf_idx;
}
-AVCodec ff_dirac_decoder = {
+const AVCodec ff_dirac_decoder = {
.name = "dirac",
.long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"),
.type = AVMEDIA_TYPE_VIDEO,