aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-17 01:29:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-17 01:29:26 +0100
commitea3b68c99d24834cc8b20f15635ee9c0c27523d3 (patch)
tree13541c92647f74516c32038aaf79f872a94fef29
parentfe0e64ca6431c2f606bc702c1a4e230f22531a4f (diff)
parentdcf8f259d107838ff3778343dcb762398130a1a3 (diff)
downloadffmpeg-ea3b68c99d24834cc8b20f15635ee9c0c27523d3.tar.gz
Merge commit 'dcf8f259d107838ff3778343dcb762398130a1a3' into release/0.10
* commit 'dcf8f259d107838ff3778343dcb762398130a1a3': build: Add 'check' target to run all compile and test targets. Ignore generated aviocat tool. avconv: only apply presets when we have an encoder. flacenc: ensure the order is within the min/max range in LPC order search yuv4mpeg: reject unsupported codecs vp8: reset loopfilter delta values at keyframes. vp56: release frames on error vp56: make parse_header return standard error codes ivi_common: check that scan pattern is set before using it. Prepare for 0.8.5 Release x86: Require an assembler able to cope with AVX instructions Conflicts: RELEASE avconv.c doc/developer.texi libavformat/yuv4mpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--Makefile4
-rwxr-xr-xconfigure3
-rw-r--r--libavcodec/flacenc.c8
-rw-r--r--libavcodec/ivi_common.c5
-rw-r--r--libavcodec/vp5.c12
-rw-r--r--libavcodec/vp56.c14
-rw-r--r--libavcodec/vp56.h2
-rw-r--r--libavcodec/vp6.c12
-rw-r--r--libavcodec/vp8.c1
-rw-r--r--libavformat/yuv4mpeg.c5
10 files changed, 41 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 2253ef1852..a98ef8a17e 100644
--- a/Makefile
+++ b/Makefile
@@ -158,6 +158,8 @@ coverage-html: coverage.info
$(Q)genhtml -o $@ $<
$(Q)touch $@
+check: all alltools checkheaders examples testprogs fate
+
include $(SRC_PATH)/doc/Makefile
include $(SRC_PATH)/tests/Makefile
@@ -172,5 +174,5 @@ $(sort $(OBJDIRS)):
# so this saves some time on slow systems.
.SUFFIXES:
-.PHONY: all all-yes alltools *clean config examples install*
+.PHONY: all all-yes alltools check *clean config examples install*
.PHONY: testprogs uninstall*
diff --git a/configure b/configure
index e307fd3a7a..e5337a112f 100755
--- a/configure
+++ b/configure
@@ -2962,9 +2962,8 @@ EOF
elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
esac
- check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
+ check_yasm "vextractf128 xmm0, ymm0, 0" && enable yasm ||
die "yasm not found, use --disable-yasm for a crippled build"
- check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
fi
case "$cpu" in
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 7345a7eef0..3a7cc59a30 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -937,14 +937,16 @@ static int encode_residual_ch(FlacEncodeContext *s, int ch)
omethod == ORDER_METHOD_8LEVEL) {
int levels = 1 << omethod;
uint32_t bits[1 << ORDER_METHOD_8LEVEL];
- int order;
+ int order = -1;
int opt_index = levels-1;
opt_order = max_order-1;
bits[opt_index] = UINT32_MAX;
for (i = levels-1; i >= 0; i--) {
+ int last_order = order;
order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1;
- if (order < 0)
- order = 0;
+ order = av_clip(order, min_order - 1, max_order - 1);
+ if (order == last_order)
+ continue;
encode_residual_lpc(res, smp, n, order+1, coefs[order], shift[order]);
bits[i] = find_subframe_rice_params(s, sub, order+1);
if (bits[i] < bits[opt_index]) {
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index e3b16e1ffb..3eb7d811c9 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -413,6 +413,11 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
}
if (cbp & 1) { /* block coded ? */
+ if (!band->scan) {
+ av_log(NULL, AV_LOG_ERROR, "Scan pattern is not set.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
scan_pos = -1;
memset(trvec, 0, num_coeffs*sizeof(trvec[0])); /* zero transform vector */
memset(col_flags, 0, sizeof(col_flags)); /* zero column flags */
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index ea205991d4..918dc177e6 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -49,18 +49,18 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
{
vp56_rac_gets(c, 8);
if(vp56_rac_gets(c, 5) > 5)
- return 0;
+ return AVERROR_INVALIDDATA;
vp56_rac_gets(c, 2);
if (vp56_rac_get(c)) {
av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
- return 0;
+ return AVERROR_PATCHWELCOME;
}
rows = vp56_rac_gets(c, 8); /* number of stored macroblock rows */
cols = vp56_rac_gets(c, 8); /* number of stored macroblock cols */
if (!rows || !cols) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid size %dx%d\n",
cols << 4, rows << 4);
- return 0;
+ return AVERROR_INVALIDDATA;
}
vp56_rac_gets(c, 8); /* number of displayed macroblock rows */
vp56_rac_gets(c, 8); /* number of displayed macroblock cols */
@@ -69,11 +69,11 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
16*cols != s->avctx->coded_width ||
16*rows != s->avctx->coded_height) {
avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
- return 2;
+ return VP56_SIZE_CHANGE;
}
} else if (!s->macroblocks)
- return 0;
- return 1;
+ return AVERROR_INVALIDDATA;
+ return 0;
}
static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect)
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index cca3e207b2..f864097099 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -513,10 +513,16 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
s->modelp = &s->models[is_alpha];
res = s->parse_header(s, buf, remaining_buf_size, &golden_frame);
- if (!res)
- return -1;
+ if (res < 0) {
+ int i;
+ for (i = 0; i < 4; i++) {
+ if (s->frames[i].data[0])
+ avctx->release_buffer(avctx, &s->frames[i]);
+ }
+ return res;
+ }
- if (res == 2) {
+ if (res == VP56_SIZE_CHANGE) {
int i;
for (i = 0; i < 4; i++) {
if (s->frames[i].data[0])
@@ -535,7 +541,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return -1;
}
- if (res == 2)
+ if (res == VP56_SIZE_CHANGE)
if (vp56_size_changed(avctx)) {
avctx->release_buffer(avctx, p);
return -1;
diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h
index e135718d20..9e1b5c0599 100644
--- a/libavcodec/vp56.h
+++ b/libavcodec/vp56.h
@@ -39,6 +39,8 @@ typedef struct {
int16_t y;
} DECLARE_ALIGNED(4, , VP56mv);
+#define VP56_SIZE_CHANGE 1
+
typedef void (*VP56ParseVectorAdjustment)(VP56Context *s,
VP56mv *vect);
typedef void (*VP56Filter)(VP56Context *s, uint8_t *dst, uint8_t *src,
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index 6254104b2c..ca6878a8be 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -52,7 +52,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
int vrt_shift = 0;
int sub_version;
int rows, cols;
- int res = 1;
+ int res = 0;
int separated_coeff = buf[0] & 1;
s->framep[VP56_FRAME_CURRENT]->key_frame = !(buf[0] & 0x80);
@@ -61,7 +61,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
if (s->framep[VP56_FRAME_CURRENT]->key_frame) {
sub_version = buf[1] >> 3;
if (sub_version > 8)
- return 0;
+ return AVERROR_INVALIDDATA;
s->filter_header = buf[1] & 0x06;
if (buf[1] & 1) {
av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
@@ -79,7 +79,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
/* buf[5] is number of displayed macroblock cols */
if (!rows || !cols) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid size %dx%d\n", cols << 4, rows << 4);
- return 0;
+ return AVERROR_INVALIDDATA;
}
if (!s->macroblocks || /* first frame */
@@ -90,7 +90,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
s->avctx->width -= s->avctx->extradata[0] >> 4;
s->avctx->height -= s->avctx->extradata[0] & 0x0F;
}
- res = 2;
+ res = VP56_SIZE_CHANGE;
}
ff_vp56_init_range_decoder(c, buf+6, buf_size-6);
@@ -102,7 +102,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
s->sub_version = sub_version;
} else {
if (!s->sub_version || !s->avctx->coded_width || !s->avctx->coded_height)
- return 0;
+ return AVERROR_INVALIDDATA;
if (separated_coeff || !s->filter_header) {
coeff_offset = AV_RB16(buf+1) - 2;
@@ -146,7 +146,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
if (buf_size < 0) {
if (s->framep[VP56_FRAME_CURRENT]->key_frame)
avcodec_set_dimensions(s->avctx, 0, 0);
- return 0;
+ return AVERROR_INVALIDDATA;
}
if (s->use_huffman) {
s->parse_coeff = vp6_parse_coeff_huffman;
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index d68a91ea54..716812a4bd 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -318,6 +318,7 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
memcpy(s->prob->pred8x8c , vp8_pred8x8c_prob_inter , sizeof(s->prob->pred8x8c));
memcpy(s->prob->mvc , vp8_mv_default_prob , sizeof(s->prob->mvc));
memset(&s->segmentation, 0, sizeof(s->segmentation));
+ memset(&s->lf_delta, 0, sizeof(s->lf_delta));
}
if (!s->macroblocks_base || /* first frame */
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index 36122fded4..31fb08469a 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -156,9 +156,8 @@ static int yuv4_write_header(AVFormatContext *s)
return AVERROR(EIO);
if (s->streams[0]->codec->codec_id != 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;
}
if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {