check_mathfunc(){
log check_mathfunc "$@"
func=$1
- shift
- disable $func
- check_ld "cc" "$@" <<EOF && enable $func
- #include <math.h>
- float foo(float f) { return $func(f); }
- int main(void){ return (int) foo; }
- EOF
- }
-
- check_math2func(){
- log check_math2func "$@"
- func=$1
- shift
+ narg=$2
+ shift 2
+ test $narg = 2 && args="f, g" || args="f"
disable $func
- check_ld "$@" <<EOF && enable $func
+ check_ld "cc" "$@" <<EOF && enable $func
#include <math.h>
- float foo(float f) { return $func(f, f); }
+ float foo(float f, float g) { return $func($args); }
-int main(void){ return 0; }
+int main(void){ return (int) foo; }
EOF
}
fi
done
+if enabled pthreads; then
+ check_func pthread_cancel
+fi
+
check_lib math.h sin -lm && LIBM="-lm"
+disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
enabled vaapi && require vaapi va/va.h vaInitialize -lva
- for func in $MATH_FUNCS; do
- check_mathfunc $func
- done
+ atan2f_args=2
+ ldexpf_args=2
+ powf_args=2
- for func in $MATH2_FUNCS; do
- check_math2func $func
+ for func in $MATH_FUNCS; do
+ eval check_mathfunc $func \${${func}_args:-1}
done
# these are off by default, so fail if requested and not available
*
* @param q pointer to the COOKContext
* @param decouple_tab decoupling array
- *
*/
-static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
+static int decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
{
int i;
int vlc = get_bits1(&q->gb);
if (vlc)
for (i = 0; i < length; i++)
- decouple_tab[start + i] = get_vlc2(&q->gb, p->ccpl.table, p->ccpl.bits, 2);
+ decouple_tab[start + i] = get_vlc2(&q->gb,
+ p->channel_coupling.table,
+ p->channel_coupling.bits, 2);
else
- for (i = 0; i < length; i++)
- decouple_tab[start + i] = get_bits(&q->gb, p->js_vlc_bits);
+ for (i = 0; i < length; i++) {
+ int v = get_bits(&q->gb, p->js_vlc_bits);
+ if (v == (1<<p->js_vlc_bits)-1) {
+ av_log(q->avctx, AV_LOG_ERROR, "decouple value too large\n");
+ return AVERROR_INVALIDDATA;
+ }
+ decouple_tab[start + i] = v;
+ }
+ return 0;
}
/*
memset(decode_buffer, 0, sizeof(q->decode_buffer_0));
/* Make sure the buffers are zeroed out. */
- memset(mlt_buffer1, 0, 1024 * sizeof(*mlt_buffer1));
- memset(mlt_buffer2, 0, 1024 * sizeof(*mlt_buffer2));
+ memset(mlt_buffer_left, 0, 1024 * sizeof(*mlt_buffer_left));
+ memset(mlt_buffer_right, 0, 1024 * sizeof(*mlt_buffer_right));
- decouple_info(q, p, decouple_tab);
+ if ((res = decouple_info(q, p, decouple_tab)) < 0)
+ return res;
if ((res = mono_decode(q, p, decode_buffer)) < 0)
return res;
-
/* The two channels are stored interleaved in decode_buffer. */
for (i = 0; i < p->js_subband_start; i++) {
for (j = 0; j < SUBBAND_SIZE; j++) {
//{ START_TIMER;
if (ctx->is_nonnull_frame(ctx)) {
+ ctx->buf_invalid[ctx->dst_buf] = 1;
for (p = 0; p < 3; p++) {
for (b = 0; b < ctx->planes[p].num_bands; b++) {
- result = decode_band(ctx, p, &ctx->planes[p].bands[b], avctx);
+ result = decode_band(ctx, &ctx->planes[p].bands[b], avctx);
if (result) {
av_log(avctx, AV_LOG_ERROR,
"Error while decoding band: %d, plane: %d\n", b, p);
const int mot_stride= s->b8_stride;
const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
- assert(!s->mb_skipped);
+ av_assert2(!s->mb_skipped);
- memcpy(mv_cache[1][1], s->current_picture.f.motion_val[0][mot_xy ], sizeof(int16_t) * 4);
- memcpy(mv_cache[2][1], s->current_picture.f.motion_val[0][mot_xy + mot_stride], sizeof(int16_t) * 4);
- memcpy(mv_cache[3][1], s->current_picture.f.motion_val[0][mot_xy + mot_stride], sizeof(int16_t) * 4);
+ AV_COPY32(mv_cache[1][1], cur_frame->motion_val[0][mot_xy ]);
+ AV_COPY32(mv_cache[1][2], cur_frame->motion_val[0][mot_xy + 1]);
- if (mb_y == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - s->mb_stride])) {
- memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
+ AV_COPY32(mv_cache[2][1], cur_frame->motion_val[0][mot_xy + mot_stride ]);
+ AV_COPY32(mv_cache[2][2], cur_frame->motion_val[0][mot_xy + mot_stride + 1]);
+
+ AV_COPY32(mv_cache[3][1], cur_frame->motion_val[0][mot_xy + mot_stride ]);
+ AV_COPY32(mv_cache[3][2], cur_frame->motion_val[0][mot_xy + mot_stride + 1]);
+
+ if (mb_y == 0 || IS_INTRA(cur_frame->mb_type[xy - s->mb_stride])) {
+ AV_COPY32(mv_cache[0][1], mv_cache[1][1]);
+ AV_COPY32(mv_cache[0][2], mv_cache[1][2]);
}else{
- memcpy(mv_cache[0][1], s->current_picture.f.motion_val[0][mot_xy - mot_stride], sizeof(int16_t) * 4);
+ AV_COPY32(mv_cache[0][1], cur_frame->motion_val[0][mot_xy - mot_stride ]);
+ AV_COPY32(mv_cache[0][2], cur_frame->motion_val[0][mot_xy - mot_stride + 1]);
}
- if (mb_x == 0 || IS_INTRA(s->current_picture.f.mb_type[xy - 1])) {
+ if (mb_x == 0 || IS_INTRA(cur_frame->mb_type[xy - 1])) {
AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
}else{