51 #define MAX_REFERENCE_FRAMES 8
53 #define MAX_FRAMES (MAX_REFERENCE_FRAMES + MAX_DELAY + 1)
55 #define MAX_BLOCKSIZE 32
60 #define DIRAC_REF_MASK_REF1 1
61 #define DIRAC_REF_MASK_REF2 2
62 #define DIRAC_REF_MASK_GLOBAL 4
68 #define DELAYED_PIC_REF 4
70 #define CALC_PADDING(size, depth) \
71 (((size + (1 << depth) - 1) >> depth) << depth)
73 #define DIVRNDUP(a, b) (((a) + (b) - 1) / (b))
107 typedef struct Plane {
253 return (
int)((x+1U)*21845 + 10922) >> 16;
259 int i, remove_idx = -1;
261 for (
i = 0; framelist[
i];
i++)
262 if (framelist[
i]->avframe->display_picture_number == picnum) {
263 remove_pic = framelist[
i];
268 for (
i = remove_idx; framelist[
i];
i++)
269 framelist[
i] = framelist[
i+1];
277 for (
i = 0;
i < maxframes;
i++)
288 int sbheight =
DIVRNDUP(
s->seq.height, 4);
289 int i,
w,
h, top_padding;
292 for (
i = 0;
i < 3;
i++) {
295 w =
s->seq.width >> (
i ?
s->chroma_x_shift : 0);
296 h =
s->seq.height >> (
i ?
s->chroma_y_shift : 0);
309 s->plane[
i].idwt.buf =
s->plane[
i].idwt.buf_base + (top_padding*
w)*(2 <<
s->pshift);
310 if (!
s->plane[
i].idwt.buf_base || !
s->plane[
i].idwt.tmp)
318 if (!
s->sbsplit || !
s->blmotion)
325 int w =
s->seq.width;
326 int h =
s->seq.height;
331 if (
s->buffer_stride >=
stride)
333 s->buffer_stride = 0;
336 memset(
s->edge_emu_buffer, 0,
sizeof(
s->edge_emu_buffer));
345 if (!
s->edge_emu_buffer_base || !
s->mctmp || !
s->mcscratch)
357 if (
s->all_frames[
i].avframe->data[0]) {
359 memset(
s->all_frames[
i].interpolated, 0,
sizeof(
s->all_frames[
i].interpolated));
362 for (j = 0; j < 3; j++)
363 for (k = 1; k < 4; k++)
367 memset(
s->ref_frames, 0,
sizeof(
s->ref_frames));
368 memset(
s->delay_frames, 0,
sizeof(
s->delay_frames));
370 for (
i = 0;
i < 3;
i++) {
375 s->buffer_stride = 0;
392 s->frame_number = -1;
394 s->thread_buf =
NULL;
395 s->threads_num_buf = -1;
396 s->thread_buf_size = -1;
404 if (!
s->all_frames[
i].avframe) {
421 s->seen_sequence_header = 0;
422 s->frame_number = -1;
445 coeff = sign*((sign *
coeff * qfactor + qoffset) >> 2);
449 #define SIGN_CTX(x) (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0))
451 #define UNPACK_ARITH(n, type) \
452 static inline void coeff_unpack_arith_##n(DiracArith *c, int qfactor, int qoffset, \
453 SubBand *b, type *buf, int x, int y) \
455 int sign, sign_pred = 0, pred_ctx = CTX_ZPZN_F1; \
457 const int mstride = -(b->stride >> (1+b->pshift)); \
459 const type *pbuf = (type *)b->parent->ibuf; \
460 const int stride = b->parent->stride >> (1+b->parent->pshift); \
461 pred_ctx += !!pbuf[stride * (y>>1) + (x>>1)] << 1; \
463 if (b->orientation == subband_hl) \
464 sign_pred = buf[mstride]; \
466 pred_ctx += !(buf[-1] | buf[mstride] | buf[-1 + mstride]); \
467 if (b->orientation == subband_lh) \
468 sign_pred = buf[-1]; \
470 pred_ctx += !buf[mstride]; \
472 coeff = dirac_get_arith_uint(c, pred_ctx, CTX_COEFF_DATA); \
474 coeff = (coeff * qfactor + qoffset) >> 2; \
475 sign = dirac_get_arith_bit(c, SIGN_CTX(sign_pred)); \
476 coeff = (coeff ^ -sign) + sign; \
490 int left,
int right,
int top,
int bottom,
491 int blockcnt_one,
int is_arith)
493 int x, y, zero_block;
494 int qoffset, qfactor;
508 if (
s->codeblock_mode && !(
s->old_delta_quant && blockcnt_one)) {
514 if (
quant > INT_MAX -
b->quant ||
b->quant +
quant < 0) {
534 buf =
b->ibuf + top *
b->stride;
536 for (y = top; y < bottom; y++) {
539 for (x = left; x < right; x++) {
541 coeff_unpack_arith_10(
c, qfactor, qoffset,
b, (
int32_t*)(buf)+x, x, y);
543 coeff_unpack_arith_8(
c, qfactor, qoffset,
b, (int16_t*)(buf)+x, x, y);
549 for (y = top; y < bottom; y++) {
552 for (x = left; x < right; x++) {
570 #define INTRA_DC_PRED(n, type) \
571 static inline void intra_dc_prediction_##n(SubBand *b) \
573 type *buf = (type*)b->ibuf; \
576 for (x = 1; x < b->width; x++) \
577 buf[x] += buf[x-1]; \
578 buf += (b->stride >> (1+b->pshift)); \
580 for (y = 1; y < b->height; y++) { \
581 buf[0] += buf[-(b->stride >> (1+b->pshift))]; \
583 for (x = 1; x < b->width; x++) { \
584 int pred = buf[x - 1] + buf[x - (b->stride >> (1+b->pshift))] + buf[x - (b->stride >> (1+b->pshift))-1]; \
585 buf[x] += divide3(pred); \
587 buf += (b->stride >> (1+b->pshift)); \
600 int cb_x, cb_y, left, right, top, bottom;
605 int blockcnt_one = (cb_width + cb_height) == 2;
617 for (cb_y = 0; cb_y < cb_height; cb_y++) {
618 bottom = (
b->height * (cb_y+1LL)) / cb_height;
620 for (cb_x = 0; cb_x < cb_width; cb_x++) {
621 right = (
b->width * (cb_x+1LL)) / cb_width;
622 ret =
codeblock(
s,
b, &gb, &
c, left, right, top, bottom, blockcnt_one, is_arith);
632 intra_dc_prediction_10(
b);
634 intra_dc_prediction_8(
b);
662 int level, num_bands = 0;
665 int damaged_count = 0;
669 for (orientation = !!
level; orientation < 4; orientation++) {
701 for (
i = 0;
i <
s->wavelet_depth * 3 + 1;
i++) {
705 if (damaged_count > (
s->wavelet_depth * 3 + 1) /2)
711 #define PARSE_VALUES(type, x, gb, ebits, buf1, buf2) \
712 type *buf = (type *)buf1; \
713 buf[x] = coeff_unpack_golomb(gb, qfactor, qoffset); \
714 if (get_bits_count(gb) >= ebits) \
717 buf = (type *)buf2; \
718 buf[x] = coeff_unpack_golomb(gb, qfactor, qoffset); \
719 if (get_bits_count(gb) >= ebits) \
724 int slice_x,
int slice_y,
int bits_end,
727 int left =
b1->width * slice_x /
s->num_x;
728 int right =
b1->width *(slice_x+1) /
s->num_x;
729 int top =
b1->height * slice_y /
s->num_y;
730 int bottom =
b1->height *(slice_y+1) /
s->num_y;
732 int qfactor, qoffset;
750 for (y = top; y < bottom; y++) {
751 for (x = left; x < right; x++) {
760 for (y = top; y < bottom; y++) {
761 for (x = left; x < right; x++) {
790 for (orientation = !!
level; orientation < 4; orientation++) {
799 chroma_bits = 8*slice->
bytes - 7 - length_bits - luma_bits;
803 for (orientation = !!
level; orientation < 4; orientation++) {
806 &
s->plane[1].band[
level][orientation],
807 &
s->plane[2].band[
level][orientation]);
828 o->
top =
b->height * y /
s->num_y;
829 o->
left =
b->width * x /
s->num_x;
830 o->
tot_h = ((
b->width * (x + 1)) /
s->num_x) - o->
left;
831 o->
tot_v = ((
b->height * (y + 1)) /
s->num_y) - o->
top;
844 int i,
level, orientation, quant_idx;
859 for (orientation = !!
level; orientation < 4; orientation++) {
860 const int quant =
FFMAX(quant_idx -
s->lowdelay.quant[
level][orientation], 0);
867 for (
i = 0;
i < 3;
i++) {
868 int coef_num, coef_par, off = 0;
869 int64_t length =
s->highquality.size_scaler*
get_bits(gb, 8);
887 if (coef_num > coef_par) {
888 const int start_b = coef_par * (1 << (
s->pshift + 1));
889 const int end_b = coef_num * (1 << (
s->pshift + 1));
890 memset(&tmp_buf[start_b], 0, end_b - start_b);
895 for (orientation = !!
level; orientation < 4; orientation++) {
897 uint8_t *buf =
b1->ibuf +
c->top *
b1->stride + (
c->left << (
s->pshift + 1));
900 const int qfunc =
s->pshift + 2*(
c->tot_h <= 2);
901 s->diracdsp.dequant_subband[qfunc](&tmp_buf[off], buf,
b1->stride,
902 qfactor[
level][orientation],
903 qoffset[
level][orientation],
906 off +=
c->tot << (
s->pshift + 1);
921 uint8_t *thread_buf = &
s->thread_buf[
s->thread_buf_size*threadnr];
922 for (
i = 0;
i <
s->num_x;
i++)
934 int slice_x, slice_y, bufsize;
935 int64_t coef_buf_size, bytes = 0;
941 if (
s->slice_params_num_buf != (
s->num_x *
s->num_y)) {
943 if (!
s->slice_params_buf) {
945 s->slice_params_num_buf = 0;
948 s->slice_params_num_buf =
s->num_x *
s->num_y;
950 slices =
s->slice_params_buf;
955 coef_buf_size = (coef_buf_size << (1 +
s->pshift)) + 512;
958 s->thread_buf_size != coef_buf_size) {
960 s->thread_buf_size = coef_buf_size;
962 if (!
s->thread_buf) {
976 for (slice_y = 0; bufsize > 0 && slice_y <
s->num_y; slice_y++) {
977 for (slice_x = 0; bufsize > 0 && slice_x <
s->num_x; slice_x++) {
978 bytes =
s->highquality.prefix_bytes + 1;
979 for (
i = 0;
i < 3;
i++) {
980 if (bytes <= bufsize/8)
981 bytes += buf[bytes] *
s->highquality.size_scaler + 1;
983 if (bytes >= INT_MAX || bytes*8 > bufsize) {
988 slices[slice_num].
bytes = bytes;
989 slices[slice_num].
slice_x = slice_x;
990 slices[slice_num].
slice_y = slice_y;
995 if (bufsize/8 >= bytes)
1002 if (
s->num_x*
s->num_y != slice_num) {
1009 for (slice_y = 0; bufsize > 0 && slice_y <
s->num_y; slice_y++) {
1010 for (slice_x = 0; bufsize > 0 && slice_x <
s->num_x; slice_x++) {
1011 bytes = (slice_num+1) * (int64_t)
s->lowdelay.bytes.num /
s->lowdelay.bytes.den
1012 - slice_num * (int64_t)
s->lowdelay.bytes.num /
s->lowdelay.bytes.den;
1013 if (bytes >= INT_MAX || bytes*8 > bufsize) {
1017 slices[slice_num].
bytes = bytes;
1018 slices[slice_num].
slice_x = slice_x;
1019 slices[slice_num].
slice_y = slice_y;
1024 if (bufsize/8 >= bytes)
1034 if (
s->dc_prediction) {
1036 intra_dc_prediction_10(&
s->plane[0].band[0][0]);
1037 intra_dc_prediction_10(&
s->plane[1].band[0][0]);
1038 intra_dc_prediction_10(&
s->plane[2].band[0][0]);
1040 intra_dc_prediction_8(&
s->plane[0].band[0][0]);
1041 intra_dc_prediction_8(&
s->plane[1].band[0][0]);
1042 intra_dc_prediction_8(&
s->plane[2].band[0][0]);
1053 for (
i = 0;
i < 3;
i++) {
1056 p->
width =
s->seq.width >> (
i ?
s->chroma_x_shift : 0);
1057 p->
height =
s->seq.height >> (
i ?
s->chroma_y_shift : 0);
1065 for (orientation = !!
level; orientation < 4; orientation++) {
1068 b->pshift =
s->pshift;
1074 b->orientation = orientation;
1076 if (orientation & 1)
1077 b->ibuf +=
w << (1+
b->pshift);
1078 if (orientation > 1)
1079 b->ibuf += (
b->stride>>1);
1087 p->
xblen =
s->plane[0].xblen >>
s->chroma_x_shift;
1088 p->
yblen =
s->plane[0].yblen >>
s->chroma_y_shift;
1089 p->
xbsep =
s->plane[0].xbsep >>
s->chroma_x_shift;
1090 p->
ybsep =
s->plane[0].ybsep >>
s->chroma_y_shift;
1105 static const uint8_t default_blen[] = { 4, 12, 16, 24 };
1127 s->plane[0].xblen = default_blen[idx-1];
1128 s->plane[0].yblen = default_blen[idx-1];
1129 s->plane[0].xbsep = 4 * idx;
1130 s->plane[0].ybsep = 4 * idx;
1135 if (
s->plane[0].xblen % (1 <<
s->chroma_x_shift) != 0 ||
1136 s->plane[0].yblen % (1 <<
s->chroma_y_shift) != 0 ||
1137 !
s->plane[0].xblen || !
s->plane[0].yblen) {
1139 "invalid x/y block length (%d/%d) for x/y chroma shift (%d/%d)\n",
1140 s->plane[0].xblen,
s->plane[0].yblen,
s->chroma_x_shift,
s->chroma_y_shift);
1143 if (!
s->plane[0].xbsep || !
s->plane[0].ybsep ||
s->plane[0].xbsep <
s->plane[0].xblen/2 ||
s->plane[0].ybsep <
s->plane[0].yblen/2) {
1147 if (
s->plane[0].xbsep >
s->plane[0].xblen ||
s->plane[0].ybsep >
s->plane[0].yblen) {
1159 if (
s->mv_precision > 3) {
1167 if (
s->globalmc_flag) {
1168 memset(
s->globalmc, 0,
sizeof(
s->globalmc));
1184 s->globalmc[
ref].zrs[0][0] = 1;
1185 s->globalmc[
ref].zrs[1][1] = 1;
1193 if (
s->globalmc[
ref].perspective_exp + (uint64_t)
s->globalmc[
ref].zrs_exp > 30) {
1209 s->weight_log2denom = 1;
1215 if (
s->weight_log2denom < 1 ||
s->weight_log2denom > 8) {
1217 s->weight_log2denom = 1;
1221 if (
s->num_refs == 2)
1237 #define CHECKEDREAD(dst, cond, errmsg) \
1238 tmp = get_interleaved_ue_golomb(gb); \
1240 av_log(s->avctx, AV_LOG_ERROR, errmsg); \
1241 return AVERROR_INVALIDDATA; \
1256 if (!
s->low_delay) {
1259 for (
i = 0;
i <=
s->wavelet_depth;
i++) {
1260 CHECKEDREAD(
s->codeblock[
i].width , tmp < 1 || tmp > (
s->avctx->width >>
s->wavelet_depth-
i),
"codeblock width invalid\n")
1261 CHECKEDREAD(
s->codeblock[
i].height, tmp < 1 || tmp > (
s->avctx->height>>
s->wavelet_depth-
i),
"codeblock height invalid\n")
1267 for (
i = 0;
i <=
s->wavelet_depth;
i++)
1268 s->codeblock[
i].width =
s->codeblock[
i].height = 1;
1274 if (
s->num_x *
s->num_y == 0 ||
s->num_x * (uint64_t)
s->num_y > INT_MAX ||
1275 s->num_x * (uint64_t)
s->avctx->width > INT_MAX ||
1276 s->num_y * (uint64_t)
s->avctx->height > INT_MAX ||
1277 s->num_x >
s->avctx->width ||
1278 s->num_y >
s->avctx->height
1281 s->num_x =
s->num_y = 0;
1284 if (
s->ld_picture) {
1287 if (
s->lowdelay.bytes.den <= 0) {
1291 }
else if (
s->hq_picture) {
1294 if (
s->highquality.prefix_bytes >= INT_MAX / 8) {
1310 if (
s->wavelet_depth > 4) {
1311 av_log(
s->avctx,
AV_LOG_ERROR,
"Mandatory custom low delay matrix missing for depth %d\n",
s->wavelet_depth);
1316 for (
i = 0;
i < 4;
i++) {
1319 if (
s->wavelet_idx == 3)
1320 s->lowdelay.quant[
level][
i] += 4*(
s->wavelet_depth-1 -
level);
1329 static const uint8_t avgsplit[7] = { 0, 0, 1, 1, 1, 2, 2 };
1338 return avgsplit[sbsplit[-1] + sbsplit[-
stride] + sbsplit[-
stride-1]];
1348 return block[-1].ref & refmask;
1354 return (
pred >> 1) & refmask;
1364 for (
i = 0;
i < 3;
i++)
1370 for (
i = 0;
i < 3;
i++)
1376 for (
i = 0;
i < 3;
i++)
1382 for (
i = 0;
i < 3;
i++)
1384 }
else if (n == 3) {
1385 for (
i = 0;
i < 3;
i++)
1393 int refmask =
ref+1;
1428 int ez =
s->globalmc[
ref].zrs_exp;
1429 int ep =
s->globalmc[
ref].perspective_exp;
1430 int (*
A)[2] =
s->globalmc[
ref].zrs;
1431 int *
b =
s->globalmc[
ref].pan_tilt;
1432 int *
c =
s->globalmc[
ref].perspective;
1434 int64_t m = (1<<ep) - (
c[0]*(int64_t)x +
c[1]*(int64_t)y);
1435 int64_t mx = m * (int64_t)((
A[0][0] * (int64_t)x +
A[0][1]*(int64_t)y) + (1LL<<ez) *
b[0]);
1436 int64_t my = m * (int64_t)((
A[1][0] * (int64_t)x +
A[1][1]*(int64_t)y) + (1LL<<ez) *
b[1]);
1438 block->u.mv[
ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep);
1439 block->u.mv[
ref][1] = (my + (1<<(ez+ep))) >> (ez+ep);
1443 int stride,
int x,
int y)
1450 if (
s->num_refs == 2) {
1457 for (
i = 0;
i < 3;
i++)
1462 if (
s->globalmc_flag) {
1467 for (
i = 0;
i <
s->num_refs;
i++)
1468 if (
block->ref & (
i+1)) {
1487 for (x = 1; x <
size; x++)
1490 for (y = 1; y <
size; y++) {
1492 for (x = 0; x <
size; x++)
1511 s->sbwidth =
DIVRNDUP(
s->seq.width, 4*
s->plane[0].xbsep);
1512 s->sbheight =
DIVRNDUP(
s->seq.height, 4*
s->plane[0].ybsep);
1513 s->blwidth = 4 *
s->sbwidth;
1514 s->blheight = 4 *
s->sbheight;
1519 for (y = 0; y <
s->sbheight; y++) {
1520 for (x = 0; x <
s->sbwidth; x++) {
1526 sbsplit +=
s->sbwidth;
1531 for (
i = 0;
i <
s->num_refs;
i++) {
1535 for (
i = 0;
i < 3;
i++)
1538 for (y = 0; y <
s->sbheight; y++)
1539 for (x = 0; x <
s->sbwidth; x++) {
1540 int blkcnt = 1 <<
s->sbsplit[y *
s->sbwidth + x];
1541 int step = 4 >>
s->sbsplit[y *
s->sbwidth + x];
1543 for (q = 0; q < blkcnt; q++)
1544 for (p = 0; p < blkcnt; p++) {
1545 int bx = 4 * x + p*step;
1546 int by = 4 * y + q*step;
1553 for (
i = 0;
i < 4 + 2*
s->num_refs;
i++) {
1563 #define ROLLOFF(i) offset == 1 ? ((i) ? 5 : 3) : \
1564 (1 + (6*(i) + offset - 1) / (2*offset - 1))
1568 else if (
i > blen-1 - 2*
offset)
1574 int left,
int right,
int wy)
1577 for (x = 0; left && x < p->
xblen >> 1; x++)
1578 obmc_weight[x] = wy*8;
1579 for (; x < p->
xblen >> right; x++)
1581 for (; x < p->
xblen; x++)
1582 obmc_weight[x] = wy*8;
1588 int left,
int right,
int top,
int bottom)
1591 for (y = 0; top && y < p->
yblen >> 1; y++) {
1595 for (; y < p->
yblen >> bottom; y++) {
1600 for (; y < p->
yblen; y++) {
1609 int bottom = by ==
s->blheight-1;
1612 if (top || bottom || by == 1) {
1647 int x,
int y,
int ref,
int plane)
1649 Plane *p = &
s->plane[plane];
1650 uint8_t **ref_hpel =
s->ref_pics[
ref]->hpel[plane];
1651 int motion_x =
block->u.mv[
ref][0];
1652 int motion_y =
block->u.mv[
ref][1];
1653 int mx, my,
i, epel, nplanes = 0;
1656 motion_x >>=
s->chroma_x_shift;
1657 motion_y >>=
s->chroma_y_shift;
1660 mx = motion_x & ~(-1U <<
s->mv_precision);
1661 my = motion_y & ~(-1U <<
s->mv_precision);
1662 motion_x >>=
s->mv_precision;
1663 motion_y >>=
s->mv_precision;
1666 mx <<= 3 -
s->mv_precision;
1667 my <<= 3 -
s->mv_precision;
1676 src[0] = ref_hpel[(my>>1)+(mx>>2)] + y*p->
stride + x;
1680 for (
i = 0;
i < 4;
i++)
1705 src[!mx] =
src[2 + !!mx];
1707 }
else if (!(my&3)) {
1730 for (
i = 0;
i < nplanes;
i++) {
1731 s->vdsp.emulated_edge_mc(
s->edge_emu_buffer[
i],
src[
i],
1735 src[
i] =
s->edge_emu_buffer[
i];
1738 return (nplanes>>1) + epel;
1742 uint8_t *obmc_weight,
int xblen,
int yblen)
1747 for (y = 0; y < yblen; y++) {
1748 for (x = 0; x < xblen; x += 2) {
1749 dst[x ] +=
dc * obmc_weight[x ];
1750 dst[x+1] +=
dc * obmc_weight[x+1];
1758 uint16_t *mctmp,
uint8_t *obmc_weight,
1759 int plane,
int dstx,
int dsty)
1761 Plane *p = &
s->plane[plane];
1765 switch (
block->ref&3) {
1774 s->weight_func(
s->mcscratch, p->
stride,
s->weight_log2denom,
1775 s->weight[0] +
s->weight[1], p->
yblen);
1781 if (
s->biweight_func) {
1784 s->biweight_func(
s->mcscratch,
s->mcscratch+32, p->
stride,
s->weight_log2denom,
1785 s->weight[0],
s->weight[1], p->
yblen);
1790 s->add_obmc(mctmp,
s->mcscratch, p->
stride, obmc_weight, p->
yblen);
1795 Plane *p = &
s->plane[plane];
1801 for (x = 1; x <
s->blwidth-1; x++) {
1817 memcpy(
s->put_pixels_tab,
s->diracdsp.put_dirac_pixels_tab[idx],
sizeof(
s->put_pixels_tab));
1818 memcpy(
s->avg_pixels_tab,
s->diracdsp.avg_dirac_pixels_tab[idx],
sizeof(
s->avg_pixels_tab));
1819 s->add_obmc =
s->diracdsp.add_dirac_obmc[idx];
1820 if (
s->weight_log2denom > 1 ||
s->weight[0] != 1 ||
s->weight[1] != 1) {
1821 s->weight_func =
s->diracdsp.weight_dirac_pixels_tab[idx];
1822 s->biweight_func =
s->diracdsp.biweight_dirac_pixels_tab[idx];
1824 s->weight_func =
NULL;
1825 s->biweight_func =
NULL;
1836 ref->hpel[plane][0] =
ref->avframe->data[plane];
1840 if (!
s->mv_precision)
1843 for (
i = 1;
i < 4;
i++) {
1844 if (!
ref->hpel_base[plane][
i])
1846 if (!
ref->hpel_base[plane][
i]) {
1850 ref->hpel[plane][
i] =
ref->hpel_base[plane][
i] + edge*
ref->avframe->linesize[plane] + 16;
1853 if (!
ref->interpolated[plane]) {
1854 s->diracdsp.dirac_hpel_filter(
ref->hpel[plane][1],
ref->hpel[plane][2],
1855 ref->hpel[plane][3],
ref->hpel[plane][0],
1861 ref->interpolated[plane] = 1;
1873 int y,
i,
comp, dsty;
1878 if (!
s->hq_picture) {
1895 for (
i = 0;
i < 4;
i++)
1898 if (!
s->zero_res && !
s->low_delay)
1906 s->wavelet_depth,
s->bit_depth);
1911 for (y = 0; y < p->
height; y += 16) {
1912 int idx = (
s->bit_depth - 8) >> 1;
1914 s->diracdsp.put_signed_rect_clamped[idx](
frame + y*p->
stride,
1924 for (
i = 0;
i <
s->num_refs;
i++) {
1933 for (y = 0; y <
s->blheight; y++) {
1935 start =
FFMAX(dsty, 0);
1936 uint16_t *mctmp =
s->mctmp + y*rowheight;
1944 h = p->
ybsep - (start - dsty);
1970 int chroma_x_shift, chroma_y_shift;
1982 for (
i = 0;
f->data[
i];
i++) {
1984 f->linesize[
i] + 32;
1999 unsigned retire, picnum;
2001 int64_t refdist, refnum;
2005 picnum =
s->current_picture->avframe->display_picture_number =
get_bits_long(gb, 32);
2012 if (
s->frame_number < 0)
2013 s->frame_number = picnum;
2015 s->ref_pics[0] =
s->ref_pics[1] =
NULL;
2016 for (
i = 0;
i <
s->num_refs;
i++) {
2018 refdist = INT64_MAX;
2023 if (
s->ref_frames[j]
2024 &&
FFABS(
s->ref_frames[j]->avframe->display_picture_number - refnum) < refdist) {
2025 s->ref_pics[
i] =
s->ref_frames[j];
2026 refdist =
FFABS(
s->ref_frames[j]->avframe->display_picture_number - refnum);
2029 if (!
s->ref_pics[
i] || refdist)
2033 if (!
s->ref_pics[
i])
2035 if (!
s->all_frames[j].avframe->data[0]) {
2036 s->ref_pics[
i] = &
s->all_frames[j];
2043 if (!
s->ref_pics[
i]) {
2051 if (
s->current_picture->reference) {
2053 if (retire != picnum) {
2092 for (
i = 1;
s->delay_frames[
i];
i++)
2093 if (
s->delay_frames[
i]->avframe->display_picture_number <
out->avframe->display_picture_number) {
2094 out =
s->delay_frames[
i];
2098 for (
i = out_idx;
s->delay_frames[
i];
i++)
2099 s->delay_frames[
i] =
s->delay_frames[
i+1];
2116 #define DATA_UNIT_HEADER_SIZE 13
2132 parse_code = buf[4];
2137 if (
s->seen_sequence_header)
2171 s->pshift =
s->bit_depth > 8;
2175 &
s->chroma_y_shift);
2183 s->seen_sequence_header = 1;
2186 s->seen_sequence_header = 0;
2192 if (sscanf(buf+14,
"Schroedinger %d.%d.%d", ver, ver+1, ver+2) == 3)
2193 if (ver[0] == 1 && ver[1] == 0 && ver[2] <= 7)
2194 s->old_delta_quant = 1;
2196 }
else if (parse_code & 0x8) {
2197 if (!
s->seen_sequence_header) {
2204 if (
s->all_frames[
i].avframe->data[0] ==
NULL)
2205 pic = &
s->all_frames[
i];
2214 tmp = parse_code & 0x03;
2220 s->is_arith = (parse_code & 0x48) == 0x08;
2221 s->low_delay = (parse_code & 0x88) == 0x88;
2222 s->core_syntax = (parse_code & 0x88) == 0x08;
2223 s->ld_picture = (parse_code & 0xF8) == 0xC8;
2224 s->hq_picture = (parse_code & 0xF8) == 0xE8;
2225 s->dc_prediction = (parse_code & 0x28) == 0x08;
2226 pic->
reference = (parse_code & 0x0C) == 0x0C;
2231 if (
s->version.minor == 2 && parse_code == 0x88)
2234 if (
s->low_delay && !(
s->ld_picture ||
s->hq_picture) ) {
2241 s->current_picture = pic;
2270 unsigned data_unit_size;
2274 if (
s->all_frames[
i].avframe->data[0] && !
s->all_frames[
i].reference) {
2276 memset(
s->all_frames[
i].interpolated, 0,
sizeof(
s->all_frames[
i].interpolated));
2279 s->current_picture =
NULL;
2291 if (buf[buf_idx ] ==
'B' && buf[buf_idx+1] ==
'B' &&
2292 buf[buf_idx+2] ==
'C' && buf[buf_idx+3] ==
'D')
2299 data_unit_size =
AV_RB32(buf+buf_idx+5);
2300 if (data_unit_size > buf_size - buf_idx || !data_unit_size) {
2301 if(data_unit_size > buf_size - buf_idx)
2303 "Data unit with size %d is larger than input buffer, discarding\n",
2315 buf_idx += data_unit_size;
2318 if (!
s->current_picture)
2321 if (
s->current_picture->avframe->display_picture_number >
s->frame_number) {
2327 int min_num =
s->delay_frames[0]->avframe->display_picture_number;
2331 for (
i = 1;
s->delay_frames[
i];
i++)
2332 if (
s->delay_frames[
i]->avframe->display_picture_number < min_num)
2333 min_num =
s->delay_frames[
i]->avframe->display_picture_number;
2339 if (delayed_frame) {
2345 }
else if (
s->current_picture->avframe->display_picture_number ==
s->frame_number) {
static void flush(AVCodecContext *avctx)
static double val(void *priv, double ch)
static char * split(char *message, char delim)
static const float bands[]
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> dc
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
#define flags(name, subs,...)
#define u(width, name, range_min, range_max)
#define FFSWAP(type, a, b)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh, const uint8_t *buf, size_t buf_size, void *log_ctx)
Parse a Dirac sequence header.
Interface to Dirac Decoder/Encoder.
#define MAX_DWT_LEVELS
The spec limits the number of wavelet decompositions to 4 for both level 1 (VC-2) and 128 (long-gop d...
void ff_dirac_init_arith_decoder(DiracArith *c, GetBitContext *gb, int length)
av_cold void ff_dirac_init_arith_tables(void)
Arithmetic decoder for Dirac.
static int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_ctx)
static int dirac_get_arith_bit(DiracArith *c, int ctx)
static int dirac_get_arith_int(DiracArith *c, int follow_ctx, int data_ctx)
void ff_spatial_idwt_slice2(DWTContext *d, int y)
int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type, int decomposition_count, int bit_depth)
int ff_dirac_golomb_read_32bit(const uint8_t *buf, int bytes, uint8_t *_dst, int coeffs)
int ff_dirac_golomb_read_16bit(const uint8_t *buf, int bytes, uint8_t *_dst, int coeffs)
av_cold void ff_diracdsp_init(DiracDSPContext *c)
void(* dirac_biweight_func)(uint8_t *dst, const uint8_t *src, int stride, int log2_denom, int weightd, int weights, int h)
void(* dirac_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int h)
const int32_t ff_dirac_qoffset_intra_tab[120]
const int ff_dirac_qoffset_inter_tab[122]
const int32_t ff_dirac_qscale_tab[116]
const uint8_t ff_dirac_default_qmat[7][4][4]
#define DIRAC_MAX_QUANT_INDEX
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
bitstream reader API header.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int get_bits_left(GetBitContext *gb)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const uint8_t * align_get_bits(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static int dirac_get_se_golomb(GetBitContext *gb)
static unsigned get_interleaved_ue_golomb(GetBitContext *gb)
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
static const int8_t mv[256][2]
static int decode_hq_slice_row(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
#define DATA_UNIT_HEADER_SIZE
Dirac Specification -> 9.6 Parse Info Header Syntax.
static void dirac_decode_flush(AVCodecContext *avctx)
#define CALC_PADDING(size, depth)
static void pred_block_dc(DiracBlock *block, int stride, int x, int y)
static int dirac_unpack_block_motion_data(DiracContext *s)
Dirac Specification ->
static DiracFrame * remove_frame(DiracFrame *framelist[], int picnum)
#define CHECKEDREAD(dst, cond, errmsg)
static void init_planes(DiracContext *s)
#define MAX_REFERENCE_FRAMES
The spec limits this to 3 for frame coding, but in practice can be as high as 6.
static int decode_component(DiracContext *s, int comp)
Dirac Specification -> [DIRAC_STD] 13.4.1 core_transform_data()
static int dirac_unpack_prediction_parameters(DiracContext *s)
Unpack the motion compensation parameters Dirac Specification -> 11.2 Picture prediction data.
static void free_sequence_buffers(DiracContext *s)
static int dirac_decode_picture_header(DiracContext *s)
Dirac Specification -> 11.1.1 Picture Header.
static const uint8_t epel_weights[4][4][4]
static int subband_coeffs(DiracContext *s, int x, int y, int p, SliceCoeffs c[MAX_DWT_LEVELS])
static int decode_subband_arith(AVCodecContext *avctx, void *b)
static int decode_subband_golomb(AVCodecContext *avctx, void *arg)
static int alloc_sequence_buffers(DiracContext *s)
static void decode_subband(DiracContext *s, GetBitContext *gb, int quant, int slice_x, int slice_y, int bits_end, SubBand *b1, SubBand *b2)
static av_cold int dirac_decode_init(AVCodecContext *avctx)
static void init_obmc_weight(Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int top, int bottom)
static void decode_block_params(DiracContext *s, DiracArith arith[8], DiracBlock *block, int stride, int x, int y)
#define DIRAC_REF_MASK_REF2
#define DIRAC_REF_MASK_GLOBAL
static int codeblock(DiracContext *s, SubBand *b, GetBitContext *gb, DiracArith *c, int left, int right, int top, int bottom, int blockcnt_one, int is_arith)
Decode the coeffs in the rectangle defined by left, right, top, bottom [DIRAC_STD] 13....
static int pred_block_mode(DiracBlock *block, int stride, int x, int y, int refmask)
static int decode_lowdelay_slice(AVCodecContext *avctx, void *arg)
Dirac Specification -> 13.5.2 Slices.
static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
static void add_dc(uint16_t *dst, int dc, int stride, uint8_t *obmc_weight, int xblen, int yblen)
static int interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height)
static void init_obmc_weight_row(Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int wy)
static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int size)
static int decode_hq_slice(DiracContext *s, DiracSlice *slice, uint8_t *tmp_buf)
VC-2 Specification -> 13.5.3 hq_slice(sx,sy)
static int dirac_decode_frame_internal(DiracContext *s)
Dirac Specification -> 13.0 Transform data syntax.
static int alloc_buffers(DiracContext *s, int stride)
#define PARSE_VALUES(type, x, gb, ebits, buf1, buf2)
static void pred_mv(DiracBlock *block, int stride, int x, int y, int ref)
static int divide3(int x)
static void block_mc(DiracContext *s, DiracBlock *block, uint16_t *mctmp, uint8_t *obmc_weight, int plane, int dstx, int dsty)
static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame)
static int decode_lowdelay(DiracContext *s)
Dirac Specification -> 13.5.1 low_delay_transform_data()
static void propagate_block_data(DiracBlock *block, int stride, int size)
Copies the current block to the other blocks covered by the current superblock split mode.
static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5], int x, int y, int ref, int plane)
For block x,y, determine which of the hpel planes to do bilinear interpolation from and set src[] to ...
#define DELAYED_PIC_REF
Value of Picture.reference when Picture is not a reference picture, but is held for delayed output.
static int weight(int i, int blen, int offset)
static av_always_inline int decode_subband_internal(DiracContext *s, SubBand *b, int is_arith)
Dirac Specification -> 13.4.2 Non-skipped subbands.
static void mc_row(DiracContext *s, DiracBlock *block, uint16_t *mctmp, int plane, int dsty)
static int add_frame(DiracFrame *framelist[], int maxframes, DiracFrame *frame)
static void init_obmc_weights(DiracContext *s, Plane *p, int by)
#define UNPACK_ARITH(n, type)
static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref)
#define INTRA_DC_PRED(n, type)
Dirac Specification -> 13.3 intra_dc_prediction(band)
static int pred_sbsplit(uint8_t *sbsplit, int stride, int x, int y)
static int dirac_unpack_idwt_params(DiracContext *s)
Dirac Specification -> 11.3 Wavelet transform data.
static void select_dsp_funcs(DiracContext *s, int width, int height, int xblen, int yblen)
static int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)
#define DIRAC_REF_MASK_REF1
DiracBlock->ref flags, if set then the block does MC from the given ref.
static AVOnce dirac_arith_init
static int get_buffer_with_edge(AVCodecContext *avctx, AVFrame *f, int flags)
static av_cold int dirac_decode_end(AVCodecContext *avctx)
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int ff_thread_once(char *control, void(*routine)(void))
static const uint16_t mask[17]
av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
typedef void(RENAME(mix_any_func_type))
static const float pred[4]
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int64_t max_pixels
The number of pixels per image to maximally accept.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
enum AVColorSpace colorspace
YUV colorspace type.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
int display_picture_number
picture number in display order
int key_frame
1 -> keyframe, 0-> not
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
Rational number (pair of numerator and denominator).
MpegvideoEncDSPContext mpvencdsp
DiracFrame * delay_frames[MAX_DELAY+1]
dirac_biweight_func biweight_func
struct DiracContext::@53 globalmc[2]
uint8_t obmc_weight[3][MAX_BLOCKSIZE *MAX_BLOCKSIZE]
struct DiracContext::@51 lowdelay
uint8_t * edge_emu_buffer[4]
uint8_t quant[MAX_DWT_LEVELS][4]
void(* put_pixels_tab[4])(uint8_t *dst, const uint8_t *src[5], int stride, int h)
DiracFrame * ref_frames[MAX_REFERENCE_FRAMES+1]
uint8_t * edge_emu_buffer_base
void(* add_obmc)(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen)
unsigned weight_log2denom
DiracFrame * current_picture
dirac_weight_func weight_func
DiracSlice * slice_params_buf
struct DiracContext::@52 highquality
unsigned old_delta_quant
schroedinger older than 1.0.8 doesn't store quant delta if only one codebook exists in a band
DiracFrame all_frames[MAX_FRAMES]
struct DiracContext::@50 codeblock[MAX_DWT_LEVELS+1]
void(* avg_pixels_tab[4])(uint8_t *dst, const uint8_t *src[5], int stride, int h)
SubBand band[DWT_LEVELS_3D][4]
const uint8_t * coeff_data
#define av_malloc_array(a, b)
#define av_realloc_f(p, o, n)
static void error(const char *err)
static int ref[MAX_W *MAX_W]
static const double coeff[2][5]
static const uint8_t offset[127][2]
static double b1(void *priv, double x, double y)
static double b2(void *priv, double x, double y)
Core video DSP helper functions.