* qatar/master: yuv4mpeg: reject unsupported codecs nutenc: K&R formatting cosmetics assdec: fix qsort() callback signature configure: detect sparc64 automatically vp8: fix memset() crossing array boundary h264: fix invalid pointer arithmetic amrwbdec: fix invalid pointer arithmetic Conflicts: libavformat/nutenc.c libavformat/yuv4mpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n1.1
@@ -2745,9 +2745,8 @@ case "$arch" in | |||||
sh4|sh) | sh4|sh) | ||||
arch="sh4" | arch="sh4" | ||||
;; | ;; | ||||
sun4u|sparc64) | |||||
sun4u|sparc*) | |||||
arch="sparc" | arch="sparc" | ||||
subarch="sparc64" | |||||
;; | ;; | ||||
tilegx|tile-gx) | tilegx|tile-gx) | ||||
arch="tilegx" | arch="tilegx" | ||||
@@ -2965,7 +2964,7 @@ check_64bit(){ | |||||
} | } | ||||
case "$arch" in | case "$arch" in | ||||
alpha|ia64|sparc) | |||||
alpha|ia64) | |||||
spic=$shared | spic=$shared | ||||
;; | ;; | ||||
mips) | mips) | ||||
@@ -2979,6 +2978,10 @@ case "$arch" in | |||||
ppc) | ppc) | ||||
check_64bit ppc ppc64 'sizeof(void *) > 4' | check_64bit ppc ppc64 'sizeof(void *) > 4' | ||||
;; | ;; | ||||
sparc) | |||||
check_64bit sparc sparc64 'sizeof(void *) > 4' | |||||
spic=$shared | |||||
;; | |||||
x86) | x86) | ||||
check_64bit x86_32 x86_64 'sizeof(void *) > 4' | check_64bit x86_32 x86_64 'sizeof(void *) > 4' | ||||
if test "$subarch" = "x86_64"; then | if test "$subarch" = "x86_64"; then | ||||
@@ -918,10 +918,9 @@ static float auto_correlation(float *diff_isf, float mean, int lag) | |||||
static void extrapolate_isf(float isf[LP_ORDER_16k]) | static void extrapolate_isf(float isf[LP_ORDER_16k]) | ||||
{ | { | ||||
float diff_isf[LP_ORDER - 2], diff_mean; | float diff_isf[LP_ORDER - 2], diff_mean; | ||||
float *diff_hi = diff_isf - LP_ORDER + 1; // diff array for extrapolated indexes | |||||
float corr_lag[3]; | float corr_lag[3]; | ||||
float est, scale; | float est, scale; | ||||
int i, i_max_corr; | |||||
int i, j, i_max_corr; | |||||
isf[LP_ORDER_16k - 1] = isf[LP_ORDER - 1]; | isf[LP_ORDER_16k - 1] = isf[LP_ORDER - 1]; | ||||
@@ -952,20 +951,20 @@ static void extrapolate_isf(float isf[LP_ORDER_16k]) | |||||
scale = 0.5 * (FFMIN(est, 7600) - isf[LP_ORDER - 2]) / | scale = 0.5 * (FFMIN(est, 7600) - isf[LP_ORDER - 2]) / | ||||
(isf[LP_ORDER_16k - 2] - isf[LP_ORDER - 2]); | (isf[LP_ORDER_16k - 2] - isf[LP_ORDER - 2]); | ||||
for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++) | |||||
diff_hi[i] = scale * (isf[i] - isf[i - 1]); | |||||
for (i = LP_ORDER - 1, j = 0; i < LP_ORDER_16k - 1; i++, j++) | |||||
diff_isf[j] = scale * (isf[i] - isf[i - 1]); | |||||
/* Stability insurance */ | /* Stability insurance */ | ||||
for (i = LP_ORDER; i < LP_ORDER_16k - 1; i++) | |||||
if (diff_hi[i] + diff_hi[i - 1] < 5.0) { | |||||
if (diff_hi[i] > diff_hi[i - 1]) { | |||||
diff_hi[i - 1] = 5.0 - diff_hi[i]; | |||||
for (i = 1; i < LP_ORDER_16k - LP_ORDER; i++) | |||||
if (diff_isf[i] + diff_isf[i - 1] < 5.0) { | |||||
if (diff_isf[i] > diff_isf[i - 1]) { | |||||
diff_isf[i - 1] = 5.0 - diff_isf[i]; | |||||
} else | } else | ||||
diff_hi[i] = 5.0 - diff_hi[i - 1]; | |||||
diff_isf[i] = 5.0 - diff_isf[i - 1]; | |||||
} | } | ||||
for (i = LP_ORDER - 1; i < LP_ORDER_16k - 1; i++) | |||||
isf[i] = isf[i - 1] + diff_hi[i] * (1.0f / (1 << 15)); | |||||
for (i = LP_ORDER - 1, j = 0; i < LP_ORDER_16k - 1; i++, j++) | |||||
isf[i] = isf[i - 1] + diff_isf[j] * (1.0f / (1 << 15)); | |||||
/* Scale the ISF vector for 16000 Hz */ | /* Scale the ISF vector for 16000 Hz */ | ||||
for (i = 0; i < LP_ORDER_16k - 1; i++) | for (i = 0; i < LP_ORDER_16k - 1; i++) | ||||
@@ -1965,7 +1965,8 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size, | |||||
// top edge of 127 for intra prediction | // top edge of 127 for intra prediction | ||||
if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) { | if (!(avctx->flags & CODEC_FLAG_EMU_EDGE)) { | ||||
s->top_border[0][15] = s->top_border[0][23] = 127; | s->top_border[0][15] = s->top_border[0][23] = 127; | ||||
memset(s->top_border[1]-1, 127, s->mb_width*sizeof(*s->top_border)+1); | |||||
s->top_border[0][31] = 127; | |||||
memset(s->top_border[1], 127, s->mb_width*sizeof(*s->top_border)); | |||||
} | } | ||||
memset(s->ref_count, 0, sizeof(s->ref_count)); | memset(s->ref_count, 0, sizeof(s->ref_count)); | ||||
@@ -68,8 +68,9 @@ static int64_t get_pts(const uint8_t *p) | |||||
return sec*100+hsec; | return sec*100+hsec; | ||||
} | } | ||||
static int event_cmp(uint8_t **a, uint8_t **b) | |||||
static int event_cmp(const void *_a, const void *_b) | |||||
{ | { | ||||
const uint8_t *const *a = _a, *const *b = _b; | |||||
return get_pts(*a) - get_pts(*b); | return get_pts(*a) - get_pts(*b); | ||||
} | } | ||||
@@ -131,7 +132,7 @@ static int read_header(AVFormatContext *s) | |||||
p++; | p++; | ||||
} | } | ||||
qsort(ass->event, ass->event_count, sizeof(*ass->event), (void*)event_cmp); | |||||
qsort(ass->event, ass->event_count, sizeof(*ass->event), event_cmp); | |||||
return 0; | return 0; | ||||
@@ -216,9 +216,8 @@ static int yuv4_write_header(AVFormatContext *s) | |||||
return AVERROR(EIO); | return AVERROR(EIO); | ||||
if (s->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) { | if (s->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) { | ||||
av_log(s, AV_LOG_ERROR, | |||||
"A non-rawvideo stream was selected, but yuv4mpeg only handles rawvideo streams\n"); | |||||
return AVERROR(EINVAL); | |||||
av_log(s, AV_LOG_ERROR, "ERROR: Only rawvideo supported.\n"); | |||||
return AVERROR_INVALIDDATA; | |||||
} | } | ||||
switch (s->streams[0]->codec->pix_fmt) { | switch (s->streams[0]->codec->pix_fmt) { | ||||