aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-21 02:43:44 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-21 02:43:44 +0100
commit50ff83e3afa75535bea839873f3e4c2356a979f6 (patch)
tree31478978aec0d464a3938f528b62d6f79bf98bcc
parent2d7f139155dd734860d0731d095db1db9e9550fd (diff)
parentbdb975ab699a4374e928bc12f1653d079667d84a (diff)
downloadffmpeg-50ff83e3afa75535bea839873f3e4c2356a979f6.tar.gz
Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9: arm: Don't clobber callee saved registers in scalarproduct alsdec: check block length h264/mpegvideo: do not provide pixel formats for hwaccels that are not compiled in mpeg4video_parser: init mpeg4 static tables. Conflicts: libavcodec/mpeg4video_parser.c libavcodec/mpeg4videodec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/alsdec.c5
-rw-r--r--libavcodec/arm/int_neon.S12
-rw-r--r--libavcodec/h264.c6
-rw-r--r--libavcodec/mpeg4video.h1
-rw-r--r--libavcodec/mpeg4videodec.c54
-rw-r--r--libavcodec/mpegvideo.c6
6 files changed, 51 insertions, 33 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 7e43478405..9f05f52798 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1394,6 +1394,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
for (b = 0; b < ctx->num_blocks; b++) {
bd.block_length = div_blocks[b];
+ if (bd.block_length <= 0) {
+ av_log(ctx->avctx, AV_LOG_WARNING,
+ "Invalid block length %d in channel data!\n", bd.block_length);
+ continue;
+ }
for (c = 0; c < avctx->channels; c++) {
bd.const_block = ctx->const_block + c;
diff --git a/libavcodec/arm/int_neon.S b/libavcodec/arm/int_neon.S
index 6b28a97af8..29fdfe0f37 100644
--- a/libavcodec/arm/int_neon.S
+++ b/libavcodec/arm/int_neon.S
@@ -41,10 +41,10 @@ function ff_scalarproduct_int16_neon, export=1
vpadd.s32 d16, d0, d1
vpadd.s32 d17, d2, d3
- vpadd.s32 d10, d4, d5
- vpadd.s32 d11, d6, d7
+ vpadd.s32 d18, d4, d5
+ vpadd.s32 d19, d6, d7
vpadd.s32 d0, d16, d17
- vpadd.s32 d1, d10, d11
+ vpadd.s32 d1, d18, d19
vpadd.s32 d2, d0, d1
vpaddl.s32 d3, d2
vmov.32 r0, d3[0]
@@ -81,10 +81,10 @@ function ff_scalarproduct_and_madd_int16_neon, export=1
vpadd.s32 d16, d0, d1
vpadd.s32 d17, d2, d3
- vpadd.s32 d10, d4, d5
- vpadd.s32 d11, d6, d7
+ vpadd.s32 d18, d4, d5
+ vpadd.s32 d19, d6, d7
vpadd.s32 d0, d16, d17
- vpadd.s32 d1, d10, d11
+ vpadd.s32 d1, d18, d19
vpadd.s32 d2, d0, d1
vpaddl.s32 d3, d2
vmov.32 r0, d3[0]
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index bf5bfa0e0d..cd088e17b0 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -67,9 +67,15 @@ static const uint8_t div6[QP_MAX_NUM + 1] = {
};
static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
AV_PIX_FMT_VDA_VLD,
+#endif
AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_NONE
};
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index 97c39b6ed6..91c091205e 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -111,6 +111,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my);
extern uint8_t ff_mpeg4_static_rl_table_store[3][2][2*MAX_RUN + MAX_LEVEL + 3];
+void ff_mpeg4_init_tables(void);
#if 0 //3IV1 is quite rare and it slows things down a tiny bit
#define IS_3IV1 s->codec_tag == AV_RL32("3IV1")
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 84d51aaa2a..fab4bda162 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -48,6 +48,33 @@ static const int mb_type_b_map[4]= {
MB_TYPE_L0 | MB_TYPE_16x16,
};
+av_cold void ff_mpeg4videodec_static_init(void)
+{
+ static int done = 0;
+
+ if (!done) {
+ ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
+ ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
+ ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
+ INIT_VLC_RL(ff_mpeg4_rl_intra, 554);
+ INIT_VLC_RL(ff_rvlc_rl_inter, 1072);
+ INIT_VLC_RL(ff_rvlc_rl_intra, 1072);
+ INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
+ &ff_mpeg4_DCtab_lum[0][1], 2, 1,
+ &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512);
+ INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
+ &ff_mpeg4_DCtab_chrom[0][1], 2, 1,
+ &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512);
+ INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
+ &ff_sprite_trajectory_tab[0][1], 4, 2,
+ &ff_sprite_trajectory_tab[0][0], 4, 2, 128);
+ INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
+ &ff_mb_type_b_tab[0][1], 2, 1,
+ &ff_mb_type_b_tab[0][0], 2, 1, 16);
+ done = 1;
+ }
+}
+
/**
* Predict the ac.
* @param n block index (0-3 are luma, 4-5 are chroma)
@@ -2255,33 +2282,6 @@ end:
return decode_vop_header(s, gb);
}
-av_cold void ff_mpeg4videodec_static_init(void)
-{
- static int done = 0;
-
- if (!done) {
- ff_init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
- ff_init_rl(&ff_rvlc_rl_inter, ff_mpeg4_static_rl_table_store[1]);
- ff_init_rl(&ff_rvlc_rl_intra, ff_mpeg4_static_rl_table_store[2]);
- INIT_VLC_RL(ff_mpeg4_rl_intra, 554);
- INIT_VLC_RL(ff_rvlc_rl_inter, 1072);
- INIT_VLC_RL(ff_rvlc_rl_intra, 1072);
- INIT_VLC_STATIC(&dc_lum, DC_VLC_BITS, 10 /* 13 */,
- &ff_mpeg4_DCtab_lum[0][1], 2, 1,
- &ff_mpeg4_DCtab_lum[0][0], 2, 1, 512);
- INIT_VLC_STATIC(&dc_chrom, DC_VLC_BITS, 10 /* 13 */,
- &ff_mpeg4_DCtab_chrom[0][1], 2, 1,
- &ff_mpeg4_DCtab_chrom[0][0], 2, 1, 512);
- INIT_VLC_STATIC(&sprite_trajectory, SPRITE_TRAJ_VLC_BITS, 15,
- &ff_sprite_trajectory_tab[0][1], 4, 2,
- &ff_sprite_trajectory_tab[0][0], 4, 2, 128);
- INIT_VLC_STATIC(&mb_type_b_vlc, MB_TYPE_B_VLC_BITS, 4,
- &ff_mb_type_b_tab[0][1], 2, 1,
- &ff_mb_type_b_tab[0][0], 2, 1, 16);
- done = 1;
- }
-}
-
static av_cold int decode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index bcbda07891..0a3329d2c8 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -128,9 +128,15 @@ const enum AVPixelFormat ff_pixfmt_list_420[] = {
};
const enum AVPixelFormat ff_hwaccel_pixfmt_list_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
AV_PIX_FMT_VDA_VLD,
+#endif
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE
};