diff options
author | Peter Ross <pross@xvid.org> | 2014-04-01 16:21:51 +0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-04-04 06:00:11 +0400 |
commit | ac4b32df71bd932838043a4838b86d11e169707f (patch) | |
tree | 50fbb1b0c61040f815d8f7bb22fe8c53987ed7a1 /libavcodec/arm | |
parent | ce58ead40dd16f272ec1f127f04f69df67c7cd35 (diff) |
On2 VP7 decoder
Further performance improvements and security fixes by
Vittorio Giovara, Luca Barbato and Diego Biurrun.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/Makefile | 6 | ||||
-rw-r--r-- | libavcodec/arm/h264pred_init_arm.c | 8 | ||||
-rw-r--r-- | libavcodec/arm/vp8dsp.h | 2 | ||||
-rw-r--r-- | libavcodec/arm/vp8dsp_init_arm.c | 10 | ||||
-rw-r--r-- | libavcodec/arm/vp8dsp_init_armv6.c | 47 | ||||
-rw-r--r-- | libavcodec/arm/vp8dsp_init_neon.c | 45 |
6 files changed, 72 insertions, 46 deletions
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index 3d34c4a754..9d5b6aab5b 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -31,6 +31,7 @@ OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_arm.o OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_init_arm.o +OBJS-$(CONFIG_VP7_DECODER) += arm/vp8dsp_init_arm.o OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_arm.o OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_init_arm.o OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_init_arm.o \ @@ -55,6 +56,9 @@ ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \ ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o +ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \ + arm/vp8dsp_init_armv6.o \ + arm/vp8dsp_armv6.o ARMV6-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8_armv6.o \ arm/vp8dsp_init_armv6.o \ arm/vp8dsp_armv6.o @@ -102,5 +106,7 @@ NEON-OBJS-$(CONFIG_VC1_DECODER) += arm/vc1dsp_init_neon.o \ arm/vc1dsp_neon.o NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_neon.o +NEON-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8dsp_init_neon.o \ + arm/vp8dsp_neon.o NEON-OBJS-$(CONFIG_VP8_DECODER) += arm/vp8dsp_init_neon.o \ arm/vp8dsp_neon.o diff --git a/libavcodec/arm/h264pred_init_arm.c b/libavcodec/arm/h264pred_init_arm.c index 2e25c2a271..bbfe63f2aa 100644 --- a/libavcodec/arm/h264pred_init_arm.c +++ b/libavcodec/arm/h264pred_init_arm.c @@ -56,10 +56,11 @@ static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id, h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon; h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon; - if (codec_id != AV_CODEC_ID_VP8) + if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon; h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon; - if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8) { + if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 && + codec_id != AV_CODEC_ID_VP8) { h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon; h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon; h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon; @@ -75,7 +76,8 @@ static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id, h->pred16x16[LEFT_DC_PRED8x8] = ff_pred16x16_left_dc_neon; h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_neon; h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_neon; - if (codec_id != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8) + if (codec_id != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 && + codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_neon; } diff --git a/libavcodec/arm/vp8dsp.h b/libavcodec/arm/vp8dsp.h index ce00e4abf5..0d55e0ffc0 100644 --- a/libavcodec/arm/vp8dsp.h +++ b/libavcodec/arm/vp8dsp.h @@ -21,6 +21,8 @@ #include "libavcodec/vp8dsp.h" +void ff_vp78dsp_init_armv6(VP8DSPContext *dsp); +void ff_vp78dsp_init_neon(VP8DSPContext *dsp); void ff_vp8dsp_init_armv6(VP8DSPContext *dsp); void ff_vp8dsp_init_neon(VP8DSPContext *dsp); diff --git a/libavcodec/arm/vp8dsp_init_arm.c b/libavcodec/arm/vp8dsp_init_arm.c index b7897cd9fd..aa77dbab98 100644 --- a/libavcodec/arm/vp8dsp_init_arm.c +++ b/libavcodec/arm/vp8dsp_init_arm.c @@ -23,6 +23,16 @@ #include "libavcodec/vp8dsp.h" #include "vp8dsp.h" +av_cold void ff_vp78dsp_init_arm(VP8DSPContext *dsp) +{ + int cpu_flags = av_get_cpu_flags(); + + if (have_armv6(cpu_flags)) + ff_vp78dsp_init_armv6(dsp); + if (have_neon(cpu_flags)) + ff_vp78dsp_init_neon(dsp); +} + av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); diff --git a/libavcodec/arm/vp8dsp_init_armv6.c b/libavcodec/arm/vp8dsp_init_armv6.c index e15e191e30..febe4e71a2 100644 --- a/libavcodec/arm/vp8dsp_init_armv6.c +++ b/libavcodec/arm/vp8dsp_init_armv6.c @@ -40,29 +40,8 @@ VP8_BILIN(16, armv6); VP8_BILIN(8, armv6); VP8_BILIN(4, armv6); -av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp) +av_cold void ff_vp78dsp_init_armv6(VP8DSPContext *dsp) { - dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_armv6; - dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6; - - dsp->vp8_idct_add = ff_vp8_idct_add_armv6; - dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_armv6; - dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_armv6; - dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_armv6; - - dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_armv6; - dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_armv6; - dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_armv6; - dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_armv6; - - dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_armv6; - dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_armv6; - dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_armv6; - dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_armv6; - - dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_armv6; - dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_armv6; - dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_armv6; dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_armv6; dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_armv6; @@ -118,3 +97,27 @@ av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp) dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_armv6; dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_armv6; } + +av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp) +{ + dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_armv6; + dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6; + + dsp->vp8_idct_add = ff_vp8_idct_add_armv6; + dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_armv6; + dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_armv6; + dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_armv6; + + dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_armv6; + dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_armv6; + dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_armv6; + dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_armv6; + + dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_armv6; + dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_armv6; + dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_armv6; + dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_armv6; + + dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_armv6; + dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_armv6; +} diff --git a/libavcodec/arm/vp8dsp_init_neon.c b/libavcodec/arm/vp8dsp_init_neon.c index 0468181f70..2b6c7750d3 100644 --- a/libavcodec/arm/vp8dsp_init_neon.c +++ b/libavcodec/arm/vp8dsp_init_neon.c @@ -39,28 +39,8 @@ VP8_BILIN(16, neon); VP8_BILIN(8, neon); VP8_BILIN(4, neon); -av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp) +av_cold void ff_vp78dsp_init_neon(VP8DSPContext *dsp) { - dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon; - - dsp->vp8_idct_add = ff_vp8_idct_add_neon; - dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon; - dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon; - dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon; - - dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon; - dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon; - dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon; - dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon; - - dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon; - dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon; - dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon; - dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon; - - dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon; - dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon; - dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon; dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_neon; dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_neon; @@ -114,3 +94,26 @@ av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp) dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_neon; dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_neon; } + +av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp) +{ + dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon; + + dsp->vp8_idct_add = ff_vp8_idct_add_neon; + dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon; + dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon; + dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon; + + dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon; + dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon; + dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon; + dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon; + + dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon; + dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon; + dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon; + dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon; + + dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon; + dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon; +} |